@veltdev/sdk-dev 6.0.21 → 6.0.23
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/{chunk-Z3NOEF5O.js → chunk-3M5GZFCG.js} +1 -1
- package/{chunk-TIDK55EX.js → chunk-3PSEC6OK.js} +1 -1
- package/{chunk-Q5QIV3YT.js → chunk-5GFU7BU6.js} +1 -1
- package/{chunk-PGPXYZZN.js → chunk-6BCXLMAY.js} +1 -1
- package/{chunk-JC7WVK34.js → chunk-6F7MEOHL.js} +1 -1
- package/{chunk-PLEUR6AN.js → chunk-C3DWGOTZ.js} +1 -1
- package/chunk-CJVRXVE5.js +1 -0
- package/chunk-COMT5MGY.js +1 -0
- package/{chunk-G6CVZGMW.js → chunk-CQZ7DKJB.js} +1 -1
- package/{chunk-IYN573WN.js → chunk-D2UJGDHP.js} +1 -1
- package/{chunk-UPKZBLXG.js → chunk-EC25EQB5.js} +1 -1
- package/{chunk-MOU625G2.js → chunk-EIDOVJ3L.js} +1 -1
- package/{chunk-2PD23MCR.js → chunk-F2XJIYNI.js} +1 -1
- package/{chunk-RS4IIGBQ.js → chunk-F2Z7K4AL.js} +1 -1
- package/{chunk-KBPP2RJV.js → chunk-GUBXZVJ3.js} +1 -1
- package/{chunk-IV6TXG5Z.js → chunk-J2NS4TI4.js} +1 -1
- package/{chunk-GMP3ZGYE.js → chunk-KE64O5B7.js} +1 -1
- package/{chunk-XDDHCYC6.js → chunk-KXEU5HGR.js} +1 -1
- package/{chunk-IUO7RNPW.js → chunk-M5AN4E5A.js} +1 -1
- package/{chunk-MD5ZTISB.js → chunk-MAEEPXIL.js} +1 -1
- package/{chunk-LG756VXD.js → chunk-MGORC6ST.js} +1 -1
- package/{chunk-WXX73A2Z.js → chunk-MU6RYO5X.js} +1 -1
- package/{chunk-64VJSQ7G.js → chunk-N2ZDAA6T.js} +1 -1
- package/{chunk-5CHLXJQA.js → chunk-O4J2GUCR.js} +1 -1
- package/{chunk-T4CZDGU7.js → chunk-RCOPSCV6.js} +1 -1
- package/{chunk-3QL3XETD.js → chunk-TDVYFBCW.js} +1 -1
- package/{chunk-NK4G7LFH.js → chunk-TM2JOAC4.js} +1 -1
- package/{chunk-ACBISYSH.js → chunk-TVANUSZU.js} +1 -1
- package/{chunk-6EMXC6J7.js → chunk-UFGQLAOK.js} +1 -1
- package/{chunk-HRHQ2ONQ.js → chunk-UWH2AIKJ.js} +1 -1
- package/{chunk-YNU6L4ZC.js → chunk-V53LQO22.js} +6 -6
- package/{chunk-I3NP7X72.js → chunk-VFYLOVTK.js} +1 -1
- package/{chunk-TSAUKBNW.js → chunk-XAZILV5B.js} +1 -1
- package/{chunk-PXOUAPOU.js → chunk-ZEWGJF7N.js} +1 -1
- package/{chunk-TPPAZ2V2.js → chunk-ZURN7SUE.js} +1 -1
- package/package.json +1 -1
- package/velt-activity-log.js +1 -1
- package/velt-area.js +1 -1
- package/velt-arrow.js +1 -1
- package/velt-comment.js +7 -7
- package/velt-crdt.js +1 -1
- package/velt-cursor.js +1 -1
- package/velt-huddle.js +1 -1
- package/velt-live-state-sync.js +1 -1
- package/velt-notification.js +1 -1
- package/velt-portable.js +1 -1
- package/velt-presence.js +1 -1
- package/velt-reaction.js +1 -1
- package/velt-recorder.js +1 -1
- package/velt-rewriter.js +1 -1
- package/velt-selection.js +1 -1
- package/velt-tag.js +1 -1
- package/velt-user-invite.js +1 -1
- package/velt-user-request.js +1 -1
- package/velt-video-player.js +1 -1
- package/velt-views.js +1 -1
- package/velt.js +2 -2
- package/chunk-7YXWYOYZ.js +0 -1
- package/chunk-P2OUKDDH.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var $6=Object.create;var bm=Object.defineProperty,W6=Object.defineProperties,z6=Object.getOwnPropertyDescriptor,q6=Object.getOwnPropertyDescriptors,K6=Object.getOwnPropertyNames,wm=Object.getOwnPropertySymbols,QM=Object.getPrototypeOf,Kv=Object.prototype.hasOwnProperty,JM=Object.prototype.propertyIsEnumerable,Y6=Reflect.get;var XM=(t,e,n)=>e in t?bm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,B=(t,e)=>{for(var n in e||={})Kv.call(e,n)&&XM(t,n,e[n]);if(wm)for(var n of wm(e))JM.call(e,n)&&XM(t,n,e[n]);return t},Ee=(t,e)=>W6(t,q6(e));var X6=(t,e)=>{var n={};for(var r in t)Kv.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&wm)for(var r of wm(t))e.indexOf(r)<0&&JM.call(t,r)&&(n[r]=t[r]);return n};var oce=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},sce=(t,e)=>{for(var n in e)bm(t,n,{get:e[n],enumerable:!0})},Q6=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of K6(e))!Kv.call(t,i)&&i!==n&&bm(t,i,{get:()=>e[i],enumerable:!(r=z6(e,i))||r.enumerable});return t};var ace=(t,e,n)=>(n=t!=null?$6(QM(t)):{},Q6(e||!t||!t.__esModule?bm(n,"default",{value:t,enumerable:!0}):n,t));var Ga=(t,e,n)=>Y6(QM(t),n,e);var y=(t,e,n)=>new Promise((r,i)=>{var o=c=>{try{a(n.next(c))}catch(l){i(l)}},s=c=>{try{a(n.throw(c))}catch(l){i(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,s);a((n=n.apply(t,e)).next())});function _e(t){return typeof t=="function"}function Yv(t){return _e(t?.lift)}function me(t){return e=>{if(Yv(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function us(t){let n=t(r=>{Error.call(r),r.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Om=us(t=>function(n){t(this),this.message=n?`${n.length} errors occurred during unsubscription:
|
|
2
2
|
${n.map((r,i)=>`${i+1}) ${r.toString()}`).join(`
|
|
3
|
-
`)}`:"",this.name="UnsubscriptionError",this.errors=n});function ja(t,e){if(t){let n=t.indexOf(e);0<=n&&t.splice(n,1)}}var gt=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:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let o of n)o.remove(this);else n.remove(this);let{initialTeardown:r}=this;if(_e(r))try{r()}catch(o){e=o instanceof Om?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{ZM(o)}catch(s){e=e??[],s instanceof Om?e=[...e,...s.errors]:e.push(s)}}if(e)throw new Om(e)}}add(e){var n;if(e&&e!==this)if(this.closed)ZM(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}}_hasParent(e){let{_parentage:n}=this;return n===e||Array.isArray(n)&&n.includes(e)}_addParent(e){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e}_removeParent(e){let{_parentage:n}=this;n===e?this._parentage=null:Array.isArray(n)&&ja(n,e)}remove(e){let{_finalizers:n}=this;n&&ja(n,e),e instanceof t&&e._removeParent(this)}};gt.EMPTY=(()=>{let t=new gt;return t.closed=!0,t})();var Xv=gt.EMPTY;function Mm(t){return t instanceof gt||t&&"closed"in t&&_e(t.remove)&&_e(t.add)&&_e(t.unsubscribe)}function ZM(t){_e(t)?t():t.unsubscribe()}var qr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var cu={setTimeout(t,e,...n){let{delegate:r}=cu;return r?.setTimeout?r.setTimeout(t,e,...n):setTimeout(t,e,...n)},clearTimeout(t){let{delegate:e}=cu;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Lm(t){cu.setTimeout(()=>{let{onUnhandledError:e}=qr;if(e)e(t);else throw t})}function Kr(){}var eL=Qv("C",void 0,void 0);function tL(t){return Qv("E",void 0,t)}function nL(t){return Qv("N",t,void 0)}function Qv(t,e,n){return{kind:t,value:e,error:n}}var Ha=null;function lu(t){if(qr.useDeprecatedSynchronousErrorHandling){let e=!Ha;if(e&&(Ha={errorThrown:!1,error:null}),t(),e){let{errorThrown:n,error:r}=Ha;if(Ha=null,n)throw r}}else t()}function rL(t){qr.useDeprecatedSynchronousErrorHandling&&Ha&&(Ha.errorThrown=!0,Ha.error=t)}var $a=class extends gt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Mm(e)&&e.add(this)):this.destination=e4}static create(e,n,r){return new Yr(e,n,r)}next(e){this.isStopped?Zv(nL(e),this):this._next(e)}error(e){this.isStopped?Zv(tL(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Zv(eL,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()}}},J6=Function.prototype.bind;function Jv(t,e){return J6.call(t,e)}var eS=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:n}=this;if(n.next)try{n.next(e)}catch(r){Pm(r)}}error(e){let{partialObserver:n}=this;if(n.error)try{n.error(e)}catch(r){Pm(r)}else Pm(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(n){Pm(n)}}},Yr=class extends $a{constructor(e,n,r){super();let i;if(_e(e)||!e)i={next:e??void 0,error:n??void 0,complete:r??void 0};else{let o;this&&qr.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&Jv(e.next,o),error:e.error&&Jv(e.error,o),complete:e.complete&&Jv(e.complete,o)}):i=e}this.destination=new eS(i)}};function Pm(t){qr.useDeprecatedSynchronousErrorHandling?rL(t):Lm(t)}function Z6(t){throw t}function Zv(t,e){let{onStoppedNotification:n}=qr;n&&cu.setTimeout(()=>n(t,e))}var e4={closed:!0,next:Kr,error:Z6,complete:Kr};function he(t,e,n,r,i){return new tS(t,e,n,r,i)}var tS=class extends $a{constructor(e,n,r,i,o,s){super(e),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=n?function(a){try{n(a)}catch(c){e.error(c)}}:super._next,this._error=i?function(a){try{i(a)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function mn(t,e){return me((n,r)=>{let i=0;n.subscribe(he(r,o=>t.call(e,o,i++)&&r.next(o)))})}var uu=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Xr(t){return t}function iL(t){return t.length===0?Xr:t.length===1?t[0]:function(n){return t.reduce((r,i)=>i(r),n)}}var fe=(()=>{class t{constructor(n){n&&(this._subscribe=n)}lift(n){let r=new t;return r.source=this,r.operator=n,r}subscribe(n,r,i){let o=n4(n)?n:new Yr(n,r,i);return lu(()=>{let{operator:s,source:a}=this;o.add(s?s.call(o,a):a?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(n){try{return this._subscribe(n)}catch(r){n.error(r)}}forEach(n,r){return r=oL(r),new r((i,o)=>{let s=new Yr({next:a=>{try{n(a)}catch(c){o(c),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(n){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(n)}[uu](){return this}pipe(...n){return iL(n)(this)}toPromise(n){return n=oL(n),new n((r,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>r(o))})}}return t.create=e=>new t(e),t})();function oL(t){var e;return(e=t??qr.Promise)!==null&&e!==void 0?e:Promise}function t4(t){return t&&_e(t.next)&&_e(t.error)&&_e(t.complete)}function n4(t){return t&&t instanceof $a||t4(t)&&Mm(t)}var Wa=new fe(t=>t.complete());function En(t){return t<=0?()=>Wa:me((e,n)=>{let r=0;e.subscribe(he(n,i=>{++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function nS(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function aL(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(d){try{l(r.next(d))}catch(h){s(h)}}function c(d){try{l(r.throw(d))}catch(h){s(h)}}function l(d){d.done?o(d.value):i(d.value).then(a,c)}l((r=r.apply(t,e||[])).next())})}function sL(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function za(t){return this instanceof za?(this.v=t,this):new za(t)}function cL(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(E){return Promise.resolve(E).then(g,h)}}function a(g,E){r[g]&&(i[g]=function(I){return new Promise(function(S,L){o.push([g,I,S,L])>1||c(g,I)})},E&&(i[g]=E(i[g])))}function c(g,E){try{l(r[g](E))}catch(I){f(o[0][3],I)}}function l(g){g.value instanceof za?Promise.resolve(g.value.v).then(d,h):f(o[0][2],g)}function d(g){c("next",g)}function h(g){c("throw",g)}function f(g,E){g(E),o.shift(),o.length&&c(o[0][0],o[0][1])}}function lL(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof sL=="function"?sL(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(s){return new Promise(function(a,c){s=t[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var du=t=>t&&typeof t.length=="number"&&typeof t!="function";function xm(t){return _e(t?.then)}function km(t){return _e(t[uu])}function Fm(t){return Symbol.asyncIterator&&_e(t?.[Symbol.asyncIterator])}function Um(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 r4(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Vm=r4();function Bm(t){return _e(t?.[Vm])}function Gm(t){return cL(this,arguments,function*(){let n=t.getReader();try{for(;;){let{value:r,done:i}=yield za(n.read());if(i)return yield za(void 0);yield yield za(r)}}finally{n.releaseLock()}})}function jm(t){return _e(t?.getReader)}function Ce(t){if(t instanceof fe)return t;if(t!=null){if(km(t))return i4(t);if(du(t))return o4(t);if(xm(t))return s4(t);if(Fm(t))return uL(t);if(Bm(t))return a4(t);if(jm(t))return c4(t)}throw Um(t)}function i4(t){return new fe(e=>{let n=t[uu]();if(_e(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function o4(t){return new fe(e=>{for(let n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function s4(t){return new fe(e=>{t.then(n=>{e.closed||(e.next(n),e.complete())},n=>e.error(n)).then(null,Lm)})}function a4(t){return new fe(e=>{for(let n of t)if(e.next(n),e.closed)return;e.complete()})}function uL(t){return new fe(e=>{l4(t,e).catch(n=>e.error(n))})}function c4(t){return uL(Gm(t))}function l4(t,e){var n,r,i,o;return aL(this,void 0,void 0,function*(){try{for(n=lL(t);r=yield n.next(),!r.done;){let s=r.value;if(e.next(s),e.closed)return}}catch(s){i={error:s}}finally{try{r&&!r.done&&(o=n.return)&&(yield o.call(n))}finally{if(i)throw i.error}}e.complete()})}function dL(t){return me((e,n)=>{let r=!1,i=null,o=null,s=!1,a=()=>{if(o?.unsubscribe(),o=null,r){r=!1;let l=i;i=null,n.next(l)}s&&n.complete()},c=()=>{o=null,s&&n.complete()};e.subscribe(he(n,l=>{r=!0,i=l,o||Ce(t(l)).subscribe(o=he(n,a,c))},()=>{s=!0,(!r||!o||o.closed)&&n.complete()}))})}var Hm=class extends gt{constructor(e,n){super()}schedule(e,n=0){return this}};var Xh={setInterval(t,e,...n){let{delegate:r}=Xh;return r?.setInterval?r.setInterval(t,e,...n):setInterval(t,e,...n)},clearInterval(t){let{delegate:e}=Xh;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var Ai=class extends Hm{constructor(e,n){super(e,n),this.scheduler=e,this.work=n,this.pending=!1}schedule(e,n=0){var r;if(this.closed)return this;this.state=e;let i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(o,this.id,n),this}requestAsyncId(e,n,r=0){return Xh.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,n,r=0){if(r!=null&&this.delay===r&&this.pending===!1)return n;n!=null&&Xh.clearInterval(n)}execute(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let r=this._execute(e,n);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,n){let r=!1,i;try{this.work(e)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){let{id:e,scheduler:n}=this,{actions:r}=n;this.work=this.state=this.scheduler=null,this.pending=!1,ja(r,this),e!=null&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,super.unsubscribe()}}};var qa={now(){return(qa.delegate||Date).now()},delegate:void 0};var hu=class t{constructor(e,n=t.now){this.schedulerActionCtor=e,this.now=n}schedule(e,n=0,r){return new this.schedulerActionCtor(this,e).schedule(r,n)}};hu.now=qa.now;var Ci=class extends hu{constructor(e,n=hu.now){super(e,n),this.actions=[],this._active=!1}flush(e){let{actions:n}=this;if(this._active){n.push(e);return}let r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,r){for(;e=n.shift();)e.unsubscribe();throw r}}};var An=new Ci(Ai),rS=An;function $m(t){return t&&_e(t.schedule)}function Wm(t){return t instanceof Date&&!isNaN(t)}function To(t=0,e,n=rS){let r=-1;return e!=null&&($m(e)?n=e:r=e),new fe(i=>{let o=Wm(t)?+t-n.now():t;o<0&&(o=0);let s=0;return n.schedule(function(){i.closed||(i.next(s++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function u4(t,e=An){return dL(()=>To(t,e))}function iS(t){return t[t.length-1]}function zm(t){return _e(iS(t))?t.pop():void 0}function Di(t){return $m(iS(t))?t.pop():void 0}function hL(t,e){return typeof iS(t)=="number"?t.pop():e}function Cn(t,e,n,r=0,i=!1){let o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function oS(t){return me((e,n)=>{let r=null,i=!1,o;r=e.subscribe(he(n,void 0,void 0,s=>{o=Ce(t(s,oS(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}var{isArray:d4}=Array,{getPrototypeOf:h4,prototype:f4,keys:p4}=Object;function qm(t){if(t.length===1){let e=t[0];if(d4(e))return{args:e,keys:null};if(g4(e)){let n=p4(e);return{args:n.map(r=>e[r]),keys:n}}}return{args:t,keys:null}}function g4(t){return t&&typeof t=="object"&&h4(t)===f4}function ds(t,e=0){return me((n,r)=>{n.subscribe(he(r,i=>Cn(r,t,()=>r.next(i),e),()=>Cn(r,t,()=>r.complete(),e),i=>Cn(r,t,()=>r.error(i),e)))})}function hs(t,e=0){return me((n,r)=>{r.add(t.schedule(()=>n.subscribe(r),e))})}function fL(t,e){return Ce(t).pipe(hs(e),ds(e))}function pL(t,e){return Ce(t).pipe(hs(e),ds(e))}function gL(t,e){return new fe(n=>{let r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function mL(t,e){return new fe(n=>{let r;return Cn(n,e,()=>{r=t[Vm](),Cn(n,e,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(s){n.error(s);return}o?n.complete():n.next(i)},0,!0)}),()=>_e(r?.return)&&r.return()})}function Km(t,e){if(!t)throw new Error("Iterable cannot be null");return new fe(n=>{Cn(n,e,()=>{let r=t[Symbol.asyncIterator]();Cn(n,e,()=>{r.next().then(i=>{i.done?n.complete():n.next(i.value)})},0,!0)})})}function EL(t,e){return Km(Gm(t),e)}function _L(t,e){if(t!=null){if(km(t))return fL(t,e);if(du(t))return gL(t,e);if(xm(t))return pL(t,e);if(Fm(t))return Km(t,e);if(Bm(t))return mL(t,e);if(jm(t))return EL(t,e)}throw Um(t)}function cr(t,e){return e?_L(t,e):Ce(t)}function De(t,e){return me((n,r)=>{let i=0;n.subscribe(he(r,o=>{r.next(t.call(e,o,i++))}))})}var{isArray:m4}=Array;function E4(t,e){return m4(e)?t(...e):t(e)}function fu(t){return De(e=>E4(t,e))}function Ym(t,e){return t.reduce((n,r,i)=>(n[r]=e[i],n),{})}function Ka(...t){let e=Di(t),n=zm(t),{args:r,keys:i}=qm(t);if(r.length===0)return cr([],e);let o=new fe(_4(r,e,i?s=>Ym(i,s):Xr));return n?o.pipe(fu(n)):o}function _4(t,e,n=Xr){return r=>{TL(e,()=>{let{length:i}=t,o=new Array(i),s=i,a=i;for(let c=0;c<i;c++)TL(e,()=>{let l=cr(t[c],e),d=!1;l.subscribe(he(r,h=>{o[c]=h,d||(d=!0,a--),a||r.next(n(o.slice()))},()=>{--s||r.complete()}))},r)},r)}}function TL(t,e,n){t?Cn(n,t,e):e()}function yL(t,e,n,r,i,o,s,a){let c=[],l=0,d=0,h=!1,f=()=>{h&&!c.length&&!l&&e.complete()},g=I=>l<r?E(I):c.push(I),E=I=>{o&&e.next(I),l++;let S=!1;Ce(n(I,d++)).subscribe(he(e,L=>{i?.(L),o?g(L):e.next(L)},()=>{S=!0},void 0,()=>{if(S)try{for(l--;c.length&&l<r;){let L=c.shift();s?Cn(e,s,()=>E(L)):E(L)}f()}catch(L){e.error(L)}}))};return t.subscribe(he(e,g,()=>{h=!0,f()})),()=>{a?.()}}function Ri(t,e,n=1/0){return _e(e)?Ri((r,i)=>De((o,s)=>e(r,o,i,s))(Ce(t(r,i))),n):(typeof e=="number"&&(n=e),me((r,i)=>yL(r,i,t,n)))}function IL(t,e,n,r,i){return(o,s)=>{let a=n,c=e,l=0;o.subscribe(he(s,d=>{let h=l++;c=a?t(c,d,h):(a=!0,d),r&&s.next(c)},i&&(()=>{a&&s.next(c),s.complete()})))}}function Xm(t=1/0){return Ri(Xr,t)}function vL(){return Xm(1)}function sS(t,e){return _e(e)?Ri(t,e,1):Ri(t,1)}var SL=us(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Rt=(()=>{class t extends fe{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){let r=new Qm(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new SL}next(n){lu(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(n)}})}error(n){lu(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;let{observers:r}=this;for(;r.length;)r.shift().error(n)}})}complete(){lu(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){let{hasError:r,isStopped:i,observers:o}=this;return r||i?Xv:(this.currentObservers=null,o.push(n),new gt(()=>{this.currentObservers=null,ja(o,n)}))}_checkFinalizedStatuses(n){let{hasError:r,thrownError:i,isStopped:o}=this;r?n.error(i):o&&n.complete()}asObservable(){let n=new fe;return n.source=this,n}}return t.create=(e,n)=>new Qm(e,n),t})(),Qm=class extends Rt{constructor(e,n){super(),this.destination=e,this.source=n}next(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,e)}error(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,e)}complete(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)}_subscribe(e){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&r!==void 0?r:Xv}};function T4(t){return me((e,n)=>{let r=!1,i=null,o=null,s=()=>{if(o?.unsubscribe(),o=null,r){r=!1;let a=i;i=null,n.next(a)}};e.subscribe(he(n,a=>{o?.unsubscribe(),r=!0,i=a,o=he(n,s,Kr),Ce(t(a)).subscribe(o)},()=>{s(),n.complete()},void 0,()=>{i=o=null}))})}function Jm(t,e=An){return me((n,r)=>{let i=null,o=null,s=null,a=()=>{if(i){i.unsubscribe(),i=null;let l=o;o=null,r.next(l)}};function c(){let l=s+t,d=e.now();if(d<l){i=this.schedule(void 0,l-d),r.add(i);return}a()}n.subscribe(he(r,l=>{o=l,s=e.now(),i||(i=e.schedule(c,t),r.add(i))},()=>{a(),r.complete()},void 0,()=>{o=i=null}))})}function fs(...t){return vL()(cr(t,Di(t)))}function AL(){return me((t,e)=>{t.subscribe(he(e,Kr))})}function CL(t){return De(()=>t)}function aS(t,e){return e?n=>fs(e.pipe(En(1),AL()),n.pipe(aS(t))):Ri((n,r)=>Ce(t(n,r)).pipe(En(1),CL(n)))}function cS(t,e=An){let n=To(t,e);return aS(()=>n)}function lt(...t){let e=Di(t);return cr(t,e)}function yo(t,e=Xr){return t=t??y4,me((n,r)=>{let i,o=!0;n.subscribe(he(r,s=>{let a=e(s);(o||!t(i,a))&&(o=!1,i=a,r.next(s))}))})}function y4(t,e){return t===e}var DL=us(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function Qh(t){return me((e,n)=>{try{e.subscribe(n)}finally{n.add(t)}})}function RL(){return me((t,e)=>{let n=null;t._refCount++;let r=he(e,void 0,void 0,void 0,()=>{if(!t||t._refCount<=0||0<--t._refCount){n=null;return}let i=t._connection,o=n;n=null,i&&(!o||i===o)&&i.unsubscribe(),e.unsubscribe()});t.subscribe(r),r.closed||(n=t.connect())})}var lS=class extends fe{constructor(e,n){super(),this.source=e,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,Yv(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 gt;let n=this.getSubject();e.add(this.source.subscribe(he(n,void 0,()=>{this._teardown(),n.complete()},r=>{this._teardown(),n.error(r)},()=>this._teardown()))),e.closed&&(this._connection=null,e=gt.EMPTY)}return e}refCount(){return RL()(this)}};function Ya(){return me((t,e)=>{let n,r=!1;t.subscribe(he(e,i=>{let o=n;n=i,r&&e.next([o,i]),r=!0}))})}var ie=class extends Rt{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let n=super._subscribe(e);return!n.closed&&e.next(this._value),n}getValue(){let{hasError:e,thrownError:n,_value:r}=this;if(e)throw n;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}};var Xa=class extends Rt{constructor(e=1/0,n=1/0,r=qa){super(),this._bufferSize=e,this._windowTime=n,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,n)}next(e){let{isStopped:n,_buffer:r,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:s}=this;n||(r.push(e),!i&&r.push(o.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let n=this._innerSubscribe(e),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let s=0;s<o.length&&!e.closed;s+=r?1:2)e.next(o[s]);return this._checkFinalizedStatuses(e),n}_trimBuffer(){let{_bufferSize:e,_timestampProvider:n,_buffer:r,_infiniteTimeWindow:i}=this,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){let s=n.now(),a=0;for(let c=1;c<r.length&&r[c]<=s;c+=2)a=c;a&&r.splice(0,a+1)}}};function I4(t=0,e=An){return t<0&&(t=0),To(t,t,e)}function Zm(t,e){return me(IL(t,e,arguments.length>=2,!0))}function dS(t={}){let{connector:e=()=>new Rt,resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=t;return o=>{let s,a,c,l=0,d=!1,h=!1,f=()=>{a?.unsubscribe(),a=void 0},g=()=>{f(),s=c=void 0,d=h=!1},E=()=>{let I=s;g(),I?.unsubscribe()};return me((I,S)=>{l++,!h&&!d&&f();let L=c=c??e();S.add(()=>{l--,l===0&&!h&&!d&&(a=uS(E,i))}),L.subscribe(S),!s&&l>0&&(s=new Yr({next:V=>L.next(V),error:V=>{h=!0,f(),a=uS(g,n,V),L.error(V)},complete:()=>{d=!0,f(),a=uS(g,r),L.complete()}}),Ce(I).subscribe(s))})(o)}}function uS(t,e,...n){if(e===!0){t();return}if(e===!1)return;let r=new Yr({next:()=>{r.unsubscribe(),t()}});return Ce(e(...n)).subscribe(r)}function v4(t,e,n){let r,i=!1;return t&&typeof t=="object"?{bufferSize:r=1/0,windowTime:e=1/0,refCount:i=!1,scheduler:n}=t:r=t??1/0,dS({connector:()=>new Xa(r,e,n),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function hS(t){return mn((e,n)=>t<=n)}function S4(t){return me((e,n)=>{let r=!1,i=he(n,()=>{i?.unsubscribe(),r=!0},Kr);Ce(t).subscribe(i),e.subscribe(he(n,o=>r&&n.next(o)))})}function Qa(...t){let e=Di(t);return me((n,r)=>{(e?fs(t,n,e):fs(t,n)).subscribe(r)})}function Mr(t,e){return me((n,r)=>{let i=null,o=0,s=!1,a=()=>s&&!i&&r.complete();n.subscribe(he(r,c=>{i?.unsubscribe();let l=0,d=o++;Ce(t(c,d)).subscribe(i=he(r,h=>r.next(e?e(c,h,d,l++):h),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function ps(t){return me((e,n)=>{Ce(t).subscribe(he(n,()=>n.complete(),Kr)),!n.closed&&e.subscribe(n)})}function A4(t,e=!1){return me((n,r)=>{let i=0;n.subscribe(he(r,o=>{let s=t(o,i++);(s||e)&&r.next(o),!s&&r.complete()}))})}function eE(t,e,n){let r=_e(t)||e||n?{next:t,error:e,complete:n}:t;return r?me((i,o)=>{var s;(s=r.subscribe)===null||s===void 0||s.call(r);let a=!0;i.subscribe(he(o,c=>{var l;(l=r.next)===null||l===void 0||l.call(r,c),o.next(c)},()=>{var c;a=!1,(c=r.complete)===null||c===void 0||c.call(r),o.complete()},c=>{var l;a=!1,(l=r.error)===null||l===void 0||l.call(r,c),o.error(c)},()=>{var c,l;a&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(l=r.finalize)===null||l===void 0||l.call(r)}))}):Xr}function NL(t,e){return me((n,r)=>{let{leading:i=!0,trailing:o=!1}=e??{},s=!1,a=null,c=null,l=!1,d=()=>{c?.unsubscribe(),c=null,o&&(g(),l&&r.complete())},h=()=>{c=null,l&&r.complete()},f=E=>c=Ce(t(E)).subscribe(he(r,d,h)),g=()=>{if(s){s=!1;let E=a;a=null,r.next(E),!l&&f(E)}};n.subscribe(he(r,E=>{s=!0,a=E,!(c&&!c.closed)&&(i?g():f(E))},()=>{l=!0,!(o&&s&&c&&!c.closed)&&r.complete()}))})}function C4(t,e=An,n){let r=To(t,e);return NL(()=>r,n)}var D4=us(t=>function(n=null){t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=n});function R4(t,e){let{first:n,each:r,with:i=N4,scheduler:o=e??An,meta:s=null}=Wm(t)?{first:t}:typeof t=="number"?{each:t}:t;if(n==null&&r==null)throw new TypeError("No timeout provided.");return me((a,c)=>{let l,d,h=null,f=0,g=E=>{d=Cn(c,o,()=>{try{l.unsubscribe(),Ce(i({meta:s,lastValue:h,seen:f})).subscribe(c)}catch(I){c.error(I)}},E)};l=a.subscribe(he(c,E=>{d?.unsubscribe(),f++,c.next(h=E),r>0&&g(r)},void 0,void 0,()=>{d?.closed||d?.unsubscribe(),h=null})),!f&&g(n!=null?typeof n=="number"?n:+n-o.now():r)})}function N4(t){throw new D4(t)}function w4(t=qa){return De(e=>({value:e,timestamp:t.now()}))}var fS;function tE(){return fS}function Ni(t){let e=fS;return fS=t,e}var wL=Symbol("NotFound");function pu(t){return t===wL||t?.name==="\u0275NotFound"}var Dn=null,nE=!1,pS=1,b4=null,rn=Symbol("SIGNAL");function Te(t){let e=Dn;return Dn=t,e}function sE(){return Dn}var Ja={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function gu(t){if(nE)throw new Error("");if(Dn===null)return;Dn.consumerOnSignalRead(t);let e=Dn.producersTail;if(e!==void 0&&e.producer===t)return;let n,r=Dn.recomputing;if(r&&(n=e!==void 0?e.nextProducer:Dn.producers,n!==void 0&&n.producer===t)){Dn.producersTail=n,n.lastReadVersion=t.version;return}let i=t.consumersTail;if(i!==void 0&&i.consumer===Dn&&(!r||M4(i,Dn)))return;let o=_u(Dn),s={producer:t,consumer:Dn,nextProducer:n,prevConsumer:i,lastReadVersion:t.version,nextConsumer:void 0};Dn.producersTail=s,e!==void 0?e.nextProducer=s:Dn.producers=s,o&&LL(t,s)}function bL(){pS++}function aE(t){if(!(_u(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===pS)){if(!t.producerMustRecompute(t)&&!Eu(t)){oE(t);return}t.producerRecomputeValue(t),oE(t)}}function gS(t){if(t.consumers===void 0)return;let e=nE;nE=!0;try{for(let n=t.consumers;n!==void 0;n=n.nextConsumer){let r=n.consumer;r.dirty||O4(r)}}finally{nE=e}}function mS(){return Dn?.consumerAllowSignalWrites!==!1}function O4(t){t.dirty=!0,gS(t),t.consumerMarkedDirty?.(t)}function oE(t){t.dirty=!1,t.lastCleanEpoch=pS}function Za(t){return t&&OL(t),Te(t)}function OL(t){t.producersTail=void 0,t.recomputing=!0}function mu(t,e){Te(e),t&&ML(t)}function ML(t){t.recomputing=!1;let e=t.producersTail,n=e!==void 0?e.nextProducer:t.producers;if(n!==void 0){if(_u(t))do n=ES(n);while(n!==void 0);e!==void 0?e.nextProducer=void 0:t.producers=void 0}}function Eu(t){for(let e=t.producers;e!==void 0;e=e.nextProducer){let n=e.producer,r=e.lastReadVersion;if(r!==n.version||(aE(n),r!==n.version))return!0}return!1}function ec(t){if(_u(t)){let e=t.producers;for(;e!==void 0;)e=ES(e)}t.producers=void 0,t.producersTail=void 0,t.consumers=void 0,t.consumersTail=void 0}function LL(t,e){let n=t.consumersTail,r=_u(t);if(n!==void 0?(e.nextConsumer=n.nextConsumer,n.nextConsumer=e):(e.nextConsumer=void 0,t.consumers=e),e.prevConsumer=n,t.consumersTail=e,!r)for(let i=t.producers;i!==void 0;i=i.nextProducer)LL(i.producer,i)}function ES(t){let e=t.producer,n=t.nextProducer,r=t.nextConsumer,i=t.prevConsumer;if(t.nextConsumer=void 0,t.prevConsumer=void 0,r!==void 0?r.prevConsumer=i:e.consumersTail=i,i!==void 0)i.nextConsumer=r;else if(e.consumers=r,!_u(e)){let o=e.producers;for(;o!==void 0;)o=ES(o)}return n}function _u(t){return t.consumerIsAlwaysLive||t.consumers!==void 0}function cE(t){b4?.(t)}function M4(t,e){let n=e.producersTail;if(n!==void 0){let r=e.producers;do{if(r===t)return!0;if(r===n)break;r=r.nextProducer}while(r!==void 0)}return!1}function lE(t,e){return Object.is(t,e)}function Zh(t,e){let n=Object.create(L4);n.computation=t,e!==void 0&&(n.equal=e);let r=()=>{if(aE(n),gu(n),n.value===Jh)throw n.error;return n.value};return r[rn]=n,cE(n),r}var rE=Symbol("UNSET"),iE=Symbol("COMPUTING"),Jh=Symbol("ERRORED"),L4=Ee(B({},Ja),{value:rE,dirty:!0,error:null,equal:lE,kind:"computed",producerMustRecompute(t){return t.value===rE||t.value===iE},producerRecomputeValue(t){if(t.value===iE)throw new Error("");let e=t.value;t.value=iE;let n=Za(t),r,i=!1;try{r=t.computation(),Te(null),i=e!==rE&&e!==Jh&&r!==Jh&&t.equal(e,r)}catch(o){r=Jh,t.error=o}finally{mu(t,n)}if(i){t.value=e;return}t.value=r,t.version++}});function P4(){throw new Error}var PL=P4;function xL(t){PL(t)}function _S(t){PL=t}var x4=null;function TS(t,e){let n=Object.create(uE);n.value=t,e!==void 0&&(n.equal=e);let r=()=>kL(n);return r[rn]=n,cE(n),[r,s=>Tu(n,s),s=>yS(n,s)]}function kL(t){return gu(t),t.value}function Tu(t,e){mS()||xL(t),t.equal(t.value,e)||(t.value=e,k4(t))}function yS(t,e){mS()||xL(t),Tu(t,e(t.value))}var uE=Ee(B({},Ja),{equal:lE,value:void 0,kind:"signal"});function k4(t){t.version++,bL(),gS(t),x4?.(t)}var yu={schedule(t){let e=requestAnimationFrame,n=cancelAnimationFrame,{delegate:r}=yu;r&&(e=r.requestAnimationFrame,n=r.cancelAnimationFrame);let i=e(o=>{n=void 0,t(o)});return new gt(()=>n?.(i))},requestAnimationFrame(...t){let{delegate:e}=yu;return(e?.requestAnimationFrame||requestAnimationFrame)(...t)},cancelAnimationFrame(...t){let{delegate:e}=yu;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...t)},delegate:void 0};var F4=1,IS,vS={};function FL(t){return t in vS?(delete vS[t],!0):!1}var UL={setImmediate(t){let e=F4++;return vS[e]=!0,IS||(IS=Promise.resolve()),IS.then(()=>FL(e)&&t()),e},clearImmediate(t){FL(t)}};var{setImmediate:U4,clearImmediate:V4}=UL,ef={setImmediate(...t){let{delegate:e}=ef;return(e?.setImmediate||U4)(...t)},clearImmediate(t){let{delegate:e}=ef;return(e?.clearImmediate||V4)(t)},delegate:void 0};var dE=class extends Ai{constructor(e,n){super(e,n),this.scheduler=e,this.work=n}requestAsyncId(e,n,r=0){return r!==null&&r>0?super.requestAsyncId(e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=ef.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,n,r=0){var i;if(r!=null?r>0:this.delay>0)return super.recycleAsyncId(e,n,r);let{actions:o}=e;n!=null&&((i=o[o.length-1])===null||i===void 0?void 0:i.id)!==n&&(ef.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))}};var hE=class extends Ci{flush(e){this._active=!0;let n=this._scheduled;this._scheduled=void 0;let{actions:r}=this,i;e=e||r.shift();do if(i=e.execute(e.state,e.delay))break;while((e=r[0])&&e.id===n&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===n&&r.shift();)e.unsubscribe();throw i}}};var B4=new hE(dE);var fE=class extends Ai{constructor(e,n){super(e,n),this.scheduler=e,this.work=n}schedule(e,n=0){return n>0?super.schedule(e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)}execute(e,n){return n>0||this.closed?super.execute(e,n):this._execute(e,n)}requestAsyncId(e,n,r=0){return r!=null&&r>0||r==null&&this.delay>0?super.requestAsyncId(e,n,r):(e.flush(this),0)}};var pE=class extends Ci{};var SS=new pE(fE);var gE=class extends Ai{constructor(e,n){super(e,n),this.scheduler=e,this.work=n}requestAsyncId(e,n,r=0){return r!==null&&r>0?super.requestAsyncId(e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=yu.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,n,r=0){var i;if(r!=null?r>0:this.delay>0)return super.recycleAsyncId(e,n,r);let{actions:o}=e;n!=null&&n===e._scheduled&&((i=o[o.length-1])===null||i===void 0?void 0:i.id)!==n&&(yu.cancelAnimationFrame(n),e._scheduled=void 0)}};var mE=class extends Ci{flush(e){this._active=!0;let n;e?n=e.id:(n=this._scheduled,this._scheduled=void 0);let{actions:r}=this,i;e=e||r.shift();do if(i=e.execute(e.state,e.delay))break;while((e=r[0])&&e.id===n&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===n&&r.shift();)e.unsubscribe();throw i}}};var G4=new mE(gE);function j4(t){return!!t&&(t instanceof fe||_e(t.lift)&&_e(t.subscribe))}function H4(t,e){let n=typeof e=="object";return new Promise((r,i)=>{let o=new Yr({next:s=>{r(s),o.unsubscribe()},error:i,complete:()=>{n?r(e.defaultValue):i(new DL)}});t.subscribe(o)})}function tf(t){return new fe(e=>{Ce(t()).subscribe(e)})}function $4(...t){let e=zm(t),{args:n,keys:r}=qm(t),i=new fe(o=>{let{length:s}=n;if(!s){o.complete();return}let a=new Array(s),c=s,l=s;for(let d=0;d<s;d++){let h=!1;Ce(n[d]).subscribe(he(o,f=>{h||(h=!0,l--),a[d]=f},()=>c--,void 0,()=>{(!c||!h)&&(l||o.next(r?Ym(r,a):a),o.complete())}))}});return e?i.pipe(fu(e)):i}var W4=["addListener","removeListener"],z4=["addEventListener","removeEventListener"],q4=["on","off"];function wi(t,e,n,r){if(_e(n)&&(r=n,n=void 0),r)return wi(t,e,n).pipe(fu(r));let[i,o]=X4(t)?z4.map(s=>a=>t[s](e,a,n)):K4(t)?W4.map(VL(t,e)):Y4(t)?q4.map(VL(t,e)):[];if(!i&&du(t))return Ri(s=>wi(s,e,n))(Ce(t));if(!i)throw new TypeError("Invalid event target");return new fe(s=>{let a=(...c)=>s.next(1<c.length?c:c[0]);return i(a),()=>o(a)})}function VL(t,e){return n=>r=>t[n](e,r)}function K4(t){return _e(t.addListener)&&_e(t.removeListener)}function Y4(t){return _e(t.on)&&_e(t.off)}function X4(t){return _e(t.addEventListener)&&_e(t.removeEventListener)}function Q4(t,e,n){return tf(()=>t()?e:n)}function gs(...t){let e=Di(t),n=hL(t,1/0),r=t;return r.length?r.length===1?Ce(r[0]):Xm(n)(cr(r,e)):Wa}function BL(t){let e=Te(null);try{return t()}finally{Te(e)}}var GL=Ee(B({},Ja),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"});function jL(t){if(t.dirty=!1,t.version>0&&!Eu(t))return;t.version++;let e=Za(t);try{t.cleanup(),t.fn()}finally{mu(t,e)}}var nc=class{full;major;minor;patch;constructor(e){this.full=e;let n=e.split(".");this.major=n[0],this.minor=n[1],this.patch=n.slice(2).join(".")}},xS=new nc("20.3.31");var IE="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",J=class extends Error{code;constructor(e,n){super(Ts(e,n)),this.code=e}};function J4(t){return`NG0${Math.abs(t)}`}function Ts(t,e){return`${J4(t)}${e?": "+e:""}`}var Lt=globalThis;function We(t){for(let e in t)if(t[e]===We)return e;throw Error("")}function WL(t,e){for(let n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function vo(t){if(typeof t=="string")return t;if(Array.isArray(t))return`[${t.map(vo).join(", ")}]`;if(t==null)return""+t;let e=t.overriddenName||t.name;if(e)return`${e}`;let n=t.toString();if(n==null)return""+n;let r=n.indexOf(`
|
|
4
|
-
`);return r>=0?n.slice(0,r):n}function vE(t,e){return t?e?`${t} ${e}`:t:e||""}var Z4=We({__forward_ref__:We});function SE(t){return t.__forward_ref__=SE,t.toString=function(){return vo(this())},t}function jt(t){return kS(t)?t():t}function kS(t){return typeof t=="function"&&t.hasOwnProperty(Z4)&&t.__forward_ref__===SE}function Q(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function So(t){return{providers:t.providers||[],imports:t.imports||[]}}function AE(t){return ez(t,CE)}function ez(t,e){return t.hasOwnProperty(e)&&t[e]||null}function tz(t){let e=t?.[CE]??null;return e||null}function CS(t){return t&&t.hasOwnProperty(TE)?t[TE]:null}var CE=We({\u0275prov:We}),TE=We({\u0275inj:We}),z=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,n){this._desc=e,this.\u0275prov=void 0,typeof n=="number"?this.__NG_ELEMENT_ID__=n:n!==void 0&&(this.\u0275prov=Q({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function FS(t){return t&&!!t.\u0275providers}var US=We({\u0275cmp:We}),VS=We({\u0275dir:We}),BS=We({\u0275pipe:We}),GS=We({\u0275mod:We}),rf=We({\u0275fac:We}),sc=We({__NG_ELEMENT_ID__:We}),HL=We({__NG_ENV_ID__:We});function ur(t){return typeof t=="string"?t:t==null?"":String(t)}function zL(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():ur(t)}var qL=We({ngErrorCode:We}),nz=We({ngErrorMessage:We}),rz=We({ngTokenPath:We});function jS(t,e){return KL("",-200,e)}function DE(t,e){throw new J(-201,!1)}function KL(t,e,n){let r=new J(e,t);return r[qL]=e,r[nz]=t,n&&(r[rz]=n),r}function iz(t){return t[qL]}var DS;function YL(){return DS}function Bn(t){let e=DS;return DS=t,e}function HS(t,e,n){let r=AE(t);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(n&8)return null;if(e!==void 0)return e;DE(t,"Injector")}var oz={},tc=oz,RS="__NG_DI_FLAG__",NS=class{injector;constructor(e){this.injector=e}retrieve(e,n){let r=rc(n)||0;try{return this.injector.get(e,r&8?null:tc,r)}catch(i){if(pu(i))return i;throw i}}};function sz(t,e=0){let n=tE();if(n===void 0)throw new J(-203,!1);if(n===null)return HS(t,void 0,e);{let r=az(e),i=n.retrieve(t,r);if(pu(i)){if(r.optional)return null;throw i}return i}}function $(t,e=0){return(YL()||sz)(jt(t),e)}function Y(t,e){return $(t,rc(e))}function rc(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function az(t){return{optional:!!(t&8),host:!!(t&1),self:!!(t&2),skipSelf:!!(t&4)}}function wS(t){let e=[];for(let n=0;n<t.length;n++){let r=jt(t[n]);if(Array.isArray(r)){if(r.length===0)throw new J(900,!1);let i,o=0;for(let s=0;s<r.length;s++){let a=r[s],c=cz(a);typeof c=="number"?c===-1?i=a.token:o|=c:i=a}e.push($(i,o))}else e.push($(r))}return e}function $S(t,e){return t[RS]=e,t.prototype[RS]=e,t}function cz(t){return t[RS]}function Es(t,e){let n=t.hasOwnProperty(rf);return n?t[rf]:null}function XL(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=e[r];if(n&&(i=n(i),o=n(o)),o!==i)return!1}return!0}function QL(t){return t.flat(Number.POSITIVE_INFINITY)}function RE(t,e){t.forEach(n=>Array.isArray(n)?RE(n,e):e(n))}function WS(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function cf(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function JL(t,e){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function ZL(t,e,n,r){let i=t.length;if(i==e)t.push(n,r);else if(i===1)t.push(r,t[0]),t[0]=n;else{for(i--,t.push(t[i-1],t[i]);i>e;){let o=i-2;t[i]=t[o],i--}t[e]=n,t[e+1]=r}}function lf(t,e,n){let r=vu(t,e);return r>=0?t[r|1]=n:(r=~r,ZL(t,r,e,n)),r}function NE(t,e){let n=vu(t,e);if(n>=0)return t[n|1]}function vu(t,e){return lz(t,e,1)}function lz(t,e,n){let r=0,i=t.length>>n;for(;i!==r;){let o=r+(i-r>>1),s=t[o<<n];if(e===s)return o<<n;s>e?i=o:r=o+1}return~(i<<n)}var Qr={},Rn=[],ys=new z(""),zS=new z("",-1),qS=new z(""),of=class{get(e,n=tc){if(n===tc){let i=KL("",-201);throw i.name="\u0275NotFound",i}return n}};function eP(t){return t[GS]||null}function Is(t){return t[US]||null}function wE(t){return t[VS]||null}function KS(t){return t[BS]||null}function Xn(t){return{\u0275providers:t}}function tP(...t){return{\u0275providers:YS(!0,t),\u0275fromNgModule:!0}}function YS(t,...e){let n=[],r=new Set,i,o=s=>{n.push(s)};return RE(e,s=>{let a=s;yE(a,o,[],r)&&(i||=[],i.push(a))}),i!==void 0&&nP(i,o),n}function nP(t,e){for(let n=0;n<t.length;n++){let{ngModule:r,providers:i}=t[n];XS(i,o=>{e(o,r)})}}function yE(t,e,n,r){if(t=jt(t),!t)return!1;let i=null,o=CS(t),s=!o&&Is(t);if(!o&&!s){let c=t.ngModule;if(o=CS(c),o)i=c;else return!1}else{if(s&&!s.standalone)return!1;i=t}let a=r.has(i);if(s){if(a)return!1;if(r.add(i),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)yE(l,e,n,r)}}else if(o){if(o.imports!=null&&!a){r.add(i);let l;RE(o.imports,d=>{yE(d,e,n,r)&&(l||=[],l.push(d))}),l!==void 0&&nP(l,e)}if(!a){let l=Es(i)||(()=>new i);e({provide:i,useFactory:l,deps:Rn},i),e({provide:qS,useValue:i,multi:!0},i),e({provide:ys,useValue:()=>$(i),multi:!0},i)}let c=o.providers;if(c!=null&&!a){let l=t;XS(c,d=>{e(d,l)})}}else return!1;return i!==t&&t.providers!==void 0}function XS(t,e){for(let n of t)FS(n)&&(n=n.\u0275providers),Array.isArray(n)?XS(n,e):e(n)}var uz=We({provide:String,useValue:We});function rP(t){return t!==null&&typeof t=="object"&&uz in t}function dz(t){return!!(t&&t.useExisting)}function hz(t){return!!(t&&t.useFactory)}function ic(t){return typeof t=="function"}function iP(t){return!!t.useClass}var uf=new z(""),EE={},$L={},AS;function Su(){return AS===void 0&&(AS=new of),AS}var Nn=class{},oc=class extends Nn{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,n,r,i){super(),this.parent=n,this.source=r,this.scopes=i,OS(e,s=>this.processProvider(s)),this.records.set(zS,Iu(void 0,this)),i.has("environment")&&this.records.set(Nn,Iu(void 0,this));let o=this.records.get(uf);o!=null&&typeof o.value=="string"&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(qS,Rn,{self:!0}))}retrieve(e,n){let r=rc(n)||0;try{return this.get(e,tc,r)}catch(i){if(pu(i))return i;throw i}}destroy(){nf(this),this._destroyed=!0;let e=Te(null);try{for(let r of this._ngOnDestroyHooks)r.ngOnDestroy();let n=this._onDestroyHooks;this._onDestroyHooks=[];for(let r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),Te(e)}}onDestroy(e){return nf(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){nf(this);let n=Ni(this),r=Bn(void 0),i;try{return e()}finally{Ni(n),Bn(r)}}get(e,n=tc,r){if(nf(this),e.hasOwnProperty(HL))return e[HL](this);let i=rc(r),o,s=Ni(this),a=Bn(void 0);try{if(!(i&4)){let l=this.records.get(e);if(l===void 0){let d=Ez(e)&&AE(e);d&&this.injectableDefInScope(d)?l=Iu(bS(e),EE):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,i)}let c=i&2?Su():this.parent;return n=i&8&&n===tc?null:n,c.get(e,n)}catch(c){let l=iz(c);throw l===-200||l===-201?new J(l,null):c}finally{Bn(a),Ni(s)}}resolveInjectorInitializers(){let e=Te(null),n=Ni(this),r=Bn(void 0),i;try{let o=this.get(ys,Rn,{self:!0});for(let s of o)s()}finally{Ni(n),Bn(r),Te(e)}}toString(){let e=[],n=this.records;for(let r of n.keys())e.push(vo(r));return`R3Injector[${e.join(", ")}]`}processProvider(e){e=jt(e);let n=ic(e)?e:jt(e&&e.provide),r=pz(e);if(!ic(e)&&e.multi===!0){let i=this.records.get(n);i||(i=Iu(void 0,EE,!0),i.factory=()=>wS(i.multi),this.records.set(n,i)),n=e,i.multi.push(e)}this.records.set(n,r)}hydrate(e,n,r){let i=Te(null);try{if(n.value===$L)throw jS(vo(e));return n.value===EE&&(n.value=$L,n.value=n.factory(void 0,r)),typeof n.value=="object"&&n.value&&mz(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{Te(i)}}injectableDefInScope(e){if(!e.providedIn)return!1;let n=jt(e.providedIn);return typeof n=="string"?n==="any"||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(e){let n=this._onDestroyHooks.indexOf(e);n!==-1&&this._onDestroyHooks.splice(n,1)}};function bS(t){let e=AE(t),n=e!==null?e.factory:Es(t);if(n!==null)return n;if(t instanceof z)throw new J(204,!1);if(t instanceof Function)return fz(t);throw new J(204,!1)}function fz(t){if(t.length>0)throw new J(204,!1);let n=tz(t);return n!==null?()=>n.factory(t):()=>new t}function pz(t){if(rP(t))return Iu(void 0,t.useValue);{let e=QS(t);return Iu(e,EE)}}function QS(t,e,n){let r;if(ic(t)){let i=jt(t);return Es(i)||bS(i)}else if(rP(t))r=()=>jt(t.useValue);else if(hz(t))r=()=>t.useFactory(...wS(t.deps||[]));else if(dz(t))r=(i,o)=>$(jt(t.useExisting),o!==void 0&&o&8?8:void 0);else{let i=jt(t&&(t.useClass||t.provide));if(gz(t))r=()=>new i(...wS(t.deps));else return Es(i)||bS(i)}return r}function nf(t){if(t.destroyed)throw new J(205,!1)}function Iu(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function gz(t){return!!t.deps}function mz(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function Ez(t){return typeof t=="function"||typeof t=="object"&&t.ngMetadataName==="InjectionToken"}function OS(t,e){for(let n of t)Array.isArray(n)?OS(n,e):n&&FS(n)?OS(n.\u0275providers,e):e(n)}function bi(t,e){let n;t instanceof oc?(nf(t),n=t):n=new NS(t);let r,i=Ni(n),o=Bn(void 0);try{return e()}finally{Ni(i),Bn(o)}}function JS(){return YL()!==void 0||tE()!=null}var Jr=0,pe=1,ye=2,Ht=3,Pr=4,Gn=5,ac=6,Au=7,Nt=8,Ao=9,Oi=10,qe=11,Cu=12,ZS=13,cc=14,wn=15,vs=16,lc=17,Mi=18,df=19,eA=20,Io=21,bE=22,Co=23,dr=24,uc=25,dc=26,Ke=27,oP=1,tA=6,Ss=7,hf=8,hc=9,wt=10;function Li(t){return Array.isArray(t)&&typeof t[oP]=="object"}function Zr(t){return Array.isArray(t)&&t[oP]===!0}function nA(t){return(t.flags&4)!==0}function Do(t){return t.componentOffset>-1}function Du(t){return(t.flags&1)===1}function ei(t){return!!t.template}function Ru(t){return(t[ye]&512)!==0}function fc(t){return(t[ye]&256)===256}var vt=(function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t[t.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING",t})(vt||{}),_E,sf="svg",rA="math";function sP(){return _E||(_E={},ms(vt.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),ms(vt.STYLE,void 0,[["*",["style"]]]),ms(vt.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),ms(vt.URL,rA,[["*",["href","xlink:href"]],["annotation",["href","xlink:href"]],["annotation-xml",["href","xlink:href"]],["maction",["href","xlink:href"]],["malignmark",["href","xlink:href"]],["math",["href","xlink:href"]],["mroot",["href","xlink:href"]],["msqrt",["href","xlink:href"]],["merror",["href","xlink:href"]],["mfrac",["href","xlink:href"]],["mglyph",["href","xlink:href"]],["msub",["href","xlink:href"]],["msup",["href","xlink:href"]],["msubsup",["href","xlink:href"]],["mmultiscripts",["href","xlink:href"]],["mprescripts",["href","xlink:href"]],["mi",["href","xlink:href"]],["mn",["href","xlink:href"]],["mo",["href","xlink:href"]],["mpadded",["href","xlink:href"]],["mphantom",["href","xlink:href"]],["mrow",["href","xlink:href"]],["ms",["href","xlink:href"]],["mspace",["href","xlink:href"]],["mstyle",["href","xlink:href"]],["mtable",["href","xlink:href"]],["mtd",["href","xlink:href"]],["mtr",["href","xlink:href"]],["mtext",["href","xlink:href"]],["mover",["href","xlink:href"]],["munder",["href","xlink:href"]],["munderover",["href","xlink:href"]],["semantics",["href","xlink:href"]],["none",["href","xlink:href"]]]),ms(vt.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),ms(vt.URL,sf,[["a",["href","xlink:href"]]]),ms(vt.ATTRIBUTE_NO_BINDING,sf,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),ms(vt.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]]])),_E}function ms(t,e,n){for(let[r,i]of n){let o=e&&r!=="unknown"?`:${e}:${r}`:r;o=o.toLowerCase();for(let s of i)_E[`${o}|${s.toLowerCase()}`]=t}}function aP(t,e,n){let r=sP(),i=t.toLowerCase(),o=e.toLowerCase(),s=n&&i!=="*"&&i!=="unknown"?r[`:${n}:${i}|${o}`]:void 0,a=n?r[`:${n}:*|${o}`]:void 0;return s??a??r[`${i}|${o}`]??r[`*|${o}`]??vt.NONE}function xr(t){for(;Array.isArray(t);)t=t[Jr];return t}function iA(t,e){return xr(e[t])}function hr(t,e){return xr(e[t.index])}function ff(t,e){return t.data[e]}function pc(t,e){return t[e]}function pf(t,e,n,r){n>=t.data.length&&(t.data[n]=null,t.blueprint[n]=null),e[n]=r}function kr(t,e){let n=e[t];return Li(n)?n:n[Jr]}function cP(t){return(t[ye]&4)===4}function OE(t){return(t[ye]&128)===128}function lP(t){return Zr(t[Ht])}function fr(t,e){return e==null?null:t[e]}function oA(t){t[lc]=0}function ME(t){t[ye]&1024||(t[ye]|=1024,OE(t)&&As(t))}function uP(t,e){for(;t>0;)e=e[cc],t--;return e}function Nu(t){return!!(t[ye]&9216||t[dr]?.dirty)}function LE(t){t[Oi].changeDetectionScheduler?.notify(8),t[ye]&64&&(t[ye]|=1024),Nu(t)&&As(t)}function As(t){t[Oi].changeDetectionScheduler?.notify(0);let e=_s(t);for(;e!==null&&!(e[ye]&8192||(e[ye]|=8192,!OE(e)));)e=_s(e)}function sA(t,e){if(fc(t))throw new J(911,!1);t[Io]===null&&(t[Io]=[]),t[Io].push(e)}function dP(t,e){if(t[Io]===null)return;let n=t[Io].indexOf(e);n!==-1&&t[Io].splice(n,1)}function _s(t){let e=t[Ht];return Zr(e)?e[Ht]:e}function aA(t){return t[Au]??=[]}function cA(t){return t.cleanup??=[]}function hP(t,e,n,r){let i=aA(e);i.push(n),t.firstCreatePass&&cA(t).push(r,i.length-1)}var Se={lFrame:AP(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var MS=!1;function fP(){return Se.lFrame.elementDepthCount}function pP(){Se.lFrame.elementDepthCount++}function lA(){Se.lFrame.elementDepthCount--}function PE(){return Se.bindingsEnabled}function uA(){return Se.skipHydrationRootTNode!==null}function dA(t){return Se.skipHydrationRootTNode===t}function hA(){Se.skipHydrationRootTNode=null}function ne(){return Se.lFrame.lView}function Ye(){return Se.lFrame.tView}function gP(t){return Se.lFrame.contextLView=t,t[Nt]}function mP(t){return Se.lFrame.contextLView=null,t}function $t(){let t=fA();for(;t!==null&&t.type===64;)t=t.parent;return t}function fA(){return Se.lFrame.currentTNode}function EP(){let t=Se.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function gc(t,e){let n=Se.lFrame;n.currentTNode=t,n.isParent=e}function pA(){return Se.lFrame.isParent}function gA(){Se.lFrame.isParent=!1}function mA(){return Se.lFrame.contextLView}function EA(){return MS}function wu(t){let e=MS;return MS=t,e}function jn(){let t=Se.lFrame,e=t.bindingRootIndex;return e===-1&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function _A(){return Se.lFrame.bindingIndex}function _P(t){return Se.lFrame.bindingIndex=t}function Pi(){return Se.lFrame.bindingIndex++}function gf(t){let e=Se.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function TP(){return Se.lFrame.inI18n}function yP(t,e){let n=Se.lFrame;n.bindingIndex=n.bindingRootIndex=t,xE(e)}function IP(){return Se.lFrame.currentDirectiveIndex}function xE(t){Se.lFrame.currentDirectiveIndex=t}function vP(t){let e=Se.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function kE(){return Se.lFrame.currentQueryIndex}function mf(t){Se.lFrame.currentQueryIndex=t}function _z(t){let e=t[pe];return e.type===2?e.declTNode:e.type===1?t[Gn]:null}function TA(t,e,n){if(n&4){let i=e,o=t;for(;i=i.parent,i===null&&!(n&1);)if(i=_z(o),i===null||(o=o[cc],i.type&10))break;if(i===null)return!1;e=i,t=o}let r=Se.lFrame=SP();return r.currentTNode=e,r.lView=t,!0}function FE(t){let e=SP(),n=t[pe];Se.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function SP(){let t=Se.lFrame,e=t===null?null:t.child;return e===null?AP(t):e}function AP(t){let e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return t!==null&&(t.child=e),e}function CP(){let t=Se.lFrame;return Se.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var yA=CP;function UE(){let t=CP();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function DP(t){return(Se.lFrame.contextLView=uP(t,Se.lFrame.contextLView))[Nt]}function pr(){return Se.lFrame.selectedIndex}function Cs(t){Se.lFrame.selectedIndex=t}function mc(){let t=Se.lFrame;return ff(t.tView,t.selectedIndex)}function RP(){Se.lFrame.currentNamespace=sf}function NP(){Tz()}function Tz(){Se.lFrame.currentNamespace=null}function IA(){return Se.lFrame.currentNamespace}var wP=!0;function VE(){return wP}function Ef(t){wP=t}function LS(t,e=null,n=null,r){let i=vA(t,e,n,r);return i.resolveInjectorInitializers(),i}function vA(t,e=null,n=null,r,i=new Set){let o=[n||Rn,tP(t)];return r=r||(typeof t=="object"?void 0:vo(t)),new oc(o,e||Su(),r||null,i)}var ze=class t{static THROW_IF_NOT_FOUND=tc;static NULL=new of;static create(e,n){if(Array.isArray(e))return LS({name:""},n,e,"");{let r=e.name??"";return LS({name:r},e.parent,e.providers,r)}}static \u0275prov=Q({token:t,providedIn:"any",factory:()=>$(zS)});static __NG_ELEMENT_ID__=-1},on=new z(""),Hn=(()=>{class t{static __NG_ELEMENT_ID__=yz;static __NG_ENV_ID__=n=>n}return t})(),af=class extends Hn{_lView;constructor(e){super(),this._lView=e}get destroyed(){return fc(this._lView)}onDestroy(e){let n=this._lView;return sA(n,e),()=>dP(n,e)}};function yz(){return new af(ne())}var lr=class{_console=console;handleError(e){this._console.error("ERROR",e)}},xi=new z("",{providedIn:"root",factory:()=>{let t=Y(Nn),e;return n=>{t.destroyed&&!e?setTimeout(()=>{throw n}):(e??=t.get(lr),e.handleError(n))}}}),bP={provide:ys,useValue:()=>{Y(lr)},multi:!0};function ki(t){return typeof t=="function"&&t[rn]!==void 0}function Ec(t,e){let[n,r,i]=TS(t,e?.equal),o=n,s=o[rn];return o.set=r,o.update=i,o.asReadonly=SA.bind(o),o}function SA(){let t=this[rn];if(t.readonlyFn===void 0){let e=()=>this();e[rn]=t,t.readonlyFn=e}return t.readonlyFn}function AA(t){return ki(t)&&typeof t.set=="function"}var bu=(()=>{class t{view;node;constructor(n,r){this.view=n,this.node=r}static __NG_ELEMENT_ID__=Iz}return t})();function Iz(){return new bu(ne(),$t())}var Lr=class{},Ou=new z("",{providedIn:"root",factory:()=>!1});var CA=new z(""),BE=new z(""),Ds=(()=>{class t{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new ie(!1);get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new fe(n=>{n.next(!1),n.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let n=this.taskId++;return this.pendingTasks.add(n),n}has(n){return this.pendingTasks.has(n)}remove(n){this.pendingTasks.delete(n),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new t})}return t})(),Fi=(()=>{class t{internalPendingTasks=Y(Ds);scheduler=Y(Lr);errorHandler=Y(xi);add(){let n=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(n)&&(this.scheduler.notify(11),this.internalPendingTasks.remove(n))}}run(n){let r=this.add();n().catch(this.errorHandler).finally(r)}static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new t})}return t})();function _c(...t){}var _f=(()=>{class t{static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new PS})}return t})(),PS=class{dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let n=e.zone,r=this.queues.get(n);r.has(e)&&(r.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let n=e.zone;this.queues.has(n)||this.queues.set(n,new Set);let r=this.queues.get(n);r.has(e)||r.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[n,r]of this.queues)n===null?e||=this.flushQueue(r):e||=n.run(()=>this.flushQueue(r));e||(this.dirtyEffectCount=0)}}flushQueue(e){let n=!1;for(let r of e)r.dirty&&(this.dirtyEffectCount--,n=!0,r.run());return n}};function Wu(t){return{toString:t}.toString()}var GE="__parameters__";function Nz(t){return function(...n){if(t){let r=t(...n);for(let i in r)this[i]=r[i]}}}function fx(t,e,n){return Wu(()=>{let r=Nz(e);function i(...o){if(this instanceof i)return r.apply(this,o),this;let s=new i(...o);return a.annotation=s,a;function a(c,l,d){let h=c.hasOwnProperty(GE)?c[GE]:Object.defineProperty(c,GE,{value:[]})[GE];for(;h.length<=d;)h.push(null);return(h[d]=h[d]||[]).push(s),c}}return i.prototype.ngMetadataName=t,i.annotationCls=i,i})}var wz=$S(fx("Inject",t=>({token:t})),-1),zt=$S(fx("Optional"),8);function px(t){let e=Lt.ng;if(e&&e.\u0275compilerFacade)return e.\u0275compilerFacade;throw new Error("JIT compiler unavailable")}function bz(t){return typeof t=="function"}var ZE=class{previousValue;currentValue;firstChange;constructor(e,n,r){this.previousValue=e,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}};function gx(t,e,n,r){e!==null?e.applyValueToInputSignal(e,r):t[n]=r}var vC=(()=>{let t=()=>mx;return t.ngInherit=!0,t})();function mx(t){return t.type.prototype.ngOnChanges&&(t.setInput=Mz),Oz}function Oz(){let t=_x(this),e=t?.current;if(e){let n=t.previous;if(n===Qr)t.previous=e;else for(let r in e)n[r]=e[r];t.current=null,this.ngOnChanges(e)}}function Mz(t,e,n,r,i){let o=this.declaredInputs[r],s=_x(t)||Lz(t,{previous:Qr,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[o];a[o]=new ZE(l&&l.currentValue,n,c===Qr),gx(t,e,i,n)}var Ex="__ngSimpleChanges__";function _x(t){return t[Ex]||null}function Lz(t,e){return t[Ex]=e}var OP=[];var ot=function(t,e=null,n){for(let r=0;r<OP.length;r++){let i=OP[r];i(t,e,n)}};function Pz(t,e,n){let{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){let s=mx(e);(n.preOrderHooks??=[]).push(t,s),(n.preOrderCheckHooks??=[]).push(t,s)}i&&(n.preOrderHooks??=[]).push(0-t,i),o&&((n.preOrderHooks??=[]).push(t,o),(n.preOrderCheckHooks??=[]).push(t,o))}function Tx(t,e){for(let n=e.directiveStart,r=e.directiveEnd;n<r;n++){let o=t.data[n].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:d}=o;s&&(t.contentHooks??=[]).push(-n,s),a&&((t.contentHooks??=[]).push(n,a),(t.contentCheckHooks??=[]).push(n,a)),c&&(t.viewHooks??=[]).push(-n,c),l&&((t.viewHooks??=[]).push(n,l),(t.viewCheckHooks??=[]).push(n,l)),d!=null&&(t.destroyHooks??=[]).push(n,d)}}function KE(t,e,n){yx(t,e,3,n)}function YE(t,e,n,r){(t[ye]&3)===n&&yx(t,e,n,r)}function DA(t,e){let n=t[ye];(n&3)===e&&(n&=16383,n+=1,t[ye]=n)}function yx(t,e,n,r){let i=r!==void 0?t[lc]&65535:0,o=r??-1,s=e.length-1,a=0;for(let c=i;c<s;c++)if(typeof e[c+1]=="number"){if(a=e[c],r!=null&&a>=r)break}else e[c]<0&&(t[lc]+=65536),(a<o||o==-1)&&(xz(t,n,e,c),t[lc]=(t[lc]&4294901760)+c+2),c++}function MP(t,e){ot(4,t,e);let n=Te(null);try{e.call(t)}finally{Te(n),ot(5,t,e)}}function xz(t,e,n,r){let i=n[r]<0,o=n[r+1],s=i?-n[r]:n[r],a=t[s];i?t[ye]>>14<t[lc]>>16&&(t[ye]&3)===e&&(t[ye]+=16384,MP(a,o)):MP(a,o)}var Lu=-1,yc=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,n,r,i){this.factory=e,this.name=i,this.canSeeViewProviders=n,this.injectImpl=r}};function kz(t){return(t.flags&8)!==0}function Fz(t){return(t.flags&16)!==0}function Uz(t,e,n){let r=0;for(;r<n.length;){let i=n[r];if(typeof i=="number"){if(i!==0)break;r++;let o=n[r++],s=n[r++],a=n[r++];t.setAttribute(e,s,a,o)}else{let o=i,s=n[++r];Bz(o)?t.setProperty(e,o,s):t.setAttribute(e,o,s),r++}}return r}function Vz(t){return t===3||t===4||t===6}function Bz(t){return t.charCodeAt(0)===64}function Pu(t,e){if(!(e===null||e.length===0))if(t===null||t.length===0)t=e.slice();else{let n=-1;for(let r=0;r<e.length;r++){let i=e[r];typeof i=="number"?n=i:n===0||(n===-1||n===2?LP(t,n,i,null,e[++r]):LP(t,n,i,null,null))}}return t}function LP(t,e,n,r,i){let o=0,s=t.length;if(e===-1)s=-1;else for(;o<t.length;){let a=t[o++];if(typeof a=="number"){if(a===e){s=-1;break}else if(a>e){s=o-1;break}}}for(;o<t.length;){let a=t[o];if(typeof a=="number")break;if(a===n){i!==null&&(t[o+1]=i);return}o++,i!==null&&o++}s!==-1&&(t.splice(s,0,e),o=s+1),t.splice(o++,0,n),i!==null&&t.splice(o++,0,i)}function Ix(t){return t!==Lu}function e_(t){return t&32767}function Gz(t){return t>>16}function t_(t,e){let n=Gz(t),r=e;for(;n>0;)r=r[cc],n--;return r}var FA=!0;function n_(t){let e=FA;return FA=t,e}var jz=256,vx=jz-1,Sx=5,Hz=0,Ui={};function $z(t,e,n){let r;typeof n=="string"?r=n.charCodeAt(0)||0:n.hasOwnProperty(sc)&&(r=n[sc]),r==null&&(r=n[sc]=Hz++);let i=r&vx,o=1<<i;e.data[t+(i>>Sx)]|=o}function r_(t,e){let n=Ax(t,e);if(n!==-1)return n;let r=e[pe];r.firstCreatePass&&(t.injectorIndex=e.length,RA(r.data,t),RA(e,null),RA(r.blueprint,null));let i=SC(t,e),o=t.injectorIndex;if(Ix(i)){let s=e_(i),a=t_(i,e),c=a[pe].data;for(let l=0;l<8;l++)e[o+l]=a[s+l]|c[s+l]}return e[o+8]=i,o}function RA(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Ax(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function SC(t,e){if(t.parent&&t.parent.injectorIndex!==-1)return t.parent.injectorIndex;let n=0,r=null,i=e;for(;i!==null;){if(r=wx(i),r===null)return Lu;if(n++,i=i[cc],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return Lu}function UA(t,e,n){$z(t,e,n)}function Cx(t,e,n){if(n&8||t!==void 0)return t;DE(e,"NodeInjector")}function Dx(t,e,n,r){if(n&8&&r===void 0&&(r=null),(n&3)===0){let i=t[Ao],o=Bn(void 0);try{return i?i.get(e,r,n&8):HS(e,r,n&8)}finally{Bn(o)}}return Cx(r,e,n)}function Rx(t,e,n,r=0,i){if(t!==null){if(e[ye]&2048&&!(r&2)){let s=Yz(t,e,n,r,Ui);if(s!==Ui)return s}let o=Nx(t,e,n,r,Ui);if(o!==Ui)return o}return Dx(e,n,r,i)}function Nx(t,e,n,r,i){let o=zz(n);if(typeof o=="function"){if(!TA(e,t,r))return r&1?Cx(i,n,r):Dx(e,n,r,i);try{let s;if(s=o(r),s==null&&!(r&8))DE(n);else return s}finally{yA()}}else if(typeof o=="number"){let s=null,a=Ax(t,e),c=Lu,l=r&1?e[wn][Gn]:null;for((a===-1||r&4)&&(c=a===-1?SC(t,e):e[a+8],c===Lu||!xP(r,!1)?a=-1:(s=e[pe],a=e_(c),e=t_(c,e)));a!==-1;){let d=e[pe];if(PP(o,a,d.data)){let h=Wz(a,e,n,s,r,l);if(h!==Ui)return h}c=e[a+8],c!==Lu&&xP(r,e[pe].data[a+8]===l)&&PP(o,a,e)?(s=d,a=e_(c),e=t_(c,e)):a=-1}}return i}function Wz(t,e,n,r,i,o){let s=e[pe],a=s.data[t+8],c=r==null?Do(a)&&FA:r!=s&&(a.type&3)!==0,l=i&1&&o===a,d=XE(a,s,n,c,l);return d!==null?If(e,s,d,a,i):Ui}function XE(t,e,n,r,i){let o=t.providerIndexes,s=e.data,a=o&1048575,c=t.directiveStart,l=t.directiveEnd,d=o>>20,h=r?a:a+d,f=i?a+d:l;for(let g=h;g<f;g++){let E=s[g];if(g<c&&n===E||g>=c&&E.type===n)return g}if(i){let g=s[c];if(g&&ei(g)&&g.type===n)return c}return null}function If(t,e,n,r,i){let o=t[n],s=e.data;if(o instanceof yc){let a=o;if(a.resolving){let g=zL(s[n]);throw jS(g)}let c=n_(a.canSeeViewProviders);a.resolving=!0;let l=s[n].type||s[n],d,h=a.injectImpl?Bn(a.injectImpl):null,f=TA(t,r,0);try{o=t[n]=a.factory(void 0,i,s,t,r),e.firstCreatePass&&n>=r.directiveStart&&Pz(n,s[n],e)}finally{h!==null&&Bn(h),n_(c),a.resolving=!1,yA()}}return o}function zz(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=t.hasOwnProperty(sc)?t[sc]:void 0;return typeof e=="number"?e>=0?e&vx:qz:e}function PP(t,e,n){let r=1<<t;return!!(n[e+(t>>Sx)]&r)}function xP(t,e){return!(t&2)&&!(t&1&&e)}var Tc=class{_tNode;_lView;constructor(e,n){this._tNode=e,this._lView=n}get(e,n,r){return Rx(this._tNode,this._lView,e,rc(r),n)}};function qz(){return new Tc($t(),ne())}function Kz(t){return Wu(()=>{let e=t.prototype.constructor,n=e[rf]||VA(e),r=Object.prototype,i=Object.getPrototypeOf(t.prototype).constructor;for(;i&&i!==r;){let o=i[rf]||VA(i);if(o&&o!==n)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function VA(t){return kS(t)?()=>{let e=VA(jt(t));return e&&e()}:Es(t)}function Yz(t,e,n,r,i){let o=t,s=e;for(;o!==null&&s!==null&&s[ye]&2048&&!Ru(s);){let a=Nx(o,s,n,r|2,Ui);if(a!==Ui)return a;let c=o.parent;if(!c){let l=s[eA];if(l){let d=l.get(n,Ui,r);if(d!==Ui)return d}c=wx(s),s=s[cc]}o=c}return i}function wx(t){let e=t[pe],n=e.type;return n===2?e.declTNode:n===1?t[Gn]:null}function Xz(){return zu($t(),ne())}function zu(t,e){return new Ns(hr(t,e))}var Ns=(()=>{class t{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=Xz}return t})();function bx(t){return t instanceof Ns?t.nativeElement:t}function Qz(){return this._results[Symbol.iterator]()}var i_=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Rt}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,n){return this._results.reduce(e,n)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,n){this.dirty=!1;let r=QL(e);(this._changesDetected=!XL(this._results,r,n))&&(this._results=r,this.length=r.length,this.last=r[this.length-1],this.first=r[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=Qz};function Ox(t){return(t.flags&128)===128}var AC=(function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t})(AC||{}),Mx=new Map,Jz=0;function Zz(){return Jz++}function e8(t){Mx.set(t[df],t)}function BA(t){Mx.delete(t[df])}var kP="__ngContext__";function xu(t,e){Li(e)?(t[kP]=e[df],e8(e)):t[kP]=e}function Lx(t){return xx(t[Cu])}function Px(t){return xx(t[Pr])}function xx(t){for(;t!==null&&!Zr(t);)t=t[Pr];return t}var GA;function CC(t){GA=t}function DC(){if(GA!==void 0)return GA;if(typeof document<"u")return document;throw new J(210,!1)}var y_=new z("",{providedIn:"root",factory:()=>t8}),t8="ng",I_=new z(""),Oo=new z("",{providedIn:"platform",factory:()=>"unknown"});var n8=new z(""),qu=new z("",{providedIn:"root",factory:()=>DC().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var r8="h",i8="b";var kx="r";var Fx="di";var Ux=!1,Vx=new z("",{providedIn:"root",factory:()=>Ux});var o8=(t,e,n,r)=>{};function s8(t,e,n,r){o8(t,e,n,r)}function v_(t){return(t.flags&32)===32}var a8=()=>null;function Bx(t,e,n=!1){return a8(t,e,n)}function Gx(t,e){let n=t.contentQueries;if(n!==null){let r=Te(null);try{for(let i=0;i<n.length;i+=2){let o=n[i],s=n[i+1];if(s!==-1){let a=t.data[s];mf(o),a.contentQueries(2,e[s],s)}}}finally{Te(r)}}}function jA(t,e,n){mf(0);let r=Te(null);try{e(t,n)}finally{Te(r)}}function RC(t,e,n){if(nA(e)){let r=Te(null);try{let i=e.directiveStart,o=e.directiveEnd;for(let s=i;s<o;s++){let a=t.data[s];if(a.contentQueries){let c=n[s];a.contentQueries(1,c,s)}}}finally{Te(r)}}}var No=(function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t})(No||{});var c8="svg",l8="math",u8={"http://www.w3.org/2000/svg":c8,"http://www.w3.org/1998/Math/MathML":l8},jE;function d8(){if(jE===void 0&&(jE=null,Lt.trustedTypes))try{jE=Lt.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return jE}function S_(t){return d8()?.createHTML(t)||t}var HE;function h8(){if(HE===void 0&&(HE=null,Lt.trustedTypes))try{HE=Lt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return HE}function FP(t){return h8()?.createHTML(t)||t}var wo=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${IE})`}},HA=class extends wo{getTypeName(){return"HTML"}},$A=class extends wo{getTypeName(){return"Style"}},WA=class extends wo{getTypeName(){return"Script"}},zA=class extends wo{getTypeName(){return"URL"}},qA=class extends wo{getTypeName(){return"ResourceURL"}};function gr(t){return t instanceof wo?t.changingThisBreaksApplicationSecurity:t}function Bi(t,e){let n=jx(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${IE})`)}return n===e}function jx(t){return t instanceof wo&&t.getTypeName()||null}function NC(t){return new HA(t)}function wC(t){return new $A(t)}function bC(t){return new WA(t)}function OC(t){return new zA(t)}function MC(t){return new qA(t)}function f8(t){let e=new YA(t);return p8()?new KA(e):e}var KA=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let n=new window.DOMParser().parseFromString(S_(e),"text/html").body;return n===null?this.inertDocumentHelper.getInertBodyElement(e):(n.firstChild?.remove(),n)}catch{return null}}},YA=class{defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let n=this.inertDocument.createElement("template");return n.innerHTML=S_(e),n}};function p8(){try{return!!new window.DOMParser().parseFromString(S_(""),"text/html")}catch{return!1}}var g8=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Cf(t){return t=String(t),t.match(g8)?t:"unsafe:"+t}function Mo(t){let e={};for(let n of t.split(","))e[n]=!0;return e}function Df(...t){let e={};for(let n of t)for(let r in n)n.hasOwnProperty(r)&&(e[r]=!0);return e}var Hx=Mo("area,br,col,hr,img,wbr"),$x=Mo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Wx=Mo("rp,rt"),m8=Df(Wx,$x),E8=Df($x,Mo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),_8=Df(Wx,Mo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),UP=Df(Hx,E8,_8,m8),zx=Mo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),T8=Mo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),y8=Mo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),I8=Df(zx,T8,y8),v8=Mo("script,style,template"),XA=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let n=e.firstChild,r=!0,i=[];for(;n;){if(n.nodeType===Node.ELEMENT_NODE?r=this.startElement(n):n.nodeType===Node.TEXT_NODE?this.chars(n.nodeValue):this.sanitizedSomething=!0,r&&n.firstChild){i.push(n),n=C8(n);continue}for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let o=A8(n);if(o){n=o;break}n=i.pop()}}return this.buf.join("")}startElement(e){let n=VP(e).toLowerCase();if(!UP.hasOwnProperty(n))return this.sanitizedSomething=!0,!v8.hasOwnProperty(n);this.buf.push("<"),this.buf.push(n);let r=e.attributes;for(let i=0;i<r.length;i++){let o=r.item(i),s=o.name,a=s.toLowerCase();if(!I8.hasOwnProperty(a)){this.sanitizedSomething=!0;continue}let c=o.value;zx[a]&&(c=Cf(c)),this.buf.push(" ",s,'="',BP(c),'"')}return this.buf.push(">"),!0}endElement(e){let n=VP(e).toLowerCase();UP.hasOwnProperty(n)&&!Hx.hasOwnProperty(n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(e){this.buf.push(BP(e))}};function S8(t,e){return(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function A8(t){let e=t.nextSibling;if(e&&t!==e.previousSibling)throw qx(e);return e}function C8(t){let e=t.firstChild;if(e&&S8(t,e))throw qx(e);return e}function VP(t){let e=t.nodeName;return typeof e=="string"?e:"FORM"}function qx(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}var D8=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,R8=/([^\#-~ |!])/g;function BP(t){return t.replace(/&/g,"&").replace(D8,function(e){let n=e.charCodeAt(0),r=e.charCodeAt(1);return"&#"+((n-55296)*1024+(r-56320)+65536)+";"}).replace(R8,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}var $E;function A_(t,e){let n=null;try{$E=$E||f8(t);let r=e?String(e):"";n=$E.getInertBodyElement(r);let i=5,o=r;do{if(i===0)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=n.innerHTML,n=$E.getInertBodyElement(r)}while(r!==o);let a=new XA().sanitizeChildren(GP(n)||n);return S_(a)}finally{if(n){let r=GP(n)||n;for(;r.firstChild;)r.firstChild.remove()}}}function GP(t){return"content"in t&&N8(t)?t.content:null}function N8(t){return t.nodeType===Node.ELEMENT_NODE&&t.nodeName==="TEMPLATE"}var w8=/^>|^->|<!--|-->|--!>|<!-$/g,b8=/(<|>)/g,O8="\u200B$1\u200B";function M8(t){return t.replace(w8,e=>e.replace(b8,O8))}function L8(t,e){return t.createText(e)}function P8(t,e,n){t.setValue(e,n)}function x8(t,e){return t.createComment(M8(e))}function Kx(t,e,n){return t.createElement(e,n)}function o_(t,e,n,r,i){t.insertBefore(e,n,r,i)}function Yx(t,e,n){t.appendChild(e,n)}function jP(t,e,n,r,i){r!==null?o_(t,e,n,r,i):Yx(t,e,n)}function Xx(t,e,n,r){t.removeChild(null,e,n,r)}function k8(t,e,n){t.setAttribute(e,"style",n)}function F8(t,e,n){n===""?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n)}function Qx(t,e,n){let{mergedAttrs:r,classes:i,styles:o}=n;r!==null&&Uz(t,e,r),i!==null&&F8(t,e,i),o!==null&&k8(t,e,o)}function U8(t,e=!0){if(t[0]!=":")return[null,t];let n=t.indexOf(":",1);if(n===-1){if(e)throw new Error(`Unsupported format "${t}" expecting ":namespace:name"`);return[null,t]}return[t.slice(1,n),t.slice(n+1)]}function V8(t,e,n){if(e!==void 0&&n!==void 0&&j8(e,n)!==vt.HTML)return t;let r=LC();return r?FP(r.sanitize(vt.HTML,t)||""):Bi(t,"HTML")?FP(gr(t)):A_(DC(),ur(t))}function B8(t){let e=LC();return e?e.sanitize(vt.STYLE,t)||"":Bi(t,"Style")?gr(t):ur(t)}function G8(t){let e=LC();return e?e.sanitize(vt.URL,t)||"":Bi(t,"URL")?gr(t):Cf(ur(t))}function LC(){let t=ne();return t&&t[Oi].sanitizer}function j8(t,e){let[n,r]=H8(t);return aP(r,e,n)}function H8(t){t=t.toLowerCase();let e=U8(t,!1);if(e[0])return e;let r=pr()===-1?null:mc(),i=r?.namespace;if(t==="#host"&&r?.type===2){let o=hr(r,ne());if(o.tagName&&(t=o.tagName.toLowerCase()),i==null){let s=o.namespaceURI;i=s&&u8[s]}}return[i,t]}function $8(t){return t.ownerDocument.defaultView}function W8(t){return t.ownerDocument}function z8(t){return t instanceof Function?t():t}function q8(t,e,n){let r=t.length;for(;;){let i=t.indexOf(e,n);if(i===-1)return i;if(i===0||t.charCodeAt(i-1)<=32){let o=e.length;if(i+o===r||t.charCodeAt(i+o)<=32)return i}n=i+1}}var Jx="ng-template";function K8(t,e,n,r){let i=0;if(r){for(;i<e.length&&typeof e[i]=="string";i+=2)if(e[i]==="class"&&q8(e[i+1].toLowerCase(),n,0)!==-1)return!0}else if(PC(t))return!1;if(i=e.indexOf(1,i),i>-1){let o;for(;++i<e.length&&typeof(o=e[i])=="string";)if(o.toLowerCase()===n)return!0}return!1}function PC(t){return t.type===4&&t.value!==Jx}function Y8(t,e,n){let r=t.type===4&&!n?Jx:t.value;return e===r}function X8(t,e,n){let r=4,i=t.attrs,o=i!==null?Z8(i):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!ti(r)&&!ti(c))return!1;if(s&&ti(c))continue;s=!1,r=c|r&1;continue}if(!s)if(r&4){if(r=2|r&1,c!==""&&!Y8(t,c,n)||c===""&&e.length===1){if(ti(r))return!1;s=!0}}else if(r&8){if(i===null||!K8(t,i,c,n)){if(ti(r))return!1;s=!0}}else{let l=e[++a],d=Q8(c,i,PC(t),n);if(d===-1){if(ti(r))return!1;s=!0;continue}if(l!==""){let h;if(d>o?h="":h=i[d+1].toLowerCase(),r&2&&l!==h){if(ti(r))return!1;s=!0}}}}return ti(r)||s}function ti(t){return(t&1)===0}function Q8(t,e,n,r){if(e===null)return-1;let i=0;if(r||!n){let o=!1;for(;i<e.length;){let s=e[i];if(s===t)return i;if(s===3||s===6)o=!0;else if(s===1||s===2){let a=e[++i];for(;typeof a=="string";)a=e[++i];continue}else{if(s===4)break;if(s===0){i+=4;continue}}i+=o?1:2}return-1}else return e5(e,t)}function Zx(t,e,n=!1){for(let r=0;r<e.length;r++)if(X8(t,e[r],n))return!0;return!1}function J8(t){let e=t.attrs;if(e!=null){let n=e.indexOf(5);if((n&1)===0)return e[n+1]}return null}function Z8(t){for(let e=0;e<t.length;e++){let n=t[e];if(Vz(n))return e}return t.length}function e5(t,e){let n=t.indexOf(4);if(n>-1)for(n++;n<t.length;){let r=t[n];if(typeof r=="number")return-1;if(r===e)return n;n++}return-1}function t5(t,e){e:for(let n=0;n<e.length;n++){let r=e[n];if(t.length===r.length){for(let i=0;i<t.length;i++)if(t[i]!==r[i])continue e;return!0}}return!1}function HP(t,e){return t?":not("+e.trim()+")":e}function n5(t){let e=t[0],n=1,r=2,i="",o=!1;for(;n<t.length;){let s=t[n];if(typeof s=="string")if(r&2){let a=t[++n];i+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else r&8?i+="."+s:r&4&&(i+=" "+s);else i!==""&&!ti(s)&&(e+=HP(o,i),i=""),r=s,o=o||!ti(r);n++}return i!==""&&(e+=HP(o,i)),e}function r5(t){return t.map(n5).join(",")}function i5(t){let e=[],n=[],r=1,i=2;for(;r<t.length;){let o=t[r];if(typeof o=="string")i===2?o!==""&&e.push(o,t[++r]):i===8&&n.push(o);else{if(!ti(i))break;i=o}r++}return n.length&&e.push(1,...n),e}var sn={};function xC(t,e,n,r,i,o,s,a,c,l,d){let h=Ke+r,f=h+i,g=o5(h,f),E=typeof l=="function"?l():l;return g[pe]={type:t,blueprint:g,template:n,queries:null,viewQuery:a,declTNode:e,data:g.slice().fill(null,h),bindingStartIndex:h,expandoStartIndex:f,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof o=="function"?o():o,pipeRegistry:typeof s=="function"?s():s,firstChild:null,schemas:c,consts:E,incompleteFirstPass:!1,ssrId:d}}function o5(t,e){let n=[];for(let r=0;r<e;r++)n.push(r<t?null:sn);return n}function s5(t){let e=t.tView;return e===null||e.incompleteFirstPass?t.tView=xC(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):e}function kC(t,e,n,r,i,o,s,a,c,l,d){let h=e.blueprint.slice();return h[Jr]=i,h[ye]=r|4|128|8|64|1024,(l!==null||t&&t[ye]&2048)&&(h[ye]|=2048),oA(h),h[Ht]=h[cc]=t,h[Nt]=n,h[Oi]=s||t&&t[Oi],h[qe]=a||t&&t[qe],h[Ao]=c||t&&t[Ao]||null,h[Gn]=o,h[df]=Zz(),h[ac]=d,h[eA]=l,h[wn]=e.type==2?t[wn]:h,h}function a5(t,e,n){let r=hr(e,t),i=s5(n),o=t[Oi].rendererFactory,s=FC(t,kC(t,i,null,ek(n),r,e,null,o.createRenderer(r,n),null,null,null));return t[e.index]=s}function ek(t){let e=16;return t.signals?e=4096:t.onPush&&(e=64),e}function tk(t,e,n,r){if(n===0)return-1;let i=e.length;for(let o=0;o<n;o++)e.push(r),t.blueprint.push(r),t.data.push(null);return i}function FC(t,e){return t[Cu]?t[ZS][Pr]=e:t[Cu]=e,t[ZS]=e,e}function c5(t=1){nk(Ye(),ne(),pr()+t,!1)}function nk(t,e,n,r){if(!r)if((e[ye]&3)===3){let o=t.preOrderCheckHooks;o!==null&&KE(e,o,n)}else{let o=t.preOrderHooks;o!==null&&YE(e,o,0,n)}Cs(n)}var C_=(function(t){return t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",t})(C_||{});function QA(t,e,n,r){let i=Te(null);try{let[o,s,a]=t.inputs[n],c=null;(s&C_.SignalBased)!==0&&(c=e[o][rn]),c!==null&&c.transformFn!==void 0?r=c.transformFn(r):a!==null&&(r=a.call(e,r)),t.setInput!==null?t.setInput(e,c,r,n,o):gx(e,c,o,r)}finally{Te(i)}}var ni=(function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t})(ni||{}),l5;function UC(t,e){return l5(t,e)}var Ic=new Set,D_=(function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t})(D_||{}),Ac=new z(""),$P=new Set;function Lo(t){$P.has(t)||($P.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var rk=!1,JA=class extends Rt{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,JS()&&(this.destroyRef=Y(Hn,{optional:!0})??void 0,this.pendingTasks=Y(Ds,{optional:!0})??void 0)}emit(e){let n=Te(null);try{super.next(e)}finally{Te(n)}}subscribe(e,n,r){let i=e,o=n||(()=>null),s=r;if(e&&typeof e=="object"){let c=e;i=c.next?.bind(c),o=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(o=this.wrapInTimeout(o),i&&(i=this.wrapInTimeout(i)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:i,error:o,complete:s});return e instanceof gt&&e.add(a),a}wrapInTimeout(e){return n=>{let r=this.pendingTasks?.add();setTimeout(()=>{try{e(n)}finally{r!==void 0&&this.pendingTasks?.remove(r)}})}}},Ro=JA;function ik(t){let e,n;function r(){t=_c;try{n!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(n),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{t(),r()}),typeof requestAnimationFrame=="function"&&(n=requestAnimationFrame(()=>{t(),r()})),()=>r()}function WP(t){return queueMicrotask(()=>t()),()=>{t=_c}}var VC="isAngularZone",s_=VC+"_ID",u5=0,Ae=class t{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Ro(!1);onMicrotaskEmpty=new Ro(!1);onStable=new Ro(!1);onError=new Ro(!1);constructor(e){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:o=rk}=e;if(typeof Zone>"u")throw new J(908,!1);Zone.assertZonePatched();let s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),n&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!i&&r,s.shouldCoalesceRunChangeDetection=i,s.callbackScheduled=!1,s.scheduleInRootZone=o,f5(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(VC)===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new J(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new J(909,!1)}run(e,n,r){return this._inner.run(e,n,r)}runTask(e,n,r,i){let o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+i,e,d5,_c,_c);try{return o.runTask(s,n,r)}finally{o.cancelTask(s)}}runGuarded(e,n,r){return this._inner.runGuarded(e,n,r)}runOutsideAngular(e){return this._outer.run(e)}},d5={};function BC(t){if(t._nesting==0&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function h5(t){if(t.isCheckStableRunning||t.callbackScheduled)return;t.callbackScheduled=!0;function e(){ik(()=>{t.callbackScheduled=!1,ZA(t),t.isCheckStableRunning=!0,BC(t),t.isCheckStableRunning=!1})}t.scheduleInRootZone?Zone.root.run(()=>{e()}):t._outer.run(()=>{e()}),ZA(t)}function f5(t){let e=()=>{h5(t)},n=u5++;t._inner=t._inner.fork({name:"angular",properties:{[VC]:!0,[s_]:n,[s_+n]:!0},onInvokeTask:(r,i,o,s,a,c)=>{if(p5(c))return r.invokeTask(o,s,a,c);try{return zP(t),r.invokeTask(o,s,a,c)}finally{(t.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),qP(t)}},onInvoke:(r,i,o,s,a,c,l)=>{try{return zP(t),r.invoke(o,s,a,c,l)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!g5(c)&&e(),qP(t)}},onHasTask:(r,i,o,s)=>{r.hasTask(o,s),i===o&&(s.change=="microTask"?(t._hasPendingMicrotasks=s.microTask,ZA(t),BC(t)):s.change=="macroTask"&&(t.hasPendingMacrotasks=s.macroTask))},onHandleError:(r,i,o,s)=>(r.handleError(o,s),t.runOutsideAngular(()=>t.onError.emit(s)),!1)})}function ZA(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.callbackScheduled===!0?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function zP(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function qP(t){t._nesting--,BC(t)}var ku=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Ro;onMicrotaskEmpty=new Ro;onStable=new Ro;onError=new Ro;run(e,n,r){return e.apply(n,r)}runGuarded(e,n,r){return e.apply(n,r)}runOutsideAngular(e){return e()}runTask(e,n,r,i){return e.apply(n,r)}};function p5(t){return ok(t,"__ignore_ng_zone__")}function g5(t){return ok(t,"__scheduler_tick__")}function ok(t,e){return!Array.isArray(t)||t.length!==1?!1:t[0]?.data?.[e]===!0}function sk(t="zone.js",e){return t==="noop"?new ku:t==="zone.js"?new Ae(e):t}var GC=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new t})}return t})(),ak=[0,1,2,3],ck=(()=>{class t{ngZone=Y(Ae);scheduler=Y(Lr);errorHandler=Y(lr,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){Y(Ac,{optional:!0})}execute(){let n=this.sequences.size>0;n&&ot(16),this.executing=!0;for(let r of ak)for(let i of this.sequences)if(!(i.erroredOrDestroyed||!i.hooks[r]))try{i.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let o=i.hooks[r];return o(i.pipelinedValue)},i.snapshot))}catch(o){i.erroredOrDestroyed=!0,this.errorHandler?.handleError(o)}this.executing=!1;for(let r of this.sequences)r.afterRun(),r.once&&(this.sequences.delete(r),r.destroy());for(let r of this.deferredRegistrations)this.sequences.add(r);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),n&&ot(17)}register(n){let{view:r}=n;r!==void 0?((r[uc]??=[]).push(n),As(r),r[ye]|=8192):this.executing?this.deferredRegistrations.add(n):this.addSequence(n)}addSequence(n){this.sequences.add(n),this.scheduler.notify(7)}unregister(n){this.executing&&this.sequences.has(n)?(n.erroredOrDestroyed=!0,n.pipelinedValue=void 0,n.once=!0):(this.sequences.delete(n),this.deferredRegistrations.delete(n))}maybeTrace(n,r){return r?r.run(D_.AFTER_NEXT_RENDER,n):n()}static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new t})}return t})(),a_=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,n,r,i,o,s=null){this.impl=e,this.hooks=n,this.view=r,this.once=i,this.snapshot=s,this.unregisterOnDestroy=o?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[uc];e&&(this.view[uc]=e.filter(n=>n!==this))}};function m5(t,e){let n=e?.injector??Y(ze);return Lo("NgAfterNextRender"),_5(t,n,e,!0)}function E5(t){return t instanceof Function?[void 0,void 0,t,void 0]:[t.earlyRead,t.write,t.mixedReadWrite,t.read]}function _5(t,e,n,r){let i=e.get(GC);i.impl??=e.get(ck);let o=e.get(Ac,null,{optional:!0}),s=n?.manualCleanup!==!0?e.get(Hn):null,a=e.get(bu,null,{optional:!0}),c=new a_(i.impl,E5(t),a?.view,r,s,o?.snapshot(null));return i.impl.register(c),c}var lk=new z("",{providedIn:"root",factory:()=>({queue:new Set,isScheduled:!1,scheduler:null})});function uk(t,e,n){let r=t.get(lk);if(Array.isArray(e))for(let i of e)r.queue.add(i),n?.detachedLeaveAnimationFns?.push(i);else r.queue.add(e),n?.detachedLeaveAnimationFns?.push(e);r.scheduler&&r.scheduler(t)}function T5(t,e){let n=t.get(lk);if(e.detachedLeaveAnimationFns){for(let r of e.detachedLeaveAnimationFns)n.queue.delete(r);e.detachedLeaveAnimationFns=void 0}}function y5(t,e){for(let[n,r]of e)uk(t,r.animateFns)}function KP(t,e,n,r){let i=t?.[dc]?.enter;e!==null&&i&&i.has(n.index)&&y5(r,i)}function Mu(t,e,n,r,i,o,s,a){if(i!=null){let c,l=!1;Zr(i)?c=i:Li(i)&&(l=!0,i=i[Jr]);let d=xr(i);t===0&&r!==null?(KP(a,r,o,n),s==null?Yx(e,r,d):o_(e,r,d,s||null,!0)):t===1&&r!==null?(KP(a,r,o,n),o_(e,r,d,s||null,!0)):t===2?YP(a,o,n,h=>{Xx(e,d,l,h)}):t===3&&YP(a,o,n,()=>{e.destroyNode(d)}),c!=null&&O5(e,t,n,c,o,r,s)}}function I5(t,e){dk(t,e),e[Jr]=null,e[Gn]=null}function v5(t,e,n,r,i,o){r[Jr]=i,r[Gn]=e,N_(t,r,n,1,i,o)}function dk(t,e){e[Oi].changeDetectionScheduler?.notify(9),N_(t,e,e[qe],2,null,null)}function S5(t){let e=t[Cu];if(!e)return NA(t[pe],t);for(;e;){let n=null;if(Li(e))n=e[Cu];else{let r=e[wt];r&&(n=r)}if(!n){for(;e&&!e[Pr]&&e!==t;)Li(e)&&NA(e[pe],e),e=e[Ht];e===null&&(e=t),Li(e)&&NA(e[pe],e),n=e&&e[Pr]}e=n}}function jC(t,e){let n=t[hc],r=n.indexOf(e);n.splice(r,1)}function R_(t,e){if(fc(e))return;let n=e[qe];n.destroyNode&&N_(t,e,n,3,null,null),S5(e)}function NA(t,e){if(fc(e))return;let n=Te(null);try{e[ye]&=-129,e[ye]|=256,e[dr]&&ec(e[dr]),D5(t,e),C5(t,e),e[pe].type===1&&e[qe].destroy();let r=e[vs];if(r!==null&&Zr(e[Ht])){r!==e[Ht]&&jC(r,e);let i=e[Mi];i!==null&&i.detachView(t)}BA(e)}finally{Te(n)}}function YP(t,e,n,r){let i=t?.[dc];if(i==null||i.leave==null||!i.leave.has(e.index))return r(!1);t&&Ic.add(t),uk(n,()=>{if(i.leave&&i.leave.has(e.index)){let s=i.leave.get(e.index),a=[];if(s){for(let c=0;c<s.animateFns.length;c++){let l=s.animateFns[c],{promise:d}=l();a.push(d)}i.detachedLeaveAnimationFns=void 0}i.running=Promise.allSettled(a),A5(t,r)}else t&&Ic.delete(t),r(!1)},i)}function A5(t,e){let n=t[dc]?.running;if(n){n.then(()=>{t[dc].running=void 0,Ic.delete(t),e(!0)});return}e(!1)}function C5(t,e){let n=t.cleanup,r=e[Au];if(n!==null)for(let s=0;s<n.length-1;s+=2)if(typeof n[s]=="string"){let a=n[s+3];a>=0?r[a]():r[-a].unsubscribe(),s+=2}else{let a=r[n[s+1]];n[s].call(a)}r!==null&&(e[Au]=null);let i=e[Io];if(i!==null){e[Io]=null;for(let s=0;s<i.length;s++){let a=i[s];a()}}let o=e[Co];if(o!==null){e[Co]=null;for(let s of o)s.destroy()}}function D5(t,e){let n;if(t!=null&&(n=t.destroyHooks)!=null)for(let r=0;r<n.length;r+=2){let i=e[n[r]];if(!(i instanceof yc)){let o=n[r+1];if(Array.isArray(o))for(let s=0;s<o.length;s+=2){let a=i[o[s]],c=o[s+1];ot(4,a,c);try{c.call(a)}finally{ot(5,a,c)}}else{ot(4,i,o);try{o.call(i)}finally{ot(5,i,o)}}}}}function hk(t,e,n){return R5(t,e.parent,n)}function R5(t,e,n){let r=e;for(;r!==null&&r.type&168;)e=r,r=e.parent;if(r===null)return n[Jr];if(Do(r)){let{encapsulation:i}=t.data[r.directiveStart+r.componentOffset];if(i===No.None||i===No.Emulated)return null}return hr(r,n)}function fk(t,e,n){return w5(t,e,n)}function N5(t,e,n){return t.type&40?hr(t,n):null}var w5=N5,XP;function HC(t,e,n,r){let i=hk(t,r,e),o=e[qe],s=r.parent||e[Gn],a=fk(s,r,e);if(i!=null)if(Array.isArray(n))for(let c=0;c<n.length;c++)jP(o,i,n[c],a,!1);else jP(o,i,n,a,!1);XP!==void 0&&XP(o,r,e,n,i)}function Tf(t,e){if(e!==null){let n=e.type;if(n&3)return hr(e,t);if(n&4)return eC(-1,t[e.index]);if(n&8){let r=e.child;if(r!==null)return Tf(t,r);{let i=t[e.index];return Zr(i)?eC(-1,i):xr(i)}}else{if(n&128)return Tf(t,e.next);if(n&32)return UC(e,t)()||xr(t[e.index]);{let r=pk(t,e);if(r!==null){if(Array.isArray(r))return r[0];let i=_s(t[wn]);return Tf(i,r)}else return Tf(t,e.next)}}}return null}function pk(t,e){if(e!==null){let r=t[wn][Gn],i=e.projection;return r.projection[i]}return null}function eC(t,e){let n=wt+t+1;if(n<e.length){let r=e[n],i=r[pe].firstChild;if(i!==null)return Tf(r,i)}return e[Ss]}function $C(t,e,n,r,i,o,s){for(;n!=null;){let a=r[Ao];if(n.type===128){n=n.next;continue}let c=r[n.index],l=n.type;if(s&&e===0&&(c&&xu(xr(c),r),n.flags|=2),!v_(n))if(l&8)$C(t,e,n.child,r,i,o,!1),Mu(e,t,a,i,c,n,o,r);else if(l&32){let d=UC(n,r),h;for(;h=d();)Mu(e,t,a,i,h,n,o,r);Mu(e,t,a,i,c,n,o,r)}else l&16?gk(t,e,r,n,i,o):Mu(e,t,a,i,c,n,o,r);n=s?n.projectionNext:n.next}}function N_(t,e,n,r,i,o){$C(n,r,t.firstChild,e,i,o,!1)}function b5(t,e,n){let r=e[qe],i=hk(t,n,e),o=n.parent||e[Gn],s=fk(o,n,e);gk(r,0,e,n,i,s)}function gk(t,e,n,r,i,o){let s=n[wn],c=s[Gn].projection[r.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let d=c[l];Mu(e,t,n[Ao],i,d,r,o,n)}else{let l=c,d=s[Ht];Ox(r)&&(l.flags|=128),$C(t,e,l,d,i,o,!0)}}function O5(t,e,n,r,i,o,s){let a=r[Ss],c=xr(r);a!==c&&Mu(e,t,n,o,a,i,s);for(let l=wt;l<r.length;l++){let d=r[l];N_(d[pe],d,t,e,o,a)}}function M5(t,e,n,r,i){if(e)i?t.addClass(n,r):t.removeClass(n,r);else{let o=r.indexOf("-")===-1?void 0:ni.DashCase;i==null?t.removeStyle(n,r,o):(typeof i=="string"&&i.endsWith("!important")&&(i=i.slice(0,-10),o|=ni.Important),t.setStyle(n,r,i,o))}}function mk(t,e,n,r,i){let o=pr(),s=r&2;try{Cs(-1),s&&e.length>Ke&&nk(t,e,Ke,!1),ot(s?2:0,i,n),n(r,i)}finally{Cs(o),ot(s?3:1,i,n)}}function w_(t,e,n){F5(t,e,n),(n.flags&64)===64&&U5(t,e,n)}function Rf(t,e,n=hr){let r=e.localNames;if(r!==null){let i=e.index+1;for(let o=0;o<r.length;o+=2){let s=r[o+1],a=s===-1?n(e,t):t[s];t[i++]=a}}}function L5(t,e,n,r){let o=r.get(Vx,Ux)||n===No.ShadowDom,s=t.selectRootElement(e,o);return P5(s),s}function P5(t){x5(t)}var x5=()=>null;function k5(t){return t==="class"?"className":t==="for"?"htmlFor":t==="formaction"?"formAction":t==="innerHtml"?"innerHTML":t==="readonly"?"readOnly":t==="tabindex"?"tabIndex":t}function Ek(t,e,n,r,i,o){let s=e[pe];if(b_(t,s,e,n,r)){Do(t)&&Tk(e,t.index);return}t.type&3&&(n=k5(n)),_k(t,e,n,r,i,o)}function _k(t,e,n,r,i,o){if(t.type&3){let s=hr(t,e);r=o!=null?o(r,t.value||"",n):r,i.setProperty(s,n,r)}else t.type&12}function Tk(t,e){let n=kr(e,t);n[ye]&16||(n[ye]|=64)}function F5(t,e,n){let r=n.directiveStart,i=n.directiveEnd;Do(n)&&a5(e,n,t.data[r+n.componentOffset]),t.firstCreatePass||r_(n,e);let o=n.initialInputs;for(let s=r;s<i;s++){let a=t.data[s],c=If(e,t,s,n);if(xu(c,e),o!==null&&G5(e,s-r,c,a,n,o),ei(a)){let l=kr(n.index,e);l[Nt]=If(e,t,s,n)}}}function U5(t,e,n){let r=n.directiveStart,i=n.directiveEnd,o=n.index,s=IP();try{Cs(o);for(let a=r;a<i;a++){let c=t.data[a],l=e[a];xE(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&V5(c,l)}}finally{Cs(-1),xE(s)}}function V5(t,e){t.hostBindings!==null&&t.hostBindings(1,e)}function WC(t,e){let n=t.directiveRegistry,r=null;if(n)for(let i=0;i<n.length;i++){let o=n[i];Zx(e,o.selectors,!1)&&(r??=[],ei(o)?r.unshift(o):r.push(o))}return r}function B5(t,e,n,r,i,o){let s=hr(t,e);yk(e[qe],s,o,t.value,n,r,i)}function yk(t,e,n,r,i,o,s){if(o==null)t.removeAttribute(e,i,n);else{let a=s==null?ur(o):s(o,r||"",i);t.setAttribute(e,i,a,n)}}function G5(t,e,n,r,i,o){let s=o[e];if(s!==null)for(let a=0;a<s.length;a+=2){let c=s[a],l=s[a+1];QA(r,n,c,l)}}function zC(t,e,n,r,i){let o=Ke+n,s=e[pe],a=i(s,e,t,r,n);e[o]=a,gc(t,!0);let c=t.type===2;return c?(Qx(e[qe],a,t),(fP()===0||Du(t))&&xu(a,e),pP()):xu(a,e),VE()&&(!c||!v_(t))&&HC(s,e,a,t),t}function qC(t){let e=t;return pA()?gA():(e=e.parent,gc(e,!1)),e}function j5(t,e){let n=t[Ao];if(!n)return;let r;try{r=n.get(xi,null)}catch{r=null}r?.(e)}function b_(t,e,n,r,i){let o=t.inputs?.[r],s=t.hostDirectiveInputs?.[r],a=!1;if(s)for(let c=0;c<s.length;c+=2){let l=s[c],d=s[c+1],h=e.data[l];QA(h,n[l],d,i),a=!0}if(o)for(let c of o){let l=n[c],d=e.data[c];QA(d,l,r,i),a=!0}return a}function H5(t,e){let n=kr(e,t),r=n[pe];$5(r,n);let i=n[Jr];i!==null&&n[ac]===null&&(n[ac]=Bx(i,n[Ao])),ot(18),KC(r,n,n[Nt]),ot(19,n[Nt])}function $5(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}function KC(t,e,n){FE(e);try{let r=t.viewQuery;r!==null&&jA(1,r,n);let i=t.template;i!==null&&mk(t,e,i,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),e[Mi]?.finishViewCreation(t),t.staticContentQueries&&Gx(t,e),t.staticViewQueries&&jA(2,t.viewQuery,n);let o=t.components;o!==null&&W5(e,o)}catch(r){throw t.firstCreatePass&&(t.incompleteFirstPass=!0,t.firstCreatePass=!1),r}finally{e[ye]&=-5,UE()}}function W5(t,e){for(let n=0;n<e.length;n++)H5(t,e[n])}function Nf(t,e,n,r){let i=Te(null);try{let o=e.tView,a=t[ye]&4096?4096:16,c=kC(t,o,n,a,null,e,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null),l=t[e.index];c[vs]=l;let d=t[Mi];return d!==null&&(c[Mi]=d.createEmbeddedView(o)),KC(o,c,n),c}finally{Te(i)}}function Fu(t,e){return!e||e.firstChild===null||Ox(t)}function vf(t,e,n,r,i=!1){for(;n!==null;){if(n.type===128){n=i?n.projectionNext:n.next;continue}let o=e[n.index];o!==null&&r.push(xr(o)),Zr(o)&&Ik(o,r);let s=n.type;if(s&8)vf(t,e,n.child,r);else if(s&32){let a=UC(n,e),c;for(;c=a();)r.push(c)}else if(s&16){let a=pk(e,n);if(Array.isArray(a))r.push(...a);else{let c=_s(e[wn]);vf(c[pe],c,a,r,!0)}}n=i?n.projectionNext:n.next}return r}function Ik(t,e){for(let n=wt;n<t.length;n++){let r=t[n],i=r[pe].firstChild;i!==null&&vf(r[pe],r,i,e)}t[Ss]!==t[Jr]&&e.push(t[Ss])}function vk(t){if(t[uc]!==null){for(let e of t[uc])e.impl.addSequence(e);t[uc].length=0}}var Sk=[];function z5(t){return t[dr]??q5(t)}function q5(t){let e=Sk.pop()??Object.create(Y5);return e.lView=t,e}function K5(t){t.lView[dr]!==t&&(t.lView=null,Sk.push(t))}var Y5=Ee(B({},Ja),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{As(t.lView)},consumerOnSignalRead(){this.lView[dr]=this}});function X5(t){let e=t[dr]??Object.create(Q5);return e.lView=t,e}var Q5=Ee(B({},Ja),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let e=_s(t.lView);for(;e&&!Ak(e[pe]);)e=_s(e);e&&ME(e)},consumerOnSignalRead(){this.lView[dr]=this}});function Ak(t){return t.type!==2}function Ck(t){if(t[Co]===null)return;let e=!0;for(;e;){let n=!1;for(let r of t[Co])r.dirty&&(n=!0,r.zone===null||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=n&&!!(t[ye]&8192)}}var J5=100;function Dk(t,e=0){let r=t[Oi].rendererFactory,i=!1;i||r.begin?.();try{Z5(t,e)}finally{i||r.end?.()}}function Z5(t,e){let n=EA();try{wu(!0),tC(t,e);let r=0;for(;Nu(t);){if(r===J5)throw new J(103,!1);r++,tC(t,1)}}finally{wu(n)}}function eq(t,e,n,r){if(fc(e))return;let i=e[ye],o=!1,s=!1;FE(e);let a=!0,c=null,l=null;o||(Ak(t)?(l=z5(e),c=Za(l)):sE()===null?(a=!1,l=X5(e),c=Za(l)):e[dr]&&(ec(e[dr]),e[dr]=null));try{oA(e),_P(t.bindingStartIndex),n!==null&&mk(t,e,n,2,r);let d=(i&3)===3;if(!o)if(d){let g=t.preOrderCheckHooks;g!==null&&KE(e,g,null)}else{let g=t.preOrderHooks;g!==null&&YE(e,g,0,null),DA(e,0)}if(s||tq(e),Ck(e),Rk(e,0),t.contentQueries!==null&&Gx(t,e),!o)if(d){let g=t.contentCheckHooks;g!==null&&KE(e,g)}else{let g=t.contentHooks;g!==null&&YE(e,g,1),DA(e,1)}rq(t,e);let h=t.components;h!==null&&wk(e,h,0);let f=t.viewQuery;if(f!==null&&jA(2,f,r),!o)if(d){let g=t.viewCheckHooks;g!==null&&KE(e,g)}else{let g=t.viewHooks;g!==null&&YE(e,g,2),DA(e,2)}if(t.firstUpdatePass===!0&&(t.firstUpdatePass=!1),e[bE]){for(let g of e[bE])g();e[bE]=null}o||(vk(e),e[ye]&=-73)}catch(d){throw o||As(e),d}finally{l!==null&&(mu(l,c),a&&K5(l)),UE()}}function Rk(t,e){for(let n=Lx(t);n!==null;n=Px(n))for(let r=wt;r<n.length;r++){let i=n[r];Nk(i,e)}}function tq(t){for(let e=Lx(t);e!==null;e=Px(e)){if(!(e[ye]&2))continue;let n=e[hc];for(let r=0;r<n.length;r++){let i=n[r];ME(i)}}}function nq(t,e,n){ot(18);let r=kr(e,t);Nk(r,n),ot(19,r[Nt])}function Nk(t,e){OE(t)&&tC(t,e)}function tC(t,e){let r=t[pe],i=t[ye],o=t[dr],s=!!(e===0&&i&16);if(s||=!!(i&64&&e===0),s||=!!(i&1024),s||=!!(o?.dirty&&Eu(o)),s||=!1,o&&(o.dirty=!1),t[ye]&=-9217,s)eq(r,t,r.template,t[Nt]);else if(i&8192){let a=Te(null);try{Ck(t),Rk(t,1);let c=r.components;c!==null&&wk(t,c,1),vk(t)}finally{Te(a)}}}function wk(t,e,n){for(let r=0;r<e.length;r++)nq(t,e[r],n)}function rq(t,e){let n=t.hostBindingOpCodes;if(n!==null)try{for(let r=0;r<n.length;r++){let i=n[r];if(i<0)Cs(~i);else{let o=i,s=n[++r],a=n[++r];yP(s,o);let c=e[o];ot(24,c),a(2,c),ot(25,c)}}}finally{Cs(-1)}}function YC(t,e){let n=EA()?64:1088;for(t[Oi].changeDetectionScheduler?.notify(e);t;){t[ye]|=n;let r=_s(t);if(Ru(t)&&!r)return t;t=r}return null}function bk(t,e,n,r){return[t,!0,0,e,null,r,null,n,null,null]}function Ok(t,e){let n=wt+e;if(n<t.length)return t[n]}function wf(t,e,n,r=!0){let i=e[pe];if(iq(i,e,t,n),r){let s=eC(n,t),a=e[qe],c=a.parentNode(t[Ss]);c!==null&&v5(i,t[Gn],a,e,c,s)}let o=e[ac];o!==null&&o.firstChild!==null&&(o.firstChild=null)}function Mk(t,e){let n=Sf(t,e);return n!==void 0&&R_(n[pe],n),n}function Sf(t,e){if(t.length<=wt)return;let n=wt+e,r=t[n];if(r){let i=r[vs];i!==null&&i!==t&&jC(i,r),e>0&&(t[n-1][Pr]=r[Pr]);let o=cf(t,wt+e);I5(r[pe],r);let s=o[Mi];s!==null&&s.detachView(o[pe]),r[Ht]=null,r[Pr]=null,r[ye]&=-129}return r}function iq(t,e,n,r){let i=wt+r,o=n.length;r>0&&(n[i-1][Pr]=e),r<o-wt?(e[Pr]=n[i],WS(n,wt+r,e)):(n.push(e),e[Pr]=null),e[Ht]=n;let s=e[vs];s!==null&&n!==s&&Lk(s,e);let a=e[Mi];a!==null&&a.insertView(t),LE(e),e[ye]|=128}function Lk(t,e){let n=t[hc],r=e[Ht];if(Li(r))t[ye]|=2;else{let i=r[Ht][wn];e[wn]!==i&&(t[ye]|=2)}n===null?t[hc]=[e]:n.push(e)}var Rs=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,n=e[pe];return vf(n,e,n.firstChild,[])}constructor(e,n){this._lView=e,this._cdRefInjectingView=n}get context(){return this._lView[Nt]}set context(e){this._lView[Nt]=e}get destroyed(){return fc(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[Ht];if(Zr(e)){let n=e[hf],r=n?n.indexOf(this):-1;r>-1&&(Sf(e,r),cf(n,r))}this._attachedToViewContainer=!1}R_(this._lView[pe],this._lView)}onDestroy(e){sA(this._lView,e)}markForCheck(){YC(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ye]&=-129}reattach(){LE(this._lView),this._lView[ye]|=128}detectChanges(){this._lView[ye]|=1024,Dk(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new J(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=Ru(this._lView),n=this._lView[vs];n!==null&&!e&&jC(n,this._lView),dk(this._lView[pe],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new J(902,!1);this._appRef=e;let n=Ru(this._lView),r=this._lView[vs];r!==null&&!n&&Lk(r,this._lView),LE(this._lView)}};function oq(t){return Nu(t._lView)||!!(t._lView[ye]&64)}function sq(t){ME(t._lView)}var Vi=(()=>{class t{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=aq;constructor(n,r,i){this._declarationLView=n,this._declarationTContainer=r,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,r){return this.createEmbeddedViewImpl(n,r)}createEmbeddedViewImpl(n,r,i){let o=Nf(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:r,dehydratedView:i});return new Rs(o)}}return t})();function aq(){return O_($t(),ne())}function O_(t,e){return t.type&4?new Vi(e,t,zu(t,e)):null}function Cc(t,e,n,r,i){let o=t.data[e];if(o===null)o=cq(t,e,n,r,i),TP()&&(o.flags|=32);else if(o.type&64){o.type=n,o.value=r,o.attrs=i;let s=EP();o.injectorIndex=s===null?-1:s.injectorIndex}return gc(o,!0),o}function cq(t,e,n,r,i){let o=fA(),s=pA(),a=s?o:o&&o.parent,c=t.data[e]=uq(t,a,n,e,r,i);return lq(t,c,o,s),c}function lq(t,e,n,r){t.firstChild===null&&(t.firstChild=e),n!==null&&(r?n.child==null&&e.parent!==null&&(n.child=e):n.next===null&&(n.next=e,e.prev=n))}function uq(t,e,n,r,i,o){let s=e?e.injectorIndex:-1,a=0;return uA()&&(a|=128),{type:n,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:i,namespace:IA(),attrs:o,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}var m_e=new RegExp(`^(\\d+)*(${i8}|${r8})*(.*)`);function dq(t){let e=t[tA]??[],r=t[Ht][qe],i=[];for(let o of e)o.data[Fx]!==void 0?i.push(o):hq(o,r);t[tA]=i}function hq(t,e){let n=0,r=t.firstChild;if(r){let i=t.data[kx];for(;n<i;){let o=r.nextSibling;Xx(e,r,!1),r=o,n++}}}var fq=()=>null,pq=()=>null;function c_(t,e){return fq(t,e)}function Pk(t,e,n){return pq(t,e,n)}var xk=class{},M_=class{},nC=class{resolveComponentFactory(e){throw new J(917,!1)}},bf=class{static NULL=new nC},bo=class{},L_=(()=>{class t{destroyNode=null;static __NG_ELEMENT_ID__=()=>gq()}return t})();function gq(){let t=ne(),e=$t(),n=kr(e.index,t);return(Li(n)?n:t)[qe]}var kk=(()=>{class t{static \u0275prov=Q({token:t,providedIn:"root",factory:()=>null})}return t})();var QE={},rC=class{injector;parentInjector;constructor(e,n){this.injector=e,this.parentInjector=n}get(e,n,r){let i=this.injector.get(e,QE,r);return i!==QE||n===QE?i:this.parentInjector.get(e,n,r)}};function l_(t,e,n){let r=n?t.styles:null,i=n?t.classes:null,o=0;if(e!==null)for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")o=a;else if(o==1)i=vE(i,a);else if(o==2){let c=a,l=e[++s];r=vE(r,c+": "+l+";")}}n?t.styles=r:t.stylesWithoutHost=r,n?t.classes=i:t.classesWithoutHost=i}function st(t,e=0){let n=ne();if(n===null)return $(t,e);let r=$t();return Rx(r,n,jt(t),e)}function mq(){let t="invalid";throw new Error(t)}function Fk(t,e,n,r,i){let o=r===null?null:{"":-1},s=i(t,n);if(s!==null){let a=s,c=null,l=null;for(let d of s)if(d.resolveHostDirectives!==null){[a,c,l]=d.resolveHostDirectives(s);break}Tq(t,e,n,a,o,c,l)}o!==null&&r!==null&&Eq(n,r,o)}function Eq(t,e,n){let r=t.localNames=[];for(let i=0;i<e.length;i+=2){let o=n[e[i+1]];if(o==null)throw new J(-301,!1);r.push(e[i],o)}}function _q(t,e,n){e.componentOffset=n,(t.components??=[]).push(e.index)}function Tq(t,e,n,r,i,o,s){let a=r.length,c=!1;for(let f=0;f<a;f++){let g=r[f];!c&&ei(g)&&(c=!0,_q(t,n,f)),UA(r_(n,e),t,g.type)}Cq(n,t.data.length,a);for(let f=0;f<a;f++){let g=r[f];g.providersResolver&&g.providersResolver(g)}let l=!1,d=!1,h=tk(t,e,a,null);a>0&&(n.directiveToIndex=new Map);for(let f=0;f<a;f++){let g=r[f];if(n.mergedAttrs=Pu(n.mergedAttrs,g.hostAttrs),Iq(t,n,e,h,g),Aq(h,g,i),s!==null&&s.has(g)){let[I,S]=s.get(g);n.directiveToIndex.set(g.type,[h,I+n.directiveStart,S+n.directiveStart])}else(o===null||!o.has(g))&&n.directiveToIndex.set(g.type,h);g.contentQueries!==null&&(n.flags|=4),(g.hostBindings!==null||g.hostAttrs!==null||g.hostVars!==0)&&(n.flags|=64);let E=g.type.prototype;!l&&(E.ngOnChanges||E.ngOnInit||E.ngDoCheck)&&((t.preOrderHooks??=[]).push(n.index),l=!0),!d&&(E.ngOnChanges||E.ngDoCheck)&&((t.preOrderCheckHooks??=[]).push(n.index),d=!0),h++}yq(t,n,o)}function yq(t,e,n){for(let r=e.directiveStart;r<e.directiveEnd;r++){let i=t.data[r];if(n===null||!n.has(i))QP(0,e,i,r),QP(1,e,i,r),ZP(e,r,!1);else{let o=n.get(i);JP(0,e,o,r),JP(1,e,o,r),ZP(e,r,!0)}}}function QP(t,e,n,r){let i=t===0?n.inputs:n.outputs;for(let o in i)if(i.hasOwnProperty(o)){let s;t===0?s=e.inputs??={}:s=e.outputs??={},s[o]??=[],s[o].push(r),Uk(e,o)}}function JP(t,e,n,r){let i=t===0?n.inputs:n.outputs;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o],a;t===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(r,o),Uk(e,s)}}function Uk(t,e){e==="class"?t.flags|=8:e==="style"&&(t.flags|=16)}function ZP(t,e,n){let{attrs:r,inputs:i,hostDirectiveInputs:o}=t;if(r===null||!n&&i===null||n&&o===null||PC(t)){t.initialInputs??=[],t.initialInputs.push(null);return}let s=null,a=0;for(;a<r.length;){let c=r[a];if(c===0){a+=4;continue}else if(c===5){a+=2;continue}else if(typeof c=="number")break;if(!n&&i.hasOwnProperty(c)){let l=i[c];for(let d of l)if(d===e){s??=[],s.push(c,r[a+1]);break}}else if(n&&o.hasOwnProperty(c)){let l=o[c];for(let d=0;d<l.length;d+=2)if(l[d]===e){s??=[],s.push(l[d+1],r[a+1]);break}}a+=2}t.initialInputs??=[],t.initialInputs.push(s)}function Iq(t,e,n,r,i){t.data[r]=i;let o=i.factory||(i.factory=Es(i.type,!0)),s=new yc(o,ei(i),st,null);t.blueprint[r]=s,n[r]=s,vq(t,e,r,tk(t,n,i.hostVars,sn),i)}function vq(t,e,n,r,i){let o=i.hostBindings;if(o){let s=t.hostBindingOpCodes;s===null&&(s=t.hostBindingOpCodes=[]);let a=~e.index;Sq(s)!=a&&s.push(a),s.push(n,r,o)}}function Sq(t){let e=t.length;for(;e>0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function Aq(t,e,n){if(n){if(e.exportAs)for(let r=0;r<e.exportAs.length;r++)n[e.exportAs[r]]=t;ei(e)&&(n[""]=t)}}function Cq(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function XC(t,e,n,r,i,o,s,a){let c=e[pe],l=c.consts,d=fr(l,s),h=Cc(c,t,n,r,d);return o&&Fk(c,e,h,fr(l,a),i),h.mergedAttrs=Pu(h.mergedAttrs,h.attrs),h.attrs!==null&&l_(h,h.attrs,!1),h.mergedAttrs!==null&&l_(h,h.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,h),h}function QC(t,e){Tx(t,e),nA(e)&&t.queries.elementEnd(e)}function Dq(t,e,n,r,i,o){let s=e.consts,a=fr(s,i),c=Cc(e,t,n,r,a);if(c.mergedAttrs=Pu(c.mergedAttrs,c.attrs),o!=null){let l=fr(s,o);c.localNames=[];for(let d=0;d<l.length;d+=2)c.localNames.push(l[d],-1)}return c.attrs!==null&&l_(c,c.attrs,!1),c.mergedAttrs!==null&&l_(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}function JC(t){return P_(t)?Array.isArray(t)||!(t instanceof Map)&&Symbol.iterator in t:!1}function Vk(t,e){if(Array.isArray(t))for(let n=0;n<t.length;n++)e(t[n]);else{let n=t[Symbol.iterator](),r;for(;!(r=n.next()).done;)e(r.value)}}function P_(t){return t!==null&&(typeof t=="function"||typeof t=="object")}function Gi(t,e,n){return t[e]=n}function Of(t,e){return t[e]}function _n(t,e,n){if(n===sn)return!1;let r=t[e];return Object.is(r,n)?!1:(t[e]=n,!0)}function Uu(t,e,n,r){let i=_n(t,e,n);return _n(t,e+1,r)||i}function ZC(t,e,n,r,i){let o=Uu(t,e,n,r);return _n(t,e+2,i)||o}function Vu(t,e,n,r,i,o){let s=Uu(t,e,n,r);return Uu(t,e+2,i,o)||s}function JE(t,e,n){return function r(i){let o=Do(t)?kr(t.index,e):e;YC(o,5);let s=e[Nt],a=ex(e,s,n,i),c=r.__ngNextListenerFn__;for(;c;)a=ex(e,s,c,i)&&a,c=c.__ngNextListenerFn__;return a}}function ex(t,e,n,r){let i=Te(null);try{return ot(6,e,n),n(r)!==!1}catch(o){return j5(t,o),!1}finally{ot(7,e,n),Te(i)}}function Bk(t,e,n,r,i,o,s,a){let c=Du(t),l=!1,d=null;if(!r&&c&&(d=Nq(e,n,o,t.index)),d!==null){let h=d.__ngLastListenerFn__||d;h.__ngNextListenerFn__=s,d.__ngLastListenerFn__=s,l=!0}else{let h=hr(t,n),f=r?r(h):h;s8(n,f,o,a);let g=i.listen(f,o,a);if(!Rq(o)){let E=r?I=>r(xr(I[t.index])):t.index;Gk(E,e,n,o,a,g,!1)}}return l}function Rq(t){return t.startsWith("animation")||t.startsWith("transition")}function Nq(t,e,n,r){let i=t.cleanup;if(i!=null)for(let o=0;o<i.length-1;o+=2){let s=i[o];if(s===n&&i[o+1]===r){let a=e[Au],c=i[o+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(o+=2)}return null}function Gk(t,e,n,r,i,o,s){let a=e.firstCreatePass?cA(e):null,c=aA(n),l=c.length;c.push(i,o),a&&a.push(r,t,l,(l+1)*(s?-1:1))}function tx(t,e,n,r,i,o){let s=e[n],a=e[pe],l=a.data[n].outputs[r],h=s[l].subscribe(o);Gk(t.index,a,e,i,o,h,!0)}var iC=Symbol("BINDING");var u_=class extends bf{ngModule;constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){let n=Is(e);return new Bu(n,this.ngModule)}};function wq(t){return Object.keys(t).map(e=>{let[n,r,i]=t[e],o={propName:n,templateName:e,isSignal:(r&C_.SignalBased)!==0};return i&&(o.transform=i),o})}function bq(t){return Object.keys(t).map(e=>({propName:t[e],templateName:e}))}function Oq(t,e,n){let r=e instanceof Nn?e:e?.injector;return r&&t.getStandaloneInjector!==null&&(r=t.getStandaloneInjector(r)||r),r?new rC(n,r):n}function Mq(t){let e=t.get(bo,null);if(e===null)throw new J(407,!1);let n=t.get(kk,null),r=t.get(Lr,null);return{rendererFactory:e,sanitizer:n,changeDetectionScheduler:r,ngReflect:!1}}function Lq(t,e){let n=jk(t);return Kx(e,n,n==="svg"?sf:n==="math"?rA:null)}function Pq(t){if(t?.toLowerCase()==="script")throw new J(905,!1)}function jk(t){return(t.selectors[0][0]||"div").toLowerCase()}var Bu=class extends M_{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=wq(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=bq(this.componentDef.outputs),this.cachedOutputs}constructor(e,n){super(),this.componentDef=e,this.ngModule=n,this.componentType=e.type,this.selector=r5(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!n}create(e,n,r,i,o,s){ot(22);let a=Te(null);try{let c=this.componentDef,l=xq(r,c,s,o),d=Oq(c,i||this.ngModule,e),h=Mq(d),f=h.rendererFactory.createRenderer(null,c),g=r?L5(f,r,c.encapsulation,d):Lq(c,f);Pq(g?.tagName);let E=s?.some(nx)||o?.some(L=>typeof L!="function"&&L.bindings.some(nx)),I=kC(null,l,null,512|ek(c),null,null,h,f,d,null,Bx(g,d,!0));I[Ke]=g,FE(I);let S=null;try{let L=XC(Ke,I,2,"#host",()=>l.directiveRegistry,!0,0);Qx(f,g,L),xu(g,I),w_(l,I,L),RC(l,L,I),QC(l,L),n!==void 0&&Fq(L,this.ngContentSelectors,n),S=kr(L.index,I),I[Nt]=S[Nt],KC(l,I,null)}catch(L){throw S!==null&&BA(S),BA(I),L}finally{ot(23),UE()}return new d_(this.componentType,I,!!E)}finally{Te(a)}}};function xq(t,e,n,r){let i=t?["ng-version","20.3.31"]:i5(e.selectors[0]),o=null,s=null,a=0;if(n)for(let d of n)a+=d[iC].requiredVars,d.create&&(d.targetIdx=0,(o??=[]).push(d)),d.update&&(d.targetIdx=0,(s??=[]).push(d));if(r)for(let d=0;d<r.length;d++){let h=r[d];if(typeof h!="function")for(let f of h.bindings){a+=f[iC].requiredVars;let g=d+1;f.create&&(f.targetIdx=g,(o??=[]).push(f)),f.update&&(f.targetIdx=g,(s??=[]).push(f))}}let c=[e];if(r)for(let d of r){let h=typeof d=="function"?d:d.type,f=wE(h);c.push(f)}return xC(0,null,kq(o,s),1,a,c,null,null,null,[i],null)}function kq(t,e){return!t&&!e?null:n=>{if(n&1&&t)for(let r of t)r.create();if(n&2&&e)for(let r of e)r.update()}}function nx(t){let e=t[iC].kind;return e==="input"||e==="twoWay"}var d_=class extends xk{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,n,r){super(),this._rootLView=n,this._hasInputBindings=r,this._tNode=ff(n[pe],Ke),this.location=zu(this._tNode,n),this.instance=kr(this._tNode.index,n)[Nt],this.hostView=this.changeDetectorRef=new Rs(n,void 0),this.componentType=e}setInput(e,n){this._hasInputBindings;let r=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),n))return;let i=this._rootLView,o=b_(r,i[pe],i,e,n);this.previousInputValues.set(e,n);let s=kr(r.index,i);YC(s,1)}get injector(){return new Tc(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function Fq(t,e,n){let r=t.projection=[];for(let i=0;i<e.length;i++){let o=n[i];r.push(o!=null&&o.length?Array.from(o):null)}}var ji=(()=>{class t{static __NG_ELEMENT_ID__=Uq}return t})();function Uq(){let t=$t();return $k(t,ne())}var Vq=ji,Hk=class extends Vq{_lContainer;_hostTNode;_hostLView;constructor(e,n,r){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=r}get element(){return zu(this._hostTNode,this._hostLView)}get injector(){return new Tc(this._hostTNode,this._hostLView)}get parentInjector(){let e=SC(this._hostTNode,this._hostLView);if(Ix(e)){let n=t_(e,this._hostLView),r=e_(e),i=n[pe].data[r+8];return new Tc(i,n)}else return new Tc(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=rx(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-wt}createEmbeddedView(e,n,r){let i,o;typeof r=="number"?i=r:r!=null&&(i=r.index,o=r.injector);let s=c_(this._lContainer,e.ssrId),a=e.createEmbeddedViewImpl(n||{},o,s);return this.insertImpl(a,i,Fu(this._hostTNode,s)),a}createComponent(e,n,r,i,o,s,a){let c=e&&!bz(e),l;if(c)l=n;else{let S=n||{};l=S.index,r=S.injector,i=S.projectableNodes,o=S.environmentInjector||S.ngModuleRef,s=S.directives,a=S.bindings}let d=c?e:new Bu(Is(e)),h=r||this.parentInjector;if(!o&&d.ngModule==null){let L=(c?h:this.parentInjector).get(Nn,null);L&&(o=L)}let f=Is(d.componentType??{}),g=c_(this._lContainer,f?.id??null),E=g?.firstChild??null,I=d.create(h,i,E,o,s,a);return this.insertImpl(I.hostView,l,Fu(this._hostTNode,g)),I}insert(e,n){return this.insertImpl(e,n,!0)}insertImpl(e,n,r){let i=e._lView;if(lP(i)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=i[Ht],l=new Hk(c,c[Gn],c[Ht]);l.detach(l.indexOf(e))}}let o=this._adjustIndex(n),s=this._lContainer;return wf(s,i,o,r),e.attachToViewContainerRef(),WS(wA(s),o,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=rx(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),r=Sf(this._lContainer,n);r&&(cf(wA(this._lContainer),n),R_(r[pe],r))}detach(e){let n=this._adjustIndex(e,-1),r=Sf(this._lContainer,n);return r&&cf(wA(this._lContainer),n)!=null?new Rs(r):null}_adjustIndex(e,n=0){return e??this.length+n}};function rx(t){return t[hf]}function wA(t){return t[hf]||(t[hf]=[])}function $k(t,e){let n,r=e[t.index];return Zr(r)?n=r:(n=bk(r,e,null,t),e[t.index]=n,FC(e,n)),Gq(n,e,t,r),new Hk(n,t,e)}function Bq(t,e){let n=t[qe],r=n.createComment(""),i=hr(e,t),o=n.parentNode(i);return o_(n,o,r,n.nextSibling(i),!1),r}var Gq=$q,jq=()=>!1;function Hq(t,e,n){return jq(t,e,n)}function $q(t,e,n,r){if(t[Ss])return;let i;n.type&8?i=xr(r):i=Bq(e,n),t[Ss]=i}var oC=class t{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},sC=class t{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let n=e.queries;if(n!==null){let r=e.contentQueries!==null?e.contentQueries[0]:n.length,i=[];for(let o=0;o<r;o++){let s=n.getByIndex(o),a=this.queries[s.indexInDeclarationView];i.push(a.clone())}return new t(i)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}finishViewCreation(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let n=0;n<this.queries.length;n++)tD(e,n).matches!==null&&this.queries[n].setDirty()}},h_=class{flags;read;predicate;constructor(e,n,r=null){this.flags=n,this.read=r,typeof e=="string"?this.predicate=Xq(e):this.predicate=e}},aC=class t{queries;constructor(e=[]){this.queries=e}elementStart(e,n){for(let r=0;r<this.queries.length;r++)this.queries[r].elementStart(e,n)}elementEnd(e){for(let n=0;n<this.queries.length;n++)this.queries[n].elementEnd(e)}embeddedTView(e){let n=null;for(let r=0;r<this.length;r++){let i=n!==null?n.length:0,o=this.getByIndex(r).embeddedTView(e,i);o&&(o.indexInDeclarationView=r,n!==null?n.push(o):n=[o])}return n!==null?new t(n):null}template(e,n){for(let r=0;r<this.queries.length;r++)this.queries[r].template(e,n)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},cC=class t{metadata;matches=null;indexInDeclarationView=-1;crossesNgTemplate=!1;_declarationNodeIndex;_appliesToNextNode=!0;constructor(e,n=-1){this.metadata=e,this._declarationNodeIndex=n}elementStart(e,n){this.isApplyingToNode(n)&&this.matchTNode(e,n)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,n){this.elementStart(e,n)}embeddedTView(e,n){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,n),new t(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){let n=this._declarationNodeIndex,r=e.parent;for(;r!==null&&r.type&8&&r.index!==n;)r=r.parent;return n===(r!==null?r.index:-1)}return this._appliesToNextNode}matchTNode(e,n){let r=this.metadata.predicate;if(Array.isArray(r))for(let i=0;i<r.length;i++){let o=r[i];this.matchTNodeWithReadOption(e,n,Wq(n,o)),this.matchTNodeWithReadOption(e,n,XE(n,e,o,!1,!1))}else r===Vi?n.type&4&&this.matchTNodeWithReadOption(e,n,-1):this.matchTNodeWithReadOption(e,n,XE(n,e,r,!1,!1))}matchTNodeWithReadOption(e,n,r){if(r!==null){let i=this.metadata.read;if(i!==null)if(i===Ns||i===ji||i===Vi&&n.type&4)this.addMatch(n.index,-2);else{let o=XE(n,e,i,!1,!1);o!==null&&this.addMatch(n.index,o)}else this.addMatch(n.index,r)}}addMatch(e,n){this.matches===null?this.matches=[e,n]:this.matches.push(e,n)}};function Wq(t,e){let n=t.localNames;if(n!==null){for(let r=0;r<n.length;r+=2)if(n[r]===e)return n[r+1]}return null}function zq(t,e){return t.type&11?zu(t,e):t.type&4?O_(t,e):null}function qq(t,e,n,r){return n===-1?zq(e,t):n===-2?Kq(t,e,r):If(t,t[pe],n,e)}function Kq(t,e,n){if(n===Ns)return zu(e,t);if(n===Vi)return O_(e,t);if(n===ji)return $k(e,t)}function Wk(t,e,n,r){let i=e[Mi].queries[r];if(i.matches===null){let o=t.data,s=n.matches,a=[];for(let c=0;s!==null&&c<s.length;c+=2){let l=s[c];if(l<0)a.push(null);else{let d=o[l];a.push(qq(e,d,s[c+1],n.metadata.read))}}i.matches=a}return i.matches}function lC(t,e,n,r){let i=t.queries.getByIndex(n),o=i.matches;if(o!==null){let s=Wk(t,e,i,n);for(let a=0;a<o.length;a+=2){let c=o[a];if(c>0)r.push(s[a/2]);else{let l=o[a+1],d=e[-c];for(let h=wt;h<d.length;h++){let f=d[h];f[vs]===f[Ht]&&lC(f[pe],f,l,r)}if(d[hc]!==null){let h=d[hc];for(let f=0;f<h.length;f++){let g=h[f];lC(g[pe],g,l,r)}}}}}return r}function eD(t,e){return t[Mi].queries[e].queryList}function zk(t,e,n){let r=new i_((n&4)===4);return hP(t,e,r,r.destroy),(e[Mi]??=new sC).queries.push(new oC(r))-1}function qk(t,e,n){let r=Ye();return r.firstCreatePass&&(Kk(r,new h_(t,e,n),-1),(e&2)===2&&(r.staticViewQueries=!0)),zk(r,ne(),e)}function Yq(t,e,n,r){let i=Ye();if(i.firstCreatePass){let o=$t();Kk(i,new h_(e,n,r),o.index),Qq(i,t),(n&2)===2&&(i.staticContentQueries=!0)}return zk(i,ne(),n)}function Xq(t){return t.split(",").map(e=>e.trim())}function Kk(t,e,n){t.queries===null&&(t.queries=new aC),t.queries.track(new cC(e,n))}function Qq(t,e){let n=t.contentQueries||(t.contentQueries=[]),r=n.length?n[n.length-1]:-1;e!==r&&n.push(t.queries.length-1,e)}function tD(t,e){return t.queries.getByIndex(e)}function Yk(t,e){let n=t[pe],r=tD(n,e);return r.crossesNgTemplate?lC(n,t,e,[]):Wk(n,t,r,e)}function Xk(t,e,n){let r,i=Zh(()=>{r._dirtyCounter();let o=Zq(r,t);if(e&&o===void 0)throw new J(-951,!1);return o});return r=i[rn],r._dirtyCounter=Ec(0),r._flatValue=void 0,i}function Qk(t){return Xk(!0,!1,t)}function Jk(t){return Xk(!0,!0,t)}function Jq(t,e){let n=t[rn];n._lView=ne(),n._queryIndex=e,n._queryList=eD(n._lView,e),n._queryList.onDirty(()=>n._dirtyCounter.update(r=>r+1))}function Zq(t,e){let n=t._lView,r=t._queryIndex;if(n===void 0||r===void 0||n[ye]&4)return e?void 0:Rn;let i=eD(n,r),o=Yk(n,r);return i.reset(o,bx),e?i.first:i._changesDetected||t._flatValue===void 0?t._flatValue=i.toArray():t._flatValue}function Zk(t){let e=[],n=new Map;function r(i){let o=n.get(i);if(!o){let s=t(i);n.set(i,o=s.then(a=>t9(i,a)))}return o}return f_.forEach((i,o)=>{let s=[];i.templateUrl&&s.push(r(i.templateUrl).then(l=>{i.template=l}));let a=typeof i.styles=="string"?[i.styles]:i.styles||[];if(i.styles=a,i.styleUrl&&i.styleUrls?.length)throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple");if(i.styleUrls?.length){let l=i.styles.length,d=i.styleUrls;i.styleUrls.forEach((h,f)=>{a.push(""),s.push(r(h).then(g=>{a[l+f]=g,d.splice(d.indexOf(h),1),d.length==0&&(i.styleUrls=void 0)}))})}else i.styleUrl&&s.push(r(i.styleUrl).then(l=>{a.push(l),i.styleUrl=void 0}));let c=Promise.all(s).then(()=>n9(o));e.push(c)}),e1(),Promise.all(e).then(()=>{})}var f_=new Map,e9=new Set;function e1(){let t=f_;return f_=new Map,t}function t1(){return f_.size===0}function t9(t,e){return typeof e=="string"?e:e.status!==void 0&&e.status!==200?Promise.reject(new J(918,!1)):e.text()}function n9(t){e9.delete(t)}var vc=class{},n1=class{};function r1(t,e){return new Gu(t,e??null,[])}var Gu=class extends vc{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new u_(this);constructor(e,n,r,i=!0){super(),this.ngModuleType=e,this._parent=n;let o=eP(e);this._bootstrapComponents=z8(o.bootstrap),this._r3Injector=vA(e,n,[{provide:vc,useValue:this},{provide:bf,useValue:this.componentFactoryResolver},...r],vo(e),new Set(["environment"])),i&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){let e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}},p_=class extends n1{moduleType;constructor(e){super(),this.moduleType=e}create(e){return new Gu(this.moduleType,e,[])}};function i1(t,e,n){return new Gu(t,e,n,!1)}var g_=class extends vc{injector;componentFactoryResolver=new u_(this);instance=null;constructor(e){super();let n=new oc([...e.providers,{provide:vc,useValue:this},{provide:bf,useValue:this.componentFactoryResolver}],e.parent||Su(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function o1(t,e,n=null){return new g_({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var r9=(()=>{class t{_injector;cachedInjectors=new Map;constructor(n){this._injector=n}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){let r=YS(!1,n.type),i=r.length>0?o1([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n,i)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(let n of this.cachedInjectors.values())n!==null&&n.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=Q({token:t,providedIn:"environment",factory:()=>new t($(Nn))})}return t})();function i9(t){return Wu(()=>{let e=a1(t),n=Ee(B({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection===AC.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:e.standalone?i=>i.get(r9).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||No.Emulated,styles:t.styles||Rn,_:null,schemas:t.schemas||null,tView:null,id:""});e.standalone&&Lo("NgStandalone"),c1(n);let r=t.dependencies;return n.directiveDefs=m_(r,s1),n.pipeDefs=m_(r,KS),n.id=a9(n),n})}function s1(t){return Is(t)||wE(t)}function ws(t){return Wu(()=>({type:t.type,bootstrap:t.bootstrap||Rn,declarations:t.declarations||Rn,imports:t.imports||Rn,exports:t.exports||Rn,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null}))}function o9(t,e){if(t==null)return Qr;let n={};for(let r in t)if(t.hasOwnProperty(r)){let i=t[r],o,s,a,c;Array.isArray(i)?(a=i[0],o=i[1],s=i[2]??o,c=i[3]||null):(o=i,s=i,a=C_.None,c=null),n[o]=[r,a,c],e[o]=s}return n}function s9(t){if(t==null)return Qr;let e={};for(let n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function Hi(t){return Wu(()=>{let e=a1(t);return c1(e),e})}function Mf(t){return{type:t.type,name:t.name,factory:null,pure:t.pure!==!1,standalone:t.standalone??!0,onDestroy:t.type.prototype.ngOnDestroy||null}}function a1(t){let e={};return{type:t.type,providersResolver:null,factory:null,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputConfig:t.inputs||Qr,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:t.signals===!0,selectors:t.selectors||Rn,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,inputs:o9(t.inputs,e),outputs:s9(t.outputs),debugInfo:null}}function c1(t){t.features?.forEach(e=>e(t))}function m_(t,e){return t?()=>{let n=typeof t=="function"?t():t,r=[];for(let i of n){let o=e(i);o!==null&&r.push(o)}return r}:null}function a9(t){let e=0,n=typeof t.consts=="function"?"":t.consts,r=[t.selectors,t.ngContentSelectors,t.hostVars,t.hostAttrs,n,t.vars,t.decls,t.encapsulation,t.standalone,t.signals,t.exportAs,JSON.stringify(t.inputs),JSON.stringify(t.outputs),Object.getOwnPropertyNames(t.type.prototype),!!t.contentQueries,!!t.viewQuery];for(let o of r.join("|"))e=Math.imul(31,e)+o.charCodeAt(0)<<0;return e+=2147483648,"c"+e}function c9(t){return Object.getPrototypeOf(t.prototype).constructor}function l1(t){let e=c9(t.type),n=!0,r=[t];for(;e;){let i;if(ei(t))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new J(903,!1);i=e.\u0275dir}if(i){if(n){r.push(i);let s=t;s.inputs=bA(t.inputs),s.declaredInputs=bA(t.declaredInputs),s.outputs=bA(t.outputs);let a=i.hostBindings;a&&f9(t,a);let c=i.viewQuery,l=i.contentQueries;if(c&&d9(t,c),l&&h9(t,l),l9(t,i),WL(t.outputs,i.outputs),ei(i)&&i.data.animation){let d=t.data;d.animation=(d.animation||[]).concat(i.data.animation)}}let o=i.features;if(o)for(let s=0;s<o.length;s++){let a=o[s];a&&a.ngInherit&&a(t),a===l1&&(n=!1)}}e=Object.getPrototypeOf(e)}u9(r)}function l9(t,e){for(let n in e.inputs){if(!e.inputs.hasOwnProperty(n)||t.inputs.hasOwnProperty(n))continue;let r=e.inputs[n];r!==void 0&&(t.inputs[n]=r,t.declaredInputs[n]=e.declaredInputs[n])}}function u9(t){let e=0,n=null;for(let r=t.length-1;r>=0;r--){let i=t[r];i.hostVars=e+=i.hostVars,i.hostAttrs=Pu(i.hostAttrs,n=Pu(n,i.hostAttrs))}}function bA(t){return t===Qr?{}:t===Rn?[]:t}function d9(t,e){let n=t.viewQuery;n?t.viewQuery=(r,i)=>{e(r,i),n(r,i)}:t.viewQuery=e}function h9(t,e){let n=t.contentQueries;n?t.contentQueries=(r,i,o)=>{e(r,i,o),n(r,i,o)}:t.contentQueries=e}function f9(t,e){let n=t.hostBindings;n?t.hostBindings=(r,i)=>{e(r,i),n(r,i)}:t.hostBindings=e}function p9(t){let e=n=>{let r=Array.isArray(t);n.hostDirectives===null?(n.resolveHostDirectives=g9,n.hostDirectives=r?t.map(uC):[t]):r?n.hostDirectives.unshift(...t.map(uC)):n.hostDirectives.unshift(t)};return e.ngInherit=!0,e}function g9(t){let e=[],n=!1,r=null,i=null;for(let o=0;o<t.length;o++){let s=t[o];if(s.hostDirectives!==null){let a=e.length;r??=new Map,i??=new Map,u1(s,e,r),i.set(s,[a,e.length-1])}o===0&&ei(s)&&(n=!0,e.push(s))}for(let o=n?1:0;o<t.length;o++)e.push(t[o]);return[e,r,i]}function u1(t,e,n){if(t.hostDirectives!==null)for(let r of t.hostDirectives)if(typeof r=="function"){let i=r();for(let o of i)ix(uC(o),e,n)}else ix(r,e,n)}function ix(t,e,n){let r=wE(t.directive);m9(r.declaredInputs,t.inputs),u1(r,e,n),n.set(r,t),e.push(r)}function uC(t){return typeof t=="function"?{directive:jt(t),inputs:Qr,outputs:Qr}:{directive:jt(t.directive),inputs:ox(t.inputs),outputs:ox(t.outputs)}}function ox(t){if(t===void 0||t.length===0)return Qr;let e={};for(let n=0;n<t.length;n+=2)e[t[n]]=t[n+1];return e}function m9(t,e){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n],i=t[n];t[r]=i}}function d1(t,e,n,r,i,o,s,a){if(n.firstCreatePass){t.mergedAttrs=Pu(t.mergedAttrs,t.attrs);let d=t.tView=xC(2,t,i,o,s,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,t),d.queries=n.queries.embeddedTView(t))}a&&(t.flags|=a),gc(t,!1);let c=_9(n,e,t,r);VE()&&HC(n,e,c,t),xu(c,e);let l=bk(c,e,c,t);e[r+Ke]=l,FC(e,l),Hq(l,t,e)}function E9(t,e,n,r,i,o,s,a,c,l,d){let h=n+Ke,f;return e.firstCreatePass?(f=Cc(e,h,4,s||null,a||null),PE()&&Fk(e,t,f,fr(e.consts,l),WC),Tx(e,f)):f=e.data[h],d1(f,t,e,n,r,i,o,c),Du(f)&&w_(e,t,f),l!=null&&Rf(t,f,d),f}function ju(t,e,n,r,i,o,s,a,c,l,d){let h=n+Ke,f;if(e.firstCreatePass){if(f=Cc(e,h,4,s||null,a||null),l!=null){let g=fr(e.consts,l);f.localNames=[];for(let E=0;E<g.length;E+=2)f.localNames.push(g[E],-1)}}else f=e.data[h];return d1(f,t,e,n,r,i,o,c),l!=null&&Rf(t,f,d),f}function h1(t,e,n,r,i,o,s,a){let c=ne(),l=Ye(),d=fr(l.consts,o);return E9(c,l,t,e,n,r,i,d,void 0,s,a),h1}function f1(t,e,n,r,i,o,s,a){let c=ne(),l=Ye(),d=fr(l.consts,o);return ju(c,l,t,e,n,r,i,d,void 0,s,a),f1}var _9=T9;function T9(t,e,n,r){return Ef(!0),e[qe].createComment("")}var x_=new z(""),Ku=new z(""),Lf=(()=>{class t{_ngZone;registry;_isZoneStable=!0;_callbacks=[];_taskTrackingZone=null;_destroyRef;constructor(n,r,i){this._ngZone=n,this.registry=r,JS()&&(this._destroyRef=Y(Hn,{optional:!0})??void 0),nD||(p1(i),i.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this._taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){let n=this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),r=this._ngZone.runOutsideAngular(()=>this._ngZone.onStable.subscribe({next:()=>{Ae.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}}));this._destroyRef?.onDestroy(()=>{n.unsubscribe(),r.unsubscribe()})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;this._callbacks.length!==0;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb()}});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>r.updateCb&&r.updateCb(n)?(clearTimeout(r.timeoutId),!1):!0)}}getPendingTasks(){return this._taskTrackingZone?this._taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,i){let o=-1;r&&r>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(s=>s.timeoutId!==o),n()},r)),this._callbacks.push({doneCb:n,timeoutId:o,updateCb:i})}whenStable(n,r,i){if(i&&!this._taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,i),this._runCallbacksIfReady()}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,i){return[]}static \u0275fac=function(r){return new(r||t)($(Ae),$(Pf),$(Ku))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),Pf=(()=>{class t{_applications=new Map;registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return nD?.findTestabilityInTree(this,n,r)??null}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})();function p1(t){nD=t}var nD;function k_(t){return!!t&&typeof t.then=="function"}function rD(t){return!!t&&typeof t.subscribe=="function"}var g1=new z("");var iD=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,r)=>{this.resolve=n,this.reject=r});appInits=Y(g1,{optional:!0})??[];injector=Y(ze);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let i of this.appInits){let o=bi(this.injector,i);if(k_(o))n.push(o);else if(rD(o)){let s=new Promise((a,c)=>{o.subscribe({complete:a,error:c})});n.push(s)}}let r=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{r()}).catch(i=>{this.reject(i)}),n.length===0&&r(),this.initialized=!0}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),m1=new z("");function E1(){_S(()=>{let t="";throw new J(600,t)})}function _1(t){return t.isBoundToModule}var y9=10;function oD(t,e){return Array.isArray(e)?e.reduce(oD,t):B(B({},t),e)}var bs=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=Y(xi);afterRenderManager=Y(GC);zonelessEnabled=Y(Ou);rootEffectScheduler=Y(_f);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Rt;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=Y(Ds);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(De(n=>!n))}constructor(){Y(Ac,{optional:!0})}whenStable(){let n;return new Promise(r=>{n=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{n.unsubscribe()})}_injector=Y(Nn);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,r){return this.bootstrapImpl(n,r)}bootstrapImpl(n,r,i=ze.NULL){return this._injector.get(Ae).run(()=>{ot(10);let s=n instanceof M_;if(!this._injector.get(iD).done){let E="";throw new J(405,E)}let c;s?c=n:c=this._injector.get(bf).resolveComponentFactory(n),this.componentTypes.push(c.componentType);let l=_1(c)?void 0:this._injector.get(vc),d=r||c.selector,h=c.create(i,[],d,l),f=h.location.nativeElement,g=h.injector.get(x_,null);return g?.registerApplication(f),h.onDestroy(()=>{this.detachView(h.hostView),yf(this.components,h),g?.unregisterApplication(f)}),this._loadComponent(h),ot(11,h),h})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){ot(12),this.tracingSnapshot!==null?this.tracingSnapshot.run(D_.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new J(101,!1);let n=Te(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,Te(n),this.afterTick.next(),ot(13)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(bo,null,{optional:!0}));let n=0;for(;this.dirtyFlags!==0&&n++<y9;)ot(14),this.synchronizeOnce(),ot(15)}synchronizeOnce(){this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush());let n=!1;if(this.dirtyFlags&7){let r=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:i}of this.allViews){if(!r&&!Nu(i))continue;let o=r&&!this.zonelessEnabled?0:1;Dk(i,o),n=!0}if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),this.dirtyFlags&23)return}n||(this._rendererFactory?.begin?.(),this._rendererFactory?.end?.()),this.dirtyFlags&8&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){if(this.allViews.some(({_lView:n})=>Nu(n))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(n){let r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){let r=n;yf(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView);try{this.tick()}catch(i){this.internalErrorHandler(i)}this.components.push(n),this._injector.get(m1,[]).forEach(i=>i(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>yf(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new J(406,!1);let n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function yf(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function T1(t,e){let n=ne(),r=Pi();if(_n(n,r,e)){let i=Ye(),o=mc();if(b_(o,i,n,t,e))Do(o)&&Tk(n,o.index);else{let a=hr(o,n);yk(n[qe],a,null,o.value,t,e,null)}}return T1}function y1(t,e,n,r){let i=ne(),o=Pi();if(_n(i,o,e)){let s=Ye(),a=mc();B5(a,i,t,e,n,r)}return y1}var S_e=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";function I9(){return ne()[wn][Nt]}var dC=class{destroy(e){}updateValue(e,n){}swap(e,n){let r=Math.min(e,n),i=Math.max(e,n),o=this.detach(i);if(i-r>1){let s=this.detach(r);this.attach(r,o),this.attach(i,s)}else this.attach(r,o)}move(e,n){this.attach(n,this.detach(e))}};function OA(t,e,n,r,i){return t===n&&Object.is(e,r)?1:Object.is(i(t,e),i(n,r))?-1:0}function v9(t,e,n){let r,i,o=0,s=t.length-1,a=void 0;if(Array.isArray(e)){let c=e.length-1;for(;o<=s&&o<=c;){let l=t.at(o),d=e[o],h=OA(o,l,o,d,n);if(h!==0){h<0&&t.updateValue(o,d),o++;continue}let f=t.at(s),g=e[c],E=OA(s,f,c,g,n);if(E!==0){E<0&&t.updateValue(s,g),s--,c--;continue}let I=n(o,l),S=n(s,f),L=n(o,d);if(Object.is(L,S)){let V=n(c,g);Object.is(V,I)?(t.swap(o,s),t.updateValue(s,g),c--,s--):t.move(s,o),t.updateValue(o,d),o++;continue}if(r??=new E_,i??=ax(t,o,s,n),hC(t,r,o,L))t.updateValue(o,d),o++,s++;else if(i.has(L))r.set(I,t.detach(o)),s--;else{let V=t.create(o,e[o]);t.attach(o,V),o++,s++}}for(;o<=c;)sx(t,r,n,o,e[o]),o++}else if(e!=null){let c=e[Symbol.iterator](),l=c.next();for(;!l.done&&o<=s;){let d=t.at(o),h=l.value,f=OA(o,d,o,h,n);if(f!==0)f<0&&t.updateValue(o,h),o++,l=c.next();else{r??=new E_,i??=ax(t,o,s,n);let g=n(o,h);if(hC(t,r,o,g))t.updateValue(o,h),o++,s++,l=c.next();else if(!i.has(g))t.attach(o,t.create(o,h)),o++,s++,l=c.next();else{let E=n(o,d);r.set(E,t.detach(o)),s--}}}for(;!l.done;)sx(t,r,n,t.length,l.value),l=c.next()}for(;o<=s;)t.destroy(t.detach(s--));r?.forEach(c=>{t.destroy(c)})}function hC(t,e,n,r){return e!==void 0&&e.has(r)?(t.attach(n,e.get(r)),e.delete(r),!0):!1}function sx(t,e,n,r,i){if(hC(t,e,r,n(r,i)))t.updateValue(r,i);else{let o=t.create(r,i);t.attach(r,o)}}function ax(t,e,n,r){let i=new Set;for(let o=e;o<=n;o++)i.add(r(o,t.at(o)));return i}var E_=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let n=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(n)?(this.kvMap.set(e,this._vMap.get(n)),this._vMap.delete(n)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,n){if(this.kvMap.has(e)){let r=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let i=this._vMap;for(;i.has(r);)r=i.get(r);i.set(r,n)}else this.kvMap.set(e,n)}forEach(e){for(let[n,r]of this.kvMap)if(e(r,n),this._vMap!==void 0){let i=this._vMap;for(;i.has(r);)r=i.get(r),e(r,n)}}};function S9(t,e,n,r,i,o,s,a){Lo("NgControlFlow");let c=ne(),l=Ye(),d=fr(l.consts,o);return ju(c,l,t,e,n,r,i,d,256,s,a),sD}function sD(t,e,n,r,i,o,s,a){Lo("NgControlFlow");let c=ne(),l=Ye(),d=fr(l.consts,o);return ju(c,l,t,e,n,r,i,d,512,s,a),sD}function A9(t,e){Lo("NgControlFlow");let n=ne(),r=Pi(),i=n[r]!==sn?n[r]:-1,o=i!==-1?__(n,Ke+i):void 0,s=0;if(_n(n,r,t)){let a=Te(null);try{if(o!==void 0&&Mk(o,s),t!==-1){let c=Ke+t,l=__(n,c),d=mC(n[pe],c),h=Pk(l,d,n),f=Nf(n,d,e,{dehydratedView:h});wf(l,f,s,Fu(d,h))}}finally{Te(a)}}else if(o!==void 0){let a=Ok(o,s);a!==void 0&&(a[Nt]=e)}}var fC=class{lContainer;$implicit;$index;constructor(e,n,r){this.lContainer=e,this.$implicit=n,this.$index=r}get $count(){return this.lContainer.length-wt}};function C9(t){return t}function D9(t,e){return e}var pC=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,n,r){this.hasEmptyBlock=e,this.trackByFn=n,this.liveCollection=r}};function R9(t,e,n,r,i,o,s,a,c,l,d,h,f){Lo("NgControlFlow");let g=ne(),E=Ye(),I=c!==void 0,S=ne(),L=a?s.bind(S[wn][Nt]):s,V=new pC(I,L);S[Ke+t]=V,ju(g,E,t+1,e,n,r,i,fr(E.consts,o),256),I&&ju(g,E,t+2,c,l,d,h,fr(E.consts,f),512)}var gC=class extends dC{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,n,r){super(),this.lContainer=e,this.hostLView=n,this.templateTNode=r}get length(){return this.lContainer.length-wt}at(e){return this.getLView(e)[Nt].$implicit}attach(e,n){let r=n[ac];this.needsIndexUpdate||=e!==this.length,wf(this.lContainer,n,e,Fu(this.templateTNode,r)),w9(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,b9(this.lContainer,e),O9(this.lContainer,e)}create(e,n){let r=c_(this.lContainer,this.templateTNode.tView.ssrId),i=Nf(this.hostLView,this.templateTNode,new fC(this.lContainer,n,e),{dehydratedView:r});return this.operationsCounter?.recordCreate(),i}destroy(e){R_(e[pe],e),this.operationsCounter?.recordDestroy()}updateValue(e,n){this.getLView(e)[Nt].$implicit=n}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[Nt].$index=e}getLView(e){return M9(this.lContainer,e)}};function N9(t){let e=Te(null),n=pr();try{let r=ne(),i=r[pe],o=r[n],s=n+1,a=__(r,s);if(o.liveCollection===void 0){let l=mC(i,s);o.liveCollection=new gC(a,r,l)}else o.liveCollection.reset();let c=o.liveCollection;if(v9(c,t,o.trackByFn),c.updateIndexes(),o.hasEmptyBlock){let l=Pi(),d=c.length===0;if(_n(r,l,d)){let h=n+2,f=__(r,h);if(d){let g=mC(i,h),E=Pk(f,g,r),I=Nf(r,g,void 0,{dehydratedView:E});wf(f,I,0,Fu(g,E))}else i.firstUpdatePass&&dq(f),Mk(f,0)}}}finally{Te(e)}}function __(t,e){return t[e]}function w9(t,e){if(t.length<=wt)return;let n=wt+e,r=t[n],i=r?r[dc]:void 0;if(r&&i&&i.detachedLeaveAnimationFns&&i.detachedLeaveAnimationFns.length>0){let o=r[Ao];T5(o,i),Ic.delete(r),i.detachedLeaveAnimationFns=void 0}}function b9(t,e){if(t.length<=wt)return;let n=wt+e,r=t[n],i=r?r[dc]:void 0;i&&i.leave&&i.leave.size>0&&(i.detachedLeaveAnimationFns=[])}function O9(t,e){return Sf(t,e)}function M9(t,e){return Ok(t,e)}function mC(t,e){return ff(t,e)}function I1(t,e,n){let r=ne(),i=Pi();if(_n(r,i,e)){let o=Ye(),s=mc();Ek(s,r,t,e,r[qe],n)}return I1}function EC(t,e,n,r,i){b_(e,t,n,i?"class":"style",r)}function aD(t,e,n,r){let i=ne(),o=i[pe],s=t+Ke,a=o.firstCreatePass?XC(s,i,2,e,WC,PE(),n,r):o.data[s];if(zC(a,i,t,e,A1),Du(a)){let c=i[pe];w_(c,i,a),RC(c,a,i)}return r!=null&&Rf(i,a),aD}function cD(){let t=Ye(),e=$t(),n=qC(e);return t.firstCreatePass&&QC(t,n),dA(n)&&hA(),lA(),n.classesWithoutHost!=null&&kz(n)&&EC(t,n,ne(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&Fz(n)&&EC(t,n,ne(),n.stylesWithoutHost,!1),cD}function v1(t,e,n,r){return aD(t,e,n,r),cD(),v1}function lD(t,e,n,r){let i=ne(),o=i[pe],s=t+Ke,a=o.firstCreatePass?Dq(s,o,2,e,n,r):o.data[s];return zC(a,i,t,e,A1),r!=null&&Rf(i,a),lD}function uD(){let t=$t(),e=qC(t);return dA(e)&&hA(),lA(),uD}function S1(t,e,n,r){return lD(t,e,n,r),uD(),S1}var A1=(t,e,n,r,i)=>(Ef(!0),Kx(e[qe],r,IA()));function dD(t,e,n){let r=ne(),i=r[pe],o=t+Ke,s=i.firstCreatePass?XC(o,r,8,"ng-container",WC,PE(),e,n):i.data[o];if(zC(s,r,t,"ng-container",L9),Du(s)){let a=r[pe];w_(a,r,s),RC(a,s,r)}return n!=null&&Rf(r,s),dD}function hD(){let t=Ye(),e=$t(),n=qC(e);return t.firstCreatePass&&QC(t,n),hD}function C1(t,e,n){return dD(t,e,n),hD(),C1}var L9=(t,e,n,r,i)=>(Ef(!0),x8(e[qe],""));function P9(){return ne()}function D1(t,e,n){let r=ne(),i=Pi();if(_n(r,i,e)){let o=Ye(),s=mc();_k(s,r,t,e,r[qe],n)}return D1}var WE=void 0;function x9(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return e===1&&n===0?1:5}var k9=["en",[["a","p"],["AM","PM"]],[["AM","PM"]],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],WE,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],WE,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",WE,"{1} 'at' {0}",WE],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",x9],MA={};function mr(t){let e=F9(t),n=cx(e);if(n)return n;let r=e.split("-")[0];if(n=cx(r),n)return n;if(r==="en")return k9;throw new J(701,!1)}function cx(t){if(!(t in MA)){let e=Lt.ng&&Lt.ng.common&&Lt.ng.common.locales&&Lt.ng.common.locales[t];return e!==void 0&&(MA[t]=e),e}return MA[t]}var Ot=(function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t})(Ot||{});function F9(t){return t.toLowerCase().replace(/_/g,"-")}var xf="en-US";var U9=xf;function R1(t){typeof t=="string"&&(U9=t.toLowerCase().replace(/_/g,"-"))}function N1(t,e,n){let r=ne(),i=Ye(),o=$t();return b1(i,r,r[qe],o,t,e,n),N1}function w1(t,e,n){let r=ne(),i=Ye(),o=$t();return(o.type&3||n)&&Bk(o,i,r,n,r[qe],t,e,JE(o,r,e)),w1}function b1(t,e,n,r,i,o,s){let a=!0,c=null;if((r.type&3||s)&&(c??=JE(r,e,o),Bk(r,t,e,s,n,i,o,c)&&(a=!1)),a){let l=r.outputs?.[i],d=r.hostDirectiveOutputs?.[i];if(d&&d.length)for(let h=0;h<d.length;h+=2){let f=d[h],g=d[h+1];c??=JE(r,e,o),tx(r,e,f,g,i,c)}if(l&&l.length)for(let h of l)c??=JE(r,e,o),tx(r,e,h,i,i,c)}}function V9(t=1){return DP(t)}function B9(t,e){let n=null,r=J8(t);for(let i=0;i<e.length;i++){let o=e[i];if(o==="*"){n=i;continue}if(r===null?Zx(t,o,!0):t5(r,o))return i}return n}function G9(t){let e=ne()[wn][Gn];if(!e.projection){let n=t?t.length:1,r=e.projection=JL(n,null),i=r.slice(),o=e.child;for(;o!==null;){if(o.type!==128){let s=t?B9(o,t):0;s!==null&&(i[s]?i[s].projectionNext=o:r[s]=o,i[s]=o)}o=o.next}}}function j9(t,e=0,n,r,i,o){let s=ne(),a=Ye(),c=r?t+1:null;c!==null&&ju(s,a,c,r,i,o,null,n);let l=Cc(a,Ke+t,16,null,n||null);l.projection===null&&(l.projection=e),gA();let h=!s[ac]||uA();s[wn][Gn].projection[l.projection]===null&&c!==null?H9(s,a,c):h&&!v_(l)&&b5(a,s,l)}function H9(t,e,n){let r=Ke+n,i=e.data[r],o=t[r],s=c_(o,i.tView.ssrId),a=Nf(t,i,void 0,{dehydratedView:s});wf(o,a,0,Fu(i,s))}function $9(t,e,n,r){Yq(t,e,n,r)}function W9(t,e,n){qk(t,e,n)}function z9(t){let e=ne(),n=Ye(),r=kE();mf(r+1);let i=tD(n,r);if(t.dirty&&cP(e)===((i.metadata.flags&2)===2)){if(i.matches===null)t.reset([]);else{let o=Yk(e,r);t.reset(o,bx),t.notifyOnChanges()}return!0}return!1}function q9(){return eD(ne(),kE())}function K9(t,e,n,r){Jq(t,qk(e,n,r))}function Y9(t=1){mf(kE()+t)}function X9(t){let e=mA();return pc(e,Ke+t)}function zE(t,e){return t<<17|e<<2}function Sc(t){return t>>17&32767}function Q9(t){return(t&2)==2}function J9(t,e){return t&131071|e<<17}function _C(t){return t|2}function Hu(t){return(t&131068)>>2}function LA(t,e){return t&-131069|e<<2}function Z9(t){return(t&1)===1}function TC(t){return t|1}function eK(t,e,n,r,i,o){let s=o?e.classBindings:e.styleBindings,a=Sc(s),c=Hu(s);t[r]=n;let l=!1,d;if(Array.isArray(n)){let h=n;d=h[1],(d===null||vu(h,d)>0)&&(l=!0)}else d=n;if(i)if(c!==0){let f=Sc(t[a+1]);t[r+1]=zE(f,a),f!==0&&(t[f+1]=LA(t[f+1],r)),t[a+1]=J9(t[a+1],r)}else t[r+1]=zE(a,0),a!==0&&(t[a+1]=LA(t[a+1],r)),a=r;else t[r+1]=zE(c,0),a===0?a=r:t[c+1]=LA(t[c+1],r),c=r;l&&(t[r+1]=_C(t[r+1])),lx(t,d,r,!0),lx(t,d,r,!1),tK(e,d,t,r,o),s=zE(a,c),o?e.classBindings=s:e.styleBindings=s}function tK(t,e,n,r,i){let o=i?t.residualClasses:t.residualStyles;o!=null&&typeof e=="string"&&vu(o,e)>=0&&(n[r+1]=TC(n[r+1]))}function lx(t,e,n,r){let i=t[n+1],o=e===null,s=r?Sc(i):Hu(i),a=!1;for(;s!==0&&(a===!1||o);){let c=t[s],l=t[s+1];nK(c,e)&&(a=!0,t[s+1]=r?TC(l):_C(l)),s=r?Sc(l):Hu(l)}a&&(t[n+1]=r?_C(i):TC(i))}function nK(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?vu(t,e)>=0:!1}var Wt={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function O1(t){return t.substring(Wt.key,Wt.keyEnd)}function rK(t){return t.substring(Wt.value,Wt.valueEnd)}function iK(t){return P1(t),M1(t,$u(t,0,Wt.textEnd))}function M1(t,e){let n=Wt.textEnd;return n===e?-1:(e=Wt.keyEnd=sK(t,Wt.key=e,n),$u(t,e,n))}function oK(t){return P1(t),L1(t,$u(t,0,Wt.textEnd))}function L1(t,e){let n=Wt.textEnd,r=Wt.key=$u(t,e,n);return n===r?-1:(r=Wt.keyEnd=aK(t,r,n),r=ux(t,r,n,58),r=Wt.value=$u(t,r,n),r=Wt.valueEnd=cK(t,r,n),ux(t,r,n,59))}function P1(t){Wt.key=0,Wt.keyEnd=0,Wt.value=0,Wt.valueEnd=0,Wt.textEnd=t.length}function $u(t,e,n){for(;e<n&&t.charCodeAt(e)<=32;)e++;return e}function sK(t,e,n){for(;e<n&&t.charCodeAt(e)>32;)e++;return e}function aK(t,e,n){let r;for(;e<n&&((r=t.charCodeAt(e))===45||r===95||(r&-33)>=65&&(r&-33)<=90||r>=48&&r<=57);)e++;return e}function ux(t,e,n,r){return e=$u(t,e,n),e<n&&e++,e}function cK(t,e,n){let r=-1,i=-1,o=-1,s=e,a=s;for(;s<n;){let c=t.charCodeAt(s++);if(c===59)return a;c===34||c===39?a=s=dx(t,c,s,n):e===s-4&&o===85&&i===82&&r===76&&c===40?a=s=dx(t,41,s,n):c>32&&(a=s),o=i,i=r,r=c&-33}return a}function dx(t,e,n,r){let i=-1,o=n;for(;o<r;){let s=t.charCodeAt(o++);if(s==e&&i!==92)return o;s==92&&i===92?i=0:i=s}throw new Error}function x1(t,e,n){return F1(t,e,n,!1),x1}function k1(t,e){return F1(t,e,null,!0),k1}function lK(t){U1(G1,uK,t,!1)}function uK(t,e){for(let n=oK(e);n>=0;n=L1(e,n))G1(t,O1(e),rK(e))}function dK(t){U1(_K,hK,t,!0)}function hK(t,e){for(let n=iK(e);n>=0;n=M1(e,n))lf(t,O1(e),!0)}function F1(t,e,n,r){let i=ne(),o=Ye(),s=gf(2);if(o.firstUpdatePass&&B1(o,t,s,r),e!==sn&&_n(i,s,e)){let a=o.data[pr()];j1(o,a,i,i[qe],t,i[s+1]=yK(e,n),r,s)}}function U1(t,e,n,r){let i=Ye(),o=gf(2);i.firstUpdatePass&&B1(i,null,o,r);let s=ne();if(n!==sn&&_n(s,o,n)){let a=i.data[pr()];if(H1(a,r)&&!V1(i,o)){let c=r?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(n=vE(c,n||"")),EC(i,a,s,n,r)}else TK(i,a,s,s[qe],s[o+1],s[o+1]=EK(t,e,n),r,o)}}function V1(t,e){return e>=t.expandoStartIndex}function B1(t,e,n,r){let i=t.data;if(i[n+1]===null){let o=i[pr()],s=V1(t,n);H1(o,r)&&e===null&&!s&&(e=!1),e=fK(i,o,e,r),eK(i,o,e,n,s,r)}}function fK(t,e,n,r){let i=vP(t),o=r?e.residualClasses:e.residualStyles;if(i===null)(r?e.classBindings:e.styleBindings)===0&&(n=PA(null,t,e,n,r),n=Af(n,e.attrs,r),o=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==i)if(n=PA(i,t,e,n,r),o===null){let c=pK(t,e,r);c!==void 0&&Array.isArray(c)&&(c=PA(null,t,e,c[1],r),c=Af(c,e.attrs,r),gK(t,e,r,c))}else o=mK(t,e,r)}return o!==void 0&&(r?e.residualClasses=o:e.residualStyles=o),n}function pK(t,e,n){let r=n?e.classBindings:e.styleBindings;if(Hu(r)!==0)return t[Sc(r)]}function gK(t,e,n,r){let i=n?e.classBindings:e.styleBindings;t[Sc(i)]=r}function mK(t,e,n){let r,i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o<i;o++){let s=t[o].hostAttrs;r=Af(r,s,n)}return Af(r,e.attrs,n)}function PA(t,e,n,r,i){let o=null,s=n.directiveEnd,a=n.directiveStylingLast;for(a===-1?a=n.directiveStart:a++;a<s&&(o=e[a],r=Af(r,o.hostAttrs,i),o!==t);)a++;return t!==null&&(n.directiveStylingLast=a),r}function Af(t,e,n){let r=n?1:2,i=-1;if(e!==null)for(let o=0;o<e.length;o++){let s=e[o];typeof s=="number"?i=s:i===r&&(Array.isArray(t)||(t=t===void 0?[]:["",t]),lf(t,s,n?!0:e[++o]))}return t===void 0?null:t}function EK(t,e,n){if(n==null||n==="")return Rn;let r=[],i=gr(n);if(Array.isArray(i))for(let o=0;o<i.length;o++)t(r,i[o],!0);else if(typeof i=="object")for(let o in i)i.hasOwnProperty(o)&&t(r,o,i[o]);else typeof i=="string"&&e(r,i);return r}function G1(t,e,n){lf(t,e,gr(n))}function _K(t,e,n){let r=String(e);r!==""&&!r.includes(" ")&&lf(t,r,n)}function TK(t,e,n,r,i,o,s,a){i===sn&&(i=Rn);let c=0,l=0,d=0<i.length?i[0]:null,h=0<o.length?o[0]:null;for(;d!==null||h!==null;){let f=c<i.length?i[c+1]:void 0,g=l<o.length?o[l+1]:void 0,E=null,I;d===h?(c+=2,l+=2,f!==g&&(E=h,I=g)):h===null||d!==null&&d<h?(c+=2,E=d):(l+=2,E=h,I=g),E!==null&&j1(t,e,n,r,E,I,s,a),d=c<i.length?i[c]:null,h=l<o.length?o[l]:null}}function j1(t,e,n,r,i,o,s,a){if(!(e.type&3))return;let c=t.data,l=c[a+1],d=Z9(l)?hx(c,e,n,i,Hu(l),s):void 0;if(!T_(d)){T_(o)||Q9(l)&&(o=hx(c,null,n,i,a,s));let h=iA(pr(),n);M5(r,s,h,i,o)}}function hx(t,e,n,r,i,o){let s=e===null,a;for(;i>0;){let c=t[i],l=Array.isArray(c),d=l?c[1]:c,h=d===null,f=n[i+1];f===sn&&(f=h?Rn:void 0);let g=h?NE(f,r):d===r?f:void 0;if(l&&!T_(g)&&(g=NE(c,r)),T_(g)&&(a=g,s))return a;let E=t[i+1];i=s?Sc(E):Hu(E)}if(e!==null){let c=o?e.residualClasses:e.residualStyles;c!=null&&(a=NE(c,r))}return a}function T_(t){return t!==void 0}function yK(t,e){return t==null||t===""||(typeof e=="string"?t=t+e:typeof t=="object"&&(t=vo(gr(t)))),t}function H1(t,e){return(t.flags&(e?8:16))!==0}function IK(t,e=""){let n=ne(),r=Ye(),i=t+Ke,o=r.firstCreatePass?Cc(r,i,1,e,null):r.data[i],s=vK(r,n,o,e,t);n[i]=s,VE()&&HC(r,n,s,o),gc(o,!1)}var vK=(t,e,n,r,i)=>(Ef(!0),L8(e[qe],r));function $1(t,e,n,r=""){return _n(t,Pi(),n)?e+ur(n)+r:sn}function SK(t,e,n,r,i,o=""){let s=_A(),a=Uu(t,s,n,i);return gf(2),a?e+ur(n)+r+ur(i)+o:sn}function AK(t,e,n,r,i,o,s,a=""){let c=_A(),l=ZC(t,c,n,i,s);return gf(3),l?e+ur(n)+r+ur(i)+o+ur(s)+a:sn}function W1(t){return fD("",t),W1}function fD(t,e,n){let r=ne(),i=$1(r,t,e,n);return i!==sn&&pD(r,pr(),i),fD}function z1(t,e,n,r,i){let o=ne(),s=SK(o,t,e,n,r,i);return s!==sn&&pD(o,pr(),s),z1}function q1(t,e,n,r,i,o,s){let a=ne(),c=AK(a,t,e,n,r,i,o,s);return c!==sn&&pD(a,pr(),c),q1}function pD(t,e,n){let r=iA(e,t);P8(t[qe],r,n)}function K1(t,e,n){AA(e)&&(e=e());let r=ne(),i=Pi();if(_n(r,i,e)){let o=Ye(),s=mc();Ek(s,r,t,e,r[qe],n)}return K1}function CK(t,e){let n=AA(t);return n&&t.set(e),n}function Y1(t,e){let n=ne(),r=Ye(),i=$t();return b1(r,n,n[qe],i,t,e),Y1}var X1={};function Q1(t){let e=Ye(),n=ne(),r=t+Ke,i=Cc(e,r,128,null,null);return gc(i,!1),pf(e,n,r,X1),Q1}function DK(t){Lo("NgLet");let e=Ye(),n=ne(),r=pr();return pf(e,n,r,t),t}function RK(t){let e=mA(),n=pc(e,Ke+t);if(n===X1)throw new J(314,!1);return n}function NK(t){return _n(ne(),Pi(),t)?ur(t):sn}function wK(t,e,n=""){return $1(ne(),t,e,n)}function bK(t,e,n){let r=Ye();if(r.firstCreatePass){let i=ei(t);yC(n,r.data,r.blueprint,i,!0),yC(e,r.data,r.blueprint,i,!1)}}function yC(t,e,n,r,i){if(t=jt(t),Array.isArray(t))for(let o=0;o<t.length;o++)yC(t[o],e,n,r,i);else{let o=Ye(),s=ne(),a=$t(),c=ic(t)?t:jt(t.provide),l=QS(t),d=a.providerIndexes&1048575,h=a.directiveStart,f=a.providerIndexes>>20;if(ic(t)||!t.multi){let g=new yc(l,i,st,null),E=kA(c,e,i?d:d+f,h);E===-1?(UA(r_(a,s),o,c),xA(o,t,e.length),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),n.push(g),s.push(g)):(n[E]=g,s[E]=g)}else{let g=kA(c,e,d+f,h),E=kA(c,e,d,d+f),I=g>=0&&n[g],S=E>=0&&n[E];if(i&&!S||!i&&!I){UA(r_(a,s),o,c);let L=LK(i?MK:OK,n.length,i,r,l,t);!i&&S&&(n[E].providerFactory=L),xA(o,t,e.length,0),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),n.push(L),s.push(L)}else{let L=J1(n[i?E:g],l,!i&&r);xA(o,t,g>-1?g:E,L)}!i&&r&&S&&n[E].componentProviders++}}}function xA(t,e,n,r){let i=ic(e),o=iP(e);if(i||o){let c=(o?jt(e.useClass):e).prototype.ngOnDestroy;if(c){let l=t.destroyHooks||(t.destroyHooks=[]);if(!i&&e.multi){let d=l.indexOf(n);d===-1?l.push(n,[r,c]):l[d+1].push(r,c)}else l.push(n,c)}}}function J1(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function kA(t,e,n,r){for(let i=n;i<r;i++)if(e[i]===t)return i;return-1}function OK(t,e,n,r,i){return IC(this.multi,[])}function MK(t,e,n,r,i){let o=this.multi,s;if(this.providerFactory){let a=this.providerFactory.componentProviders,c=If(r,r[pe],this.providerFactory.index,i);s=c.slice(0,a),IC(o,s);for(let l=a;l<c.length;l++)s.push(c[l])}else s=[],IC(o,s);return s}function IC(t,e){for(let n=0;n<t.length;n++){let r=t[n];e.push(r())}return e}function LK(t,e,n,r,i,o){let s=new yc(t,n,st,null);return s.multi=[],s.index=e,s.componentProviders=0,J1(s,i,r&&!n),s}function PK(t,e=[]){return n=>{n.providersResolver=(r,i)=>bK(r,i?i(t):t,e)}}function xK(t,e,n){let r=t.\u0275cmp;r.directiveDefs=m_(e,s1),r.pipeDefs=m_(n,KS)}function kK(t,e,n){let r=jn()+t,i=ne();return i[r]===sn?Gi(i,r,n?e.call(n):e()):Of(i,r)}function FK(t,e,n,r){return Z1(ne(),jn(),t,e,n,r)}function UK(t,e,n,r,i){return eF(ne(),jn(),t,e,n,r,i)}function VK(t,e,n,r,i,o){return tF(ne(),jn(),t,e,n,r,i,o)}function BK(t,e,n,r,i,o,s){return zK(ne(),jn(),t,e,n,r,i,o,s)}function GK(t,e,n,r,i,o,s,a){let c=jn()+t,l=ne(),d=Vu(l,c,n,r,i,o);return _n(l,c+4,s)||d?Gi(l,c+5,a?e.call(a,n,r,i,o,s):e(n,r,i,o,s)):Of(l,c+5)}function jK(t,e,n,r,i,o,s,a,c){let l=jn()+t,d=ne(),h=Vu(d,l,n,r,i,o);return Uu(d,l+4,s,a)||h?Gi(d,l+6,c?e.call(c,n,r,i,o,s,a):e(n,r,i,o,s,a)):Of(d,l+6)}function HK(t,e,n,r,i,o,s,a,c,l){let d=jn()+t,h=ne(),f=Vu(h,d,n,r,i,o);return ZC(h,d+4,s,a,c)||f?Gi(h,d+7,l?e.call(l,n,r,i,o,s,a,c):e(n,r,i,o,s,a,c)):Of(h,d+7)}function $K(t,e,n,r,i,o,s,a,c,l,d){let h=jn()+t,f=ne(),g=Vu(f,h,n,r,i,o);return Vu(f,h+4,s,a,c,l)||g?Gi(f,h+8,d?e.call(d,n,r,i,o,s,a,c,l):e(n,r,i,o,s,a,c,l)):Of(f,h+8)}function WK(t,e,n,r){return nF(ne(),jn(),t,e,n,r)}function kf(t,e){let n=t[e];return n===sn?void 0:n}function Z1(t,e,n,r,i,o){let s=e+n;return _n(t,s,i)?Gi(t,s+1,o?r.call(o,i):r(i)):kf(t,s+1)}function eF(t,e,n,r,i,o,s){let a=e+n;return Uu(t,a,i,o)?Gi(t,a+2,s?r.call(s,i,o):r(i,o)):kf(t,a+2)}function tF(t,e,n,r,i,o,s,a){let c=e+n;return ZC(t,c,i,o,s)?Gi(t,c+3,a?r.call(a,i,o,s):r(i,o,s)):kf(t,c+3)}function zK(t,e,n,r,i,o,s,a,c){let l=e+n;return Vu(t,l,i,o,s,a)?Gi(t,l+4,c?r.call(c,i,o,s,a):r(i,o,s,a)):kf(t,l+4)}function nF(t,e,n,r,i,o){let s=e+n,a=!1;for(let c=0;c<i.length;c++)_n(t,s++,i[c])&&(a=!0);return a?Gi(t,s,r.apply(o,i)):kf(t,s)}function qK(t,e){let n=Ye(),r,i=t+Ke;n.firstCreatePass?(r=KK(e,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks??=[]).push(i,r.onDestroy)):r=n.data[i];let o=r.factory||(r.factory=Es(r.type,!0)),s,a=Bn(st);try{let c=n_(!1),l=o();return n_(c),pf(n,ne(),i,l),l}finally{Bn(a)}}function KK(t,e){if(e)for(let n=e.length-1;n>=0;n--){let r=e[n];if(t===r.name)return r}}function YK(t,e,n){let r=t+Ke,i=ne(),o=pc(i,r);return F_(i,r)?Z1(i,jn(),e,o.transform,n,o):o.transform(n)}function XK(t,e,n,r){let i=t+Ke,o=ne(),s=pc(o,i);return F_(o,i)?eF(o,jn(),e,s.transform,n,r,s):s.transform(n,r)}function QK(t,e,n,r,i){let o=t+Ke,s=ne(),a=pc(s,o);return F_(s,o)?tF(s,jn(),e,a.transform,n,r,i,a):a.transform(n,r,i)}function JK(t,e,n){let r=t+Ke,i=ne(),o=pc(i,r);return F_(i,r)?nF(i,jn(),e,o.transform,n,o):o.transform.apply(o,n)}function F_(t,e){return t[pe].data[e].pure}function ZK(t,e){return O_(t,e)}var qE=null;function rF(t){qE!==null&&(t.defaultEncapsulation!==qE.defaultEncapsulation||t.preserveWhitespaces!==qE.preserveWhitespaces)||(qE=t)}var iF=new z("");var eY=(()=>{class t{zone=Y(Ae);changeDetectionScheduler=Y(Lr);applicationRef=Y(bs);applicationErrorHandler=Y(xi);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{try{this.applicationRef.dirtyFlags|=1,this.applicationRef._tick()}catch(n){this.applicationErrorHandler(n)}})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function oF({ngZoneFactory:t,ignoreChangesOutsideZone:e,scheduleInRootZone:n}){return t??=()=>new Ae(Ee(B({},gD()),{scheduleInRootZone:n})),[{provide:Ae,useFactory:t},{provide:ys,multi:!0,useFactory:()=>{let r=Y(eY,{optional:!0});return()=>r.initialize()}},{provide:ys,multi:!0,useFactory:()=>{let r=Y(tY);return()=>{r.initialize()}}},e===!0?{provide:CA,useValue:!0}:[],{provide:BE,useValue:n??rk},{provide:xi,useFactory:()=>{let r=Y(Ae),i=Y(Nn),o;return s=>{r.runOutsideAngular(()=>{i.destroyed&&!o?setTimeout(()=>{throw s}):(o??=i.get(lr),o.handleError(s))})}}}]}function gD(t){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:t?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:t?.runCoalescing??!1}}var tY=(()=>{class t{subscription=new gt;initialized=!1;zone=Y(Ae);pendingTasks=Y(Ds);initialize(){if(this.initialized)return;this.initialized=!0;let n=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(n=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Ae.assertNotInAngularZone(),queueMicrotask(()=>{n!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(n),n=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Ae.assertInAngularZone(),n??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var mD=(()=>{class t{applicationErrorHandler=Y(xi);appRef=Y(bs);taskService=Y(Ds);ngZone=Y(Ae);zonelessEnabled=Y(Ou);tracing=Y(Ac,{optional:!0});disableScheduling=Y(CA,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new gt;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(s_):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(Y(BE,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof ku||!this.zoneIsDefined)}notify(n){if(!this.zonelessEnabled&&n===5)return;let r=!1;switch(n){case 0:{this.appRef.dirtyFlags|=2;break}case 3:case 2:case 4:case 5:case 1:{this.appRef.dirtyFlags|=4;break}case 6:{this.appRef.dirtyFlags|=2,r=!0;break}case 12:{this.appRef.dirtyFlags|=16,r=!0;break}case 13:{this.appRef.dirtyFlags|=2,r=!0;break}case 11:{r=!0;break}default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(r))return;let i=this.useMicrotaskScheduler?WP:ik;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>i(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(n){return!(this.disableScheduling&&!n||this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(s_+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let n=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(r){this.taskService.remove(n),this.applicationErrorHandler(r)}finally{this.cleanup()}this.useMicrotaskScheduler=!0,WP(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(n)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let n=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(n)}}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function nY(){return Lo("NgZoneless"),Xn([{provide:Lr,useExisting:mD},{provide:Ae,useClass:ku},{provide:Ou,useValue:!0},{provide:BE,useValue:!1},[]])}function rY(){return typeof $localize<"u"&&$localize.locale||xf}var Ff=new z("",{providedIn:"root",factory:()=>Y(Ff,{optional:!0,skipSelf:!0})||rY()});var U_=class{destroyed=!1;listeners=null;errorHandler=Y(lr,{optional:!0});destroyRef=Y(Hn);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new J(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let n=this.listeners?.indexOf(e);n!==void 0&&n!==-1&&this.listeners?.splice(n,1)}}}emit(e){if(this.destroyed){console.warn(Ts(953,!1));return}if(this.listeners===null)return;let n=Te(null);try{for(let r of this.listeners)try{r(e)}catch(i){this.errorHandler?.handleError(i)}}finally{Te(n)}}};function Uf(t){return BL(t)}function Vf(t,e){return Zh(t,e?.equal)}var ED=class{[rn];constructor(e){this[rn]=e}destroy(){this[rn].destroy()}};function _D(t,e){let n=e?.injector??Y(ze),r=e?.manualCleanup!==!0?n.get(Hn):null,i,o=n.get(bu,null,{optional:!0}),s=n.get(Lr);return o!==null?(i=sY(o.view,s,t),r instanceof af&&r._lView===o.view&&(r=null)):i=aY(t,n.get(_f),s),i.injector=n,r!==null&&(i.onDestroyFn=r.onDestroy(()=>i.destroy())),new ED(i)}var sF=Ee(B({},GL),{cleanupFns:void 0,zone:null,onDestroyFn:_c,run(){let t=wu(!1);try{jL(this)}finally{wu(t)}},cleanup(){if(!this.cleanupFns?.length)return;let t=Te(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],Te(t)}}}),iY=Ee(B({},sF),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){ec(this),this.onDestroyFn(),this.cleanup(),this.scheduler.remove(this)}}),oY=Ee(B({},sF),{consumerMarkedDirty(){this.view[ye]|=8192,As(this.view),this.notifier.notify(13)},destroy(){ec(this),this.onDestroyFn(),this.cleanup(),this.view[Co]?.delete(this)}});function sY(t,e,n){let r=Object.create(oY);return r.view=t,r.zone=typeof Zone<"u"?Zone.current:null,r.notifier=e,r.fn=aF(r,n),t[Co]??=new Set,t[Co].add(r),r.consumerMarkedDirty(r),r}function aY(t,e,n){let r=Object.create(iY);return r.fn=aF(r,t),r.scheduler=e,r.notifier=n,r.zone=typeof Zone<"u"?Zone.current:null,r.scheduler.add(r),r.notifier.notify(12),r}function aF(t,e){return()=>{e(n=>(t.cleanupFns??=[]).push(n))}}var gF=Symbol("InputSignalNode#UNSET"),TY=Ee(B({},uE),{transformFn:void 0,applyValueToInputSignal(t,e){Tu(t,e)}});function mF(t,e){let n=Object.create(TY);n.value=t,n.transformFn=e?.transform;function r(){if(gu(n),n.value===gF){let i=null;throw new J(-950,i)}return n.value}return r[rn]=n,r}var yY=new z("");yY.__NG_ELEMENT_ID__=t=>{let e=$t();if(e===null)throw new J(204,!1);if(e.type&2)return e.value;if(t&8)return null;throw new J(204,!1)};function FSe(t){return new U_}function cF(t,e){return mF(t,e)}function IY(t){return mF(gF,t)}var USe=(cF.required=IY,cF);function lF(t,e){return Qk(e)}function vY(t,e){return Jk(e)}var VSe=(lF.required=vY,lF);function SY(t,e,n){let r=new p_(n);return Promise.resolve(r)}function uF(t){for(let e=t.length-1;e>=0;e--)if(t[e]!==void 0)return t[e]}var V_=new z(""),AY=new z("");function Bf(t){return!t.moduleRef}function CY(t){let e=Bf(t)?t.r3Injector:t.moduleRef.injector,n=e.get(Ae);return n.run(()=>{Bf(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();let r=e.get(xi),i;if(n.runOutsideAngular(()=>{i=n.onError.subscribe({next:r})}),Bf(t)){let o=()=>e.destroy(),s=t.platformInjector.get(V_);s.add(o),e.onDestroy(()=>{i.unsubscribe(),s.delete(o)})}else{let o=()=>t.moduleRef.destroy(),s=t.platformInjector.get(V_);s.add(o),t.moduleRef.onDestroy(()=>{yf(t.allPlatformModules,t.moduleRef),i.unsubscribe(),s.delete(o)})}return RY(r,n,()=>{let o=e.get(Ds),s=o.add(),a=e.get(iD);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(Ff,xf);if(R1(c||xf),!e.get(AY,!0))return Bf(t)?e.get(bs):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(Bf(t)){let d=e.get(bs);return t.rootComponent!==void 0&&d.bootstrap(t.rootComponent),d}else return EF?.(t.moduleRef,t.allPlatformModules),t.moduleRef}).finally(()=>{o.remove(s)})})})}var EF;function dF(){EF=DY}function DY(t,e){let n=t.injector.get(bs);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>n.bootstrap(r));else if(t.instance.ngDoBootstrap)t.instance.ngDoBootstrap(n);else throw new J(-403,!1);e.push(t)}function RY(t,e,n){try{let r=n();return k_(r)?r.catch(i=>{throw e.runOutsideAngular(()=>t(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>t(r)),r}}var _F=(()=>{class t{_injector;_modules=[];_destroyListeners=[];_destroyed=!1;constructor(n){this._injector=n}bootstrapModuleFactory(n,r){let i=r?.scheduleInRootZone,o=()=>sk(r?.ngZone,Ee(B({},gD({eventCoalescing:r?.ngZoneEventCoalescing,runCoalescing:r?.ngZoneRunCoalescing})),{scheduleInRootZone:i})),s=r?.ignoreChangesOutsideZone,a=[oF({ngZoneFactory:o,ignoreChangesOutsideZone:s}),{provide:Lr,useExisting:mD},bP],c=i1(n.moduleType,this.injector,a);return dF(),CY({moduleRef:c,allPlatformModules:this._modules,platformInjector:this.injector})}bootstrapModule(n,r=[]){let i=oD({},r);return dF(),SY(this.injector,i,n).then(o=>this.bootstrapModuleFactory(o,i))}onDestroy(n){this._destroyListeners.push(n)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new J(404,!1);this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());let n=this._injector.get(V_,null);n&&(n.forEach(r=>r()),n.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static \u0275fac=function(r){return new(r||t)($(ze))};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})(),DD=null;function NY(t){if(ND())throw new J(400,!1);E1(),DD=t;let e=t.get(_F);return OY(t),e}function RD(t,e,n=[]){let r=`Platform: ${e}`,i=new z(r);return(o=[])=>{let s=ND();if(!s){let a=[...n,...o,{provide:i,useValue:!0}];s=t?.(a)??NY(wY(a,r))}return bY(i)}}function wY(t=[],e){return ze.create({name:e,providers:[{provide:uf,useValue:"platform"},{provide:V_,useValue:new Set([()=>DD=null])},...t]})}function bY(t){let e=ND();if(!e)throw new J(-401,!1);return e}function ND(){return DD?.get(_F)??null}function OY(t){let e=t.get(I_,null);bi(t,()=>{e?.forEach(n=>n())})}function wD(){return!1}var MY=(()=>{class t{static __NG_ELEMENT_ID__=LY}return t})();function LY(t){return PY($t(),ne(),(t&16)===16)}function PY(t,e,n){if(Do(t)&&!n){let r=kr(t.index,e);return new Rs(r,r)}else if(t.type&175){let r=e[wn];return new Rs(r,e)}return null}var TD=class{constructor(){}supports(e){return JC(e)}create(e){return new yD(e)}},xY=(t,e)=>e,yD=class{length=0;collection;_linkedRecords=null;_unlinkedRecords=null;_previousItHead=null;_itHead=null;_itTail=null;_additionsHead=null;_additionsTail=null;_movesHead=null;_movesTail=null;_removalsHead=null;_removalsTail=null;_identityChangesHead=null;_identityChangesTail=null;_trackByFn;constructor(e){this._trackByFn=e||xY}forEachItem(e){let n;for(n=this._itHead;n!==null;n=n._next)e(n)}forEachOperation(e){let n=this._itHead,r=this._removalsHead,i=0,o=null;for(;n||r;){let s=!r||n&&n.currentIndex<hF(r,i,o)?n:r,a=hF(s,i,o),c=s.currentIndex;if(s===r)i--,r=r._nextRemoved;else if(n=n._next,s.previousIndex==null)i++;else{o||(o=[]);let l=a-i,d=c-i;if(l!=d){for(let f=0;f<l;f++){let g=f<o.length?o[f]:o[f]=0,E=g+f;d<=E&&E<l&&(o[f]=g+1)}let h=s.previousIndex;o[h]=d-l}}a!==c&&e(s,a,c)}}forEachPreviousItem(e){let n;for(n=this._previousItHead;n!==null;n=n._nextPrevious)e(n)}forEachAddedItem(e){let n;for(n=this._additionsHead;n!==null;n=n._nextAdded)e(n)}forEachMovedItem(e){let n;for(n=this._movesHead;n!==null;n=n._nextMoved)e(n)}forEachRemovedItem(e){let n;for(n=this._removalsHead;n!==null;n=n._nextRemoved)e(n)}forEachIdentityChange(e){let n;for(n=this._identityChangesHead;n!==null;n=n._nextIdentityChange)e(n)}diff(e){if(e==null&&(e=[]),!JC(e))throw new J(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let n=this._itHead,r=!1,i,o,s;if(Array.isArray(e)){this.length=e.length;for(let a=0;a<this.length;a++)o=e[a],s=this._trackByFn(a,o),n===null||!Object.is(n.trackById,s)?(n=this._mismatch(n,o,s,a),r=!0):(r&&(n=this._verifyReinsertion(n,o,s,a)),Object.is(n.item,o)||this._addIdentityChange(n,o)),n=n._next}else i=0,Vk(e,a=>{s=this._trackByFn(i,a),n===null||!Object.is(n.trackById,s)?(n=this._mismatch(n,a,s,i),r=!0):(r&&(n=this._verifyReinsertion(n,a,s,i)),Object.is(n.item,a)||this._addIdentityChange(n,a)),n=n._next,i++}),this.length=i;return this._truncate(n),this.collection=e,this.isDirty}get isDirty(){return this._additionsHead!==null||this._movesHead!==null||this._removalsHead!==null||this._identityChangesHead!==null}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;e!==null;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;e!==null;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,n,r,i){let o;return e===null?o=this._itTail:(o=e._prev,this._remove(e)),e=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null),e!==null?(Object.is(e.item,n)||this._addIdentityChange(e,n),this._reinsertAfter(e,o,i)):(e=this._linkedRecords===null?null:this._linkedRecords.get(r,i),e!==null?(Object.is(e.item,n)||this._addIdentityChange(e,n),this._moveAfter(e,o,i)):e=this._addAfter(new ID(n,r),o,i)),e}_verifyReinsertion(e,n,r,i){let o=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null);return o!==null?e=this._reinsertAfter(o,e._prev,i):e.currentIndex!=i&&(e.currentIndex=i,this._addToMoves(e,i)),e}_truncate(e){for(;e!==null;){let n=e._next;this._addToRemovals(this._unlink(e)),e=n}this._unlinkedRecords!==null&&this._unlinkedRecords.clear(),this._additionsTail!==null&&(this._additionsTail._nextAdded=null),this._movesTail!==null&&(this._movesTail._nextMoved=null),this._itTail!==null&&(this._itTail._next=null),this._removalsTail!==null&&(this._removalsTail._nextRemoved=null),this._identityChangesTail!==null&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,n,r){this._unlinkedRecords!==null&&this._unlinkedRecords.remove(e);let i=e._prevRemoved,o=e._nextRemoved;return i===null?this._removalsHead=o:i._nextRemoved=o,o===null?this._removalsTail=i:o._prevRemoved=i,this._insertAfter(e,n,r),this._addToMoves(e,r),e}_moveAfter(e,n,r){return this._unlink(e),this._insertAfter(e,n,r),this._addToMoves(e,r),e}_addAfter(e,n,r){return this._insertAfter(e,n,r),this._additionsTail===null?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e}_insertAfter(e,n,r){let i=n===null?this._itHead:n._next;return e._next=i,e._prev=n,i===null?this._itTail=e:i._prev=e,n===null?this._itHead=e:n._next=e,this._linkedRecords===null&&(this._linkedRecords=new B_),this._linkedRecords.put(e),e.currentIndex=r,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){this._linkedRecords!==null&&this._linkedRecords.remove(e);let n=e._prev,r=e._next;return n===null?this._itHead=r:n._next=r,r===null?this._itTail=n:r._prev=n,e}_addToMoves(e,n){return e.previousIndex===n||(this._movesTail===null?this._movesTail=this._movesHead=e:this._movesTail=this._movesTail._nextMoved=e),e}_addToRemovals(e){return this._unlinkedRecords===null&&(this._unlinkedRecords=new B_),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,this._removalsTail===null?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,n){return e.item=n,this._identityChangesTail===null?this._identityChangesTail=this._identityChangesHead=e:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=e,e}},ID=class{item;trackById;currentIndex=null;previousIndex=null;_nextPrevious=null;_prev=null;_next=null;_prevDup=null;_nextDup=null;_prevRemoved=null;_nextRemoved=null;_nextAdded=null;_nextMoved=null;_nextIdentityChange=null;constructor(e,n){this.item=e,this.trackById=n}},vD=class{_head=null;_tail=null;add(e){this._head===null?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,n){let r;for(r=this._head;r!==null;r=r._nextDup)if((n===null||n<=r.currentIndex)&&Object.is(r.trackById,e))return r;return null}remove(e){let n=e._prevDup,r=e._nextDup;return n===null?this._head=r:n._nextDup=r,r===null?this._tail=n:r._prevDup=n,this._head===null}},B_=class{map=new Map;put(e){let n=e.trackById,r=this.map.get(n);r||(r=new vD,this.map.set(n,r)),r.add(e)}get(e,n){let r=e,i=this.map.get(r);return i?i.get(e,n):null}remove(e){let n=e.trackById;return this.map.get(n).remove(e)&&this.map.delete(n),e}get isEmpty(){return this.map.size===0}clear(){this.map.clear()}};function hF(t,e,n){let r=t.previousIndex;if(r===null)return r;let i=0;return n&&r<n.length&&(i=n[r]),r+e+i}var SD=class{constructor(){}supports(e){return e instanceof Map||P_(e)}create(){return new AD}},AD=class{_records=new Map;_mapHead=null;_appendAfter=null;_previousMapHead=null;_changesHead=null;_changesTail=null;_additionsHead=null;_additionsTail=null;_removalsHead=null;_removalsTail=null;get isDirty(){return this._additionsHead!==null||this._changesHead!==null||this._removalsHead!==null}forEachItem(e){let n;for(n=this._mapHead;n!==null;n=n._next)e(n)}forEachPreviousItem(e){let n;for(n=this._previousMapHead;n!==null;n=n._nextPrevious)e(n)}forEachChangedItem(e){let n;for(n=this._changesHead;n!==null;n=n._nextChanged)e(n)}forEachAddedItem(e){let n;for(n=this._additionsHead;n!==null;n=n._nextAdded)e(n)}forEachRemovedItem(e){let n;for(n=this._removalsHead;n!==null;n=n._nextRemoved)e(n)}diff(e){if(!e)e=new Map;else if(!(e instanceof Map||P_(e)))throw new J(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let n=this._mapHead;if(this._appendAfter=null,this._forEach(e,(r,i)=>{if(n&&n.key===i)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{let o=this._getOrCreateRecordForKey(i,r);n=this._insertBeforeOrAppend(n,o)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;r!==null;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,n){if(e){let r=e._prev;return n._next=e,n._prev=r,e._prev=n,r&&(r._next=n),e===this._mapHead&&(this._mapHead=n),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(e,n){if(this._records.has(e)){let i=this._records.get(e);this._maybeAddToChanges(i,n);let o=i._prev,s=i._next;return o&&(o._next=s),s&&(s._prev=o),i._next=null,i._prev=null,i}let r=new CD(e);return this._records.set(e,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;e!==null;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;e!=null;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,n){Object.is(n,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=n,this._addToChanges(e))}_addToAdditions(e){this._additionsHead===null?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){this._changesHead===null?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,n){e instanceof Map?e.forEach(n):Object.keys(e).forEach(r=>n(e[r],r))}},CD=class{key;previousValue=null;currentValue=null;_nextPrevious=null;_next=null;_prev=null;_nextAdded=null;_nextRemoved=null;_nextChanged=null;constructor(e){this.key=e}};function fF(){return new bD([new TD])}var bD=(()=>{class t{factories;static \u0275prov=Q({token:t,providedIn:"root",factory:fF});constructor(n){this.factories=n}static create(n,r){if(r!=null){let i=r.factories.slice();n=n.concat(i)}return new t(n)}static extend(n){return{provide:t,useFactory:()=>{let r=Y(t,{optional:!0,skipSelf:!0});return t.create(n,r||fF())}}}find(n){let r=this.factories.find(i=>i.supports(n));if(r!=null)return r;throw new J(901,!1)}}return t})();function pF(){return new G_([new SD])}var G_=(()=>{class t{static \u0275prov=Q({token:t,providedIn:"root",factory:pF});factories;constructor(n){this.factories=n}static create(n,r){if(r){let i=r.factories.slice();n=n.concat(i)}return new t(n)}static extend(n){return{provide:t,useFactory:()=>{let r=Y(t,{optional:!0,skipSelf:!0});return t.create(n,r||pF())}}}find(n){let r=this.factories.find(i=>i.supports(n));if(r)return r;throw new J(901,!1)}}return t})();var TF=RD(null,"core",[]),yF=(()=>{class t{constructor(n){}static \u0275fac=function(r){return new(r||t)($(bs))};static \u0275mod=ws({type:t});static \u0275inj=So({})}return t})();function BSe(t){return typeof t=="boolean"?t:t!=null&&t!=="false"}function GSe(t,e=NaN){return!isNaN(parseFloat(t))&&!isNaN(Number(t))?Number(t):e}function jSe(t,e){let n=Is(t),r=e.elementInjector||Su();return new Bu(n).create(r,e.projectableNodes,e.hostElement,e.environmentInjector,e.directives,e.bindings)}var SF=null;function $i(){return SF}function OD(t){SF??=t}var Gf=class{},MD=(()=>{class t{historyGo(n){throw new Error("")}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:()=>Y(AF),providedIn:"platform"})}return t})();var AF=(()=>{class t extends MD{_location;_history;_doc=Y(on);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return $i().getBaseHref(this._doc)}onPopState(n){let r=$i().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",n,!1),()=>r.removeEventListener("popstate",n)}onHashChange(n){let r=$i().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",n,!1),()=>r.removeEventListener("hashchange",n)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(n){this._location.pathname=n}pushState(n,r,i){this._history.pushState(n,r,i)}replaceState(n,r,i){this._history.replaceState(n,r,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(n=0){this._history.go(n)}getState(){return this._history.state}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:()=>new t,providedIn:"platform"})}return t})();function CF(t,e){return t?e?t.endsWith("/")?e.startsWith("/")?t+e.slice(1):t+e:e.startsWith("/")?t+e:`${t}/${e}`:t:e}function IF(t){let e=t.search(/#|\?|$/);return t[e-1]==="/"?t.slice(0,e-1)+t.slice(e):t}function Os(t){return t&&t[0]!=="?"?`?${t}`:t}var j_=(()=>{class t{historyGo(n){throw new Error("")}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:()=>Y(RF),providedIn:"root"})}return t})(),DF=new z(""),RF=(()=>{class t extends j_{_platformLocation;_baseHref;_removeListenerFns=[];constructor(n,r){super(),this._platformLocation=n,this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??Y(on).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}prepareExternalUrl(n){return CF(this._baseHref,n)}path(n=!1){let r=this._platformLocation.pathname+Os(this._platformLocation.search),i=this._platformLocation.hash;return i&&n?`${r}${i}`:r}pushState(n,r,i,o){let s=this.prepareExternalUrl(i+Os(o));this._platformLocation.pushState(n,r,s)}replaceState(n,r,i,o){let s=this.prepareExternalUrl(i+Os(o));this._platformLocation.replaceState(n,r,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}static \u0275fac=function(r){return new(r||t)($(MD),$(DF,8))};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),NF=(()=>{class t{_subject=new Rt;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(n){this._locationStrategy=n;let r=this._locationStrategy.getBaseHref();this._basePath=UY(IF(vF(r))),this._locationStrategy.onPopState(i=>{this._subject.next({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(n=!1){return this.normalize(this._locationStrategy.path(n))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(n,r=""){return this.path()==this.normalize(n+Os(r))}normalize(n){return t.stripTrailingSlash(FY(this._basePath,vF(n)))}prepareExternalUrl(n){return n&&n[0]!=="/"&&(n="/"+n),this._locationStrategy.prepareExternalUrl(n)}go(n,r="",i=null){this._locationStrategy.pushState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+Os(r)),i)}replaceState(n,r="",i=null){this._locationStrategy.replaceState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+Os(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(n=0){this._locationStrategy.historyGo?.(n)}onUrlChange(n){return this._urlChangeListeners.push(n),this._urlChangeSubscription??=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}),()=>{let r=this._urlChangeListeners.indexOf(n);this._urlChangeListeners.splice(r,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(n="",r){this._urlChangeListeners.forEach(i=>i(n,r))}subscribe(n,r,i){return this._subject.subscribe({next:n,error:r??void 0,complete:i??void 0})}static normalizeQueryParams=Os;static joinWithSlash=CF;static stripTrailingSlash=IF;static \u0275fac=function(r){return new(r||t)($(j_))};static \u0275prov=Q({token:t,factory:()=>kY(),providedIn:"root"})}return t})();function kY(){return new NF($(j_))}function FY(t,e){if(!t||!e.startsWith(t))return e;let n=e.substring(t.length);return n===""||["/",";","?","#"].includes(n[0])?n:e}function vF(t){return t.replace(/\/index.html$/,"")}function UY(t){if(new RegExp("^(https?:)?//").test(t)){let[,n]=t.split(/\/\/[^\/]+/);return n}return t}var bn=(function(t){return t[t.Format=0]="Format",t[t.Standalone=1]="Standalone",t})(bn||{}),tt=(function(t){return t[t.Narrow=0]="Narrow",t[t.Abbreviated=1]="Abbreviated",t[t.Wide=2]="Wide",t[t.Short=3]="Short",t})(tt||{}),Qn=(function(t){return t[t.Short=0]="Short",t[t.Medium=1]="Medium",t[t.Long=2]="Long",t[t.Full=3]="Full",t})(Qn||{}),xo={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function PF(t){return mr(t)[Ot.LocaleId]}function xF(t,e,n){let r=mr(t),i=[r[Ot.DayPeriodsFormat],r[Ot.DayPeriodsStandalone]],o=Fr(i,e);return Fr(o,n)}function kF(t,e,n){let r=mr(t),i=[r[Ot.DaysFormat],r[Ot.DaysStandalone]],o=Fr(i,e);return Fr(o,n)}function FF(t,e,n){let r=mr(t),i=[r[Ot.MonthsFormat],r[Ot.MonthsStandalone]],o=Fr(i,e);return Fr(o,n)}function UF(t,e){let r=mr(t)[Ot.Eras];return Fr(r,e)}function jf(t,e){let n=mr(t);return Fr(n[Ot.DateFormat],e)}function Hf(t,e){let n=mr(t);return Fr(n[Ot.TimeFormat],e)}function $f(t,e){let r=mr(t)[Ot.DateTimeFormat];return Fr(r,e)}function Wf(t,e){let n=mr(t),r=n[Ot.NumberSymbols][e];if(typeof r>"u"){if(e===xo.CurrencyDecimal)return n[Ot.NumberSymbols][xo.Decimal];if(e===xo.CurrencyGroup)return n[Ot.NumberSymbols][xo.Group]}return r}function VF(t){if(!t[Ot.ExtraData])throw new J(2303,!1)}function BF(t){let e=mr(t);return VF(e),(e[Ot.ExtraData][2]||[]).map(r=>typeof r=="string"?LD(r):[LD(r[0]),LD(r[1])])}function GF(t,e,n){let r=mr(t);VF(r);let i=[r[Ot.ExtraData][0],r[Ot.ExtraData][1]],o=Fr(i,e)||[];return Fr(o,n)||[]}function Fr(t,e){for(let n=e;n>-1;n--)if(typeof t[n]<"u")return t[n];throw new J(2304,!1)}function LD(t){let[e,n]=t.split(":");return{hours:+e,minutes:+n}}var VY=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,H_={},BY=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,GY=256;function jF(t,e,n,r){let i=QY(t);jY(e),e=Po(n,e)||e;let s=[],a;for(;e;)if(a=BY.exec(e),a){s=s.concat(a.slice(1));let d=s.pop();if(!d)break;e=d}else{s.push(e);break}let c=i.getTimezoneOffset();r&&(c=$F(r,c),i=XY(i,r));let l="";return s.forEach(d=>{let h=KY(d);l+=h?h(i,n,c):d==="''"?"'":d.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}function jY(t){if(t.length>GY)throw new J(2300,!1)}function K_(t,e,n){let r=new Date(0);return r.setFullYear(t,e,n),r.setHours(0,0,0),r}function Po(t,e){let n=PF(t);if(H_[n]??={},H_[n][e])return H_[n][e];let r="";switch(e){case"shortDate":r=jf(t,Qn.Short);break;case"mediumDate":r=jf(t,Qn.Medium);break;case"longDate":r=jf(t,Qn.Long);break;case"fullDate":r=jf(t,Qn.Full);break;case"shortTime":r=Hf(t,Qn.Short);break;case"mediumTime":r=Hf(t,Qn.Medium);break;case"longTime":r=Hf(t,Qn.Long);break;case"fullTime":r=Hf(t,Qn.Full);break;case"short":let i=Po(t,"shortTime"),o=Po(t,"shortDate");r=$_($f(t,Qn.Short),[i,o]);break;case"medium":let s=Po(t,"mediumTime"),a=Po(t,"mediumDate");r=$_($f(t,Qn.Medium),[s,a]);break;case"long":let c=Po(t,"longTime"),l=Po(t,"longDate");r=$_($f(t,Qn.Long),[c,l]);break;case"full":let d=Po(t,"fullTime"),h=Po(t,"fullDate");r=$_($f(t,Qn.Full),[d,h]);break}return r&&(H_[n][e]=r),r}function $_(t,e){return e&&(t=t.replace(/\{([^}]+)}/g,function(n,r){return e!=null&&r in e?e[r]:n})),t}function ri(t,e,n="-",r,i){let o="";(t<0||i&&t<=0)&&(i?t=-t+1:(t=-t,o=n));let s=String(t);for(;s.length<e;)s="0"+s;return r&&(s=s.slice(s.length-e)),o+s}function HY(t,e){return ri(t,3).substring(0,e)}function Pt(t,e,n=0,r=!1,i=!1){return function(o,s){let a=$Y(t,o);if((n>0||a>-n)&&(a+=n),t===3)a===0&&n===-12&&(a=12);else if(t===6)return HY(a,e);let c=Wf(s,xo.MinusSign);return ri(a,e,c,r,i)}}function $Y(t,e){switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate();case 3:return e.getHours();case 4:return e.getMinutes();case 5:return e.getSeconds();case 6:return e.getMilliseconds();case 7:return e.getDay();default:throw new J(2301,!1)}}function ut(t,e,n=bn.Format,r=!1){return function(i,o){return WY(i,o,t,e,n,r)}}function WY(t,e,n,r,i,o){switch(n){case 2:return FF(e,i,r)[t.getMonth()];case 1:return kF(e,i,r)[t.getDay()];case 0:let s=t.getHours(),a=t.getMinutes();if(o){let l=BF(e),d=GF(e,i,r),h=l.findIndex(f=>{if(Array.isArray(f)){let[g,E]=f,I=s>=g.hours&&a>=g.minutes,S=s<E.hours||s===E.hours&&a<E.minutes;if(g.hours<E.hours){if(I&&S)return!0}else if(I||S)return!0}else if(f.hours===s&&f.minutes===a)return!0;return!1});if(h!==-1)return d[h]}return xF(e,i,r)[s<12?0:1];case 3:return UF(e,r)[t.getFullYear()<=0?0:1];default:let c=n;throw new J(2302,!1)}}function W_(t){return function(e,n,r){let i=-1*r,o=Wf(n,xo.MinusSign),s=i>0?Math.floor(i/60):Math.ceil(i/60);switch(t){case 0:return(i>=0?"+":"")+ri(s,2,o)+ri(Math.abs(i%60),2,o);case 1:return"GMT"+(i>=0?"+":"")+ri(s,1,o);case 2:return"GMT"+(i>=0?"+":"")+ri(s,2,o)+":"+ri(Math.abs(i%60),2,o);case 3:return r===0?"Z":(i>=0?"+":"")+ri(s,2,o)+":"+ri(Math.abs(i%60),2,o);default:throw new J(2310,!1)}}}var zY=0,q_=4;function qY(t){let e=K_(t,zY,1).getDay();return K_(t,0,1+(e<=q_?q_:q_+7)-e)}function HF(t){let e=t.getDay(),n=e===0?-3:q_-e;return K_(t.getFullYear(),t.getMonth(),t.getDate()+n)}function PD(t,e=!1){return function(n,r){let i;if(e){let o=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,s=n.getDate();i=1+Math.floor((s+o)/7)}else{let o=HF(n),s=qY(o.getFullYear()),a=o.getTime()-s.getTime();i=1+Math.round(a/6048e5)}return ri(i,t,Wf(r,xo.MinusSign))}}function z_(t,e=!1){return function(n,r){let o=HF(n).getFullYear();return ri(o,t,Wf(r,xo.MinusSign),e)}}var xD={};function KY(t){if(xD[t])return xD[t];let e;switch(t){case"G":case"GG":case"GGG":e=ut(3,tt.Abbreviated);break;case"GGGG":e=ut(3,tt.Wide);break;case"GGGGG":e=ut(3,tt.Narrow);break;case"y":e=Pt(0,1,0,!1,!0);break;case"yy":e=Pt(0,2,0,!0,!0);break;case"yyy":e=Pt(0,3,0,!1,!0);break;case"yyyy":e=Pt(0,4,0,!1,!0);break;case"Y":e=z_(1);break;case"YY":e=z_(2,!0);break;case"YYY":e=z_(3);break;case"YYYY":e=z_(4);break;case"M":case"L":e=Pt(1,1,1);break;case"MM":case"LL":e=Pt(1,2,1);break;case"MMM":e=ut(2,tt.Abbreviated);break;case"MMMM":e=ut(2,tt.Wide);break;case"MMMMM":e=ut(2,tt.Narrow);break;case"LLL":e=ut(2,tt.Abbreviated,bn.Standalone);break;case"LLLL":e=ut(2,tt.Wide,bn.Standalone);break;case"LLLLL":e=ut(2,tt.Narrow,bn.Standalone);break;case"w":e=PD(1);break;case"ww":e=PD(2);break;case"W":e=PD(1,!0);break;case"d":e=Pt(2,1);break;case"dd":e=Pt(2,2);break;case"c":case"cc":e=Pt(7,1);break;case"ccc":e=ut(1,tt.Abbreviated,bn.Standalone);break;case"cccc":e=ut(1,tt.Wide,bn.Standalone);break;case"ccccc":e=ut(1,tt.Narrow,bn.Standalone);break;case"cccccc":e=ut(1,tt.Short,bn.Standalone);break;case"E":case"EE":case"EEE":e=ut(1,tt.Abbreviated);break;case"EEEE":e=ut(1,tt.Wide);break;case"EEEEE":e=ut(1,tt.Narrow);break;case"EEEEEE":e=ut(1,tt.Short);break;case"a":case"aa":case"aaa":e=ut(0,tt.Abbreviated);break;case"aaaa":e=ut(0,tt.Wide);break;case"aaaaa":e=ut(0,tt.Narrow);break;case"b":case"bb":case"bbb":e=ut(0,tt.Abbreviated,bn.Standalone,!0);break;case"bbbb":e=ut(0,tt.Wide,bn.Standalone,!0);break;case"bbbbb":e=ut(0,tt.Narrow,bn.Standalone,!0);break;case"B":case"BB":case"BBB":e=ut(0,tt.Abbreviated,bn.Format,!0);break;case"BBBB":e=ut(0,tt.Wide,bn.Format,!0);break;case"BBBBB":e=ut(0,tt.Narrow,bn.Format,!0);break;case"h":e=Pt(3,1,-12);break;case"hh":e=Pt(3,2,-12);break;case"H":e=Pt(3,1);break;case"HH":e=Pt(3,2);break;case"m":e=Pt(4,1);break;case"mm":e=Pt(4,2);break;case"s":e=Pt(5,1);break;case"ss":e=Pt(5,2);break;case"S":e=Pt(6,1);break;case"SS":e=Pt(6,2);break;case"SSS":e=Pt(6,3);break;case"Z":case"ZZ":case"ZZZ":e=W_(0);break;case"ZZZZZ":e=W_(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":e=W_(1);break;case"OOOO":case"ZZZZ":case"zzzz":e=W_(2);break;default:return null}return xD[t]=e,e}function $F(t,e){t=t.replace(/:/g,"");let n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(n)?e:n}function YY(t,e){return t=new Date(t.getTime()),t.setMinutes(t.getMinutes()+e),t}function XY(t,e,n){let i=t.getTimezoneOffset(),o=$F(e,i);return YY(t,-1*(o-i))}function QY(t){if(wF(t))return t;if(typeof t=="number"&&!isNaN(t))return new Date(t);if(typeof t=="string"){if(t=t.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(t)){let[i,o=1,s=1]=t.split("-").map(a=>+a);return K_(i,o-1,s)}let n=parseFloat(t);if(!isNaN(t-n))return new Date(n);let r;if(r=t.match(VY))return JY(r)}let e=new Date(t);if(!wF(e))throw new J(2311,!1);return e}function JY(t){let e=new Date(0),n=0,r=0,i=t[8]?e.setUTCFullYear:e.setFullYear,o=t[8]?e.setUTCHours:e.setHours;t[9]&&(n=Number(t[9]+t[10]),r=Number(t[9]+t[11])),i.call(e,Number(t[1]),Number(t[2])-1,Number(t[3]));let s=Number(t[4]||0)-n,a=Number(t[5]||0)-r,c=Number(t[6]||0),l=Math.floor(parseFloat("0."+(t[7]||0))*1e3);return o.call(e,s,a,c,l),e}function wF(t){return t instanceof Date&&!isNaN(t.valueOf())}var kD=/\s+/,bF=[],ZY=(()=>{class t{_ngEl;_renderer;initialClasses=bF;rawClass;stateMap=new Map;constructor(n,r){this._ngEl=n,this._renderer=r}set klass(n){this.initialClasses=n!=null?n.trim().split(kD):bF}set ngClass(n){this.rawClass=typeof n=="string"?n.trim().split(kD):n}ngDoCheck(){for(let r of this.initialClasses)this._updateState(r,!0);let n=this.rawClass;if(Array.isArray(n)||n instanceof Set)for(let r of n)this._updateState(r,!0);else if(n!=null)for(let r of Object.keys(n))this._updateState(r,!!n[r]);this._applyStateDiff()}_updateState(n,r){let i=this.stateMap.get(n);i!==void 0?(i.enabled!==r&&(i.changed=!0,i.enabled=r),i.touched=!0):this.stateMap.set(n,{enabled:r,changed:!0,touched:!0})}_applyStateDiff(){for(let n of this.stateMap){let r=n[0],i=n[1];i.changed?(this._toggleClass(r,i.enabled),i.changed=!1):i.touched||(i.enabled&&this._toggleClass(r,!1),this.stateMap.delete(r)),i.touched=!1}}_toggleClass(n,r){n=n.trim(),n.length>0&&n.split(kD).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}static \u0275fac=function(r){return new(r||t)(st(Ns),st(L_))};static \u0275dir=Hi({type:t,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return t})();var Y_=class{$implicit;ngForOf;index;count;constructor(e,n,r,i){this.$implicit=e,this.ngForOf=n,this.index=r,this.count=i}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},WF=(()=>{class t{_viewContainer;_template;_differs;set ngForOf(n){this._ngForOf=n,this._ngForOfDirty=!0}set ngForTrackBy(n){this._trackByFn=n}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(n,r,i){this._viewContainer=n,this._template=r,this._differs=i}set ngForTemplate(n){n&&(this._template=n)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let n=this._ngForOf;!this._differ&&n&&(this._differ=this._differs.find(n).create(this.ngForTrackBy))}if(this._differ){let n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}}_applyChanges(n){let r=this._viewContainer;n.forEachOperation((i,o,s)=>{if(i.previousIndex==null)r.createEmbeddedView(this._template,new Y_(i.item,this._ngForOf,-1,-1),s===null?void 0:s);else if(s==null)r.remove(o===null?void 0:o);else if(o!==null){let a=r.get(o);r.move(a,s),OF(a,i)}});for(let i=0,o=r.length;i<o;i++){let a=r.get(i).context;a.index=i,a.count=o,a.ngForOf=this._ngForOf}n.forEachIdentityChange(i=>{let o=r.get(i.currentIndex);OF(o,i)})}static ngTemplateContextGuard(n,r){return!0}static \u0275fac=function(r){return new(r||t)(st(ji),st(Vi),st(bD))};static \u0275dir=Hi({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return t})();function OF(t,e){t.context.$implicit=e.item}var e7=(()=>{class t{_viewContainer;_context=new X_;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(n,r){this._viewContainer=n,this._thenTemplateRef=r}set ngIf(n){this._context.$implicit=this._context.ngIf=n,this._updateView()}set ngIfThen(n){MF(n,!1),this._thenTemplateRef=n,this._thenViewRef=null,this._updateView()}set ngIfElse(n){MF(n,!1),this._elseTemplateRef=n,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(n,r){return!0}static \u0275fac=function(r){return new(r||t)(st(ji),st(Vi))};static \u0275dir=Hi({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return t})(),X_=class{$implicit=null;ngIf=null};function MF(t,e){if(t&&!t.createEmbeddedView)throw new J(2020,!1)}var Q_=class{_viewContainerRef;_templateRef;_created=!1;constructor(e,n){this._viewContainerRef=e,this._templateRef=n}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}},FD=(()=>{class t{_defaultViews=[];_defaultUsed=!1;_caseCount=0;_lastCaseCheckIndex=0;_lastCasesMatched=!1;_ngSwitch;set ngSwitch(n){this._ngSwitch=n,this._caseCount===0&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(n){this._defaultViews.push(n)}_matchCase(n){let r=n===this._ngSwitch;return this._lastCasesMatched||=r,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),r}_updateDefaultCases(n){if(this._defaultViews.length>0&&n!==this._defaultUsed){this._defaultUsed=n;for(let r of this._defaultViews)r.enforceState(n)}}static \u0275fac=function(r){return new(r||t)};static \u0275dir=Hi({type:t,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}})}return t})(),t7=(()=>{class t{ngSwitch;_view;ngSwitchCase;constructor(n,r,i){this.ngSwitch=i,i._addCase(),this._view=new Q_(n,r)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}static \u0275fac=function(r){return new(r||t)(st(ji),st(Vi),st(FD,9))};static \u0275dir=Hi({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}})}return t})(),n7=(()=>{class t{constructor(n,r,i){i._addDefault(new Q_(n,r))}static \u0275fac=function(r){return new(r||t)(st(ji),st(Vi),st(FD,9))};static \u0275dir=Hi({type:t,selectors:[["","ngSwitchDefault",""]]})}return t})();var r7=(()=>{class t{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(n,r,i){this._ngEl=n,this._differs=r,this._renderer=i}set ngStyle(n){this._ngStyle=n,!this._differ&&n&&(this._differ=this._differs.find(n).create())}ngDoCheck(){if(this._differ){let n=this._differ.diff(this._ngStyle);n&&this._applyChanges(n)}}_setStyle(n,r){let[i,o]=n.split("."),s=i.indexOf("-")===-1?void 0:ni.DashCase;r!=null?this._renderer.setStyle(this._ngEl.nativeElement,i,o?`${r}${o}`:r,s):this._renderer.removeStyle(this._ngEl.nativeElement,i,s)}_applyChanges(n){n.forEachRemovedItem(r=>this._setStyle(r.key,null)),n.forEachAddedItem(r=>this._setStyle(r.key,r.currentValue)),n.forEachChangedItem(r=>this._setStyle(r.key,r.currentValue))}static \u0275fac=function(r){return new(r||t)(st(Ns),st(G_),st(L_))};static \u0275dir=Hi({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return t})(),i7=(()=>{class t{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;constructor(n){this._viewContainerRef=n}ngOnChanges(n){if(this._shouldRecreateView(n)){let r=this._viewContainerRef;if(this._viewRef&&r.remove(r.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let i=this._createContextForwardProxy();this._viewRef=r.createEmbeddedView(this.ngTemplateOutlet,i,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(n){return!!n.ngTemplateOutlet||!!n.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(n,r,i)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,r,i):!1,get:(n,r,i)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,r,i)}})}static \u0275fac=function(r){return new(r||t)(st(ji))};static \u0275dir=Hi({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[vC]})}return t})();function zF(t,e){return new J(2100,!1)}var o7=/(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g,s7=(()=>{class t{transform(n){if(n==null)return null;if(typeof n!="string")throw zF(t,n);return n.replace(o7,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}static \u0275fac=function(r){return new(r||t)};static \u0275pipe=Mf({name:"titlecase",type:t,pure:!0})}return t})();var a7="mediumDate",qF=new z(""),KF=new z(""),c7=(()=>{class t{locale;defaultTimezone;defaultOptions;constructor(n,r,i){this.locale=n,this.defaultTimezone=r,this.defaultOptions=i}transform(n,r,i,o){if(n==null||n===""||n!==n)return null;try{let s=r??this.defaultOptions?.dateFormat??a7,a=i??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return jF(n,s,o||this.locale,a)}catch(s){throw zF(t,s.message)}}static \u0275fac=function(r){return new(r||t)(st(Ff,16),st(qF,24),st(KF,24))};static \u0275pipe=Mf({name:"date",type:t,pure:!0})}return t})();function l7(t,e){return{key:t,value:e}}var u7=(()=>{class t{differs;constructor(n){this.differs=n}differ;keyValues=[];compareFn=LF;transform(n,r=LF){if(!n||!(n instanceof Map)&&typeof n!="object")return null;this.differ??=this.differs.find(n).create();let i=this.differ.diff(n),o=r!==this.compareFn;return i&&(this.keyValues=[],i.forEachItem(s=>{this.keyValues.push(l7(s.key,s.currentValue))})),(i||o)&&(r&&this.keyValues.sort(r),this.compareFn=r),this.keyValues}static \u0275fac=function(r){return new(r||t)(st(G_,16))};static \u0275pipe=Mf({name:"keyvalue",type:t,pure:!1})}return t})();function LF(t,e){let n=t.key,r=e.key;if(n===r)return 0;if(n==null)return 1;if(r==null)return-1;if(typeof n=="string"&&typeof r=="string")return n<r?-1:1;if(typeof n=="number"&&typeof r=="number")return n-r;if(typeof n=="boolean"&&typeof r=="boolean")return n<r?-1:1;let i=String(n),o=String(r);return i==o?0:i<o?-1:1}var UD=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=ws({type:t});static \u0275inj=So({})}return t})();function zf(t,e){e=encodeURIComponent(e);for(let n of t.split(";")){let r=n.indexOf("="),[i,o]=r==-1?[n,""]:[n.slice(0,r),n.slice(r+1)];if(i.trim()===e)return decodeURIComponent(o)}return null}var Dc=class{};var VD="browser";function YF(t){return t===VD}var qf=class{_doc;constructor(e){this._doc=e}manager},Kf=(()=>{class t extends qf{constructor(n){super(n)}supports(n){return!0}addEventListener(n,r,i,o){return n.addEventListener(r,i,o),()=>this.removeEventListener(n,r,i,o)}removeEventListener(n,r,i,o){return n.removeEventListener(r,i,o)}static \u0275fac=function(r){return new(r||t)($(on))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),Z_=new z(""),eT=(()=>{class t{_zone;_plugins;_eventNameToPlugin=new Map;constructor(n,r){this._zone=r,n.forEach(s=>{s.manager=this});let i=n.filter(s=>!(s instanceof Kf));this._plugins=i.slice().reverse();let o=n.find(s=>s instanceof Kf);o&&this._plugins.push(o)}addEventListener(n,r,i,o){return this._findPluginFor(r).addEventListener(n,r,i,o)}getZone(){return this._zone}_findPluginFor(n){let r=this._eventNameToPlugin.get(n);if(r)return r;if(r=this._plugins.find(o=>o.supports(n)),!r)throw new J(5101,!1);return this._eventNameToPlugin.set(n,r),r}static \u0275fac=function(r){return new(r||t)($(Z_),$(Ae))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),BD="ng-app-id";function XF(t){for(let e of t)e.remove()}function QF(t,e){let n=e.createElement("style");return n.textContent=t,n}function d7(t,e,n,r){let i=t.head?.querySelectorAll(`style[${BD}="${e}"],link[${BD}="${e}"]`);if(i)for(let o of i)o.removeAttribute(BD),o instanceof HTMLLinkElement?r.set(o.href.slice(o.href.lastIndexOf("/")+1),{usage:0,elements:[o]}):o.textContent&&n.set(o.textContent,{usage:0,elements:[o]})}function jD(t,e){let n=e.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),n}var tT=(()=>{class t{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(n,r,i,o={}){this.doc=n,this.appId=r,this.nonce=i,d7(n,r,this.inline,this.external),this.hosts.add(n.head)}addStyles(n,r){for(let i of n)this.addUsage(i,this.inline,QF);r?.forEach(i=>this.addUsage(i,this.external,jD))}removeStyles(n,r){for(let i of n)this.removeUsage(i,this.inline);r?.forEach(i=>this.removeUsage(i,this.external))}addUsage(n,r,i){let o=r.get(n);o?o.usage++:r.set(n,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,i(n,this.doc)))})}removeUsage(n,r){let i=r.get(n);i&&(i.usage--,i.usage<=0&&(XF(i.elements),r.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])XF(n);this.hosts.clear()}addHost(n){this.hosts.add(n);for(let[r,{elements:i}]of this.inline)i.push(this.addElement(n,QF(r,this.doc)));for(let[r,{elements:i}]of this.external)i.push(this.addElement(n,jD(r,this.doc)))}removeHost(n){this.hosts.delete(n)}addElement(n,r){return this.nonce&&r.setAttribute("nonce",this.nonce),n.appendChild(r)}static \u0275fac=function(r){return new(r||t)($(on),$(y_),$(qu,8),$(Oo))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),GD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},$D=/%COMP%/g;var ZF="%COMP%",h7=`_nghost-${ZF}`,f7=`_ngcontent-${ZF}`,p7=!0,eU=new z("",{providedIn:"root",factory:()=>p7});function g7(t){return f7.replace($D,t)}function m7(t){return h7.replace($D,t)}function tU(t,e){return e.map(n=>n.replace($D,t))}var nT=(()=>{class t{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(n,r,i,o,s,a,c=null,l=null){this.eventManager=n,this.sharedStylesHost=r,this.appId=i,this.removeStylesOnCompDestroy=o,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.platformIsServer=!1,this.defaultRenderer=new Yf(n,s,a,this.platformIsServer,this.tracingService)}createRenderer(n,r){if(!n||!r)return this.defaultRenderer;let i=this.getOrCreateRenderer(n,r);return i instanceof J_?i.applyToHost(n):i instanceof Xf&&i.applyStyles(),i}getOrCreateRenderer(n,r){let i=this.rendererByCompId,o=i.get(r.id);if(!o){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,h=this.platformIsServer,f=this.tracingService;switch(r.encapsulation){case No.Emulated:o=new J_(c,l,r,this.appId,d,s,a,h,f);break;case No.ShadowDom:return new HD(c,l,n,r,s,a,this.nonce,h,f);default:o=new Xf(c,l,r,d,s,a,h,f);break}i.set(r.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(n){this.rendererByCompId.delete(n)}static \u0275fac=function(r){return new(r||t)($(eT),$(tT),$(y_),$(eU),$(on),$(Ae),$(qu),$(Ac,8))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),Yf=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,n,r,i,o){this.eventManager=e,this.doc=n,this.ngZone=r,this.platformIsServer=i,this.tracingService=o}destroy(){}destroyNode=null;createElement(e,n){return n?this.doc.createElementNS(GD[n]||n,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,n){(JF(e)?e.content:e).appendChild(n)}insertBefore(e,n,r){e&&(JF(e)?e.content:e).insertBefore(n,r)}removeChild(e,n){n.remove()}selectRootElement(e,n){let r=typeof e=="string"?this.doc.querySelector(e):e;if(!r)throw new J(-5104,!1);return n||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,n,r,i){if(i){n=i+":"+n;let o=GD[i];o?e.setAttributeNS(o,n,r):e.setAttribute(n,r)}else e.setAttribute(n,r)}removeAttribute(e,n,r){if(r){let i=GD[r];i?e.removeAttributeNS(i,n):e.removeAttribute(`${r}:${n}`)}else e.removeAttribute(n)}addClass(e,n){e.classList.add(n)}removeClass(e,n){e.classList.remove(n)}setStyle(e,n,r,i){i&(ni.DashCase|ni.Important)?e.style.setProperty(n,r,i&ni.Important?"important":""):e.style[n]=r}removeStyle(e,n,r){r&ni.DashCase?e.style.removeProperty(n):e.style[n]=""}setProperty(e,n,r){e!=null&&(e[n]=r)}setValue(e,n){e.nodeValue=n}listen(e,n,r,i){if(typeof e=="string"&&(e=$i().getGlobalEventTarget(this.doc,e),!e))throw new J(5102,!1);let o=this.decoratePreventDefault(r);return this.tracingService?.wrapEventListener&&(o=this.tracingService.wrapEventListener(e,n,o)),this.eventManager.addEventListener(e,n,o,i)}decoratePreventDefault(e){return n=>{if(n==="__ngUnwrap__")return e;e(n)===!1&&n.preventDefault()}}};function JF(t){return t.tagName==="TEMPLATE"&&t.content!==void 0}var HD=class extends Yf{sharedStylesHost;hostEl;shadowRoot;constructor(e,n,r,i,o,s,a,c,l){super(e,o,s,c,l),this.sharedStylesHost=n,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let d=i.styles;d=tU(i.id,d);for(let f of d){let g=document.createElement("style");a&&g.setAttribute("nonce",a),g.textContent=f,this.shadowRoot.appendChild(g)}let h=i.getExternalStyles?.();if(h)for(let f of h){let g=jD(f,o);a&&g.setAttribute("nonce",a),this.shadowRoot.appendChild(g)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,n){return super.appendChild(this.nodeOrShadowRoot(e),n)}insertBefore(e,n,r){return super.insertBefore(this.nodeOrShadowRoot(e),n,r)}removeChild(e,n){return super.removeChild(null,n)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},Xf=class extends Yf{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,n,r,i,o,s,a,c,l){super(e,o,s,a,c),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=i;let d=r.styles;this.styles=l?tU(l,d):d,this.styleUrls=r.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&Ic.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},J_=class extends Xf{contentAttr;hostAttr;constructor(e,n,r,i,o,s,a,c,l){let d=i+"-"+r.id;super(e,n,r,o,s,a,c,l,d),this.contentAttr=g7(d),this.hostAttr=m7(d)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,n){let r=super.createElement(e,n);return super.setAttribute(r,this.contentAttr,""),r}};var rT=class t extends Gf{supportsDOMEvents=!0;static makeCurrent(){OD(new t)}onAndCancel(e,n,r,i){return e.addEventListener(n,r,i),()=>{e.removeEventListener(n,r,i)}}dispatchEvent(e,n){e.dispatchEvent(n)}remove(e){e.remove()}createElement(e,n){return n=n||this.getDefaultDocument(),n.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,n){return n==="window"?window:n==="document"?e:n==="body"?e.body:null}getBaseHref(e){let n=E7();return n==null?null:_7(n)}resetBaseElement(){Qf=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return zf(document.cookie,e)}},Qf=null;function E7(){return Qf=Qf||document.head.querySelector("base"),Qf?Qf.getAttribute("href"):null}function _7(t){return new URL(t,document.baseURI).pathname}var iT=class{addToWindow(e){Lt.getAngularTestability=(r,i=!0)=>{let o=e.findTestabilityInTree(r,i);if(o==null)throw new J(5103,!1);return o},Lt.getAllAngularTestabilities=()=>e.getAllTestabilities(),Lt.getAllAngularRootElements=()=>e.getAllRootElements();let n=r=>{let i=Lt.getAllAngularTestabilities(),o=i.length,s=function(){o--,o==0&&r()};i.forEach(a=>{a.whenStable(s)})};Lt.frameworkStabilizers||(Lt.frameworkStabilizers=[]),Lt.frameworkStabilizers.push(n)}findTestabilityInTree(e,n,r){if(n==null)return null;let i=e.getTestability(n);return i??(r?$i().isShadowRoot(n)?this.findTestabilityInTree(e,n.host,!0):this.findTestabilityInTree(e,n.parentElement,!0):null)}},T7=(()=>{class t{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),nU=["alt","control","meta","shift"],y7={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},I7={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},rU=(()=>{class t extends qf{constructor(n){super(n)}supports(n){return t.parseEventName(n)!=null}addEventListener(n,r,i,o){let s=t.parseEventName(r),a=t.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>$i().onAndCancel(n,s.domEventName,a,o))}static parseEventName(n){let r=n.toLowerCase().split("."),i=r.shift();if(r.length===0||!(i==="keydown"||i==="keyup"))return null;let o=t._normalizeKey(r.pop()),s="",a=r.indexOf("code");if(a>-1&&(r.splice(a,1),s="code."),nU.forEach(l=>{let d=r.indexOf(l);d>-1&&(r.splice(d,1),s+=l+".")}),s+=o,r.length!=0||o.length===0)return null;let c={};return c.domEventName=i,c.fullKey=s,c}static matchEventFullKeyCode(n,r){let i=y7[n.key]||n.key,o="";return r.indexOf("code.")>-1&&(i=n.code,o="code."),i==null||!i?!1:(i=i.toLowerCase(),i===" "?i="space":i==="."&&(i="dot"),nU.forEach(s=>{if(s!==i){let a=I7[s];a(n)&&(o+=s+".")}}),o+=i,o===r)}static eventCallback(n,r,i){return o=>{t.matchEventFullKeyCode(o,n)&&i.runGuarded(()=>r(o))}}static _normalizeKey(n){return n==="esc"?"escape":n}static \u0275fac=function(r){return new(r||t)($(on))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})();function v7(){rT.makeCurrent()}function S7(){return new lr}function A7(){return CC(document),document}var C7=[{provide:Oo,useValue:VD},{provide:I_,useValue:v7,multi:!0},{provide:on,useFactory:A7}],D7=RD(TF,"browser",C7);var R7=[{provide:Ku,useClass:iT},{provide:x_,useClass:Lf,deps:[Ae,Pf,Ku]},{provide:Lf,useClass:Lf,deps:[Ae,Pf,Ku]}],N7=[{provide:uf,useValue:"root"},{provide:lr,useFactory:S7},{provide:Z_,useClass:Kf,multi:!0,deps:[on]},{provide:Z_,useClass:rU,multi:!0,deps:[on]},nT,tT,eT,{provide:bo,useExisting:nT},{provide:Dc,useClass:T7},[]],w7=(()=>{class t{constructor(){}static \u0275fac=function(r){return new(r||t)};static \u0275mod=ws({type:t});static \u0275inj=So({providers:[...N7,...R7],imports:[UD,yF]})}return t})();var Nc=class{},Jf=class{},Ms=class t{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
|
|
3
|
+
`)}`:"",this.name="UnsubscriptionError",this.errors=n});function ja(t,e){if(t){let n=t.indexOf(e);0<=n&&t.splice(n,1)}}var gt=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:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let o of n)o.remove(this);else n.remove(this);let{initialTeardown:r}=this;if(_e(r))try{r()}catch(o){e=o instanceof Om?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{ZM(o)}catch(s){e=e??[],s instanceof Om?e=[...e,...s.errors]:e.push(s)}}if(e)throw new Om(e)}}add(e){var n;if(e&&e!==this)if(this.closed)ZM(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}}_hasParent(e){let{_parentage:n}=this;return n===e||Array.isArray(n)&&n.includes(e)}_addParent(e){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e}_removeParent(e){let{_parentage:n}=this;n===e?this._parentage=null:Array.isArray(n)&&ja(n,e)}remove(e){let{_finalizers:n}=this;n&&ja(n,e),e instanceof t&&e._removeParent(this)}};gt.EMPTY=(()=>{let t=new gt;return t.closed=!0,t})();var Xv=gt.EMPTY;function Mm(t){return t instanceof gt||t&&"closed"in t&&_e(t.remove)&&_e(t.add)&&_e(t.unsubscribe)}function ZM(t){_e(t)?t():t.unsubscribe()}var qr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var cu={setTimeout(t,e,...n){let{delegate:r}=cu;return r?.setTimeout?r.setTimeout(t,e,...n):setTimeout(t,e,...n)},clearTimeout(t){let{delegate:e}=cu;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Lm(t){cu.setTimeout(()=>{let{onUnhandledError:e}=qr;if(e)e(t);else throw t})}function Kr(){}var eL=Qv("C",void 0,void 0);function tL(t){return Qv("E",void 0,t)}function nL(t){return Qv("N",t,void 0)}function Qv(t,e,n){return{kind:t,value:e,error:n}}var Ha=null;function lu(t){if(qr.useDeprecatedSynchronousErrorHandling){let e=!Ha;if(e&&(Ha={errorThrown:!1,error:null}),t(),e){let{errorThrown:n,error:r}=Ha;if(Ha=null,n)throw r}}else t()}function rL(t){qr.useDeprecatedSynchronousErrorHandling&&Ha&&(Ha.errorThrown=!0,Ha.error=t)}var $a=class extends gt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Mm(e)&&e.add(this)):this.destination=e4}static create(e,n,r){return new Yr(e,n,r)}next(e){this.isStopped?Zv(nL(e),this):this._next(e)}error(e){this.isStopped?Zv(tL(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Zv(eL,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()}}},J6=Function.prototype.bind;function Jv(t,e){return J6.call(t,e)}var eS=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:n}=this;if(n.next)try{n.next(e)}catch(r){Pm(r)}}error(e){let{partialObserver:n}=this;if(n.error)try{n.error(e)}catch(r){Pm(r)}else Pm(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(n){Pm(n)}}},Yr=class extends $a{constructor(e,n,r){super();let i;if(_e(e)||!e)i={next:e??void 0,error:n??void 0,complete:r??void 0};else{let o;this&&qr.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&Jv(e.next,o),error:e.error&&Jv(e.error,o),complete:e.complete&&Jv(e.complete,o)}):i=e}this.destination=new eS(i)}};function Pm(t){qr.useDeprecatedSynchronousErrorHandling?rL(t):Lm(t)}function Z6(t){throw t}function Zv(t,e){let{onStoppedNotification:n}=qr;n&&cu.setTimeout(()=>n(t,e))}var e4={closed:!0,next:Kr,error:Z6,complete:Kr};function he(t,e,n,r,i){return new tS(t,e,n,r,i)}var tS=class extends $a{constructor(e,n,r,i,o,s){super(e),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=n?function(a){try{n(a)}catch(c){e.error(c)}}:super._next,this._error=i?function(a){try{i(a)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function mn(t,e){return me((n,r)=>{let i=0;n.subscribe(he(r,o=>t.call(e,o,i++)&&r.next(o)))})}var uu=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Xr(t){return t}function iL(t){return t.length===0?Xr:t.length===1?t[0]:function(n){return t.reduce((r,i)=>i(r),n)}}var fe=(()=>{class t{constructor(n){n&&(this._subscribe=n)}lift(n){let r=new t;return r.source=this,r.operator=n,r}subscribe(n,r,i){let o=n4(n)?n:new Yr(n,r,i);return lu(()=>{let{operator:s,source:a}=this;o.add(s?s.call(o,a):a?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(n){try{return this._subscribe(n)}catch(r){n.error(r)}}forEach(n,r){return r=oL(r),new r((i,o)=>{let s=new Yr({next:a=>{try{n(a)}catch(c){o(c),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(n){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(n)}[uu](){return this}pipe(...n){return iL(n)(this)}toPromise(n){return n=oL(n),new n((r,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>r(o))})}}return t.create=e=>new t(e),t})();function oL(t){var e;return(e=t??qr.Promise)!==null&&e!==void 0?e:Promise}function t4(t){return t&&_e(t.next)&&_e(t.error)&&_e(t.complete)}function n4(t){return t&&t instanceof $a||t4(t)&&Mm(t)}var Wa=new fe(t=>t.complete());function En(t){return t<=0?()=>Wa:me((e,n)=>{let r=0;e.subscribe(he(n,i=>{++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function nS(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function aL(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(d){try{l(r.next(d))}catch(h){s(h)}}function c(d){try{l(r.throw(d))}catch(h){s(h)}}function l(d){d.done?o(d.value):i(d.value).then(a,c)}l((r=r.apply(t,e||[])).next())})}function sL(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function za(t){return this instanceof za?(this.v=t,this):new za(t)}function cL(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(E){return Promise.resolve(E).then(g,h)}}function a(g,E){r[g]&&(i[g]=function(I){return new Promise(function(S,L){o.push([g,I,S,L])>1||c(g,I)})},E&&(i[g]=E(i[g])))}function c(g,E){try{l(r[g](E))}catch(I){f(o[0][3],I)}}function l(g){g.value instanceof za?Promise.resolve(g.value.v).then(d,h):f(o[0][2],g)}function d(g){c("next",g)}function h(g){c("throw",g)}function f(g,E){g(E),o.shift(),o.length&&c(o[0][0],o[0][1])}}function lL(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof sL=="function"?sL(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(s){return new Promise(function(a,c){s=t[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var du=t=>t&&typeof t.length=="number"&&typeof t!="function";function xm(t){return _e(t?.then)}function km(t){return _e(t[uu])}function Fm(t){return Symbol.asyncIterator&&_e(t?.[Symbol.asyncIterator])}function Um(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 r4(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Vm=r4();function Bm(t){return _e(t?.[Vm])}function Gm(t){return cL(this,arguments,function*(){let n=t.getReader();try{for(;;){let{value:r,done:i}=yield za(n.read());if(i)return yield za(void 0);yield yield za(r)}}finally{n.releaseLock()}})}function jm(t){return _e(t?.getReader)}function Ce(t){if(t instanceof fe)return t;if(t!=null){if(km(t))return i4(t);if(du(t))return o4(t);if(xm(t))return s4(t);if(Fm(t))return uL(t);if(Bm(t))return a4(t);if(jm(t))return c4(t)}throw Um(t)}function i4(t){return new fe(e=>{let n=t[uu]();if(_e(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function o4(t){return new fe(e=>{for(let n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function s4(t){return new fe(e=>{t.then(n=>{e.closed||(e.next(n),e.complete())},n=>e.error(n)).then(null,Lm)})}function a4(t){return new fe(e=>{for(let n of t)if(e.next(n),e.closed)return;e.complete()})}function uL(t){return new fe(e=>{l4(t,e).catch(n=>e.error(n))})}function c4(t){return uL(Gm(t))}function l4(t,e){var n,r,i,o;return aL(this,void 0,void 0,function*(){try{for(n=lL(t);r=yield n.next(),!r.done;){let s=r.value;if(e.next(s),e.closed)return}}catch(s){i={error:s}}finally{try{r&&!r.done&&(o=n.return)&&(yield o.call(n))}finally{if(i)throw i.error}}e.complete()})}function dL(t){return me((e,n)=>{let r=!1,i=null,o=null,s=!1,a=()=>{if(o?.unsubscribe(),o=null,r){r=!1;let l=i;i=null,n.next(l)}s&&n.complete()},c=()=>{o=null,s&&n.complete()};e.subscribe(he(n,l=>{r=!0,i=l,o||Ce(t(l)).subscribe(o=he(n,a,c))},()=>{s=!0,(!r||!o||o.closed)&&n.complete()}))})}var Hm=class extends gt{constructor(e,n){super()}schedule(e,n=0){return this}};var Xh={setInterval(t,e,...n){let{delegate:r}=Xh;return r?.setInterval?r.setInterval(t,e,...n):setInterval(t,e,...n)},clearInterval(t){let{delegate:e}=Xh;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var Ai=class extends Hm{constructor(e,n){super(e,n),this.scheduler=e,this.work=n,this.pending=!1}schedule(e,n=0){var r;if(this.closed)return this;this.state=e;let i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(o,this.id,n),this}requestAsyncId(e,n,r=0){return Xh.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,n,r=0){if(r!=null&&this.delay===r&&this.pending===!1)return n;n!=null&&Xh.clearInterval(n)}execute(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let r=this._execute(e,n);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,n){let r=!1,i;try{this.work(e)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){let{id:e,scheduler:n}=this,{actions:r}=n;this.work=this.state=this.scheduler=null,this.pending=!1,ja(r,this),e!=null&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,super.unsubscribe()}}};var qa={now(){return(qa.delegate||Date).now()},delegate:void 0};var hu=class t{constructor(e,n=t.now){this.schedulerActionCtor=e,this.now=n}schedule(e,n=0,r){return new this.schedulerActionCtor(this,e).schedule(r,n)}};hu.now=qa.now;var Ci=class extends hu{constructor(e,n=hu.now){super(e,n),this.actions=[],this._active=!1}flush(e){let{actions:n}=this;if(this._active){n.push(e);return}let r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,r){for(;e=n.shift();)e.unsubscribe();throw r}}};var An=new Ci(Ai),rS=An;function $m(t){return t&&_e(t.schedule)}function Wm(t){return t instanceof Date&&!isNaN(t)}function To(t=0,e,n=rS){let r=-1;return e!=null&&($m(e)?n=e:r=e),new fe(i=>{let o=Wm(t)?+t-n.now():t;o<0&&(o=0);let s=0;return n.schedule(function(){i.closed||(i.next(s++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function u4(t,e=An){return dL(()=>To(t,e))}function iS(t){return t[t.length-1]}function zm(t){return _e(iS(t))?t.pop():void 0}function Di(t){return $m(iS(t))?t.pop():void 0}function hL(t,e){return typeof iS(t)=="number"?t.pop():e}function Cn(t,e,n,r=0,i=!1){let o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function oS(t){return me((e,n)=>{let r=null,i=!1,o;r=e.subscribe(he(n,void 0,void 0,s=>{o=Ce(t(s,oS(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}var{isArray:d4}=Array,{getPrototypeOf:h4,prototype:f4,keys:p4}=Object;function qm(t){if(t.length===1){let e=t[0];if(d4(e))return{args:e,keys:null};if(g4(e)){let n=p4(e);return{args:n.map(r=>e[r]),keys:n}}}return{args:t,keys:null}}function g4(t){return t&&typeof t=="object"&&h4(t)===f4}function ds(t,e=0){return me((n,r)=>{n.subscribe(he(r,i=>Cn(r,t,()=>r.next(i),e),()=>Cn(r,t,()=>r.complete(),e),i=>Cn(r,t,()=>r.error(i),e)))})}function hs(t,e=0){return me((n,r)=>{r.add(t.schedule(()=>n.subscribe(r),e))})}function fL(t,e){return Ce(t).pipe(hs(e),ds(e))}function pL(t,e){return Ce(t).pipe(hs(e),ds(e))}function gL(t,e){return new fe(n=>{let r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function mL(t,e){return new fe(n=>{let r;return Cn(n,e,()=>{r=t[Vm](),Cn(n,e,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(s){n.error(s);return}o?n.complete():n.next(i)},0,!0)}),()=>_e(r?.return)&&r.return()})}function Km(t,e){if(!t)throw new Error("Iterable cannot be null");return new fe(n=>{Cn(n,e,()=>{let r=t[Symbol.asyncIterator]();Cn(n,e,()=>{r.next().then(i=>{i.done?n.complete():n.next(i.value)})},0,!0)})})}function EL(t,e){return Km(Gm(t),e)}function _L(t,e){if(t!=null){if(km(t))return fL(t,e);if(du(t))return gL(t,e);if(xm(t))return pL(t,e);if(Fm(t))return Km(t,e);if(Bm(t))return mL(t,e);if(jm(t))return EL(t,e)}throw Um(t)}function cr(t,e){return e?_L(t,e):Ce(t)}function De(t,e){return me((n,r)=>{let i=0;n.subscribe(he(r,o=>{r.next(t.call(e,o,i++))}))})}var{isArray:m4}=Array;function E4(t,e){return m4(e)?t(...e):t(e)}function fu(t){return De(e=>E4(t,e))}function Ym(t,e){return t.reduce((n,r,i)=>(n[r]=e[i],n),{})}function Ka(...t){let e=Di(t),n=zm(t),{args:r,keys:i}=qm(t);if(r.length===0)return cr([],e);let o=new fe(_4(r,e,i?s=>Ym(i,s):Xr));return n?o.pipe(fu(n)):o}function _4(t,e,n=Xr){return r=>{TL(e,()=>{let{length:i}=t,o=new Array(i),s=i,a=i;for(let c=0;c<i;c++)TL(e,()=>{let l=cr(t[c],e),d=!1;l.subscribe(he(r,h=>{o[c]=h,d||(d=!0,a--),a||r.next(n(o.slice()))},()=>{--s||r.complete()}))},r)},r)}}function TL(t,e,n){t?Cn(n,t,e):e()}function yL(t,e,n,r,i,o,s,a){let c=[],l=0,d=0,h=!1,f=()=>{h&&!c.length&&!l&&e.complete()},g=I=>l<r?E(I):c.push(I),E=I=>{o&&e.next(I),l++;let S=!1;Ce(n(I,d++)).subscribe(he(e,L=>{i?.(L),o?g(L):e.next(L)},()=>{S=!0},void 0,()=>{if(S)try{for(l--;c.length&&l<r;){let L=c.shift();s?Cn(e,s,()=>E(L)):E(L)}f()}catch(L){e.error(L)}}))};return t.subscribe(he(e,g,()=>{h=!0,f()})),()=>{a?.()}}function Ri(t,e,n=1/0){return _e(e)?Ri((r,i)=>De((o,s)=>e(r,o,i,s))(Ce(t(r,i))),n):(typeof e=="number"&&(n=e),me((r,i)=>yL(r,i,t,n)))}function IL(t,e,n,r,i){return(o,s)=>{let a=n,c=e,l=0;o.subscribe(he(s,d=>{let h=l++;c=a?t(c,d,h):(a=!0,d),r&&s.next(c)},i&&(()=>{a&&s.next(c),s.complete()})))}}function Xm(t=1/0){return Ri(Xr,t)}function vL(){return Xm(1)}function sS(t,e){return _e(e)?Ri(t,e,1):Ri(t,1)}var SL=us(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Rt=(()=>{class t extends fe{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){let r=new Qm(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new SL}next(n){lu(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(n)}})}error(n){lu(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;let{observers:r}=this;for(;r.length;)r.shift().error(n)}})}complete(){lu(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){let{hasError:r,isStopped:i,observers:o}=this;return r||i?Xv:(this.currentObservers=null,o.push(n),new gt(()=>{this.currentObservers=null,ja(o,n)}))}_checkFinalizedStatuses(n){let{hasError:r,thrownError:i,isStopped:o}=this;r?n.error(i):o&&n.complete()}asObservable(){let n=new fe;return n.source=this,n}}return t.create=(e,n)=>new Qm(e,n),t})(),Qm=class extends Rt{constructor(e,n){super(),this.destination=e,this.source=n}next(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,e)}error(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,e)}complete(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)}_subscribe(e){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&r!==void 0?r:Xv}};function T4(t){return me((e,n)=>{let r=!1,i=null,o=null,s=()=>{if(o?.unsubscribe(),o=null,r){r=!1;let a=i;i=null,n.next(a)}};e.subscribe(he(n,a=>{o?.unsubscribe(),r=!0,i=a,o=he(n,s,Kr),Ce(t(a)).subscribe(o)},()=>{s(),n.complete()},void 0,()=>{i=o=null}))})}function Jm(t,e=An){return me((n,r)=>{let i=null,o=null,s=null,a=()=>{if(i){i.unsubscribe(),i=null;let l=o;o=null,r.next(l)}};function c(){let l=s+t,d=e.now();if(d<l){i=this.schedule(void 0,l-d),r.add(i);return}a()}n.subscribe(he(r,l=>{o=l,s=e.now(),i||(i=e.schedule(c,t),r.add(i))},()=>{a(),r.complete()},void 0,()=>{o=i=null}))})}function fs(...t){return vL()(cr(t,Di(t)))}function AL(){return me((t,e)=>{t.subscribe(he(e,Kr))})}function CL(t){return De(()=>t)}function aS(t,e){return e?n=>fs(e.pipe(En(1),AL()),n.pipe(aS(t))):Ri((n,r)=>Ce(t(n,r)).pipe(En(1),CL(n)))}function cS(t,e=An){let n=To(t,e);return aS(()=>n)}function lt(...t){let e=Di(t);return cr(t,e)}function yo(t,e=Xr){return t=t??y4,me((n,r)=>{let i,o=!0;n.subscribe(he(r,s=>{let a=e(s);(o||!t(i,a))&&(o=!1,i=a,r.next(s))}))})}function y4(t,e){return t===e}var DL=us(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function Qh(t){return me((e,n)=>{try{e.subscribe(n)}finally{n.add(t)}})}function RL(){return me((t,e)=>{let n=null;t._refCount++;let r=he(e,void 0,void 0,void 0,()=>{if(!t||t._refCount<=0||0<--t._refCount){n=null;return}let i=t._connection,o=n;n=null,i&&(!o||i===o)&&i.unsubscribe(),e.unsubscribe()});t.subscribe(r),r.closed||(n=t.connect())})}var lS=class extends fe{constructor(e,n){super(),this.source=e,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,Yv(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 gt;let n=this.getSubject();e.add(this.source.subscribe(he(n,void 0,()=>{this._teardown(),n.complete()},r=>{this._teardown(),n.error(r)},()=>this._teardown()))),e.closed&&(this._connection=null,e=gt.EMPTY)}return e}refCount(){return RL()(this)}};function Ya(){return me((t,e)=>{let n,r=!1;t.subscribe(he(e,i=>{let o=n;n=i,r&&e.next([o,i]),r=!0}))})}var ie=class extends Rt{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let n=super._subscribe(e);return!n.closed&&e.next(this._value),n}getValue(){let{hasError:e,thrownError:n,_value:r}=this;if(e)throw n;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}};var Xa=class extends Rt{constructor(e=1/0,n=1/0,r=qa){super(),this._bufferSize=e,this._windowTime=n,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,n)}next(e){let{isStopped:n,_buffer:r,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:s}=this;n||(r.push(e),!i&&r.push(o.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let n=this._innerSubscribe(e),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let s=0;s<o.length&&!e.closed;s+=r?1:2)e.next(o[s]);return this._checkFinalizedStatuses(e),n}_trimBuffer(){let{_bufferSize:e,_timestampProvider:n,_buffer:r,_infiniteTimeWindow:i}=this,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){let s=n.now(),a=0;for(let c=1;c<r.length&&r[c]<=s;c+=2)a=c;a&&r.splice(0,a+1)}}};function I4(t=0,e=An){return t<0&&(t=0),To(t,t,e)}function Zm(t,e){return me(IL(t,e,arguments.length>=2,!0))}function dS(t={}){let{connector:e=()=>new Rt,resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=t;return o=>{let s,a,c,l=0,d=!1,h=!1,f=()=>{a?.unsubscribe(),a=void 0},g=()=>{f(),s=c=void 0,d=h=!1},E=()=>{let I=s;g(),I?.unsubscribe()};return me((I,S)=>{l++,!h&&!d&&f();let L=c=c??e();S.add(()=>{l--,l===0&&!h&&!d&&(a=uS(E,i))}),L.subscribe(S),!s&&l>0&&(s=new Yr({next:V=>L.next(V),error:V=>{h=!0,f(),a=uS(g,n,V),L.error(V)},complete:()=>{d=!0,f(),a=uS(g,r),L.complete()}}),Ce(I).subscribe(s))})(o)}}function uS(t,e,...n){if(e===!0){t();return}if(e===!1)return;let r=new Yr({next:()=>{r.unsubscribe(),t()}});return Ce(e(...n)).subscribe(r)}function v4(t,e,n){let r,i=!1;return t&&typeof t=="object"?{bufferSize:r=1/0,windowTime:e=1/0,refCount:i=!1,scheduler:n}=t:r=t??1/0,dS({connector:()=>new Xa(r,e,n),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function hS(t){return mn((e,n)=>t<=n)}function S4(t){return me((e,n)=>{let r=!1,i=he(n,()=>{i?.unsubscribe(),r=!0},Kr);Ce(t).subscribe(i),e.subscribe(he(n,o=>r&&n.next(o)))})}function Qa(...t){let e=Di(t);return me((n,r)=>{(e?fs(t,n,e):fs(t,n)).subscribe(r)})}function Mr(t,e){return me((n,r)=>{let i=null,o=0,s=!1,a=()=>s&&!i&&r.complete();n.subscribe(he(r,c=>{i?.unsubscribe();let l=0,d=o++;Ce(t(c,d)).subscribe(i=he(r,h=>r.next(e?e(c,h,d,l++):h),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function ps(t){return me((e,n)=>{Ce(t).subscribe(he(n,()=>n.complete(),Kr)),!n.closed&&e.subscribe(n)})}function A4(t,e=!1){return me((n,r)=>{let i=0;n.subscribe(he(r,o=>{let s=t(o,i++);(s||e)&&r.next(o),!s&&r.complete()}))})}function eE(t,e,n){let r=_e(t)||e||n?{next:t,error:e,complete:n}:t;return r?me((i,o)=>{var s;(s=r.subscribe)===null||s===void 0||s.call(r);let a=!0;i.subscribe(he(o,c=>{var l;(l=r.next)===null||l===void 0||l.call(r,c),o.next(c)},()=>{var c;a=!1,(c=r.complete)===null||c===void 0||c.call(r),o.complete()},c=>{var l;a=!1,(l=r.error)===null||l===void 0||l.call(r,c),o.error(c)},()=>{var c,l;a&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(l=r.finalize)===null||l===void 0||l.call(r)}))}):Xr}function NL(t,e){return me((n,r)=>{let{leading:i=!0,trailing:o=!1}=e??{},s=!1,a=null,c=null,l=!1,d=()=>{c?.unsubscribe(),c=null,o&&(g(),l&&r.complete())},h=()=>{c=null,l&&r.complete()},f=E=>c=Ce(t(E)).subscribe(he(r,d,h)),g=()=>{if(s){s=!1;let E=a;a=null,r.next(E),!l&&f(E)}};n.subscribe(he(r,E=>{s=!0,a=E,!(c&&!c.closed)&&(i?g():f(E))},()=>{l=!0,!(o&&s&&c&&!c.closed)&&r.complete()}))})}function C4(t,e=An,n){let r=To(t,e);return NL(()=>r,n)}var D4=us(t=>function(n=null){t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=n});function R4(t,e){let{first:n,each:r,with:i=N4,scheduler:o=e??An,meta:s=null}=Wm(t)?{first:t}:typeof t=="number"?{each:t}:t;if(n==null&&r==null)throw new TypeError("No timeout provided.");return me((a,c)=>{let l,d,h=null,f=0,g=E=>{d=Cn(c,o,()=>{try{l.unsubscribe(),Ce(i({meta:s,lastValue:h,seen:f})).subscribe(c)}catch(I){c.error(I)}},E)};l=a.subscribe(he(c,E=>{d?.unsubscribe(),f++,c.next(h=E),r>0&&g(r)},void 0,void 0,()=>{d?.closed||d?.unsubscribe(),h=null})),!f&&g(n!=null?typeof n=="number"?n:+n-o.now():r)})}function N4(t){throw new D4(t)}function w4(t=qa){return De(e=>({value:e,timestamp:t.now()}))}var fS;function tE(){return fS}function Ni(t){let e=fS;return fS=t,e}var wL=Symbol("NotFound");function pu(t){return t===wL||t?.name==="\u0275NotFound"}var Dn=null,nE=!1,pS=1,b4=null,rn=Symbol("SIGNAL");function Te(t){let e=Dn;return Dn=t,e}function sE(){return Dn}var Ja={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function gu(t){if(nE)throw new Error("");if(Dn===null)return;Dn.consumerOnSignalRead(t);let e=Dn.producersTail;if(e!==void 0&&e.producer===t)return;let n,r=Dn.recomputing;if(r&&(n=e!==void 0?e.nextProducer:Dn.producers,n!==void 0&&n.producer===t)){Dn.producersTail=n,n.lastReadVersion=t.version;return}let i=t.consumersTail;if(i!==void 0&&i.consumer===Dn&&(!r||M4(i,Dn)))return;let o=_u(Dn),s={producer:t,consumer:Dn,nextProducer:n,prevConsumer:i,lastReadVersion:t.version,nextConsumer:void 0};Dn.producersTail=s,e!==void 0?e.nextProducer=s:Dn.producers=s,o&&LL(t,s)}function bL(){pS++}function aE(t){if(!(_u(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===pS)){if(!t.producerMustRecompute(t)&&!Eu(t)){oE(t);return}t.producerRecomputeValue(t),oE(t)}}function gS(t){if(t.consumers===void 0)return;let e=nE;nE=!0;try{for(let n=t.consumers;n!==void 0;n=n.nextConsumer){let r=n.consumer;r.dirty||O4(r)}}finally{nE=e}}function mS(){return Dn?.consumerAllowSignalWrites!==!1}function O4(t){t.dirty=!0,gS(t),t.consumerMarkedDirty?.(t)}function oE(t){t.dirty=!1,t.lastCleanEpoch=pS}function Za(t){return t&&OL(t),Te(t)}function OL(t){t.producersTail=void 0,t.recomputing=!0}function mu(t,e){Te(e),t&&ML(t)}function ML(t){t.recomputing=!1;let e=t.producersTail,n=e!==void 0?e.nextProducer:t.producers;if(n!==void 0){if(_u(t))do n=ES(n);while(n!==void 0);e!==void 0?e.nextProducer=void 0:t.producers=void 0}}function Eu(t){for(let e=t.producers;e!==void 0;e=e.nextProducer){let n=e.producer,r=e.lastReadVersion;if(r!==n.version||(aE(n),r!==n.version))return!0}return!1}function ec(t){if(_u(t)){let e=t.producers;for(;e!==void 0;)e=ES(e)}t.producers=void 0,t.producersTail=void 0,t.consumers=void 0,t.consumersTail=void 0}function LL(t,e){let n=t.consumersTail,r=_u(t);if(n!==void 0?(e.nextConsumer=n.nextConsumer,n.nextConsumer=e):(e.nextConsumer=void 0,t.consumers=e),e.prevConsumer=n,t.consumersTail=e,!r)for(let i=t.producers;i!==void 0;i=i.nextProducer)LL(i.producer,i)}function ES(t){let e=t.producer,n=t.nextProducer,r=t.nextConsumer,i=t.prevConsumer;if(t.nextConsumer=void 0,t.prevConsumer=void 0,r!==void 0?r.prevConsumer=i:e.consumersTail=i,i!==void 0)i.nextConsumer=r;else if(e.consumers=r,!_u(e)){let o=e.producers;for(;o!==void 0;)o=ES(o)}return n}function _u(t){return t.consumerIsAlwaysLive||t.consumers!==void 0}function cE(t){b4?.(t)}function M4(t,e){let n=e.producersTail;if(n!==void 0){let r=e.producers;do{if(r===t)return!0;if(r===n)break;r=r.nextProducer}while(r!==void 0)}return!1}function lE(t,e){return Object.is(t,e)}function Zh(t,e){let n=Object.create(L4);n.computation=t,e!==void 0&&(n.equal=e);let r=()=>{if(aE(n),gu(n),n.value===Jh)throw n.error;return n.value};return r[rn]=n,cE(n),r}var rE=Symbol("UNSET"),iE=Symbol("COMPUTING"),Jh=Symbol("ERRORED"),L4=Ee(B({},Ja),{value:rE,dirty:!0,error:null,equal:lE,kind:"computed",producerMustRecompute(t){return t.value===rE||t.value===iE},producerRecomputeValue(t){if(t.value===iE)throw new Error("");let e=t.value;t.value=iE;let n=Za(t),r,i=!1;try{r=t.computation(),Te(null),i=e!==rE&&e!==Jh&&r!==Jh&&t.equal(e,r)}catch(o){r=Jh,t.error=o}finally{mu(t,n)}if(i){t.value=e;return}t.value=r,t.version++}});function P4(){throw new Error}var PL=P4;function xL(t){PL(t)}function _S(t){PL=t}var x4=null;function TS(t,e){let n=Object.create(uE);n.value=t,e!==void 0&&(n.equal=e);let r=()=>kL(n);return r[rn]=n,cE(n),[r,s=>Tu(n,s),s=>yS(n,s)]}function kL(t){return gu(t),t.value}function Tu(t,e){mS()||xL(t),t.equal(t.value,e)||(t.value=e,k4(t))}function yS(t,e){mS()||xL(t),Tu(t,e(t.value))}var uE=Ee(B({},Ja),{equal:lE,value:void 0,kind:"signal"});function k4(t){t.version++,bL(),gS(t),x4?.(t)}var yu={schedule(t){let e=requestAnimationFrame,n=cancelAnimationFrame,{delegate:r}=yu;r&&(e=r.requestAnimationFrame,n=r.cancelAnimationFrame);let i=e(o=>{n=void 0,t(o)});return new gt(()=>n?.(i))},requestAnimationFrame(...t){let{delegate:e}=yu;return(e?.requestAnimationFrame||requestAnimationFrame)(...t)},cancelAnimationFrame(...t){let{delegate:e}=yu;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...t)},delegate:void 0};var F4=1,IS,vS={};function FL(t){return t in vS?(delete vS[t],!0):!1}var UL={setImmediate(t){let e=F4++;return vS[e]=!0,IS||(IS=Promise.resolve()),IS.then(()=>FL(e)&&t()),e},clearImmediate(t){FL(t)}};var{setImmediate:U4,clearImmediate:V4}=UL,ef={setImmediate(...t){let{delegate:e}=ef;return(e?.setImmediate||U4)(...t)},clearImmediate(t){let{delegate:e}=ef;return(e?.clearImmediate||V4)(t)},delegate:void 0};var dE=class extends Ai{constructor(e,n){super(e,n),this.scheduler=e,this.work=n}requestAsyncId(e,n,r=0){return r!==null&&r>0?super.requestAsyncId(e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=ef.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,n,r=0){var i;if(r!=null?r>0:this.delay>0)return super.recycleAsyncId(e,n,r);let{actions:o}=e;n!=null&&((i=o[o.length-1])===null||i===void 0?void 0:i.id)!==n&&(ef.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))}};var hE=class extends Ci{flush(e){this._active=!0;let n=this._scheduled;this._scheduled=void 0;let{actions:r}=this,i;e=e||r.shift();do if(i=e.execute(e.state,e.delay))break;while((e=r[0])&&e.id===n&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===n&&r.shift();)e.unsubscribe();throw i}}};var B4=new hE(dE);var fE=class extends Ai{constructor(e,n){super(e,n),this.scheduler=e,this.work=n}schedule(e,n=0){return n>0?super.schedule(e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)}execute(e,n){return n>0||this.closed?super.execute(e,n):this._execute(e,n)}requestAsyncId(e,n,r=0){return r!=null&&r>0||r==null&&this.delay>0?super.requestAsyncId(e,n,r):(e.flush(this),0)}};var pE=class extends Ci{};var SS=new pE(fE);var gE=class extends Ai{constructor(e,n){super(e,n),this.scheduler=e,this.work=n}requestAsyncId(e,n,r=0){return r!==null&&r>0?super.requestAsyncId(e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=yu.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,n,r=0){var i;if(r!=null?r>0:this.delay>0)return super.recycleAsyncId(e,n,r);let{actions:o}=e;n!=null&&n===e._scheduled&&((i=o[o.length-1])===null||i===void 0?void 0:i.id)!==n&&(yu.cancelAnimationFrame(n),e._scheduled=void 0)}};var mE=class extends Ci{flush(e){this._active=!0;let n;e?n=e.id:(n=this._scheduled,this._scheduled=void 0);let{actions:r}=this,i;e=e||r.shift();do if(i=e.execute(e.state,e.delay))break;while((e=r[0])&&e.id===n&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===n&&r.shift();)e.unsubscribe();throw i}}};var G4=new mE(gE);function j4(t){return!!t&&(t instanceof fe||_e(t.lift)&&_e(t.subscribe))}function H4(t,e){let n=typeof e=="object";return new Promise((r,i)=>{let o=new Yr({next:s=>{r(s),o.unsubscribe()},error:i,complete:()=>{n?r(e.defaultValue):i(new DL)}});t.subscribe(o)})}function tf(t){return new fe(e=>{Ce(t()).subscribe(e)})}function $4(...t){let e=zm(t),{args:n,keys:r}=qm(t),i=new fe(o=>{let{length:s}=n;if(!s){o.complete();return}let a=new Array(s),c=s,l=s;for(let d=0;d<s;d++){let h=!1;Ce(n[d]).subscribe(he(o,f=>{h||(h=!0,l--),a[d]=f},()=>c--,void 0,()=>{(!c||!h)&&(l||o.next(r?Ym(r,a):a),o.complete())}))}});return e?i.pipe(fu(e)):i}var W4=["addListener","removeListener"],z4=["addEventListener","removeEventListener"],q4=["on","off"];function wi(t,e,n,r){if(_e(n)&&(r=n,n=void 0),r)return wi(t,e,n).pipe(fu(r));let[i,o]=X4(t)?z4.map(s=>a=>t[s](e,a,n)):K4(t)?W4.map(VL(t,e)):Y4(t)?q4.map(VL(t,e)):[];if(!i&&du(t))return Ri(s=>wi(s,e,n))(Ce(t));if(!i)throw new TypeError("Invalid event target");return new fe(s=>{let a=(...c)=>s.next(1<c.length?c:c[0]);return i(a),()=>o(a)})}function VL(t,e){return n=>r=>t[n](e,r)}function K4(t){return _e(t.addListener)&&_e(t.removeListener)}function Y4(t){return _e(t.on)&&_e(t.off)}function X4(t){return _e(t.addEventListener)&&_e(t.removeEventListener)}function Q4(t,e,n){return tf(()=>t()?e:n)}function gs(...t){let e=Di(t),n=hL(t,1/0),r=t;return r.length?r.length===1?Ce(r[0]):Xm(n)(cr(r,e)):Wa}function BL(t){let e=Te(null);try{return t()}finally{Te(e)}}var GL=Ee(B({},Ja),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"});function jL(t){if(t.dirty=!1,t.version>0&&!Eu(t))return;t.version++;let e=Za(t);try{t.cleanup(),t.fn()}finally{mu(t,e)}}var nc=class{full;major;minor;patch;constructor(e){this.full=e;let n=e.split(".");this.major=n[0],this.minor=n[1],this.patch=n.slice(2).join(".")}},xS=new nc("20.3.33");var IE="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",J=class extends Error{code;constructor(e,n){super(Ts(e,n)),this.code=e}};function J4(t){return`NG0${Math.abs(t)}`}function Ts(t,e){return`${J4(t)}${e?": "+e:""}`}var Lt=globalThis;function We(t){for(let e in t)if(t[e]===We)return e;throw Error("")}function WL(t,e){for(let n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function vo(t){if(typeof t=="string")return t;if(Array.isArray(t))return`[${t.map(vo).join(", ")}]`;if(t==null)return""+t;let e=t.overriddenName||t.name;if(e)return`${e}`;let n=t.toString();if(n==null)return""+n;let r=n.indexOf(`
|
|
4
|
+
`);return r>=0?n.slice(0,r):n}function vE(t,e){return t?e?`${t} ${e}`:t:e||""}var Z4=We({__forward_ref__:We});function SE(t){return t.__forward_ref__=SE,t.toString=function(){return vo(this())},t}function jt(t){return kS(t)?t():t}function kS(t){return typeof t=="function"&&t.hasOwnProperty(Z4)&&t.__forward_ref__===SE}function Q(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function So(t){return{providers:t.providers||[],imports:t.imports||[]}}function AE(t){return ez(t,CE)}function ez(t,e){return t.hasOwnProperty(e)&&t[e]||null}function tz(t){let e=t?.[CE]??null;return e||null}function CS(t){return t&&t.hasOwnProperty(TE)?t[TE]:null}var CE=We({\u0275prov:We}),TE=We({\u0275inj:We}),z=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,n){this._desc=e,this.\u0275prov=void 0,typeof n=="number"?this.__NG_ELEMENT_ID__=n:n!==void 0&&(this.\u0275prov=Q({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function FS(t){return t&&!!t.\u0275providers}var US=We({\u0275cmp:We}),VS=We({\u0275dir:We}),BS=We({\u0275pipe:We}),GS=We({\u0275mod:We}),rf=We({\u0275fac:We}),sc=We({__NG_ELEMENT_ID__:We}),HL=We({__NG_ENV_ID__:We});function ur(t){return typeof t=="string"?t:t==null?"":String(t)}function zL(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():ur(t)}var qL=We({ngErrorCode:We}),nz=We({ngErrorMessage:We}),rz=We({ngTokenPath:We});function jS(t,e){return KL("",-200,e)}function DE(t,e){throw new J(-201,!1)}function KL(t,e,n){let r=new J(e,t);return r[qL]=e,r[nz]=t,n&&(r[rz]=n),r}function iz(t){return t[qL]}var DS;function YL(){return DS}function Bn(t){let e=DS;return DS=t,e}function HS(t,e,n){let r=AE(t);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(n&8)return null;if(e!==void 0)return e;DE(t,"Injector")}var oz={},tc=oz,RS="__NG_DI_FLAG__",NS=class{injector;constructor(e){this.injector=e}retrieve(e,n){let r=rc(n)||0;try{return this.injector.get(e,r&8?null:tc,r)}catch(i){if(pu(i))return i;throw i}}};function sz(t,e=0){let n=tE();if(n===void 0)throw new J(-203,!1);if(n===null)return HS(t,void 0,e);{let r=az(e),i=n.retrieve(t,r);if(pu(i)){if(r.optional)return null;throw i}return i}}function $(t,e=0){return(YL()||sz)(jt(t),e)}function Y(t,e){return $(t,rc(e))}function rc(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function az(t){return{optional:!!(t&8),host:!!(t&1),self:!!(t&2),skipSelf:!!(t&4)}}function wS(t){let e=[];for(let n=0;n<t.length;n++){let r=jt(t[n]);if(Array.isArray(r)){if(r.length===0)throw new J(900,!1);let i,o=0;for(let s=0;s<r.length;s++){let a=r[s],c=cz(a);typeof c=="number"?c===-1?i=a.token:o|=c:i=a}e.push($(i,o))}else e.push($(r))}return e}function $S(t,e){return t[RS]=e,t.prototype[RS]=e,t}function cz(t){return t[RS]}function Es(t,e){let n=t.hasOwnProperty(rf);return n?t[rf]:null}function XL(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=e[r];if(n&&(i=n(i),o=n(o)),o!==i)return!1}return!0}function QL(t){return t.flat(Number.POSITIVE_INFINITY)}function RE(t,e){t.forEach(n=>Array.isArray(n)?RE(n,e):e(n))}function WS(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function cf(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function JL(t,e){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function ZL(t,e,n,r){let i=t.length;if(i==e)t.push(n,r);else if(i===1)t.push(r,t[0]),t[0]=n;else{for(i--,t.push(t[i-1],t[i]);i>e;){let o=i-2;t[i]=t[o],i--}t[e]=n,t[e+1]=r}}function lf(t,e,n){let r=vu(t,e);return r>=0?t[r|1]=n:(r=~r,ZL(t,r,e,n)),r}function NE(t,e){let n=vu(t,e);if(n>=0)return t[n|1]}function vu(t,e){return lz(t,e,1)}function lz(t,e,n){let r=0,i=t.length>>n;for(;i!==r;){let o=r+(i-r>>1),s=t[o<<n];if(e===s)return o<<n;s>e?i=o:r=o+1}return~(i<<n)}var Qr={},Rn=[],ys=new z(""),zS=new z("",-1),qS=new z(""),of=class{get(e,n=tc){if(n===tc){let i=KL("",-201);throw i.name="\u0275NotFound",i}return n}};function eP(t){return t[GS]||null}function Is(t){return t[US]||null}function wE(t){return t[VS]||null}function KS(t){return t[BS]||null}function Xn(t){return{\u0275providers:t}}function tP(...t){return{\u0275providers:YS(!0,t),\u0275fromNgModule:!0}}function YS(t,...e){let n=[],r=new Set,i,o=s=>{n.push(s)};return RE(e,s=>{let a=s;yE(a,o,[],r)&&(i||=[],i.push(a))}),i!==void 0&&nP(i,o),n}function nP(t,e){for(let n=0;n<t.length;n++){let{ngModule:r,providers:i}=t[n];XS(i,o=>{e(o,r)})}}function yE(t,e,n,r){if(t=jt(t),!t)return!1;let i=null,o=CS(t),s=!o&&Is(t);if(!o&&!s){let c=t.ngModule;if(o=CS(c),o)i=c;else return!1}else{if(s&&!s.standalone)return!1;i=t}let a=r.has(i);if(s){if(a)return!1;if(r.add(i),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)yE(l,e,n,r)}}else if(o){if(o.imports!=null&&!a){r.add(i);let l;RE(o.imports,d=>{yE(d,e,n,r)&&(l||=[],l.push(d))}),l!==void 0&&nP(l,e)}if(!a){let l=Es(i)||(()=>new i);e({provide:i,useFactory:l,deps:Rn},i),e({provide:qS,useValue:i,multi:!0},i),e({provide:ys,useValue:()=>$(i),multi:!0},i)}let c=o.providers;if(c!=null&&!a){let l=t;XS(c,d=>{e(d,l)})}}else return!1;return i!==t&&t.providers!==void 0}function XS(t,e){for(let n of t)FS(n)&&(n=n.\u0275providers),Array.isArray(n)?XS(n,e):e(n)}var uz=We({provide:String,useValue:We});function rP(t){return t!==null&&typeof t=="object"&&uz in t}function dz(t){return!!(t&&t.useExisting)}function hz(t){return!!(t&&t.useFactory)}function ic(t){return typeof t=="function"}function iP(t){return!!t.useClass}var uf=new z(""),EE={},$L={},AS;function Su(){return AS===void 0&&(AS=new of),AS}var Nn=class{},oc=class extends Nn{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,n,r,i){super(),this.parent=n,this.source=r,this.scopes=i,OS(e,s=>this.processProvider(s)),this.records.set(zS,Iu(void 0,this)),i.has("environment")&&this.records.set(Nn,Iu(void 0,this));let o=this.records.get(uf);o!=null&&typeof o.value=="string"&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(qS,Rn,{self:!0}))}retrieve(e,n){let r=rc(n)||0;try{return this.get(e,tc,r)}catch(i){if(pu(i))return i;throw i}}destroy(){nf(this),this._destroyed=!0;let e=Te(null);try{for(let r of this._ngOnDestroyHooks)r.ngOnDestroy();let n=this._onDestroyHooks;this._onDestroyHooks=[];for(let r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),Te(e)}}onDestroy(e){return nf(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){nf(this);let n=Ni(this),r=Bn(void 0),i;try{return e()}finally{Ni(n),Bn(r)}}get(e,n=tc,r){if(nf(this),e.hasOwnProperty(HL))return e[HL](this);let i=rc(r),o,s=Ni(this),a=Bn(void 0);try{if(!(i&4)){let l=this.records.get(e);if(l===void 0){let d=Ez(e)&&AE(e);d&&this.injectableDefInScope(d)?l=Iu(bS(e),EE):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,i)}let c=i&2?Su():this.parent;return n=i&8&&n===tc?null:n,c.get(e,n)}catch(c){let l=iz(c);throw l===-200||l===-201?new J(l,null):c}finally{Bn(a),Ni(s)}}resolveInjectorInitializers(){let e=Te(null),n=Ni(this),r=Bn(void 0),i;try{let o=this.get(ys,Rn,{self:!0});for(let s of o)s()}finally{Ni(n),Bn(r),Te(e)}}toString(){let e=[],n=this.records;for(let r of n.keys())e.push(vo(r));return`R3Injector[${e.join(", ")}]`}processProvider(e){e=jt(e);let n=ic(e)?e:jt(e&&e.provide),r=pz(e);if(!ic(e)&&e.multi===!0){let i=this.records.get(n);i||(i=Iu(void 0,EE,!0),i.factory=()=>wS(i.multi),this.records.set(n,i)),n=e,i.multi.push(e)}this.records.set(n,r)}hydrate(e,n,r){let i=Te(null);try{if(n.value===$L)throw jS(vo(e));return n.value===EE&&(n.value=$L,n.value=n.factory(void 0,r)),typeof n.value=="object"&&n.value&&mz(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{Te(i)}}injectableDefInScope(e){if(!e.providedIn)return!1;let n=jt(e.providedIn);return typeof n=="string"?n==="any"||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(e){let n=this._onDestroyHooks.indexOf(e);n!==-1&&this._onDestroyHooks.splice(n,1)}};function bS(t){let e=AE(t),n=e!==null?e.factory:Es(t);if(n!==null)return n;if(t instanceof z)throw new J(204,!1);if(t instanceof Function)return fz(t);throw new J(204,!1)}function fz(t){if(t.length>0)throw new J(204,!1);let n=tz(t);return n!==null?()=>n.factory(t):()=>new t}function pz(t){if(rP(t))return Iu(void 0,t.useValue);{let e=QS(t);return Iu(e,EE)}}function QS(t,e,n){let r;if(ic(t)){let i=jt(t);return Es(i)||bS(i)}else if(rP(t))r=()=>jt(t.useValue);else if(hz(t))r=()=>t.useFactory(...wS(t.deps||[]));else if(dz(t))r=(i,o)=>$(jt(t.useExisting),o!==void 0&&o&8?8:void 0);else{let i=jt(t&&(t.useClass||t.provide));if(gz(t))r=()=>new i(...wS(t.deps));else return Es(i)||bS(i)}return r}function nf(t){if(t.destroyed)throw new J(205,!1)}function Iu(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function gz(t){return!!t.deps}function mz(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function Ez(t){return typeof t=="function"||typeof t=="object"&&t.ngMetadataName==="InjectionToken"}function OS(t,e){for(let n of t)Array.isArray(n)?OS(n,e):n&&FS(n)?OS(n.\u0275providers,e):e(n)}function bi(t,e){let n;t instanceof oc?(nf(t),n=t):n=new NS(t);let r,i=Ni(n),o=Bn(void 0);try{return e()}finally{Ni(i),Bn(o)}}function JS(){return YL()!==void 0||tE()!=null}var Jr=0,pe=1,ye=2,Ht=3,Pr=4,Gn=5,ac=6,Au=7,Nt=8,Ao=9,Oi=10,qe=11,Cu=12,ZS=13,cc=14,wn=15,vs=16,lc=17,Mi=18,df=19,eA=20,Io=21,bE=22,Co=23,dr=24,uc=25,dc=26,Ke=27,oP=1,tA=6,Ss=7,hf=8,hc=9,wt=10;function Li(t){return Array.isArray(t)&&typeof t[oP]=="object"}function Zr(t){return Array.isArray(t)&&t[oP]===!0}function nA(t){return(t.flags&4)!==0}function Do(t){return t.componentOffset>-1}function Du(t){return(t.flags&1)===1}function ei(t){return!!t.template}function Ru(t){return(t[ye]&512)!==0}function fc(t){return(t[ye]&256)===256}var vt=(function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t[t.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING",t})(vt||{}),_E,sf="svg",rA="math";function sP(){return _E||(_E={},ms(vt.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),ms(vt.STYLE,void 0,[["*",["style"]]]),ms(vt.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),ms(vt.URL,rA,[["*",["href","xlink:href"]],["annotation",["href","xlink:href"]],["annotation-xml",["href","xlink:href"]],["maction",["href","xlink:href"]],["malignmark",["href","xlink:href"]],["math",["href","xlink:href"]],["mroot",["href","xlink:href"]],["msqrt",["href","xlink:href"]],["merror",["href","xlink:href"]],["mfrac",["href","xlink:href"]],["mglyph",["href","xlink:href"]],["msub",["href","xlink:href"]],["msup",["href","xlink:href"]],["msubsup",["href","xlink:href"]],["mmultiscripts",["href","xlink:href"]],["mprescripts",["href","xlink:href"]],["mi",["href","xlink:href"]],["mn",["href","xlink:href"]],["mo",["href","xlink:href"]],["mpadded",["href","xlink:href"]],["mphantom",["href","xlink:href"]],["mrow",["href","xlink:href"]],["ms",["href","xlink:href"]],["mspace",["href","xlink:href"]],["mstyle",["href","xlink:href"]],["mtable",["href","xlink:href"]],["mtd",["href","xlink:href"]],["mtr",["href","xlink:href"]],["mtext",["href","xlink:href"]],["mover",["href","xlink:href"]],["munder",["href","xlink:href"]],["munderover",["href","xlink:href"]],["semantics",["href","xlink:href"]],["none",["href","xlink:href"]]]),ms(vt.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),ms(vt.URL,sf,[["a",["href","xlink:href"]]]),ms(vt.ATTRIBUTE_NO_BINDING,sf,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),ms(vt.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]]])),_E}function ms(t,e,n){for(let[r,i]of n){let o=e&&r!=="unknown"?`:${e}:${r}`:r;o=o.toLowerCase();for(let s of i)_E[`${o}|${s.toLowerCase()}`]=t}}function aP(t,e,n){let r=sP(),i=t.toLowerCase(),o=e.toLowerCase(),s=n&&i!=="*"&&i!=="unknown"?r[`:${n}:${i}|${o}`]:void 0,a=n?r[`:${n}:*|${o}`]:void 0;return s??a??r[`${i}|${o}`]??r[`*|${o}`]??vt.NONE}function xr(t){for(;Array.isArray(t);)t=t[Jr];return t}function iA(t,e){return xr(e[t])}function hr(t,e){return xr(e[t.index])}function ff(t,e){return t.data[e]}function pc(t,e){return t[e]}function pf(t,e,n,r){n>=t.data.length&&(t.data[n]=null,t.blueprint[n]=null),e[n]=r}function kr(t,e){let n=e[t];return Li(n)?n:n[Jr]}function cP(t){return(t[ye]&4)===4}function OE(t){return(t[ye]&128)===128}function lP(t){return Zr(t[Ht])}function fr(t,e){return e==null?null:t[e]}function oA(t){t[lc]=0}function ME(t){t[ye]&1024||(t[ye]|=1024,OE(t)&&As(t))}function uP(t,e){for(;t>0;)e=e[cc],t--;return e}function Nu(t){return!!(t[ye]&9216||t[dr]?.dirty)}function LE(t){t[Oi].changeDetectionScheduler?.notify(8),t[ye]&64&&(t[ye]|=1024),Nu(t)&&As(t)}function As(t){t[Oi].changeDetectionScheduler?.notify(0);let e=_s(t);for(;e!==null&&!(e[ye]&8192||(e[ye]|=8192,!OE(e)));)e=_s(e)}function sA(t,e){if(fc(t))throw new J(911,!1);t[Io]===null&&(t[Io]=[]),t[Io].push(e)}function dP(t,e){if(t[Io]===null)return;let n=t[Io].indexOf(e);n!==-1&&t[Io].splice(n,1)}function _s(t){let e=t[Ht];return Zr(e)?e[Ht]:e}function aA(t){return t[Au]??=[]}function cA(t){return t.cleanup??=[]}function hP(t,e,n,r){let i=aA(e);i.push(n),t.firstCreatePass&&cA(t).push(r,i.length-1)}var Se={lFrame:AP(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var MS=!1;function fP(){return Se.lFrame.elementDepthCount}function pP(){Se.lFrame.elementDepthCount++}function lA(){Se.lFrame.elementDepthCount--}function PE(){return Se.bindingsEnabled}function uA(){return Se.skipHydrationRootTNode!==null}function dA(t){return Se.skipHydrationRootTNode===t}function hA(){Se.skipHydrationRootTNode=null}function ne(){return Se.lFrame.lView}function Ye(){return Se.lFrame.tView}function gP(t){return Se.lFrame.contextLView=t,t[Nt]}function mP(t){return Se.lFrame.contextLView=null,t}function $t(){let t=fA();for(;t!==null&&t.type===64;)t=t.parent;return t}function fA(){return Se.lFrame.currentTNode}function EP(){let t=Se.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function gc(t,e){let n=Se.lFrame;n.currentTNode=t,n.isParent=e}function pA(){return Se.lFrame.isParent}function gA(){Se.lFrame.isParent=!1}function mA(){return Se.lFrame.contextLView}function EA(){return MS}function wu(t){let e=MS;return MS=t,e}function jn(){let t=Se.lFrame,e=t.bindingRootIndex;return e===-1&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function _A(){return Se.lFrame.bindingIndex}function _P(t){return Se.lFrame.bindingIndex=t}function Pi(){return Se.lFrame.bindingIndex++}function gf(t){let e=Se.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function TP(){return Se.lFrame.inI18n}function yP(t,e){let n=Se.lFrame;n.bindingIndex=n.bindingRootIndex=t,xE(e)}function IP(){return Se.lFrame.currentDirectiveIndex}function xE(t){Se.lFrame.currentDirectiveIndex=t}function vP(t){let e=Se.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function kE(){return Se.lFrame.currentQueryIndex}function mf(t){Se.lFrame.currentQueryIndex=t}function _z(t){let e=t[pe];return e.type===2?e.declTNode:e.type===1?t[Gn]:null}function TA(t,e,n){if(n&4){let i=e,o=t;for(;i=i.parent,i===null&&!(n&1);)if(i=_z(o),i===null||(o=o[cc],i.type&10))break;if(i===null)return!1;e=i,t=o}let r=Se.lFrame=SP();return r.currentTNode=e,r.lView=t,!0}function FE(t){let e=SP(),n=t[pe];Se.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function SP(){let t=Se.lFrame,e=t===null?null:t.child;return e===null?AP(t):e}function AP(t){let e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return t!==null&&(t.child=e),e}function CP(){let t=Se.lFrame;return Se.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var yA=CP;function UE(){let t=CP();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function DP(t){return(Se.lFrame.contextLView=uP(t,Se.lFrame.contextLView))[Nt]}function pr(){return Se.lFrame.selectedIndex}function Cs(t){Se.lFrame.selectedIndex=t}function mc(){let t=Se.lFrame;return ff(t.tView,t.selectedIndex)}function RP(){Se.lFrame.currentNamespace=sf}function NP(){Tz()}function Tz(){Se.lFrame.currentNamespace=null}function IA(){return Se.lFrame.currentNamespace}var wP=!0;function VE(){return wP}function Ef(t){wP=t}function LS(t,e=null,n=null,r){let i=vA(t,e,n,r);return i.resolveInjectorInitializers(),i}function vA(t,e=null,n=null,r,i=new Set){let o=[n||Rn,tP(t)];return r=r||(typeof t=="object"?void 0:vo(t)),new oc(o,e||Su(),r||null,i)}var ze=class t{static THROW_IF_NOT_FOUND=tc;static NULL=new of;static create(e,n){if(Array.isArray(e))return LS({name:""},n,e,"");{let r=e.name??"";return LS({name:r},e.parent,e.providers,r)}}static \u0275prov=Q({token:t,providedIn:"any",factory:()=>$(zS)});static __NG_ELEMENT_ID__=-1},on=new z(""),Hn=(()=>{class t{static __NG_ELEMENT_ID__=yz;static __NG_ENV_ID__=n=>n}return t})(),af=class extends Hn{_lView;constructor(e){super(),this._lView=e}get destroyed(){return fc(this._lView)}onDestroy(e){let n=this._lView;return sA(n,e),()=>dP(n,e)}};function yz(){return new af(ne())}var lr=class{_console=console;handleError(e){this._console.error("ERROR",e)}},xi=new z("",{providedIn:"root",factory:()=>{let t=Y(Nn),e;return n=>{t.destroyed&&!e?setTimeout(()=>{throw n}):(e??=t.get(lr),e.handleError(n))}}}),bP={provide:ys,useValue:()=>{Y(lr)},multi:!0};function ki(t){return typeof t=="function"&&t[rn]!==void 0}function Ec(t,e){let[n,r,i]=TS(t,e?.equal),o=n,s=o[rn];return o.set=r,o.update=i,o.asReadonly=SA.bind(o),o}function SA(){let t=this[rn];if(t.readonlyFn===void 0){let e=()=>this();e[rn]=t,t.readonlyFn=e}return t.readonlyFn}function AA(t){return ki(t)&&typeof t.set=="function"}var bu=(()=>{class t{view;node;constructor(n,r){this.view=n,this.node=r}static __NG_ELEMENT_ID__=Iz}return t})();function Iz(){return new bu(ne(),$t())}var Lr=class{},Ou=new z("",{providedIn:"root",factory:()=>!1});var CA=new z(""),BE=new z(""),Ds=(()=>{class t{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new ie(!1);get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new fe(n=>{n.next(!1),n.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let n=this.taskId++;return this.pendingTasks.add(n),n}has(n){return this.pendingTasks.has(n)}remove(n){this.pendingTasks.delete(n),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new t})}return t})(),Fi=(()=>{class t{internalPendingTasks=Y(Ds);scheduler=Y(Lr);errorHandler=Y(xi);add(){let n=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(n)&&(this.scheduler.notify(11),this.internalPendingTasks.remove(n))}}run(n){let r=this.add();n().catch(this.errorHandler).finally(r)}static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new t})}return t})();function _c(...t){}var _f=(()=>{class t{static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new PS})}return t})(),PS=class{dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let n=e.zone,r=this.queues.get(n);r.has(e)&&(r.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let n=e.zone;this.queues.has(n)||this.queues.set(n,new Set);let r=this.queues.get(n);r.has(e)||r.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[n,r]of this.queues)n===null?e||=this.flushQueue(r):e||=n.run(()=>this.flushQueue(r));e||(this.dirtyEffectCount=0)}}flushQueue(e){let n=!1;for(let r of e)r.dirty&&(this.dirtyEffectCount--,n=!0,r.run());return n}};function Wu(t){return{toString:t}.toString()}var GE="__parameters__";function Nz(t){return function(...n){if(t){let r=t(...n);for(let i in r)this[i]=r[i]}}}function fx(t,e,n){return Wu(()=>{let r=Nz(e);function i(...o){if(this instanceof i)return r.apply(this,o),this;let s=new i(...o);return a.annotation=s,a;function a(c,l,d){let h=c.hasOwnProperty(GE)?c[GE]:Object.defineProperty(c,GE,{value:[]})[GE];for(;h.length<=d;)h.push(null);return(h[d]=h[d]||[]).push(s),c}}return i.prototype.ngMetadataName=t,i.annotationCls=i,i})}var wz=$S(fx("Inject",t=>({token:t})),-1),zt=$S(fx("Optional"),8);function px(t){let e=Lt.ng;if(e&&e.\u0275compilerFacade)return e.\u0275compilerFacade;throw new Error("JIT compiler unavailable")}function bz(t){return typeof t=="function"}var ZE=class{previousValue;currentValue;firstChange;constructor(e,n,r){this.previousValue=e,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}};function gx(t,e,n,r){e!==null?e.applyValueToInputSignal(e,r):t[n]=r}var vC=(()=>{let t=()=>mx;return t.ngInherit=!0,t})();function mx(t){return t.type.prototype.ngOnChanges&&(t.setInput=Mz),Oz}function Oz(){let t=_x(this),e=t?.current;if(e){let n=t.previous;if(n===Qr)t.previous=e;else for(let r in e)n[r]=e[r];t.current=null,this.ngOnChanges(e)}}function Mz(t,e,n,r,i){let o=this.declaredInputs[r],s=_x(t)||Lz(t,{previous:Qr,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[o];a[o]=new ZE(l&&l.currentValue,n,c===Qr),gx(t,e,i,n)}var Ex="__ngSimpleChanges__";function _x(t){return t[Ex]||null}function Lz(t,e){return t[Ex]=e}var OP=[];var ot=function(t,e=null,n){for(let r=0;r<OP.length;r++){let i=OP[r];i(t,e,n)}};function Pz(t,e,n){let{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){let s=mx(e);(n.preOrderHooks??=[]).push(t,s),(n.preOrderCheckHooks??=[]).push(t,s)}i&&(n.preOrderHooks??=[]).push(0-t,i),o&&((n.preOrderHooks??=[]).push(t,o),(n.preOrderCheckHooks??=[]).push(t,o))}function Tx(t,e){for(let n=e.directiveStart,r=e.directiveEnd;n<r;n++){let o=t.data[n].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:d}=o;s&&(t.contentHooks??=[]).push(-n,s),a&&((t.contentHooks??=[]).push(n,a),(t.contentCheckHooks??=[]).push(n,a)),c&&(t.viewHooks??=[]).push(-n,c),l&&((t.viewHooks??=[]).push(n,l),(t.viewCheckHooks??=[]).push(n,l)),d!=null&&(t.destroyHooks??=[]).push(n,d)}}function KE(t,e,n){yx(t,e,3,n)}function YE(t,e,n,r){(t[ye]&3)===n&&yx(t,e,n,r)}function DA(t,e){let n=t[ye];(n&3)===e&&(n&=16383,n+=1,t[ye]=n)}function yx(t,e,n,r){let i=r!==void 0?t[lc]&65535:0,o=r??-1,s=e.length-1,a=0;for(let c=i;c<s;c++)if(typeof e[c+1]=="number"){if(a=e[c],r!=null&&a>=r)break}else e[c]<0&&(t[lc]+=65536),(a<o||o==-1)&&(xz(t,n,e,c),t[lc]=(t[lc]&4294901760)+c+2),c++}function MP(t,e){ot(4,t,e);let n=Te(null);try{e.call(t)}finally{Te(n),ot(5,t,e)}}function xz(t,e,n,r){let i=n[r]<0,o=n[r+1],s=i?-n[r]:n[r],a=t[s];i?t[ye]>>14<t[lc]>>16&&(t[ye]&3)===e&&(t[ye]+=16384,MP(a,o)):MP(a,o)}var Lu=-1,yc=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,n,r,i){this.factory=e,this.name=i,this.canSeeViewProviders=n,this.injectImpl=r}};function kz(t){return(t.flags&8)!==0}function Fz(t){return(t.flags&16)!==0}function Uz(t,e,n){let r=0;for(;r<n.length;){let i=n[r];if(typeof i=="number"){if(i!==0)break;r++;let o=n[r++],s=n[r++],a=n[r++];t.setAttribute(e,s,a,o)}else{let o=i,s=n[++r];Bz(o)?t.setProperty(e,o,s):t.setAttribute(e,o,s),r++}}return r}function Vz(t){return t===3||t===4||t===6}function Bz(t){return t.charCodeAt(0)===64}function Pu(t,e){if(!(e===null||e.length===0))if(t===null||t.length===0)t=e.slice();else{let n=-1;for(let r=0;r<e.length;r++){let i=e[r];typeof i=="number"?n=i:n===0||(n===-1||n===2?LP(t,n,i,null,e[++r]):LP(t,n,i,null,null))}}return t}function LP(t,e,n,r,i){let o=0,s=t.length;if(e===-1)s=-1;else for(;o<t.length;){let a=t[o++];if(typeof a=="number"){if(a===e){s=-1;break}else if(a>e){s=o-1;break}}}for(;o<t.length;){let a=t[o];if(typeof a=="number")break;if(a===n){i!==null&&(t[o+1]=i);return}o++,i!==null&&o++}s!==-1&&(t.splice(s,0,e),o=s+1),t.splice(o++,0,n),i!==null&&t.splice(o++,0,i)}function Ix(t){return t!==Lu}function e_(t){return t&32767}function Gz(t){return t>>16}function t_(t,e){let n=Gz(t),r=e;for(;n>0;)r=r[cc],n--;return r}var FA=!0;function n_(t){let e=FA;return FA=t,e}var jz=256,vx=jz-1,Sx=5,Hz=0,Ui={};function $z(t,e,n){let r;typeof n=="string"?r=n.charCodeAt(0)||0:n.hasOwnProperty(sc)&&(r=n[sc]),r==null&&(r=n[sc]=Hz++);let i=r&vx,o=1<<i;e.data[t+(i>>Sx)]|=o}function r_(t,e){let n=Ax(t,e);if(n!==-1)return n;let r=e[pe];r.firstCreatePass&&(t.injectorIndex=e.length,RA(r.data,t),RA(e,null),RA(r.blueprint,null));let i=SC(t,e),o=t.injectorIndex;if(Ix(i)){let s=e_(i),a=t_(i,e),c=a[pe].data;for(let l=0;l<8;l++)e[o+l]=a[s+l]|c[s+l]}return e[o+8]=i,o}function RA(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Ax(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function SC(t,e){if(t.parent&&t.parent.injectorIndex!==-1)return t.parent.injectorIndex;let n=0,r=null,i=e;for(;i!==null;){if(r=wx(i),r===null)return Lu;if(n++,i=i[cc],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return Lu}function UA(t,e,n){$z(t,e,n)}function Cx(t,e,n){if(n&8||t!==void 0)return t;DE(e,"NodeInjector")}function Dx(t,e,n,r){if(n&8&&r===void 0&&(r=null),(n&3)===0){let i=t[Ao],o=Bn(void 0);try{return i?i.get(e,r,n&8):HS(e,r,n&8)}finally{Bn(o)}}return Cx(r,e,n)}function Rx(t,e,n,r=0,i){if(t!==null){if(e[ye]&2048&&!(r&2)){let s=Yz(t,e,n,r,Ui);if(s!==Ui)return s}let o=Nx(t,e,n,r,Ui);if(o!==Ui)return o}return Dx(e,n,r,i)}function Nx(t,e,n,r,i){let o=zz(n);if(typeof o=="function"){if(!TA(e,t,r))return r&1?Cx(i,n,r):Dx(e,n,r,i);try{let s;if(s=o(r),s==null&&!(r&8))DE(n);else return s}finally{yA()}}else if(typeof o=="number"){let s=null,a=Ax(t,e),c=Lu,l=r&1?e[wn][Gn]:null;for((a===-1||r&4)&&(c=a===-1?SC(t,e):e[a+8],c===Lu||!xP(r,!1)?a=-1:(s=e[pe],a=e_(c),e=t_(c,e)));a!==-1;){let d=e[pe];if(PP(o,a,d.data)){let h=Wz(a,e,n,s,r,l);if(h!==Ui)return h}c=e[a+8],c!==Lu&&xP(r,e[pe].data[a+8]===l)&&PP(o,a,e)?(s=d,a=e_(c),e=t_(c,e)):a=-1}}return i}function Wz(t,e,n,r,i,o){let s=e[pe],a=s.data[t+8],c=r==null?Do(a)&&FA:r!=s&&(a.type&3)!==0,l=i&1&&o===a,d=XE(a,s,n,c,l);return d!==null?If(e,s,d,a,i):Ui}function XE(t,e,n,r,i){let o=t.providerIndexes,s=e.data,a=o&1048575,c=t.directiveStart,l=t.directiveEnd,d=o>>20,h=r?a:a+d,f=i?a+d:l;for(let g=h;g<f;g++){let E=s[g];if(g<c&&n===E||g>=c&&E.type===n)return g}if(i){let g=s[c];if(g&&ei(g)&&g.type===n)return c}return null}function If(t,e,n,r,i){let o=t[n],s=e.data;if(o instanceof yc){let a=o;if(a.resolving){let g=zL(s[n]);throw jS(g)}let c=n_(a.canSeeViewProviders);a.resolving=!0;let l=s[n].type||s[n],d,h=a.injectImpl?Bn(a.injectImpl):null,f=TA(t,r,0);try{o=t[n]=a.factory(void 0,i,s,t,r),e.firstCreatePass&&n>=r.directiveStart&&Pz(n,s[n],e)}finally{h!==null&&Bn(h),n_(c),a.resolving=!1,yA()}}return o}function zz(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=t.hasOwnProperty(sc)?t[sc]:void 0;return typeof e=="number"?e>=0?e&vx:qz:e}function PP(t,e,n){let r=1<<t;return!!(n[e+(t>>Sx)]&r)}function xP(t,e){return!(t&2)&&!(t&1&&e)}var Tc=class{_tNode;_lView;constructor(e,n){this._tNode=e,this._lView=n}get(e,n,r){return Rx(this._tNode,this._lView,e,rc(r),n)}};function qz(){return new Tc($t(),ne())}function Kz(t){return Wu(()=>{let e=t.prototype.constructor,n=e[rf]||VA(e),r=Object.prototype,i=Object.getPrototypeOf(t.prototype).constructor;for(;i&&i!==r;){let o=i[rf]||VA(i);if(o&&o!==n)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function VA(t){return kS(t)?()=>{let e=VA(jt(t));return e&&e()}:Es(t)}function Yz(t,e,n,r,i){let o=t,s=e;for(;o!==null&&s!==null&&s[ye]&2048&&!Ru(s);){let a=Nx(o,s,n,r|2,Ui);if(a!==Ui)return a;let c=o.parent;if(!c){let l=s[eA];if(l){let d=l.get(n,Ui,r);if(d!==Ui)return d}c=wx(s),s=s[cc]}o=c}return i}function wx(t){let e=t[pe],n=e.type;return n===2?e.declTNode:n===1?t[Gn]:null}function Xz(){return zu($t(),ne())}function zu(t,e){return new Ns(hr(t,e))}var Ns=(()=>{class t{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=Xz}return t})();function bx(t){return t instanceof Ns?t.nativeElement:t}function Qz(){return this._results[Symbol.iterator]()}var i_=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Rt}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,n){return this._results.reduce(e,n)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,n){this.dirty=!1;let r=QL(e);(this._changesDetected=!XL(this._results,r,n))&&(this._results=r,this.length=r.length,this.last=r[this.length-1],this.first=r[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=Qz};function Ox(t){return(t.flags&128)===128}var AC=(function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t})(AC||{}),Mx=new Map,Jz=0;function Zz(){return Jz++}function e8(t){Mx.set(t[df],t)}function BA(t){Mx.delete(t[df])}var kP="__ngContext__";function xu(t,e){Li(e)?(t[kP]=e[df],e8(e)):t[kP]=e}function Lx(t){return xx(t[Cu])}function Px(t){return xx(t[Pr])}function xx(t){for(;t!==null&&!Zr(t);)t=t[Pr];return t}var GA;function CC(t){GA=t}function DC(){if(GA!==void 0)return GA;if(typeof document<"u")return document;throw new J(210,!1)}var y_=new z("",{providedIn:"root",factory:()=>t8}),t8="ng",I_=new z(""),Oo=new z("",{providedIn:"platform",factory:()=>"unknown"});var n8=new z(""),qu=new z("",{providedIn:"root",factory:()=>DC().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var r8="h",i8="b";var kx="r";var Fx="di";var Ux=!1,Vx=new z("",{providedIn:"root",factory:()=>Ux});var o8=(t,e,n,r)=>{};function s8(t,e,n,r){o8(t,e,n,r)}function v_(t){return(t.flags&32)===32}var a8=()=>null;function Bx(t,e,n=!1){return a8(t,e,n)}function Gx(t,e){let n=t.contentQueries;if(n!==null){let r=Te(null);try{for(let i=0;i<n.length;i+=2){let o=n[i],s=n[i+1];if(s!==-1){let a=t.data[s];mf(o),a.contentQueries(2,e[s],s)}}}finally{Te(r)}}}function jA(t,e,n){mf(0);let r=Te(null);try{e(t,n)}finally{Te(r)}}function RC(t,e,n){if(nA(e)){let r=Te(null);try{let i=e.directiveStart,o=e.directiveEnd;for(let s=i;s<o;s++){let a=t.data[s];if(a.contentQueries){let c=n[s];a.contentQueries(1,c,s)}}}finally{Te(r)}}}var No=(function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t})(No||{});var c8="svg",l8="math",u8={"http://www.w3.org/2000/svg":c8,"http://www.w3.org/1998/Math/MathML":l8},jE;function d8(){if(jE===void 0&&(jE=null,Lt.trustedTypes))try{jE=Lt.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return jE}function S_(t){return d8()?.createHTML(t)||t}var HE;function h8(){if(HE===void 0&&(HE=null,Lt.trustedTypes))try{HE=Lt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return HE}function FP(t){return h8()?.createHTML(t)||t}var wo=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${IE})`}},HA=class extends wo{getTypeName(){return"HTML"}},$A=class extends wo{getTypeName(){return"Style"}},WA=class extends wo{getTypeName(){return"Script"}},zA=class extends wo{getTypeName(){return"URL"}},qA=class extends wo{getTypeName(){return"ResourceURL"}};function gr(t){return t instanceof wo?t.changingThisBreaksApplicationSecurity:t}function Bi(t,e){let n=jx(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${IE})`)}return n===e}function jx(t){return t instanceof wo&&t.getTypeName()||null}function NC(t){return new HA(t)}function wC(t){return new $A(t)}function bC(t){return new WA(t)}function OC(t){return new zA(t)}function MC(t){return new qA(t)}function f8(t){let e=new YA(t);return p8()?new KA(e):e}var KA=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let n=new window.DOMParser().parseFromString(S_(e),"text/html").body;return n===null?this.inertDocumentHelper.getInertBodyElement(e):(n.firstChild?.remove(),n)}catch{return null}}},YA=class{defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let n=this.inertDocument.createElement("template");return n.innerHTML=S_(e),n}};function p8(){try{return!!new window.DOMParser().parseFromString(S_(""),"text/html")}catch{return!1}}var g8=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Cf(t){return t=String(t),t.match(g8)?t:"unsafe:"+t}function Mo(t){let e={};for(let n of t.split(","))e[n]=!0;return e}function Df(...t){let e={};for(let n of t)for(let r in n)n.hasOwnProperty(r)&&(e[r]=!0);return e}var Hx=Mo("area,br,col,hr,img,wbr"),$x=Mo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Wx=Mo("rp,rt"),m8=Df(Wx,$x),E8=Df($x,Mo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),_8=Df(Wx,Mo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),UP=Df(Hx,E8,_8,m8),zx=Mo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),T8=Mo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),y8=Mo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),I8=Df(zx,T8,y8),v8=Mo("script,style,template"),XA=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let n=e.firstChild,r=!0,i=[];for(;n;){if(n.nodeType===Node.ELEMENT_NODE?r=this.startElement(n):n.nodeType===Node.TEXT_NODE?this.chars(n.nodeValue):this.sanitizedSomething=!0,r&&n.firstChild){i.push(n),n=C8(n);continue}for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let o=A8(n);if(o){n=o;break}n=i.pop()}}return this.buf.join("")}startElement(e){let n=VP(e).toLowerCase();if(!UP.hasOwnProperty(n))return this.sanitizedSomething=!0,!v8.hasOwnProperty(n);this.buf.push("<"),this.buf.push(n);let r=e.attributes;for(let i=0;i<r.length;i++){let o=r.item(i),s=o.name,a=s.toLowerCase();if(!I8.hasOwnProperty(a)){this.sanitizedSomething=!0;continue}let c=o.value;zx[a]&&(c=Cf(c)),this.buf.push(" ",s,'="',BP(c),'"')}return this.buf.push(">"),!0}endElement(e){let n=VP(e).toLowerCase();UP.hasOwnProperty(n)&&!Hx.hasOwnProperty(n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(e){this.buf.push(BP(e))}};function S8(t,e){return(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function A8(t){let e=t.nextSibling;if(e&&t!==e.previousSibling)throw qx(e);return e}function C8(t){let e=t.firstChild;if(e&&S8(t,e))throw qx(e);return e}function VP(t){let e=t.nodeName;return typeof e=="string"?e:"FORM"}function qx(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}var D8=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,R8=/([^\#-~ |!])/g;function BP(t){return t.replace(/&/g,"&").replace(D8,function(e){let n=e.charCodeAt(0),r=e.charCodeAt(1);return"&#"+((n-55296)*1024+(r-56320)+65536)+";"}).replace(R8,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}var $E;function A_(t,e){let n=null;try{$E=$E||f8(t);let r=e?String(e):"";n=$E.getInertBodyElement(r);let i=5,o=r;do{if(i===0)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=n.innerHTML,n=$E.getInertBodyElement(r)}while(r!==o);let a=new XA().sanitizeChildren(GP(n)||n);return S_(a)}finally{if(n){let r=GP(n)||n;for(;r.firstChild;)r.firstChild.remove()}}}function GP(t){return"content"in t&&N8(t)?t.content:null}function N8(t){return t.nodeType===Node.ELEMENT_NODE&&t.nodeName==="TEMPLATE"}var w8=/^>|^->|<!--|-->|--!>|<!-$/g,b8=/(<|>)/g,O8="\u200B$1\u200B";function M8(t){return t.replace(w8,e=>e.replace(b8,O8))}function L8(t,e){return t.createText(e)}function P8(t,e,n){t.setValue(e,n)}function x8(t,e){return t.createComment(M8(e))}function Kx(t,e,n){return t.createElement(e,n)}function o_(t,e,n,r,i){t.insertBefore(e,n,r,i)}function Yx(t,e,n){t.appendChild(e,n)}function jP(t,e,n,r,i){r!==null?o_(t,e,n,r,i):Yx(t,e,n)}function Xx(t,e,n,r){t.removeChild(null,e,n,r)}function k8(t,e,n){t.setAttribute(e,"style",n)}function F8(t,e,n){n===""?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n)}function Qx(t,e,n){let{mergedAttrs:r,classes:i,styles:o}=n;r!==null&&Uz(t,e,r),i!==null&&F8(t,e,i),o!==null&&k8(t,e,o)}function U8(t,e=!0){if(t[0]!=":")return[null,t];let n=t.indexOf(":",1);if(n===-1){if(e)throw new Error(`Unsupported format "${t}" expecting ":namespace:name"`);return[null,t]}return[t.slice(1,n),t.slice(n+1)]}function V8(t,e,n){if(e!==void 0&&n!==void 0&&j8(e,n)!==vt.HTML)return t;let r=LC();return r?FP(r.sanitize(vt.HTML,t)||""):Bi(t,"HTML")?FP(gr(t)):A_(DC(),ur(t))}function B8(t){let e=LC();return e?e.sanitize(vt.STYLE,t)||"":Bi(t,"Style")?gr(t):ur(t)}function G8(t){let e=LC();return e?e.sanitize(vt.URL,t)||"":Bi(t,"URL")?gr(t):Cf(ur(t))}function LC(){let t=ne();return t&&t[Oi].sanitizer}function j8(t,e){let[n,r]=H8(t);return aP(r,e,n)}function H8(t){t=t.toLowerCase();let e=U8(t,!1);if(e[0])return e;let r=pr()===-1?null:mc(),i=r?.namespace;if(t==="#host"&&r?.type===2){let o=hr(r,ne());if(o.tagName&&(t=o.tagName.toLowerCase()),i==null){let s=o.namespaceURI;i=s&&u8[s]}}return[i,t]}function $8(t){return t.ownerDocument.defaultView}function W8(t){return t.ownerDocument}function z8(t){return t instanceof Function?t():t}function q8(t,e,n){let r=t.length;for(;;){let i=t.indexOf(e,n);if(i===-1)return i;if(i===0||t.charCodeAt(i-1)<=32){let o=e.length;if(i+o===r||t.charCodeAt(i+o)<=32)return i}n=i+1}}var Jx="ng-template";function K8(t,e,n,r){let i=0;if(r){for(;i<e.length&&typeof e[i]=="string";i+=2)if(e[i]==="class"&&q8(e[i+1].toLowerCase(),n,0)!==-1)return!0}else if(PC(t))return!1;if(i=e.indexOf(1,i),i>-1){let o;for(;++i<e.length&&typeof(o=e[i])=="string";)if(o.toLowerCase()===n)return!0}return!1}function PC(t){return t.type===4&&t.value!==Jx}function Y8(t,e,n){let r=t.type===4&&!n?Jx:t.value;return e===r}function X8(t,e,n){let r=4,i=t.attrs,o=i!==null?Z8(i):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!ti(r)&&!ti(c))return!1;if(s&&ti(c))continue;s=!1,r=c|r&1;continue}if(!s)if(r&4){if(r=2|r&1,c!==""&&!Y8(t,c,n)||c===""&&e.length===1){if(ti(r))return!1;s=!0}}else if(r&8){if(i===null||!K8(t,i,c,n)){if(ti(r))return!1;s=!0}}else{let l=e[++a],d=Q8(c,i,PC(t),n);if(d===-1){if(ti(r))return!1;s=!0;continue}if(l!==""){let h;if(d>o?h="":h=i[d+1].toLowerCase(),r&2&&l!==h){if(ti(r))return!1;s=!0}}}}return ti(r)||s}function ti(t){return(t&1)===0}function Q8(t,e,n,r){if(e===null)return-1;let i=0;if(r||!n){let o=!1;for(;i<e.length;){let s=e[i];if(s===t)return i;if(s===3||s===6)o=!0;else if(s===1||s===2){let a=e[++i];for(;typeof a=="string";)a=e[++i];continue}else{if(s===4)break;if(s===0){i+=4;continue}}i+=o?1:2}return-1}else return e5(e,t)}function Zx(t,e,n=!1){for(let r=0;r<e.length;r++)if(X8(t,e[r],n))return!0;return!1}function J8(t){let e=t.attrs;if(e!=null){let n=e.indexOf(5);if((n&1)===0)return e[n+1]}return null}function Z8(t){for(let e=0;e<t.length;e++){let n=t[e];if(Vz(n))return e}return t.length}function e5(t,e){let n=t.indexOf(4);if(n>-1)for(n++;n<t.length;){let r=t[n];if(typeof r=="number")return-1;if(r===e)return n;n++}return-1}function t5(t,e){e:for(let n=0;n<e.length;n++){let r=e[n];if(t.length===r.length){for(let i=0;i<t.length;i++)if(t[i]!==r[i])continue e;return!0}}return!1}function HP(t,e){return t?":not("+e.trim()+")":e}function n5(t){let e=t[0],n=1,r=2,i="",o=!1;for(;n<t.length;){let s=t[n];if(typeof s=="string")if(r&2){let a=t[++n];i+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else r&8?i+="."+s:r&4&&(i+=" "+s);else i!==""&&!ti(s)&&(e+=HP(o,i),i=""),r=s,o=o||!ti(r);n++}return i!==""&&(e+=HP(o,i)),e}function r5(t){return t.map(n5).join(",")}function i5(t){let e=[],n=[],r=1,i=2;for(;r<t.length;){let o=t[r];if(typeof o=="string")i===2?o!==""&&e.push(o,t[++r]):i===8&&n.push(o);else{if(!ti(i))break;i=o}r++}return n.length&&e.push(1,...n),e}var sn={};function xC(t,e,n,r,i,o,s,a,c,l,d){let h=Ke+r,f=h+i,g=o5(h,f),E=typeof l=="function"?l():l;return g[pe]={type:t,blueprint:g,template:n,queries:null,viewQuery:a,declTNode:e,data:g.slice().fill(null,h),bindingStartIndex:h,expandoStartIndex:f,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof o=="function"?o():o,pipeRegistry:typeof s=="function"?s():s,firstChild:null,schemas:c,consts:E,incompleteFirstPass:!1,ssrId:d}}function o5(t,e){let n=[];for(let r=0;r<e;r++)n.push(r<t?null:sn);return n}function s5(t){let e=t.tView;return e===null||e.incompleteFirstPass?t.tView=xC(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):e}function kC(t,e,n,r,i,o,s,a,c,l,d){let h=e.blueprint.slice();return h[Jr]=i,h[ye]=r|4|128|8|64|1024,(l!==null||t&&t[ye]&2048)&&(h[ye]|=2048),oA(h),h[Ht]=h[cc]=t,h[Nt]=n,h[Oi]=s||t&&t[Oi],h[qe]=a||t&&t[qe],h[Ao]=c||t&&t[Ao]||null,h[Gn]=o,h[df]=Zz(),h[ac]=d,h[eA]=l,h[wn]=e.type==2?t[wn]:h,h}function a5(t,e,n){let r=hr(e,t),i=s5(n),o=t[Oi].rendererFactory,s=FC(t,kC(t,i,null,ek(n),r,e,null,o.createRenderer(r,n),null,null,null));return t[e.index]=s}function ek(t){let e=16;return t.signals?e=4096:t.onPush&&(e=64),e}function tk(t,e,n,r){if(n===0)return-1;let i=e.length;for(let o=0;o<n;o++)e.push(r),t.blueprint.push(r),t.data.push(null);return i}function FC(t,e){return t[Cu]?t[ZS][Pr]=e:t[Cu]=e,t[ZS]=e,e}function c5(t=1){nk(Ye(),ne(),pr()+t,!1)}function nk(t,e,n,r){if(!r)if((e[ye]&3)===3){let o=t.preOrderCheckHooks;o!==null&&KE(e,o,n)}else{let o=t.preOrderHooks;o!==null&&YE(e,o,0,n)}Cs(n)}var C_=(function(t){return t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",t})(C_||{});function QA(t,e,n,r){let i=Te(null);try{let[o,s,a]=t.inputs[n],c=null;(s&C_.SignalBased)!==0&&(c=e[o][rn]),c!==null&&c.transformFn!==void 0?r=c.transformFn(r):a!==null&&(r=a.call(e,r)),t.setInput!==null?t.setInput(e,c,r,n,o):gx(e,c,o,r)}finally{Te(i)}}var ni=(function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t})(ni||{}),l5;function UC(t,e){return l5(t,e)}var Ic=new Set,D_=(function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t})(D_||{}),Ac=new z(""),$P=new Set;function Lo(t){$P.has(t)||($P.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var rk=!1,JA=class extends Rt{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,JS()&&(this.destroyRef=Y(Hn,{optional:!0})??void 0,this.pendingTasks=Y(Ds,{optional:!0})??void 0)}emit(e){let n=Te(null);try{super.next(e)}finally{Te(n)}}subscribe(e,n,r){let i=e,o=n||(()=>null),s=r;if(e&&typeof e=="object"){let c=e;i=c.next?.bind(c),o=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(o=this.wrapInTimeout(o),i&&(i=this.wrapInTimeout(i)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:i,error:o,complete:s});return e instanceof gt&&e.add(a),a}wrapInTimeout(e){return n=>{let r=this.pendingTasks?.add();setTimeout(()=>{try{e(n)}finally{r!==void 0&&this.pendingTasks?.remove(r)}})}}},Ro=JA;function ik(t){let e,n;function r(){t=_c;try{n!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(n),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{t(),r()}),typeof requestAnimationFrame=="function"&&(n=requestAnimationFrame(()=>{t(),r()})),()=>r()}function WP(t){return queueMicrotask(()=>t()),()=>{t=_c}}var VC="isAngularZone",s_=VC+"_ID",u5=0,Ae=class t{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Ro(!1);onMicrotaskEmpty=new Ro(!1);onStable=new Ro(!1);onError=new Ro(!1);constructor(e){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:o=rk}=e;if(typeof Zone>"u")throw new J(908,!1);Zone.assertZonePatched();let s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),n&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!i&&r,s.shouldCoalesceRunChangeDetection=i,s.callbackScheduled=!1,s.scheduleInRootZone=o,f5(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(VC)===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new J(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new J(909,!1)}run(e,n,r){return this._inner.run(e,n,r)}runTask(e,n,r,i){let o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+i,e,d5,_c,_c);try{return o.runTask(s,n,r)}finally{o.cancelTask(s)}}runGuarded(e,n,r){return this._inner.runGuarded(e,n,r)}runOutsideAngular(e){return this._outer.run(e)}},d5={};function BC(t){if(t._nesting==0&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function h5(t){if(t.isCheckStableRunning||t.callbackScheduled)return;t.callbackScheduled=!0;function e(){ik(()=>{t.callbackScheduled=!1,ZA(t),t.isCheckStableRunning=!0,BC(t),t.isCheckStableRunning=!1})}t.scheduleInRootZone?Zone.root.run(()=>{e()}):t._outer.run(()=>{e()}),ZA(t)}function f5(t){let e=()=>{h5(t)},n=u5++;t._inner=t._inner.fork({name:"angular",properties:{[VC]:!0,[s_]:n,[s_+n]:!0},onInvokeTask:(r,i,o,s,a,c)=>{if(p5(c))return r.invokeTask(o,s,a,c);try{return zP(t),r.invokeTask(o,s,a,c)}finally{(t.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),qP(t)}},onInvoke:(r,i,o,s,a,c,l)=>{try{return zP(t),r.invoke(o,s,a,c,l)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!g5(c)&&e(),qP(t)}},onHasTask:(r,i,o,s)=>{r.hasTask(o,s),i===o&&(s.change=="microTask"?(t._hasPendingMicrotasks=s.microTask,ZA(t),BC(t)):s.change=="macroTask"&&(t.hasPendingMacrotasks=s.macroTask))},onHandleError:(r,i,o,s)=>(r.handleError(o,s),t.runOutsideAngular(()=>t.onError.emit(s)),!1)})}function ZA(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.callbackScheduled===!0?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function zP(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function qP(t){t._nesting--,BC(t)}var ku=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Ro;onMicrotaskEmpty=new Ro;onStable=new Ro;onError=new Ro;run(e,n,r){return e.apply(n,r)}runGuarded(e,n,r){return e.apply(n,r)}runOutsideAngular(e){return e()}runTask(e,n,r,i){return e.apply(n,r)}};function p5(t){return ok(t,"__ignore_ng_zone__")}function g5(t){return ok(t,"__scheduler_tick__")}function ok(t,e){return!Array.isArray(t)||t.length!==1?!1:t[0]?.data?.[e]===!0}function sk(t="zone.js",e){return t==="noop"?new ku:t==="zone.js"?new Ae(e):t}var GC=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new t})}return t})(),ak=[0,1,2,3],ck=(()=>{class t{ngZone=Y(Ae);scheduler=Y(Lr);errorHandler=Y(lr,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){Y(Ac,{optional:!0})}execute(){let n=this.sequences.size>0;n&&ot(16),this.executing=!0;for(let r of ak)for(let i of this.sequences)if(!(i.erroredOrDestroyed||!i.hooks[r]))try{i.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let o=i.hooks[r];return o(i.pipelinedValue)},i.snapshot))}catch(o){i.erroredOrDestroyed=!0,this.errorHandler?.handleError(o)}this.executing=!1;for(let r of this.sequences)r.afterRun(),r.once&&(this.sequences.delete(r),r.destroy());for(let r of this.deferredRegistrations)this.sequences.add(r);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),n&&ot(17)}register(n){let{view:r}=n;r!==void 0?((r[uc]??=[]).push(n),As(r),r[ye]|=8192):this.executing?this.deferredRegistrations.add(n):this.addSequence(n)}addSequence(n){this.sequences.add(n),this.scheduler.notify(7)}unregister(n){this.executing&&this.sequences.has(n)?(n.erroredOrDestroyed=!0,n.pipelinedValue=void 0,n.once=!0):(this.sequences.delete(n),this.deferredRegistrations.delete(n))}maybeTrace(n,r){return r?r.run(D_.AFTER_NEXT_RENDER,n):n()}static \u0275prov=Q({token:t,providedIn:"root",factory:()=>new t})}return t})(),a_=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,n,r,i,o,s=null){this.impl=e,this.hooks=n,this.view=r,this.once=i,this.snapshot=s,this.unregisterOnDestroy=o?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[uc];e&&(this.view[uc]=e.filter(n=>n!==this))}};function m5(t,e){let n=e?.injector??Y(ze);return Lo("NgAfterNextRender"),_5(t,n,e,!0)}function E5(t){return t instanceof Function?[void 0,void 0,t,void 0]:[t.earlyRead,t.write,t.mixedReadWrite,t.read]}function _5(t,e,n,r){let i=e.get(GC);i.impl??=e.get(ck);let o=e.get(Ac,null,{optional:!0}),s=n?.manualCleanup!==!0?e.get(Hn):null,a=e.get(bu,null,{optional:!0}),c=new a_(i.impl,E5(t),a?.view,r,s,o?.snapshot(null));return i.impl.register(c),c}var lk=new z("",{providedIn:"root",factory:()=>({queue:new Set,isScheduled:!1,scheduler:null})});function uk(t,e,n){let r=t.get(lk);if(Array.isArray(e))for(let i of e)r.queue.add(i),n?.detachedLeaveAnimationFns?.push(i);else r.queue.add(e),n?.detachedLeaveAnimationFns?.push(e);r.scheduler&&r.scheduler(t)}function T5(t,e){let n=t.get(lk);if(e.detachedLeaveAnimationFns){for(let r of e.detachedLeaveAnimationFns)n.queue.delete(r);e.detachedLeaveAnimationFns=void 0}}function y5(t,e){for(let[n,r]of e)uk(t,r.animateFns)}function KP(t,e,n,r){let i=t?.[dc]?.enter;e!==null&&i&&i.has(n.index)&&y5(r,i)}function Mu(t,e,n,r,i,o,s,a){if(i!=null){let c,l=!1;Zr(i)?c=i:Li(i)&&(l=!0,i=i[Jr]);let d=xr(i);t===0&&r!==null?(KP(a,r,o,n),s==null?Yx(e,r,d):o_(e,r,d,s||null,!0)):t===1&&r!==null?(KP(a,r,o,n),o_(e,r,d,s||null,!0)):t===2?YP(a,o,n,h=>{Xx(e,d,l,h)}):t===3&&YP(a,o,n,()=>{e.destroyNode(d)}),c!=null&&O5(e,t,n,c,o,r,s)}}function I5(t,e){dk(t,e),e[Jr]=null,e[Gn]=null}function v5(t,e,n,r,i,o){r[Jr]=i,r[Gn]=e,N_(t,r,n,1,i,o)}function dk(t,e){e[Oi].changeDetectionScheduler?.notify(9),N_(t,e,e[qe],2,null,null)}function S5(t){let e=t[Cu];if(!e)return NA(t[pe],t);for(;e;){let n=null;if(Li(e))n=e[Cu];else{let r=e[wt];r&&(n=r)}if(!n){for(;e&&!e[Pr]&&e!==t;)Li(e)&&NA(e[pe],e),e=e[Ht];e===null&&(e=t),Li(e)&&NA(e[pe],e),n=e&&e[Pr]}e=n}}function jC(t,e){let n=t[hc],r=n.indexOf(e);n.splice(r,1)}function R_(t,e){if(fc(e))return;let n=e[qe];n.destroyNode&&N_(t,e,n,3,null,null),S5(e)}function NA(t,e){if(fc(e))return;let n=Te(null);try{e[ye]&=-129,e[ye]|=256,e[dr]&&ec(e[dr]),D5(t,e),C5(t,e),e[pe].type===1&&e[qe].destroy();let r=e[vs];if(r!==null&&Zr(e[Ht])){r!==e[Ht]&&jC(r,e);let i=e[Mi];i!==null&&i.detachView(t)}BA(e)}finally{Te(n)}}function YP(t,e,n,r){let i=t?.[dc];if(i==null||i.leave==null||!i.leave.has(e.index))return r(!1);t&&Ic.add(t),uk(n,()=>{if(i.leave&&i.leave.has(e.index)){let s=i.leave.get(e.index),a=[];if(s){for(let c=0;c<s.animateFns.length;c++){let l=s.animateFns[c],{promise:d}=l();a.push(d)}i.detachedLeaveAnimationFns=void 0}i.running=Promise.allSettled(a),A5(t,r)}else t&&Ic.delete(t),r(!1)},i)}function A5(t,e){let n=t[dc]?.running;if(n){n.then(()=>{t[dc].running=void 0,Ic.delete(t),e(!0)});return}e(!1)}function C5(t,e){let n=t.cleanup,r=e[Au];if(n!==null)for(let s=0;s<n.length-1;s+=2)if(typeof n[s]=="string"){let a=n[s+3];a>=0?r[a]():r[-a].unsubscribe(),s+=2}else{let a=r[n[s+1]];n[s].call(a)}r!==null&&(e[Au]=null);let i=e[Io];if(i!==null){e[Io]=null;for(let s=0;s<i.length;s++){let a=i[s];a()}}let o=e[Co];if(o!==null){e[Co]=null;for(let s of o)s.destroy()}}function D5(t,e){let n;if(t!=null&&(n=t.destroyHooks)!=null)for(let r=0;r<n.length;r+=2){let i=e[n[r]];if(!(i instanceof yc)){let o=n[r+1];if(Array.isArray(o))for(let s=0;s<o.length;s+=2){let a=i[o[s]],c=o[s+1];ot(4,a,c);try{c.call(a)}finally{ot(5,a,c)}}else{ot(4,i,o);try{o.call(i)}finally{ot(5,i,o)}}}}}function hk(t,e,n){return R5(t,e.parent,n)}function R5(t,e,n){let r=e;for(;r!==null&&r.type&168;)e=r,r=e.parent;if(r===null)return n[Jr];if(Do(r)){let{encapsulation:i}=t.data[r.directiveStart+r.componentOffset];if(i===No.None||i===No.Emulated)return null}return hr(r,n)}function fk(t,e,n){return w5(t,e,n)}function N5(t,e,n){return t.type&40?hr(t,n):null}var w5=N5,XP;function HC(t,e,n,r){let i=hk(t,r,e),o=e[qe],s=r.parent||e[Gn],a=fk(s,r,e);if(i!=null)if(Array.isArray(n))for(let c=0;c<n.length;c++)jP(o,i,n[c],a,!1);else jP(o,i,n,a,!1);XP!==void 0&&XP(o,r,e,n,i)}function Tf(t,e){if(e!==null){let n=e.type;if(n&3)return hr(e,t);if(n&4)return eC(-1,t[e.index]);if(n&8){let r=e.child;if(r!==null)return Tf(t,r);{let i=t[e.index];return Zr(i)?eC(-1,i):xr(i)}}else{if(n&128)return Tf(t,e.next);if(n&32)return UC(e,t)()||xr(t[e.index]);{let r=pk(t,e);if(r!==null){if(Array.isArray(r))return r[0];let i=_s(t[wn]);return Tf(i,r)}else return Tf(t,e.next)}}}return null}function pk(t,e){if(e!==null){let r=t[wn][Gn],i=e.projection;return r.projection[i]}return null}function eC(t,e){let n=wt+t+1;if(n<e.length){let r=e[n],i=r[pe].firstChild;if(i!==null)return Tf(r,i)}return e[Ss]}function $C(t,e,n,r,i,o,s){for(;n!=null;){let a=r[Ao];if(n.type===128){n=n.next;continue}let c=r[n.index],l=n.type;if(s&&e===0&&(c&&xu(xr(c),r),n.flags|=2),!v_(n))if(l&8)$C(t,e,n.child,r,i,o,!1),Mu(e,t,a,i,c,n,o,r);else if(l&32){let d=UC(n,r),h;for(;h=d();)Mu(e,t,a,i,h,n,o,r);Mu(e,t,a,i,c,n,o,r)}else l&16?gk(t,e,r,n,i,o):Mu(e,t,a,i,c,n,o,r);n=s?n.projectionNext:n.next}}function N_(t,e,n,r,i,o){$C(n,r,t.firstChild,e,i,o,!1)}function b5(t,e,n){let r=e[qe],i=hk(t,n,e),o=n.parent||e[Gn],s=fk(o,n,e);gk(r,0,e,n,i,s)}function gk(t,e,n,r,i,o){let s=n[wn],c=s[Gn].projection[r.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let d=c[l];Mu(e,t,n[Ao],i,d,r,o,n)}else{let l=c,d=s[Ht];Ox(r)&&(l.flags|=128),$C(t,e,l,d,i,o,!0)}}function O5(t,e,n,r,i,o,s){let a=r[Ss],c=xr(r);a!==c&&Mu(e,t,n,o,a,i,s);for(let l=wt;l<r.length;l++){let d=r[l];N_(d[pe],d,t,e,o,a)}}function M5(t,e,n,r,i){if(e)i?t.addClass(n,r):t.removeClass(n,r);else{let o=r.indexOf("-")===-1?void 0:ni.DashCase;i==null?t.removeStyle(n,r,o):(typeof i=="string"&&i.endsWith("!important")&&(i=i.slice(0,-10),o|=ni.Important),t.setStyle(n,r,i,o))}}function mk(t,e,n,r,i){let o=pr(),s=r&2;try{Cs(-1),s&&e.length>Ke&&nk(t,e,Ke,!1),ot(s?2:0,i,n),n(r,i)}finally{Cs(o),ot(s?3:1,i,n)}}function w_(t,e,n){F5(t,e,n),(n.flags&64)===64&&U5(t,e,n)}function Rf(t,e,n=hr){let r=e.localNames;if(r!==null){let i=e.index+1;for(let o=0;o<r.length;o+=2){let s=r[o+1],a=s===-1?n(e,t):t[s];t[i++]=a}}}function L5(t,e,n,r){let o=r.get(Vx,Ux)||n===No.ShadowDom,s=t.selectRootElement(e,o);return P5(s),s}function P5(t){x5(t)}var x5=()=>null;function k5(t){return t==="class"?"className":t==="for"?"htmlFor":t==="formaction"?"formAction":t==="innerHtml"?"innerHTML":t==="readonly"?"readOnly":t==="tabindex"?"tabIndex":t}function Ek(t,e,n,r,i,o){let s=e[pe];if(b_(t,s,e,n,r)){Do(t)&&Tk(e,t.index);return}t.type&3&&(n=k5(n)),_k(t,e,n,r,i,o)}function _k(t,e,n,r,i,o){if(t.type&3){let s=hr(t,e);r=o!=null?o(r,t.value||"",n):r,i.setProperty(s,n,r)}else t.type&12}function Tk(t,e){let n=kr(e,t);n[ye]&16||(n[ye]|=64)}function F5(t,e,n){let r=n.directiveStart,i=n.directiveEnd;Do(n)&&a5(e,n,t.data[r+n.componentOffset]),t.firstCreatePass||r_(n,e);let o=n.initialInputs;for(let s=r;s<i;s++){let a=t.data[s],c=If(e,t,s,n);if(xu(c,e),o!==null&&G5(e,s-r,c,a,n,o),ei(a)){let l=kr(n.index,e);l[Nt]=If(e,t,s,n)}}}function U5(t,e,n){let r=n.directiveStart,i=n.directiveEnd,o=n.index,s=IP();try{Cs(o);for(let a=r;a<i;a++){let c=t.data[a],l=e[a];xE(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&V5(c,l)}}finally{Cs(-1),xE(s)}}function V5(t,e){t.hostBindings!==null&&t.hostBindings(1,e)}function WC(t,e){let n=t.directiveRegistry,r=null;if(n)for(let i=0;i<n.length;i++){let o=n[i];Zx(e,o.selectors,!1)&&(r??=[],ei(o)?r.unshift(o):r.push(o))}return r}function B5(t,e,n,r,i,o){let s=hr(t,e);yk(e[qe],s,o,t.value,n,r,i)}function yk(t,e,n,r,i,o,s){if(o==null)t.removeAttribute(e,i,n);else{let a=s==null?ur(o):s(o,r||"",i);t.setAttribute(e,i,a,n)}}function G5(t,e,n,r,i,o){let s=o[e];if(s!==null)for(let a=0;a<s.length;a+=2){let c=s[a],l=s[a+1];QA(r,n,c,l)}}function zC(t,e,n,r,i){let o=Ke+n,s=e[pe],a=i(s,e,t,r,n);e[o]=a,gc(t,!0);let c=t.type===2;return c?(Qx(e[qe],a,t),(fP()===0||Du(t))&&xu(a,e),pP()):xu(a,e),VE()&&(!c||!v_(t))&&HC(s,e,a,t),t}function qC(t){let e=t;return pA()?gA():(e=e.parent,gc(e,!1)),e}function j5(t,e){let n=t[Ao];if(!n)return;let r;try{r=n.get(xi,null)}catch{r=null}r?.(e)}function b_(t,e,n,r,i){let o=t.inputs?.[r],s=t.hostDirectiveInputs?.[r],a=!1;if(s)for(let c=0;c<s.length;c+=2){let l=s[c],d=s[c+1],h=e.data[l];QA(h,n[l],d,i),a=!0}if(o)for(let c of o){let l=n[c],d=e.data[c];QA(d,l,r,i),a=!0}return a}function H5(t,e){let n=kr(e,t),r=n[pe];$5(r,n);let i=n[Jr];i!==null&&n[ac]===null&&(n[ac]=Bx(i,n[Ao])),ot(18),KC(r,n,n[Nt]),ot(19,n[Nt])}function $5(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}function KC(t,e,n){FE(e);try{let r=t.viewQuery;r!==null&&jA(1,r,n);let i=t.template;i!==null&&mk(t,e,i,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),e[Mi]?.finishViewCreation(t),t.staticContentQueries&&Gx(t,e),t.staticViewQueries&&jA(2,t.viewQuery,n);let o=t.components;o!==null&&W5(e,o)}catch(r){throw t.firstCreatePass&&(t.incompleteFirstPass=!0,t.firstCreatePass=!1),r}finally{e[ye]&=-5,UE()}}function W5(t,e){for(let n=0;n<e.length;n++)H5(t,e[n])}function Nf(t,e,n,r){let i=Te(null);try{let o=e.tView,a=t[ye]&4096?4096:16,c=kC(t,o,n,a,null,e,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null),l=t[e.index];c[vs]=l;let d=t[Mi];return d!==null&&(c[Mi]=d.createEmbeddedView(o)),KC(o,c,n),c}finally{Te(i)}}function Fu(t,e){return!e||e.firstChild===null||Ox(t)}function vf(t,e,n,r,i=!1){for(;n!==null;){if(n.type===128){n=i?n.projectionNext:n.next;continue}let o=e[n.index];o!==null&&r.push(xr(o)),Zr(o)&&Ik(o,r);let s=n.type;if(s&8)vf(t,e,n.child,r);else if(s&32){let a=UC(n,e),c;for(;c=a();)r.push(c)}else if(s&16){let a=pk(e,n);if(Array.isArray(a))r.push(...a);else{let c=_s(e[wn]);vf(c[pe],c,a,r,!0)}}n=i?n.projectionNext:n.next}return r}function Ik(t,e){for(let n=wt;n<t.length;n++){let r=t[n],i=r[pe].firstChild;i!==null&&vf(r[pe],r,i,e)}t[Ss]!==t[Jr]&&e.push(t[Ss])}function vk(t){if(t[uc]!==null){for(let e of t[uc])e.impl.addSequence(e);t[uc].length=0}}var Sk=[];function z5(t){return t[dr]??q5(t)}function q5(t){let e=Sk.pop()??Object.create(Y5);return e.lView=t,e}function K5(t){t.lView[dr]!==t&&(t.lView=null,Sk.push(t))}var Y5=Ee(B({},Ja),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{As(t.lView)},consumerOnSignalRead(){this.lView[dr]=this}});function X5(t){let e=t[dr]??Object.create(Q5);return e.lView=t,e}var Q5=Ee(B({},Ja),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let e=_s(t.lView);for(;e&&!Ak(e[pe]);)e=_s(e);e&&ME(e)},consumerOnSignalRead(){this.lView[dr]=this}});function Ak(t){return t.type!==2}function Ck(t){if(t[Co]===null)return;let e=!0;for(;e;){let n=!1;for(let r of t[Co])r.dirty&&(n=!0,r.zone===null||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=n&&!!(t[ye]&8192)}}var J5=100;function Dk(t,e=0){let r=t[Oi].rendererFactory,i=!1;i||r.begin?.();try{Z5(t,e)}finally{i||r.end?.()}}function Z5(t,e){let n=EA();try{wu(!0),tC(t,e);let r=0;for(;Nu(t);){if(r===J5)throw new J(103,!1);r++,tC(t,1)}}finally{wu(n)}}function eq(t,e,n,r){if(fc(e))return;let i=e[ye],o=!1,s=!1;FE(e);let a=!0,c=null,l=null;o||(Ak(t)?(l=z5(e),c=Za(l)):sE()===null?(a=!1,l=X5(e),c=Za(l)):e[dr]&&(ec(e[dr]),e[dr]=null));try{oA(e),_P(t.bindingStartIndex),n!==null&&mk(t,e,n,2,r);let d=(i&3)===3;if(!o)if(d){let g=t.preOrderCheckHooks;g!==null&&KE(e,g,null)}else{let g=t.preOrderHooks;g!==null&&YE(e,g,0,null),DA(e,0)}if(s||tq(e),Ck(e),Rk(e,0),t.contentQueries!==null&&Gx(t,e),!o)if(d){let g=t.contentCheckHooks;g!==null&&KE(e,g)}else{let g=t.contentHooks;g!==null&&YE(e,g,1),DA(e,1)}rq(t,e);let h=t.components;h!==null&&wk(e,h,0);let f=t.viewQuery;if(f!==null&&jA(2,f,r),!o)if(d){let g=t.viewCheckHooks;g!==null&&KE(e,g)}else{let g=t.viewHooks;g!==null&&YE(e,g,2),DA(e,2)}if(t.firstUpdatePass===!0&&(t.firstUpdatePass=!1),e[bE]){for(let g of e[bE])g();e[bE]=null}o||(vk(e),e[ye]&=-73)}catch(d){throw o||As(e),d}finally{l!==null&&(mu(l,c),a&&K5(l)),UE()}}function Rk(t,e){for(let n=Lx(t);n!==null;n=Px(n))for(let r=wt;r<n.length;r++){let i=n[r];Nk(i,e)}}function tq(t){for(let e=Lx(t);e!==null;e=Px(e)){if(!(e[ye]&2))continue;let n=e[hc];for(let r=0;r<n.length;r++){let i=n[r];ME(i)}}}function nq(t,e,n){ot(18);let r=kr(e,t);Nk(r,n),ot(19,r[Nt])}function Nk(t,e){OE(t)&&tC(t,e)}function tC(t,e){let r=t[pe],i=t[ye],o=t[dr],s=!!(e===0&&i&16);if(s||=!!(i&64&&e===0),s||=!!(i&1024),s||=!!(o?.dirty&&Eu(o)),s||=!1,o&&(o.dirty=!1),t[ye]&=-9217,s)eq(r,t,r.template,t[Nt]);else if(i&8192){let a=Te(null);try{Ck(t),Rk(t,1);let c=r.components;c!==null&&wk(t,c,1),vk(t)}finally{Te(a)}}}function wk(t,e,n){for(let r=0;r<e.length;r++)nq(t,e[r],n)}function rq(t,e){let n=t.hostBindingOpCodes;if(n!==null)try{for(let r=0;r<n.length;r++){let i=n[r];if(i<0)Cs(~i);else{let o=i,s=n[++r],a=n[++r];yP(s,o);let c=e[o];ot(24,c),a(2,c),ot(25,c)}}}finally{Cs(-1)}}function YC(t,e){let n=EA()?64:1088;for(t[Oi].changeDetectionScheduler?.notify(e);t;){t[ye]|=n;let r=_s(t);if(Ru(t)&&!r)return t;t=r}return null}function bk(t,e,n,r){return[t,!0,0,e,null,r,null,n,null,null]}function Ok(t,e){let n=wt+e;if(n<t.length)return t[n]}function wf(t,e,n,r=!0){let i=e[pe];if(iq(i,e,t,n),r){let s=eC(n,t),a=e[qe],c=a.parentNode(t[Ss]);c!==null&&v5(i,t[Gn],a,e,c,s)}let o=e[ac];o!==null&&o.firstChild!==null&&(o.firstChild=null)}function Mk(t,e){let n=Sf(t,e);return n!==void 0&&R_(n[pe],n),n}function Sf(t,e){if(t.length<=wt)return;let n=wt+e,r=t[n];if(r){let i=r[vs];i!==null&&i!==t&&jC(i,r),e>0&&(t[n-1][Pr]=r[Pr]);let o=cf(t,wt+e);I5(r[pe],r);let s=o[Mi];s!==null&&s.detachView(o[pe]),r[Ht]=null,r[Pr]=null,r[ye]&=-129}return r}function iq(t,e,n,r){let i=wt+r,o=n.length;r>0&&(n[i-1][Pr]=e),r<o-wt?(e[Pr]=n[i],WS(n,wt+r,e)):(n.push(e),e[Pr]=null),e[Ht]=n;let s=e[vs];s!==null&&n!==s&&Lk(s,e);let a=e[Mi];a!==null&&a.insertView(t),LE(e),e[ye]|=128}function Lk(t,e){let n=t[hc],r=e[Ht];if(Li(r))t[ye]|=2;else{let i=r[Ht][wn];e[wn]!==i&&(t[ye]|=2)}n===null?t[hc]=[e]:n.push(e)}var Rs=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,n=e[pe];return vf(n,e,n.firstChild,[])}constructor(e,n){this._lView=e,this._cdRefInjectingView=n}get context(){return this._lView[Nt]}set context(e){this._lView[Nt]=e}get destroyed(){return fc(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[Ht];if(Zr(e)){let n=e[hf],r=n?n.indexOf(this):-1;r>-1&&(Sf(e,r),cf(n,r))}this._attachedToViewContainer=!1}R_(this._lView[pe],this._lView)}onDestroy(e){sA(this._lView,e)}markForCheck(){YC(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ye]&=-129}reattach(){LE(this._lView),this._lView[ye]|=128}detectChanges(){this._lView[ye]|=1024,Dk(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new J(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=Ru(this._lView),n=this._lView[vs];n!==null&&!e&&jC(n,this._lView),dk(this._lView[pe],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new J(902,!1);this._appRef=e;let n=Ru(this._lView),r=this._lView[vs];r!==null&&!n&&Lk(r,this._lView),LE(this._lView)}};function oq(t){return Nu(t._lView)||!!(t._lView[ye]&64)}function sq(t){ME(t._lView)}var Vi=(()=>{class t{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=aq;constructor(n,r,i){this._declarationLView=n,this._declarationTContainer=r,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,r){return this.createEmbeddedViewImpl(n,r)}createEmbeddedViewImpl(n,r,i){let o=Nf(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:r,dehydratedView:i});return new Rs(o)}}return t})();function aq(){return O_($t(),ne())}function O_(t,e){return t.type&4?new Vi(e,t,zu(t,e)):null}function Cc(t,e,n,r,i){let o=t.data[e];if(o===null)o=cq(t,e,n,r,i),TP()&&(o.flags|=32);else if(o.type&64){o.type=n,o.value=r,o.attrs=i;let s=EP();o.injectorIndex=s===null?-1:s.injectorIndex}return gc(o,!0),o}function cq(t,e,n,r,i){let o=fA(),s=pA(),a=s?o:o&&o.parent,c=t.data[e]=uq(t,a,n,e,r,i);return lq(t,c,o,s),c}function lq(t,e,n,r){t.firstChild===null&&(t.firstChild=e),n!==null&&(r?n.child==null&&e.parent!==null&&(n.child=e):n.next===null&&(n.next=e,e.prev=n))}function uq(t,e,n,r,i,o){let s=e?e.injectorIndex:-1,a=0;return uA()&&(a|=128),{type:n,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:i,namespace:IA(),attrs:o,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}var m_e=new RegExp(`^(\\d+)*(${i8}|${r8})*(.*)`);function dq(t){let e=t[tA]??[],r=t[Ht][qe],i=[];for(let o of e)o.data[Fx]!==void 0?i.push(o):hq(o,r);t[tA]=i}function hq(t,e){let n=0,r=t.firstChild;if(r){let i=t.data[kx];for(;n<i;){let o=r.nextSibling;Xx(e,r,!1),r=o,n++}}}var fq=()=>null,pq=()=>null;function c_(t,e){return fq(t,e)}function Pk(t,e,n){return pq(t,e,n)}var xk=class{},M_=class{},nC=class{resolveComponentFactory(e){throw new J(917,!1)}},bf=class{static NULL=new nC},bo=class{},L_=(()=>{class t{destroyNode=null;static __NG_ELEMENT_ID__=()=>gq()}return t})();function gq(){let t=ne(),e=$t(),n=kr(e.index,t);return(Li(n)?n:t)[qe]}var kk=(()=>{class t{static \u0275prov=Q({token:t,providedIn:"root",factory:()=>null})}return t})();var QE={},rC=class{injector;parentInjector;constructor(e,n){this.injector=e,this.parentInjector=n}get(e,n,r){let i=this.injector.get(e,QE,r);return i!==QE||n===QE?i:this.parentInjector.get(e,n,r)}};function l_(t,e,n){let r=n?t.styles:null,i=n?t.classes:null,o=0;if(e!==null)for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")o=a;else if(o==1)i=vE(i,a);else if(o==2){let c=a,l=e[++s];r=vE(r,c+": "+l+";")}}n?t.styles=r:t.stylesWithoutHost=r,n?t.classes=i:t.classesWithoutHost=i}function st(t,e=0){let n=ne();if(n===null)return $(t,e);let r=$t();return Rx(r,n,jt(t),e)}function mq(){let t="invalid";throw new Error(t)}function Fk(t,e,n,r,i){let o=r===null?null:{"":-1},s=i(t,n);if(s!==null){let a=s,c=null,l=null;for(let d of s)if(d.resolveHostDirectives!==null){[a,c,l]=d.resolveHostDirectives(s);break}Tq(t,e,n,a,o,c,l)}o!==null&&r!==null&&Eq(n,r,o)}function Eq(t,e,n){let r=t.localNames=[];for(let i=0;i<e.length;i+=2){let o=n[e[i+1]];if(o==null)throw new J(-301,!1);r.push(e[i],o)}}function _q(t,e,n){e.componentOffset=n,(t.components??=[]).push(e.index)}function Tq(t,e,n,r,i,o,s){let a=r.length,c=!1;for(let f=0;f<a;f++){let g=r[f];!c&&ei(g)&&(c=!0,_q(t,n,f)),UA(r_(n,e),t,g.type)}Cq(n,t.data.length,a);for(let f=0;f<a;f++){let g=r[f];g.providersResolver&&g.providersResolver(g)}let l=!1,d=!1,h=tk(t,e,a,null);a>0&&(n.directiveToIndex=new Map);for(let f=0;f<a;f++){let g=r[f];if(n.mergedAttrs=Pu(n.mergedAttrs,g.hostAttrs),Iq(t,n,e,h,g),Aq(h,g,i),s!==null&&s.has(g)){let[I,S]=s.get(g);n.directiveToIndex.set(g.type,[h,I+n.directiveStart,S+n.directiveStart])}else(o===null||!o.has(g))&&n.directiveToIndex.set(g.type,h);g.contentQueries!==null&&(n.flags|=4),(g.hostBindings!==null||g.hostAttrs!==null||g.hostVars!==0)&&(n.flags|=64);let E=g.type.prototype;!l&&(E.ngOnChanges||E.ngOnInit||E.ngDoCheck)&&((t.preOrderHooks??=[]).push(n.index),l=!0),!d&&(E.ngOnChanges||E.ngDoCheck)&&((t.preOrderCheckHooks??=[]).push(n.index),d=!0),h++}yq(t,n,o)}function yq(t,e,n){for(let r=e.directiveStart;r<e.directiveEnd;r++){let i=t.data[r];if(n===null||!n.has(i))QP(0,e,i,r),QP(1,e,i,r),ZP(e,r,!1);else{let o=n.get(i);JP(0,e,o,r),JP(1,e,o,r),ZP(e,r,!0)}}}function QP(t,e,n,r){let i=t===0?n.inputs:n.outputs;for(let o in i)if(i.hasOwnProperty(o)){let s;t===0?s=e.inputs??={}:s=e.outputs??={},s[o]??=[],s[o].push(r),Uk(e,o)}}function JP(t,e,n,r){let i=t===0?n.inputs:n.outputs;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o],a;t===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(r,o),Uk(e,s)}}function Uk(t,e){e==="class"?t.flags|=8:e==="style"&&(t.flags|=16)}function ZP(t,e,n){let{attrs:r,inputs:i,hostDirectiveInputs:o}=t;if(r===null||!n&&i===null||n&&o===null||PC(t)){t.initialInputs??=[],t.initialInputs.push(null);return}let s=null,a=0;for(;a<r.length;){let c=r[a];if(c===0){a+=4;continue}else if(c===5){a+=2;continue}else if(typeof c=="number")break;if(!n&&i.hasOwnProperty(c)){let l=i[c];for(let d of l)if(d===e){s??=[],s.push(c,r[a+1]);break}}else if(n&&o.hasOwnProperty(c)){let l=o[c];for(let d=0;d<l.length;d+=2)if(l[d]===e){s??=[],s.push(l[d+1],r[a+1]);break}}a+=2}t.initialInputs??=[],t.initialInputs.push(s)}function Iq(t,e,n,r,i){t.data[r]=i;let o=i.factory||(i.factory=Es(i.type,!0)),s=new yc(o,ei(i),st,null);t.blueprint[r]=s,n[r]=s,vq(t,e,r,tk(t,n,i.hostVars,sn),i)}function vq(t,e,n,r,i){let o=i.hostBindings;if(o){let s=t.hostBindingOpCodes;s===null&&(s=t.hostBindingOpCodes=[]);let a=~e.index;Sq(s)!=a&&s.push(a),s.push(n,r,o)}}function Sq(t){let e=t.length;for(;e>0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function Aq(t,e,n){if(n){if(e.exportAs)for(let r=0;r<e.exportAs.length;r++)n[e.exportAs[r]]=t;ei(e)&&(n[""]=t)}}function Cq(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function XC(t,e,n,r,i,o,s,a){let c=e[pe],l=c.consts,d=fr(l,s),h=Cc(c,t,n,r,d);return o&&Fk(c,e,h,fr(l,a),i),h.mergedAttrs=Pu(h.mergedAttrs,h.attrs),h.attrs!==null&&l_(h,h.attrs,!1),h.mergedAttrs!==null&&l_(h,h.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,h),h}function QC(t,e){Tx(t,e),nA(e)&&t.queries.elementEnd(e)}function Dq(t,e,n,r,i,o){let s=e.consts,a=fr(s,i),c=Cc(e,t,n,r,a);if(c.mergedAttrs=Pu(c.mergedAttrs,c.attrs),o!=null){let l=fr(s,o);c.localNames=[];for(let d=0;d<l.length;d+=2)c.localNames.push(l[d],-1)}return c.attrs!==null&&l_(c,c.attrs,!1),c.mergedAttrs!==null&&l_(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}function JC(t){return P_(t)?Array.isArray(t)||!(t instanceof Map)&&Symbol.iterator in t:!1}function Vk(t,e){if(Array.isArray(t))for(let n=0;n<t.length;n++)e(t[n]);else{let n=t[Symbol.iterator](),r;for(;!(r=n.next()).done;)e(r.value)}}function P_(t){return t!==null&&(typeof t=="function"||typeof t=="object")}function Gi(t,e,n){return t[e]=n}function Of(t,e){return t[e]}function _n(t,e,n){if(n===sn)return!1;let r=t[e];return Object.is(r,n)?!1:(t[e]=n,!0)}function Uu(t,e,n,r){let i=_n(t,e,n);return _n(t,e+1,r)||i}function ZC(t,e,n,r,i){let o=Uu(t,e,n,r);return _n(t,e+2,i)||o}function Vu(t,e,n,r,i,o){let s=Uu(t,e,n,r);return Uu(t,e+2,i,o)||s}function JE(t,e,n){return function r(i){let o=Do(t)?kr(t.index,e):e;YC(o,5);let s=e[Nt],a=ex(e,s,n,i),c=r.__ngNextListenerFn__;for(;c;)a=ex(e,s,c,i)&&a,c=c.__ngNextListenerFn__;return a}}function ex(t,e,n,r){let i=Te(null);try{return ot(6,e,n),n(r)!==!1}catch(o){return j5(t,o),!1}finally{ot(7,e,n),Te(i)}}function Bk(t,e,n,r,i,o,s,a){let c=Du(t),l=!1,d=null;if(!r&&c&&(d=Nq(e,n,o,t.index)),d!==null){let h=d.__ngLastListenerFn__||d;h.__ngNextListenerFn__=s,d.__ngLastListenerFn__=s,l=!0}else{let h=hr(t,n),f=r?r(h):h;s8(n,f,o,a);let g=i.listen(f,o,a);if(!Rq(o)){let E=r?I=>r(xr(I[t.index])):t.index;Gk(E,e,n,o,a,g,!1)}}return l}function Rq(t){return t.startsWith("animation")||t.startsWith("transition")}function Nq(t,e,n,r){let i=t.cleanup;if(i!=null)for(let o=0;o<i.length-1;o+=2){let s=i[o];if(s===n&&i[o+1]===r){let a=e[Au],c=i[o+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(o+=2)}return null}function Gk(t,e,n,r,i,o,s){let a=e.firstCreatePass?cA(e):null,c=aA(n),l=c.length;c.push(i,o),a&&a.push(r,t,l,(l+1)*(s?-1:1))}function tx(t,e,n,r,i,o){let s=e[n],a=e[pe],l=a.data[n].outputs[r],h=s[l].subscribe(o);Gk(t.index,a,e,i,o,h,!0)}var iC=Symbol("BINDING");var u_=class extends bf{ngModule;constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){let n=Is(e);return new Bu(n,this.ngModule)}};function wq(t){return Object.keys(t).map(e=>{let[n,r,i]=t[e],o={propName:n,templateName:e,isSignal:(r&C_.SignalBased)!==0};return i&&(o.transform=i),o})}function bq(t){return Object.keys(t).map(e=>({propName:t[e],templateName:e}))}function Oq(t,e,n){let r=e instanceof Nn?e:e?.injector;return r&&t.getStandaloneInjector!==null&&(r=t.getStandaloneInjector(r)||r),r?new rC(n,r):n}function Mq(t){let e=t.get(bo,null);if(e===null)throw new J(407,!1);let n=t.get(kk,null),r=t.get(Lr,null);return{rendererFactory:e,sanitizer:n,changeDetectionScheduler:r,ngReflect:!1}}function Lq(t,e){let n=jk(t);return Kx(e,n,n==="svg"?sf:n==="math"?rA:null)}function Pq(t){if(t?.toLowerCase()==="script")throw new J(905,!1)}function jk(t){return(t.selectors[0][0]||"div").toLowerCase()}var Bu=class extends M_{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=wq(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=bq(this.componentDef.outputs),this.cachedOutputs}constructor(e,n){super(),this.componentDef=e,this.ngModule=n,this.componentType=e.type,this.selector=r5(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!n}create(e,n,r,i,o,s){ot(22);let a=Te(null);try{let c=this.componentDef,l=xq(r,c,s,o),d=Oq(c,i||this.ngModule,e),h=Mq(d),f=h.rendererFactory.createRenderer(null,c),g=r?L5(f,r,c.encapsulation,d):Lq(c,f);Pq(g?.tagName);let E=s?.some(nx)||o?.some(L=>typeof L!="function"&&L.bindings.some(nx)),I=kC(null,l,null,512|ek(c),null,null,h,f,d,null,Bx(g,d,!0));I[Ke]=g,FE(I);let S=null;try{let L=XC(Ke,I,2,"#host",()=>l.directiveRegistry,!0,0);Qx(f,g,L),xu(g,I),w_(l,I,L),RC(l,L,I),QC(l,L),n!==void 0&&Fq(L,this.ngContentSelectors,n),S=kr(L.index,I),I[Nt]=S[Nt],KC(l,I,null)}catch(L){throw S!==null&&BA(S),BA(I),L}finally{ot(23),UE()}return new d_(this.componentType,I,!!E)}finally{Te(a)}}};function xq(t,e,n,r){let i=t?["ng-version","20.3.33"]:i5(e.selectors[0]),o=null,s=null,a=0;if(n)for(let d of n)a+=d[iC].requiredVars,d.create&&(d.targetIdx=0,(o??=[]).push(d)),d.update&&(d.targetIdx=0,(s??=[]).push(d));if(r)for(let d=0;d<r.length;d++){let h=r[d];if(typeof h!="function")for(let f of h.bindings){a+=f[iC].requiredVars;let g=d+1;f.create&&(f.targetIdx=g,(o??=[]).push(f)),f.update&&(f.targetIdx=g,(s??=[]).push(f))}}let c=[e];if(r)for(let d of r){let h=typeof d=="function"?d:d.type,f=wE(h);c.push(f)}return xC(0,null,kq(o,s),1,a,c,null,null,null,[i],null)}function kq(t,e){return!t&&!e?null:n=>{if(n&1&&t)for(let r of t)r.create();if(n&2&&e)for(let r of e)r.update()}}function nx(t){let e=t[iC].kind;return e==="input"||e==="twoWay"}var d_=class extends xk{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,n,r){super(),this._rootLView=n,this._hasInputBindings=r,this._tNode=ff(n[pe],Ke),this.location=zu(this._tNode,n),this.instance=kr(this._tNode.index,n)[Nt],this.hostView=this.changeDetectorRef=new Rs(n,void 0),this.componentType=e}setInput(e,n){this._hasInputBindings;let r=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),n))return;let i=this._rootLView,o=b_(r,i[pe],i,e,n);this.previousInputValues.set(e,n);let s=kr(r.index,i);YC(s,1)}get injector(){return new Tc(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function Fq(t,e,n){let r=t.projection=[];for(let i=0;i<e.length;i++){let o=n[i];r.push(o!=null&&o.length?Array.from(o):null)}}var ji=(()=>{class t{static __NG_ELEMENT_ID__=Uq}return t})();function Uq(){let t=$t();return $k(t,ne())}var Vq=ji,Hk=class extends Vq{_lContainer;_hostTNode;_hostLView;constructor(e,n,r){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=r}get element(){return zu(this._hostTNode,this._hostLView)}get injector(){return new Tc(this._hostTNode,this._hostLView)}get parentInjector(){let e=SC(this._hostTNode,this._hostLView);if(Ix(e)){let n=t_(e,this._hostLView),r=e_(e),i=n[pe].data[r+8];return new Tc(i,n)}else return new Tc(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=rx(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-wt}createEmbeddedView(e,n,r){let i,o;typeof r=="number"?i=r:r!=null&&(i=r.index,o=r.injector);let s=c_(this._lContainer,e.ssrId),a=e.createEmbeddedViewImpl(n||{},o,s);return this.insertImpl(a,i,Fu(this._hostTNode,s)),a}createComponent(e,n,r,i,o,s,a){let c=e&&!bz(e),l;if(c)l=n;else{let S=n||{};l=S.index,r=S.injector,i=S.projectableNodes,o=S.environmentInjector||S.ngModuleRef,s=S.directives,a=S.bindings}let d=c?e:new Bu(Is(e)),h=r||this.parentInjector;if(!o&&d.ngModule==null){let L=(c?h:this.parentInjector).get(Nn,null);L&&(o=L)}let f=Is(d.componentType??{}),g=c_(this._lContainer,f?.id??null),E=g?.firstChild??null,I=d.create(h,i,E,o,s,a);return this.insertImpl(I.hostView,l,Fu(this._hostTNode,g)),I}insert(e,n){return this.insertImpl(e,n,!0)}insertImpl(e,n,r){let i=e._lView;if(lP(i)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=i[Ht],l=new Hk(c,c[Gn],c[Ht]);l.detach(l.indexOf(e))}}let o=this._adjustIndex(n),s=this._lContainer;return wf(s,i,o,r),e.attachToViewContainerRef(),WS(wA(s),o,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=rx(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),r=Sf(this._lContainer,n);r&&(cf(wA(this._lContainer),n),R_(r[pe],r))}detach(e){let n=this._adjustIndex(e,-1),r=Sf(this._lContainer,n);return r&&cf(wA(this._lContainer),n)!=null?new Rs(r):null}_adjustIndex(e,n=0){return e??this.length+n}};function rx(t){return t[hf]}function wA(t){return t[hf]||(t[hf]=[])}function $k(t,e){let n,r=e[t.index];return Zr(r)?n=r:(n=bk(r,e,null,t),e[t.index]=n,FC(e,n)),Gq(n,e,t,r),new Hk(n,t,e)}function Bq(t,e){let n=t[qe],r=n.createComment(""),i=hr(e,t),o=n.parentNode(i);return o_(n,o,r,n.nextSibling(i),!1),r}var Gq=$q,jq=()=>!1;function Hq(t,e,n){return jq(t,e,n)}function $q(t,e,n,r){if(t[Ss])return;let i;n.type&8?i=xr(r):i=Bq(e,n),t[Ss]=i}var oC=class t{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},sC=class t{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let n=e.queries;if(n!==null){let r=e.contentQueries!==null?e.contentQueries[0]:n.length,i=[];for(let o=0;o<r;o++){let s=n.getByIndex(o),a=this.queries[s.indexInDeclarationView];i.push(a.clone())}return new t(i)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}finishViewCreation(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let n=0;n<this.queries.length;n++)tD(e,n).matches!==null&&this.queries[n].setDirty()}},h_=class{flags;read;predicate;constructor(e,n,r=null){this.flags=n,this.read=r,typeof e=="string"?this.predicate=Xq(e):this.predicate=e}},aC=class t{queries;constructor(e=[]){this.queries=e}elementStart(e,n){for(let r=0;r<this.queries.length;r++)this.queries[r].elementStart(e,n)}elementEnd(e){for(let n=0;n<this.queries.length;n++)this.queries[n].elementEnd(e)}embeddedTView(e){let n=null;for(let r=0;r<this.length;r++){let i=n!==null?n.length:0,o=this.getByIndex(r).embeddedTView(e,i);o&&(o.indexInDeclarationView=r,n!==null?n.push(o):n=[o])}return n!==null?new t(n):null}template(e,n){for(let r=0;r<this.queries.length;r++)this.queries[r].template(e,n)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},cC=class t{metadata;matches=null;indexInDeclarationView=-1;crossesNgTemplate=!1;_declarationNodeIndex;_appliesToNextNode=!0;constructor(e,n=-1){this.metadata=e,this._declarationNodeIndex=n}elementStart(e,n){this.isApplyingToNode(n)&&this.matchTNode(e,n)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,n){this.elementStart(e,n)}embeddedTView(e,n){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,n),new t(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){let n=this._declarationNodeIndex,r=e.parent;for(;r!==null&&r.type&8&&r.index!==n;)r=r.parent;return n===(r!==null?r.index:-1)}return this._appliesToNextNode}matchTNode(e,n){let r=this.metadata.predicate;if(Array.isArray(r))for(let i=0;i<r.length;i++){let o=r[i];this.matchTNodeWithReadOption(e,n,Wq(n,o)),this.matchTNodeWithReadOption(e,n,XE(n,e,o,!1,!1))}else r===Vi?n.type&4&&this.matchTNodeWithReadOption(e,n,-1):this.matchTNodeWithReadOption(e,n,XE(n,e,r,!1,!1))}matchTNodeWithReadOption(e,n,r){if(r!==null){let i=this.metadata.read;if(i!==null)if(i===Ns||i===ji||i===Vi&&n.type&4)this.addMatch(n.index,-2);else{let o=XE(n,e,i,!1,!1);o!==null&&this.addMatch(n.index,o)}else this.addMatch(n.index,r)}}addMatch(e,n){this.matches===null?this.matches=[e,n]:this.matches.push(e,n)}};function Wq(t,e){let n=t.localNames;if(n!==null){for(let r=0;r<n.length;r+=2)if(n[r]===e)return n[r+1]}return null}function zq(t,e){return t.type&11?zu(t,e):t.type&4?O_(t,e):null}function qq(t,e,n,r){return n===-1?zq(e,t):n===-2?Kq(t,e,r):If(t,t[pe],n,e)}function Kq(t,e,n){if(n===Ns)return zu(e,t);if(n===Vi)return O_(e,t);if(n===ji)return $k(e,t)}function Wk(t,e,n,r){let i=e[Mi].queries[r];if(i.matches===null){let o=t.data,s=n.matches,a=[];for(let c=0;s!==null&&c<s.length;c+=2){let l=s[c];if(l<0)a.push(null);else{let d=o[l];a.push(qq(e,d,s[c+1],n.metadata.read))}}i.matches=a}return i.matches}function lC(t,e,n,r){let i=t.queries.getByIndex(n),o=i.matches;if(o!==null){let s=Wk(t,e,i,n);for(let a=0;a<o.length;a+=2){let c=o[a];if(c>0)r.push(s[a/2]);else{let l=o[a+1],d=e[-c];for(let h=wt;h<d.length;h++){let f=d[h];f[vs]===f[Ht]&&lC(f[pe],f,l,r)}if(d[hc]!==null){let h=d[hc];for(let f=0;f<h.length;f++){let g=h[f];lC(g[pe],g,l,r)}}}}}return r}function eD(t,e){return t[Mi].queries[e].queryList}function zk(t,e,n){let r=new i_((n&4)===4);return hP(t,e,r,r.destroy),(e[Mi]??=new sC).queries.push(new oC(r))-1}function qk(t,e,n){let r=Ye();return r.firstCreatePass&&(Kk(r,new h_(t,e,n),-1),(e&2)===2&&(r.staticViewQueries=!0)),zk(r,ne(),e)}function Yq(t,e,n,r){let i=Ye();if(i.firstCreatePass){let o=$t();Kk(i,new h_(e,n,r),o.index),Qq(i,t),(n&2)===2&&(i.staticContentQueries=!0)}return zk(i,ne(),n)}function Xq(t){return t.split(",").map(e=>e.trim())}function Kk(t,e,n){t.queries===null&&(t.queries=new aC),t.queries.track(new cC(e,n))}function Qq(t,e){let n=t.contentQueries||(t.contentQueries=[]),r=n.length?n[n.length-1]:-1;e!==r&&n.push(t.queries.length-1,e)}function tD(t,e){return t.queries.getByIndex(e)}function Yk(t,e){let n=t[pe],r=tD(n,e);return r.crossesNgTemplate?lC(n,t,e,[]):Wk(n,t,r,e)}function Xk(t,e,n){let r,i=Zh(()=>{r._dirtyCounter();let o=Zq(r,t);if(e&&o===void 0)throw new J(-951,!1);return o});return r=i[rn],r._dirtyCounter=Ec(0),r._flatValue=void 0,i}function Qk(t){return Xk(!0,!1,t)}function Jk(t){return Xk(!0,!0,t)}function Jq(t,e){let n=t[rn];n._lView=ne(),n._queryIndex=e,n._queryList=eD(n._lView,e),n._queryList.onDirty(()=>n._dirtyCounter.update(r=>r+1))}function Zq(t,e){let n=t._lView,r=t._queryIndex;if(n===void 0||r===void 0||n[ye]&4)return e?void 0:Rn;let i=eD(n,r),o=Yk(n,r);return i.reset(o,bx),e?i.first:i._changesDetected||t._flatValue===void 0?t._flatValue=i.toArray():t._flatValue}function Zk(t){let e=[],n=new Map;function r(i){let o=n.get(i);if(!o){let s=t(i);n.set(i,o=s.then(a=>t9(i,a)))}return o}return f_.forEach((i,o)=>{let s=[];i.templateUrl&&s.push(r(i.templateUrl).then(l=>{i.template=l}));let a=typeof i.styles=="string"?[i.styles]:i.styles||[];if(i.styles=a,i.styleUrl&&i.styleUrls?.length)throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple");if(i.styleUrls?.length){let l=i.styles.length,d=i.styleUrls;i.styleUrls.forEach((h,f)=>{a.push(""),s.push(r(h).then(g=>{a[l+f]=g,d.splice(d.indexOf(h),1),d.length==0&&(i.styleUrls=void 0)}))})}else i.styleUrl&&s.push(r(i.styleUrl).then(l=>{a.push(l),i.styleUrl=void 0}));let c=Promise.all(s).then(()=>n9(o));e.push(c)}),e1(),Promise.all(e).then(()=>{})}var f_=new Map,e9=new Set;function e1(){let t=f_;return f_=new Map,t}function t1(){return f_.size===0}function t9(t,e){return typeof e=="string"?e:e.status!==void 0&&e.status!==200?Promise.reject(new J(918,!1)):e.text()}function n9(t){e9.delete(t)}var vc=class{},n1=class{};function r1(t,e){return new Gu(t,e??null,[])}var Gu=class extends vc{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new u_(this);constructor(e,n,r,i=!0){super(),this.ngModuleType=e,this._parent=n;let o=eP(e);this._bootstrapComponents=z8(o.bootstrap),this._r3Injector=vA(e,n,[{provide:vc,useValue:this},{provide:bf,useValue:this.componentFactoryResolver},...r],vo(e),new Set(["environment"])),i&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){let e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}},p_=class extends n1{moduleType;constructor(e){super(),this.moduleType=e}create(e){return new Gu(this.moduleType,e,[])}};function i1(t,e,n){return new Gu(t,e,n,!1)}var g_=class extends vc{injector;componentFactoryResolver=new u_(this);instance=null;constructor(e){super();let n=new oc([...e.providers,{provide:vc,useValue:this},{provide:bf,useValue:this.componentFactoryResolver}],e.parent||Su(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function o1(t,e,n=null){return new g_({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var r9=(()=>{class t{_injector;cachedInjectors=new Map;constructor(n){this._injector=n}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){let r=YS(!1,n.type),i=r.length>0?o1([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n,i)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(let n of this.cachedInjectors.values())n!==null&&n.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=Q({token:t,providedIn:"environment",factory:()=>new t($(Nn))})}return t})();function i9(t){return Wu(()=>{let e=a1(t),n=Ee(B({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection===AC.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:e.standalone?i=>i.get(r9).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||No.Emulated,styles:t.styles||Rn,_:null,schemas:t.schemas||null,tView:null,id:""});e.standalone&&Lo("NgStandalone"),c1(n);let r=t.dependencies;return n.directiveDefs=m_(r,s1),n.pipeDefs=m_(r,KS),n.id=a9(n),n})}function s1(t){return Is(t)||wE(t)}function ws(t){return Wu(()=>({type:t.type,bootstrap:t.bootstrap||Rn,declarations:t.declarations||Rn,imports:t.imports||Rn,exports:t.exports||Rn,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null}))}function o9(t,e){if(t==null)return Qr;let n={};for(let r in t)if(t.hasOwnProperty(r)){let i=t[r],o,s,a,c;Array.isArray(i)?(a=i[0],o=i[1],s=i[2]??o,c=i[3]||null):(o=i,s=i,a=C_.None,c=null),n[o]=[r,a,c],e[o]=s}return n}function s9(t){if(t==null)return Qr;let e={};for(let n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function Hi(t){return Wu(()=>{let e=a1(t);return c1(e),e})}function Mf(t){return{type:t.type,name:t.name,factory:null,pure:t.pure!==!1,standalone:t.standalone??!0,onDestroy:t.type.prototype.ngOnDestroy||null}}function a1(t){let e={};return{type:t.type,providersResolver:null,factory:null,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputConfig:t.inputs||Qr,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:t.signals===!0,selectors:t.selectors||Rn,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,inputs:o9(t.inputs,e),outputs:s9(t.outputs),debugInfo:null}}function c1(t){t.features?.forEach(e=>e(t))}function m_(t,e){return t?()=>{let n=typeof t=="function"?t():t,r=[];for(let i of n){let o=e(i);o!==null&&r.push(o)}return r}:null}function a9(t){let e=0,n=typeof t.consts=="function"?"":t.consts,r=[t.selectors,t.ngContentSelectors,t.hostVars,t.hostAttrs,n,t.vars,t.decls,t.encapsulation,t.standalone,t.signals,t.exportAs,JSON.stringify(t.inputs),JSON.stringify(t.outputs),Object.getOwnPropertyNames(t.type.prototype),!!t.contentQueries,!!t.viewQuery];for(let o of r.join("|"))e=Math.imul(31,e)+o.charCodeAt(0)<<0;return e+=2147483648,"c"+e}function c9(t){return Object.getPrototypeOf(t.prototype).constructor}function l1(t){let e=c9(t.type),n=!0,r=[t];for(;e;){let i;if(ei(t))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new J(903,!1);i=e.\u0275dir}if(i){if(n){r.push(i);let s=t;s.inputs=bA(t.inputs),s.declaredInputs=bA(t.declaredInputs),s.outputs=bA(t.outputs);let a=i.hostBindings;a&&f9(t,a);let c=i.viewQuery,l=i.contentQueries;if(c&&d9(t,c),l&&h9(t,l),l9(t,i),WL(t.outputs,i.outputs),ei(i)&&i.data.animation){let d=t.data;d.animation=(d.animation||[]).concat(i.data.animation)}}let o=i.features;if(o)for(let s=0;s<o.length;s++){let a=o[s];a&&a.ngInherit&&a(t),a===l1&&(n=!1)}}e=Object.getPrototypeOf(e)}u9(r)}function l9(t,e){for(let n in e.inputs){if(!e.inputs.hasOwnProperty(n)||t.inputs.hasOwnProperty(n))continue;let r=e.inputs[n];r!==void 0&&(t.inputs[n]=r,t.declaredInputs[n]=e.declaredInputs[n])}}function u9(t){let e=0,n=null;for(let r=t.length-1;r>=0;r--){let i=t[r];i.hostVars=e+=i.hostVars,i.hostAttrs=Pu(i.hostAttrs,n=Pu(n,i.hostAttrs))}}function bA(t){return t===Qr?{}:t===Rn?[]:t}function d9(t,e){let n=t.viewQuery;n?t.viewQuery=(r,i)=>{e(r,i),n(r,i)}:t.viewQuery=e}function h9(t,e){let n=t.contentQueries;n?t.contentQueries=(r,i,o)=>{e(r,i,o),n(r,i,o)}:t.contentQueries=e}function f9(t,e){let n=t.hostBindings;n?t.hostBindings=(r,i)=>{e(r,i),n(r,i)}:t.hostBindings=e}function p9(t){let e=n=>{let r=Array.isArray(t);n.hostDirectives===null?(n.resolveHostDirectives=g9,n.hostDirectives=r?t.map(uC):[t]):r?n.hostDirectives.unshift(...t.map(uC)):n.hostDirectives.unshift(t)};return e.ngInherit=!0,e}function g9(t){let e=[],n=!1,r=null,i=null;for(let o=0;o<t.length;o++){let s=t[o];if(s.hostDirectives!==null){let a=e.length;r??=new Map,i??=new Map,u1(s,e,r),i.set(s,[a,e.length-1])}o===0&&ei(s)&&(n=!0,e.push(s))}for(let o=n?1:0;o<t.length;o++)e.push(t[o]);return[e,r,i]}function u1(t,e,n){if(t.hostDirectives!==null)for(let r of t.hostDirectives)if(typeof r=="function"){let i=r();for(let o of i)ix(uC(o),e,n)}else ix(r,e,n)}function ix(t,e,n){let r=wE(t.directive);m9(r.declaredInputs,t.inputs),u1(r,e,n),n.set(r,t),e.push(r)}function uC(t){return typeof t=="function"?{directive:jt(t),inputs:Qr,outputs:Qr}:{directive:jt(t.directive),inputs:ox(t.inputs),outputs:ox(t.outputs)}}function ox(t){if(t===void 0||t.length===0)return Qr;let e={};for(let n=0;n<t.length;n+=2)e[t[n]]=t[n+1];return e}function m9(t,e){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n],i=t[n];t[r]=i}}function d1(t,e,n,r,i,o,s,a){if(n.firstCreatePass){t.mergedAttrs=Pu(t.mergedAttrs,t.attrs);let d=t.tView=xC(2,t,i,o,s,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,t),d.queries=n.queries.embeddedTView(t))}a&&(t.flags|=a),gc(t,!1);let c=_9(n,e,t,r);VE()&&HC(n,e,c,t),xu(c,e);let l=bk(c,e,c,t);e[r+Ke]=l,FC(e,l),Hq(l,t,e)}function E9(t,e,n,r,i,o,s,a,c,l,d){let h=n+Ke,f;return e.firstCreatePass?(f=Cc(e,h,4,s||null,a||null),PE()&&Fk(e,t,f,fr(e.consts,l),WC),Tx(e,f)):f=e.data[h],d1(f,t,e,n,r,i,o,c),Du(f)&&w_(e,t,f),l!=null&&Rf(t,f,d),f}function ju(t,e,n,r,i,o,s,a,c,l,d){let h=n+Ke,f;if(e.firstCreatePass){if(f=Cc(e,h,4,s||null,a||null),l!=null){let g=fr(e.consts,l);f.localNames=[];for(let E=0;E<g.length;E+=2)f.localNames.push(g[E],-1)}}else f=e.data[h];return d1(f,t,e,n,r,i,o,c),l!=null&&Rf(t,f,d),f}function h1(t,e,n,r,i,o,s,a){let c=ne(),l=Ye(),d=fr(l.consts,o);return E9(c,l,t,e,n,r,i,d,void 0,s,a),h1}function f1(t,e,n,r,i,o,s,a){let c=ne(),l=Ye(),d=fr(l.consts,o);return ju(c,l,t,e,n,r,i,d,void 0,s,a),f1}var _9=T9;function T9(t,e,n,r){return Ef(!0),e[qe].createComment("")}var x_=new z(""),Ku=new z(""),Lf=(()=>{class t{_ngZone;registry;_isZoneStable=!0;_callbacks=[];_taskTrackingZone=null;_destroyRef;constructor(n,r,i){this._ngZone=n,this.registry=r,JS()&&(this._destroyRef=Y(Hn,{optional:!0})??void 0),nD||(p1(i),i.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this._taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){let n=this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),r=this._ngZone.runOutsideAngular(()=>this._ngZone.onStable.subscribe({next:()=>{Ae.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}}));this._destroyRef?.onDestroy(()=>{n.unsubscribe(),r.unsubscribe()})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;this._callbacks.length!==0;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb()}});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>r.updateCb&&r.updateCb(n)?(clearTimeout(r.timeoutId),!1):!0)}}getPendingTasks(){return this._taskTrackingZone?this._taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,i){let o=-1;r&&r>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(s=>s.timeoutId!==o),n()},r)),this._callbacks.push({doneCb:n,timeoutId:o,updateCb:i})}whenStable(n,r,i){if(i&&!this._taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,i),this._runCallbacksIfReady()}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,i){return[]}static \u0275fac=function(r){return new(r||t)($(Ae),$(Pf),$(Ku))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),Pf=(()=>{class t{_applications=new Map;registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return nD?.findTestabilityInTree(this,n,r)??null}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})();function p1(t){nD=t}var nD;function k_(t){return!!t&&typeof t.then=="function"}function rD(t){return!!t&&typeof t.subscribe=="function"}var g1=new z("");var iD=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,r)=>{this.resolve=n,this.reject=r});appInits=Y(g1,{optional:!0})??[];injector=Y(ze);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let i of this.appInits){let o=bi(this.injector,i);if(k_(o))n.push(o);else if(rD(o)){let s=new Promise((a,c)=>{o.subscribe({complete:a,error:c})});n.push(s)}}let r=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{r()}).catch(i=>{this.reject(i)}),n.length===0&&r(),this.initialized=!0}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),m1=new z("");function E1(){_S(()=>{let t="";throw new J(600,t)})}function _1(t){return t.isBoundToModule}var y9=10;function oD(t,e){return Array.isArray(e)?e.reduce(oD,t):B(B({},t),e)}var bs=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=Y(xi);afterRenderManager=Y(GC);zonelessEnabled=Y(Ou);rootEffectScheduler=Y(_f);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Rt;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=Y(Ds);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(De(n=>!n))}constructor(){Y(Ac,{optional:!0})}whenStable(){let n;return new Promise(r=>{n=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{n.unsubscribe()})}_injector=Y(Nn);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,r){return this.bootstrapImpl(n,r)}bootstrapImpl(n,r,i=ze.NULL){return this._injector.get(Ae).run(()=>{ot(10);let s=n instanceof M_;if(!this._injector.get(iD).done){let E="";throw new J(405,E)}let c;s?c=n:c=this._injector.get(bf).resolveComponentFactory(n),this.componentTypes.push(c.componentType);let l=_1(c)?void 0:this._injector.get(vc),d=r||c.selector,h=c.create(i,[],d,l),f=h.location.nativeElement,g=h.injector.get(x_,null);return g?.registerApplication(f),h.onDestroy(()=>{this.detachView(h.hostView),yf(this.components,h),g?.unregisterApplication(f)}),this._loadComponent(h),ot(11,h),h})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){ot(12),this.tracingSnapshot!==null?this.tracingSnapshot.run(D_.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new J(101,!1);let n=Te(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,Te(n),this.afterTick.next(),ot(13)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(bo,null,{optional:!0}));let n=0;for(;this.dirtyFlags!==0&&n++<y9;)ot(14),this.synchronizeOnce(),ot(15)}synchronizeOnce(){this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush());let n=!1;if(this.dirtyFlags&7){let r=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:i}of this.allViews){if(!r&&!Nu(i))continue;let o=r&&!this.zonelessEnabled?0:1;Dk(i,o),n=!0}if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),this.dirtyFlags&23)return}n||(this._rendererFactory?.begin?.(),this._rendererFactory?.end?.()),this.dirtyFlags&8&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){if(this.allViews.some(({_lView:n})=>Nu(n))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(n){let r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){let r=n;yf(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView);try{this.tick()}catch(i){this.internalErrorHandler(i)}this.components.push(n),this._injector.get(m1,[]).forEach(i=>i(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>yf(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new J(406,!1);let n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function yf(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function T1(t,e){let n=ne(),r=Pi();if(_n(n,r,e)){let i=Ye(),o=mc();if(b_(o,i,n,t,e))Do(o)&&Tk(n,o.index);else{let a=hr(o,n);yk(n[qe],a,null,o.value,t,e,null)}}return T1}function y1(t,e,n,r){let i=ne(),o=Pi();if(_n(i,o,e)){let s=Ye(),a=mc();B5(a,i,t,e,n,r)}return y1}var S_e=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";function I9(){return ne()[wn][Nt]}var dC=class{destroy(e){}updateValue(e,n){}swap(e,n){let r=Math.min(e,n),i=Math.max(e,n),o=this.detach(i);if(i-r>1){let s=this.detach(r);this.attach(r,o),this.attach(i,s)}else this.attach(r,o)}move(e,n){this.attach(n,this.detach(e))}};function OA(t,e,n,r,i){return t===n&&Object.is(e,r)?1:Object.is(i(t,e),i(n,r))?-1:0}function v9(t,e,n){let r,i,o=0,s=t.length-1,a=void 0;if(Array.isArray(e)){let c=e.length-1;for(;o<=s&&o<=c;){let l=t.at(o),d=e[o],h=OA(o,l,o,d,n);if(h!==0){h<0&&t.updateValue(o,d),o++;continue}let f=t.at(s),g=e[c],E=OA(s,f,c,g,n);if(E!==0){E<0&&t.updateValue(s,g),s--,c--;continue}let I=n(o,l),S=n(s,f),L=n(o,d);if(Object.is(L,S)){let V=n(c,g);Object.is(V,I)?(t.swap(o,s),t.updateValue(s,g),c--,s--):t.move(s,o),t.updateValue(o,d),o++;continue}if(r??=new E_,i??=ax(t,o,s,n),hC(t,r,o,L))t.updateValue(o,d),o++,s++;else if(i.has(L))r.set(I,t.detach(o)),s--;else{let V=t.create(o,e[o]);t.attach(o,V),o++,s++}}for(;o<=c;)sx(t,r,n,o,e[o]),o++}else if(e!=null){let c=e[Symbol.iterator](),l=c.next();for(;!l.done&&o<=s;){let d=t.at(o),h=l.value,f=OA(o,d,o,h,n);if(f!==0)f<0&&t.updateValue(o,h),o++,l=c.next();else{r??=new E_,i??=ax(t,o,s,n);let g=n(o,h);if(hC(t,r,o,g))t.updateValue(o,h),o++,s++,l=c.next();else if(!i.has(g))t.attach(o,t.create(o,h)),o++,s++,l=c.next();else{let E=n(o,d);r.set(E,t.detach(o)),s--}}}for(;!l.done;)sx(t,r,n,t.length,l.value),l=c.next()}for(;o<=s;)t.destroy(t.detach(s--));r?.forEach(c=>{t.destroy(c)})}function hC(t,e,n,r){return e!==void 0&&e.has(r)?(t.attach(n,e.get(r)),e.delete(r),!0):!1}function sx(t,e,n,r,i){if(hC(t,e,r,n(r,i)))t.updateValue(r,i);else{let o=t.create(r,i);t.attach(r,o)}}function ax(t,e,n,r){let i=new Set;for(let o=e;o<=n;o++)i.add(r(o,t.at(o)));return i}var E_=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let n=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(n)?(this.kvMap.set(e,this._vMap.get(n)),this._vMap.delete(n)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,n){if(this.kvMap.has(e)){let r=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let i=this._vMap;for(;i.has(r);)r=i.get(r);i.set(r,n)}else this.kvMap.set(e,n)}forEach(e){for(let[n,r]of this.kvMap)if(e(r,n),this._vMap!==void 0){let i=this._vMap;for(;i.has(r);)r=i.get(r),e(r,n)}}};function S9(t,e,n,r,i,o,s,a){Lo("NgControlFlow");let c=ne(),l=Ye(),d=fr(l.consts,o);return ju(c,l,t,e,n,r,i,d,256,s,a),sD}function sD(t,e,n,r,i,o,s,a){Lo("NgControlFlow");let c=ne(),l=Ye(),d=fr(l.consts,o);return ju(c,l,t,e,n,r,i,d,512,s,a),sD}function A9(t,e){Lo("NgControlFlow");let n=ne(),r=Pi(),i=n[r]!==sn?n[r]:-1,o=i!==-1?__(n,Ke+i):void 0,s=0;if(_n(n,r,t)){let a=Te(null);try{if(o!==void 0&&Mk(o,s),t!==-1){let c=Ke+t,l=__(n,c),d=mC(n[pe],c),h=Pk(l,d,n),f=Nf(n,d,e,{dehydratedView:h});wf(l,f,s,Fu(d,h))}}finally{Te(a)}}else if(o!==void 0){let a=Ok(o,s);a!==void 0&&(a[Nt]=e)}}var fC=class{lContainer;$implicit;$index;constructor(e,n,r){this.lContainer=e,this.$implicit=n,this.$index=r}get $count(){return this.lContainer.length-wt}};function C9(t){return t}function D9(t,e){return e}var pC=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,n,r){this.hasEmptyBlock=e,this.trackByFn=n,this.liveCollection=r}};function R9(t,e,n,r,i,o,s,a,c,l,d,h,f){Lo("NgControlFlow");let g=ne(),E=Ye(),I=c!==void 0,S=ne(),L=a?s.bind(S[wn][Nt]):s,V=new pC(I,L);S[Ke+t]=V,ju(g,E,t+1,e,n,r,i,fr(E.consts,o),256),I&&ju(g,E,t+2,c,l,d,h,fr(E.consts,f),512)}var gC=class extends dC{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,n,r){super(),this.lContainer=e,this.hostLView=n,this.templateTNode=r}get length(){return this.lContainer.length-wt}at(e){return this.getLView(e)[Nt].$implicit}attach(e,n){let r=n[ac];this.needsIndexUpdate||=e!==this.length,wf(this.lContainer,n,e,Fu(this.templateTNode,r)),w9(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,b9(this.lContainer,e),O9(this.lContainer,e)}create(e,n){let r=c_(this.lContainer,this.templateTNode.tView.ssrId),i=Nf(this.hostLView,this.templateTNode,new fC(this.lContainer,n,e),{dehydratedView:r});return this.operationsCounter?.recordCreate(),i}destroy(e){R_(e[pe],e),this.operationsCounter?.recordDestroy()}updateValue(e,n){this.getLView(e)[Nt].$implicit=n}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[Nt].$index=e}getLView(e){return M9(this.lContainer,e)}};function N9(t){let e=Te(null),n=pr();try{let r=ne(),i=r[pe],o=r[n],s=n+1,a=__(r,s);if(o.liveCollection===void 0){let l=mC(i,s);o.liveCollection=new gC(a,r,l)}else o.liveCollection.reset();let c=o.liveCollection;if(v9(c,t,o.trackByFn),c.updateIndexes(),o.hasEmptyBlock){let l=Pi(),d=c.length===0;if(_n(r,l,d)){let h=n+2,f=__(r,h);if(d){let g=mC(i,h),E=Pk(f,g,r),I=Nf(r,g,void 0,{dehydratedView:E});wf(f,I,0,Fu(g,E))}else i.firstUpdatePass&&dq(f),Mk(f,0)}}}finally{Te(e)}}function __(t,e){return t[e]}function w9(t,e){if(t.length<=wt)return;let n=wt+e,r=t[n],i=r?r[dc]:void 0;if(r&&i&&i.detachedLeaveAnimationFns&&i.detachedLeaveAnimationFns.length>0){let o=r[Ao];T5(o,i),Ic.delete(r),i.detachedLeaveAnimationFns=void 0}}function b9(t,e){if(t.length<=wt)return;let n=wt+e,r=t[n],i=r?r[dc]:void 0;i&&i.leave&&i.leave.size>0&&(i.detachedLeaveAnimationFns=[])}function O9(t,e){return Sf(t,e)}function M9(t,e){return Ok(t,e)}function mC(t,e){return ff(t,e)}function I1(t,e,n){let r=ne(),i=Pi();if(_n(r,i,e)){let o=Ye(),s=mc();Ek(s,r,t,e,r[qe],n)}return I1}function EC(t,e,n,r,i){b_(e,t,n,i?"class":"style",r)}function aD(t,e,n,r){let i=ne(),o=i[pe],s=t+Ke,a=o.firstCreatePass?XC(s,i,2,e,WC,PE(),n,r):o.data[s];if(zC(a,i,t,e,A1),Du(a)){let c=i[pe];w_(c,i,a),RC(c,a,i)}return r!=null&&Rf(i,a),aD}function cD(){let t=Ye(),e=$t(),n=qC(e);return t.firstCreatePass&&QC(t,n),dA(n)&&hA(),lA(),n.classesWithoutHost!=null&&kz(n)&&EC(t,n,ne(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&Fz(n)&&EC(t,n,ne(),n.stylesWithoutHost,!1),cD}function v1(t,e,n,r){return aD(t,e,n,r),cD(),v1}function lD(t,e,n,r){let i=ne(),o=i[pe],s=t+Ke,a=o.firstCreatePass?Dq(s,o,2,e,n,r):o.data[s];return zC(a,i,t,e,A1),r!=null&&Rf(i,a),lD}function uD(){let t=$t(),e=qC(t);return dA(e)&&hA(),lA(),uD}function S1(t,e,n,r){return lD(t,e,n,r),uD(),S1}var A1=(t,e,n,r,i)=>(Ef(!0),Kx(e[qe],r,IA()));function dD(t,e,n){let r=ne(),i=r[pe],o=t+Ke,s=i.firstCreatePass?XC(o,r,8,"ng-container",WC,PE(),e,n):i.data[o];if(zC(s,r,t,"ng-container",L9),Du(s)){let a=r[pe];w_(a,r,s),RC(a,s,r)}return n!=null&&Rf(r,s),dD}function hD(){let t=Ye(),e=$t(),n=qC(e);return t.firstCreatePass&&QC(t,n),hD}function C1(t,e,n){return dD(t,e,n),hD(),C1}var L9=(t,e,n,r,i)=>(Ef(!0),x8(e[qe],""));function P9(){return ne()}function D1(t,e,n){let r=ne(),i=Pi();if(_n(r,i,e)){let o=Ye(),s=mc();_k(s,r,t,e,r[qe],n)}return D1}var WE=void 0;function x9(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return e===1&&n===0?1:5}var k9=["en",[["a","p"],["AM","PM"]],[["AM","PM"]],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],WE,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],WE,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",WE,"{1} 'at' {0}",WE],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",x9],MA={};function mr(t){let e=F9(t),n=cx(e);if(n)return n;let r=e.split("-")[0];if(n=cx(r),n)return n;if(r==="en")return k9;throw new J(701,!1)}function cx(t){if(!(t in MA)){let e=Lt.ng&&Lt.ng.common&&Lt.ng.common.locales&&Lt.ng.common.locales[t];return e!==void 0&&(MA[t]=e),e}return MA[t]}var Ot=(function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t})(Ot||{});function F9(t){return t.toLowerCase().replace(/_/g,"-")}var xf="en-US";var U9=xf;function R1(t){typeof t=="string"&&(U9=t.toLowerCase().replace(/_/g,"-"))}function N1(t,e,n){let r=ne(),i=Ye(),o=$t();return b1(i,r,r[qe],o,t,e,n),N1}function w1(t,e,n){let r=ne(),i=Ye(),o=$t();return(o.type&3||n)&&Bk(o,i,r,n,r[qe],t,e,JE(o,r,e)),w1}function b1(t,e,n,r,i,o,s){let a=!0,c=null;if((r.type&3||s)&&(c??=JE(r,e,o),Bk(r,t,e,s,n,i,o,c)&&(a=!1)),a){let l=r.outputs?.[i],d=r.hostDirectiveOutputs?.[i];if(d&&d.length)for(let h=0;h<d.length;h+=2){let f=d[h],g=d[h+1];c??=JE(r,e,o),tx(r,e,f,g,i,c)}if(l&&l.length)for(let h of l)c??=JE(r,e,o),tx(r,e,h,i,i,c)}}function V9(t=1){return DP(t)}function B9(t,e){let n=null,r=J8(t);for(let i=0;i<e.length;i++){let o=e[i];if(o==="*"){n=i;continue}if(r===null?Zx(t,o,!0):t5(r,o))return i}return n}function G9(t){let e=ne()[wn][Gn];if(!e.projection){let n=t?t.length:1,r=e.projection=JL(n,null),i=r.slice(),o=e.child;for(;o!==null;){if(o.type!==128){let s=t?B9(o,t):0;s!==null&&(i[s]?i[s].projectionNext=o:r[s]=o,i[s]=o)}o=o.next}}}function j9(t,e=0,n,r,i,o){let s=ne(),a=Ye(),c=r?t+1:null;c!==null&&ju(s,a,c,r,i,o,null,n);let l=Cc(a,Ke+t,16,null,n||null);l.projection===null&&(l.projection=e),gA();let h=!s[ac]||uA();s[wn][Gn].projection[l.projection]===null&&c!==null?H9(s,a,c):h&&!v_(l)&&b5(a,s,l)}function H9(t,e,n){let r=Ke+n,i=e.data[r],o=t[r],s=c_(o,i.tView.ssrId),a=Nf(t,i,void 0,{dehydratedView:s});wf(o,a,0,Fu(i,s))}function $9(t,e,n,r){Yq(t,e,n,r)}function W9(t,e,n){qk(t,e,n)}function z9(t){let e=ne(),n=Ye(),r=kE();mf(r+1);let i=tD(n,r);if(t.dirty&&cP(e)===((i.metadata.flags&2)===2)){if(i.matches===null)t.reset([]);else{let o=Yk(e,r);t.reset(o,bx),t.notifyOnChanges()}return!0}return!1}function q9(){return eD(ne(),kE())}function K9(t,e,n,r){Jq(t,qk(e,n,r))}function Y9(t=1){mf(kE()+t)}function X9(t){let e=mA();return pc(e,Ke+t)}function zE(t,e){return t<<17|e<<2}function Sc(t){return t>>17&32767}function Q9(t){return(t&2)==2}function J9(t,e){return t&131071|e<<17}function _C(t){return t|2}function Hu(t){return(t&131068)>>2}function LA(t,e){return t&-131069|e<<2}function Z9(t){return(t&1)===1}function TC(t){return t|1}function eK(t,e,n,r,i,o){let s=o?e.classBindings:e.styleBindings,a=Sc(s),c=Hu(s);t[r]=n;let l=!1,d;if(Array.isArray(n)){let h=n;d=h[1],(d===null||vu(h,d)>0)&&(l=!0)}else d=n;if(i)if(c!==0){let f=Sc(t[a+1]);t[r+1]=zE(f,a),f!==0&&(t[f+1]=LA(t[f+1],r)),t[a+1]=J9(t[a+1],r)}else t[r+1]=zE(a,0),a!==0&&(t[a+1]=LA(t[a+1],r)),a=r;else t[r+1]=zE(c,0),a===0?a=r:t[c+1]=LA(t[c+1],r),c=r;l&&(t[r+1]=_C(t[r+1])),lx(t,d,r,!0),lx(t,d,r,!1),tK(e,d,t,r,o),s=zE(a,c),o?e.classBindings=s:e.styleBindings=s}function tK(t,e,n,r,i){let o=i?t.residualClasses:t.residualStyles;o!=null&&typeof e=="string"&&vu(o,e)>=0&&(n[r+1]=TC(n[r+1]))}function lx(t,e,n,r){let i=t[n+1],o=e===null,s=r?Sc(i):Hu(i),a=!1;for(;s!==0&&(a===!1||o);){let c=t[s],l=t[s+1];nK(c,e)&&(a=!0,t[s+1]=r?TC(l):_C(l)),s=r?Sc(l):Hu(l)}a&&(t[n+1]=r?_C(i):TC(i))}function nK(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?vu(t,e)>=0:!1}var Wt={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function O1(t){return t.substring(Wt.key,Wt.keyEnd)}function rK(t){return t.substring(Wt.value,Wt.valueEnd)}function iK(t){return P1(t),M1(t,$u(t,0,Wt.textEnd))}function M1(t,e){let n=Wt.textEnd;return n===e?-1:(e=Wt.keyEnd=sK(t,Wt.key=e,n),$u(t,e,n))}function oK(t){return P1(t),L1(t,$u(t,0,Wt.textEnd))}function L1(t,e){let n=Wt.textEnd,r=Wt.key=$u(t,e,n);return n===r?-1:(r=Wt.keyEnd=aK(t,r,n),r=ux(t,r,n,58),r=Wt.value=$u(t,r,n),r=Wt.valueEnd=cK(t,r,n),ux(t,r,n,59))}function P1(t){Wt.key=0,Wt.keyEnd=0,Wt.value=0,Wt.valueEnd=0,Wt.textEnd=t.length}function $u(t,e,n){for(;e<n&&t.charCodeAt(e)<=32;)e++;return e}function sK(t,e,n){for(;e<n&&t.charCodeAt(e)>32;)e++;return e}function aK(t,e,n){let r;for(;e<n&&((r=t.charCodeAt(e))===45||r===95||(r&-33)>=65&&(r&-33)<=90||r>=48&&r<=57);)e++;return e}function ux(t,e,n,r){return e=$u(t,e,n),e<n&&e++,e}function cK(t,e,n){let r=-1,i=-1,o=-1,s=e,a=s;for(;s<n;){let c=t.charCodeAt(s++);if(c===59)return a;c===34||c===39?a=s=dx(t,c,s,n):e===s-4&&o===85&&i===82&&r===76&&c===40?a=s=dx(t,41,s,n):c>32&&(a=s),o=i,i=r,r=c&-33}return a}function dx(t,e,n,r){let i=-1,o=n;for(;o<r;){let s=t.charCodeAt(o++);if(s==e&&i!==92)return o;s==92&&i===92?i=0:i=s}throw new Error}function x1(t,e,n){return F1(t,e,n,!1),x1}function k1(t,e){return F1(t,e,null,!0),k1}function lK(t){U1(G1,uK,t,!1)}function uK(t,e){for(let n=oK(e);n>=0;n=L1(e,n))G1(t,O1(e),rK(e))}function dK(t){U1(_K,hK,t,!0)}function hK(t,e){for(let n=iK(e);n>=0;n=M1(e,n))lf(t,O1(e),!0)}function F1(t,e,n,r){let i=ne(),o=Ye(),s=gf(2);if(o.firstUpdatePass&&B1(o,t,s,r),e!==sn&&_n(i,s,e)){let a=o.data[pr()];j1(o,a,i,i[qe],t,i[s+1]=yK(e,n),r,s)}}function U1(t,e,n,r){let i=Ye(),o=gf(2);i.firstUpdatePass&&B1(i,null,o,r);let s=ne();if(n!==sn&&_n(s,o,n)){let a=i.data[pr()];if(H1(a,r)&&!V1(i,o)){let c=r?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(n=vE(c,n||"")),EC(i,a,s,n,r)}else TK(i,a,s,s[qe],s[o+1],s[o+1]=EK(t,e,n),r,o)}}function V1(t,e){return e>=t.expandoStartIndex}function B1(t,e,n,r){let i=t.data;if(i[n+1]===null){let o=i[pr()],s=V1(t,n);H1(o,r)&&e===null&&!s&&(e=!1),e=fK(i,o,e,r),eK(i,o,e,n,s,r)}}function fK(t,e,n,r){let i=vP(t),o=r?e.residualClasses:e.residualStyles;if(i===null)(r?e.classBindings:e.styleBindings)===0&&(n=PA(null,t,e,n,r),n=Af(n,e.attrs,r),o=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==i)if(n=PA(i,t,e,n,r),o===null){let c=pK(t,e,r);c!==void 0&&Array.isArray(c)&&(c=PA(null,t,e,c[1],r),c=Af(c,e.attrs,r),gK(t,e,r,c))}else o=mK(t,e,r)}return o!==void 0&&(r?e.residualClasses=o:e.residualStyles=o),n}function pK(t,e,n){let r=n?e.classBindings:e.styleBindings;if(Hu(r)!==0)return t[Sc(r)]}function gK(t,e,n,r){let i=n?e.classBindings:e.styleBindings;t[Sc(i)]=r}function mK(t,e,n){let r,i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o<i;o++){let s=t[o].hostAttrs;r=Af(r,s,n)}return Af(r,e.attrs,n)}function PA(t,e,n,r,i){let o=null,s=n.directiveEnd,a=n.directiveStylingLast;for(a===-1?a=n.directiveStart:a++;a<s&&(o=e[a],r=Af(r,o.hostAttrs,i),o!==t);)a++;return t!==null&&(n.directiveStylingLast=a),r}function Af(t,e,n){let r=n?1:2,i=-1;if(e!==null)for(let o=0;o<e.length;o++){let s=e[o];typeof s=="number"?i=s:i===r&&(Array.isArray(t)||(t=t===void 0?[]:["",t]),lf(t,s,n?!0:e[++o]))}return t===void 0?null:t}function EK(t,e,n){if(n==null||n==="")return Rn;let r=[],i=gr(n);if(Array.isArray(i))for(let o=0;o<i.length;o++)t(r,i[o],!0);else if(typeof i=="object")for(let o in i)i.hasOwnProperty(o)&&t(r,o,i[o]);else typeof i=="string"&&e(r,i);return r}function G1(t,e,n){lf(t,e,gr(n))}function _K(t,e,n){let r=String(e);r!==""&&!r.includes(" ")&&lf(t,r,n)}function TK(t,e,n,r,i,o,s,a){i===sn&&(i=Rn);let c=0,l=0,d=0<i.length?i[0]:null,h=0<o.length?o[0]:null;for(;d!==null||h!==null;){let f=c<i.length?i[c+1]:void 0,g=l<o.length?o[l+1]:void 0,E=null,I;d===h?(c+=2,l+=2,f!==g&&(E=h,I=g)):h===null||d!==null&&d<h?(c+=2,E=d):(l+=2,E=h,I=g),E!==null&&j1(t,e,n,r,E,I,s,a),d=c<i.length?i[c]:null,h=l<o.length?o[l]:null}}function j1(t,e,n,r,i,o,s,a){if(!(e.type&3))return;let c=t.data,l=c[a+1],d=Z9(l)?hx(c,e,n,i,Hu(l),s):void 0;if(!T_(d)){T_(o)||Q9(l)&&(o=hx(c,null,n,i,a,s));let h=iA(pr(),n);M5(r,s,h,i,o)}}function hx(t,e,n,r,i,o){let s=e===null,a;for(;i>0;){let c=t[i],l=Array.isArray(c),d=l?c[1]:c,h=d===null,f=n[i+1];f===sn&&(f=h?Rn:void 0);let g=h?NE(f,r):d===r?f:void 0;if(l&&!T_(g)&&(g=NE(c,r)),T_(g)&&(a=g,s))return a;let E=t[i+1];i=s?Sc(E):Hu(E)}if(e!==null){let c=o?e.residualClasses:e.residualStyles;c!=null&&(a=NE(c,r))}return a}function T_(t){return t!==void 0}function yK(t,e){return t==null||t===""||(typeof e=="string"?t=t+e:typeof t=="object"&&(t=vo(gr(t)))),t}function H1(t,e){return(t.flags&(e?8:16))!==0}function IK(t,e=""){let n=ne(),r=Ye(),i=t+Ke,o=r.firstCreatePass?Cc(r,i,1,e,null):r.data[i],s=vK(r,n,o,e,t);n[i]=s,VE()&&HC(r,n,s,o),gc(o,!1)}var vK=(t,e,n,r,i)=>(Ef(!0),L8(e[qe],r));function $1(t,e,n,r=""){return _n(t,Pi(),n)?e+ur(n)+r:sn}function SK(t,e,n,r,i,o=""){let s=_A(),a=Uu(t,s,n,i);return gf(2),a?e+ur(n)+r+ur(i)+o:sn}function AK(t,e,n,r,i,o,s,a=""){let c=_A(),l=ZC(t,c,n,i,s);return gf(3),l?e+ur(n)+r+ur(i)+o+ur(s)+a:sn}function W1(t){return fD("",t),W1}function fD(t,e,n){let r=ne(),i=$1(r,t,e,n);return i!==sn&&pD(r,pr(),i),fD}function z1(t,e,n,r,i){let o=ne(),s=SK(o,t,e,n,r,i);return s!==sn&&pD(o,pr(),s),z1}function q1(t,e,n,r,i,o,s){let a=ne(),c=AK(a,t,e,n,r,i,o,s);return c!==sn&&pD(a,pr(),c),q1}function pD(t,e,n){let r=iA(e,t);P8(t[qe],r,n)}function K1(t,e,n){AA(e)&&(e=e());let r=ne(),i=Pi();if(_n(r,i,e)){let o=Ye(),s=mc();Ek(s,r,t,e,r[qe],n)}return K1}function CK(t,e){let n=AA(t);return n&&t.set(e),n}function Y1(t,e){let n=ne(),r=Ye(),i=$t();return b1(r,n,n[qe],i,t,e),Y1}var X1={};function Q1(t){let e=Ye(),n=ne(),r=t+Ke,i=Cc(e,r,128,null,null);return gc(i,!1),pf(e,n,r,X1),Q1}function DK(t){Lo("NgLet");let e=Ye(),n=ne(),r=pr();return pf(e,n,r,t),t}function RK(t){let e=mA(),n=pc(e,Ke+t);if(n===X1)throw new J(314,!1);return n}function NK(t){return _n(ne(),Pi(),t)?ur(t):sn}function wK(t,e,n=""){return $1(ne(),t,e,n)}function bK(t,e,n){let r=Ye();if(r.firstCreatePass){let i=ei(t);yC(n,r.data,r.blueprint,i,!0),yC(e,r.data,r.blueprint,i,!1)}}function yC(t,e,n,r,i){if(t=jt(t),Array.isArray(t))for(let o=0;o<t.length;o++)yC(t[o],e,n,r,i);else{let o=Ye(),s=ne(),a=$t(),c=ic(t)?t:jt(t.provide),l=QS(t),d=a.providerIndexes&1048575,h=a.directiveStart,f=a.providerIndexes>>20;if(ic(t)||!t.multi){let g=new yc(l,i,st,null),E=kA(c,e,i?d:d+f,h);E===-1?(UA(r_(a,s),o,c),xA(o,t,e.length),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),n.push(g),s.push(g)):(n[E]=g,s[E]=g)}else{let g=kA(c,e,d+f,h),E=kA(c,e,d,d+f),I=g>=0&&n[g],S=E>=0&&n[E];if(i&&!S||!i&&!I){UA(r_(a,s),o,c);let L=LK(i?MK:OK,n.length,i,r,l,t);!i&&S&&(n[E].providerFactory=L),xA(o,t,e.length,0),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),n.push(L),s.push(L)}else{let L=J1(n[i?E:g],l,!i&&r);xA(o,t,g>-1?g:E,L)}!i&&r&&S&&n[E].componentProviders++}}}function xA(t,e,n,r){let i=ic(e),o=iP(e);if(i||o){let c=(o?jt(e.useClass):e).prototype.ngOnDestroy;if(c){let l=t.destroyHooks||(t.destroyHooks=[]);if(!i&&e.multi){let d=l.indexOf(n);d===-1?l.push(n,[r,c]):l[d+1].push(r,c)}else l.push(n,c)}}}function J1(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function kA(t,e,n,r){for(let i=n;i<r;i++)if(e[i]===t)return i;return-1}function OK(t,e,n,r,i){return IC(this.multi,[])}function MK(t,e,n,r,i){let o=this.multi,s;if(this.providerFactory){let a=this.providerFactory.componentProviders,c=If(r,r[pe],this.providerFactory.index,i);s=c.slice(0,a),IC(o,s);for(let l=a;l<c.length;l++)s.push(c[l])}else s=[],IC(o,s);return s}function IC(t,e){for(let n=0;n<t.length;n++){let r=t[n];e.push(r())}return e}function LK(t,e,n,r,i,o){let s=new yc(t,n,st,null);return s.multi=[],s.index=e,s.componentProviders=0,J1(s,i,r&&!n),s}function PK(t,e=[]){return n=>{n.providersResolver=(r,i)=>bK(r,i?i(t):t,e)}}function xK(t,e,n){let r=t.\u0275cmp;r.directiveDefs=m_(e,s1),r.pipeDefs=m_(n,KS)}function kK(t,e,n){let r=jn()+t,i=ne();return i[r]===sn?Gi(i,r,n?e.call(n):e()):Of(i,r)}function FK(t,e,n,r){return Z1(ne(),jn(),t,e,n,r)}function UK(t,e,n,r,i){return eF(ne(),jn(),t,e,n,r,i)}function VK(t,e,n,r,i,o){return tF(ne(),jn(),t,e,n,r,i,o)}function BK(t,e,n,r,i,o,s){return zK(ne(),jn(),t,e,n,r,i,o,s)}function GK(t,e,n,r,i,o,s,a){let c=jn()+t,l=ne(),d=Vu(l,c,n,r,i,o);return _n(l,c+4,s)||d?Gi(l,c+5,a?e.call(a,n,r,i,o,s):e(n,r,i,o,s)):Of(l,c+5)}function jK(t,e,n,r,i,o,s,a,c){let l=jn()+t,d=ne(),h=Vu(d,l,n,r,i,o);return Uu(d,l+4,s,a)||h?Gi(d,l+6,c?e.call(c,n,r,i,o,s,a):e(n,r,i,o,s,a)):Of(d,l+6)}function HK(t,e,n,r,i,o,s,a,c,l){let d=jn()+t,h=ne(),f=Vu(h,d,n,r,i,o);return ZC(h,d+4,s,a,c)||f?Gi(h,d+7,l?e.call(l,n,r,i,o,s,a,c):e(n,r,i,o,s,a,c)):Of(h,d+7)}function $K(t,e,n,r,i,o,s,a,c,l,d){let h=jn()+t,f=ne(),g=Vu(f,h,n,r,i,o);return Vu(f,h+4,s,a,c,l)||g?Gi(f,h+8,d?e.call(d,n,r,i,o,s,a,c,l):e(n,r,i,o,s,a,c,l)):Of(f,h+8)}function WK(t,e,n,r){return nF(ne(),jn(),t,e,n,r)}function kf(t,e){let n=t[e];return n===sn?void 0:n}function Z1(t,e,n,r,i,o){let s=e+n;return _n(t,s,i)?Gi(t,s+1,o?r.call(o,i):r(i)):kf(t,s+1)}function eF(t,e,n,r,i,o,s){let a=e+n;return Uu(t,a,i,o)?Gi(t,a+2,s?r.call(s,i,o):r(i,o)):kf(t,a+2)}function tF(t,e,n,r,i,o,s,a){let c=e+n;return ZC(t,c,i,o,s)?Gi(t,c+3,a?r.call(a,i,o,s):r(i,o,s)):kf(t,c+3)}function zK(t,e,n,r,i,o,s,a,c){let l=e+n;return Vu(t,l,i,o,s,a)?Gi(t,l+4,c?r.call(c,i,o,s,a):r(i,o,s,a)):kf(t,l+4)}function nF(t,e,n,r,i,o){let s=e+n,a=!1;for(let c=0;c<i.length;c++)_n(t,s++,i[c])&&(a=!0);return a?Gi(t,s,r.apply(o,i)):kf(t,s)}function qK(t,e){let n=Ye(),r,i=t+Ke;n.firstCreatePass?(r=KK(e,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks??=[]).push(i,r.onDestroy)):r=n.data[i];let o=r.factory||(r.factory=Es(r.type,!0)),s,a=Bn(st);try{let c=n_(!1),l=o();return n_(c),pf(n,ne(),i,l),l}finally{Bn(a)}}function KK(t,e){if(e)for(let n=e.length-1;n>=0;n--){let r=e[n];if(t===r.name)return r}}function YK(t,e,n){let r=t+Ke,i=ne(),o=pc(i,r);return F_(i,r)?Z1(i,jn(),e,o.transform,n,o):o.transform(n)}function XK(t,e,n,r){let i=t+Ke,o=ne(),s=pc(o,i);return F_(o,i)?eF(o,jn(),e,s.transform,n,r,s):s.transform(n,r)}function QK(t,e,n,r,i){let o=t+Ke,s=ne(),a=pc(s,o);return F_(s,o)?tF(s,jn(),e,a.transform,n,r,i,a):a.transform(n,r,i)}function JK(t,e,n){let r=t+Ke,i=ne(),o=pc(i,r);return F_(i,r)?nF(i,jn(),e,o.transform,n,o):o.transform.apply(o,n)}function F_(t,e){return t[pe].data[e].pure}function ZK(t,e){return O_(t,e)}var qE=null;function rF(t){qE!==null&&(t.defaultEncapsulation!==qE.defaultEncapsulation||t.preserveWhitespaces!==qE.preserveWhitespaces)||(qE=t)}var iF=new z("");var eY=(()=>{class t{zone=Y(Ae);changeDetectionScheduler=Y(Lr);applicationRef=Y(bs);applicationErrorHandler=Y(xi);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{try{this.applicationRef.dirtyFlags|=1,this.applicationRef._tick()}catch(n){this.applicationErrorHandler(n)}})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function oF({ngZoneFactory:t,ignoreChangesOutsideZone:e,scheduleInRootZone:n}){return t??=()=>new Ae(Ee(B({},gD()),{scheduleInRootZone:n})),[{provide:Ae,useFactory:t},{provide:ys,multi:!0,useFactory:()=>{let r=Y(eY,{optional:!0});return()=>r.initialize()}},{provide:ys,multi:!0,useFactory:()=>{let r=Y(tY);return()=>{r.initialize()}}},e===!0?{provide:CA,useValue:!0}:[],{provide:BE,useValue:n??rk},{provide:xi,useFactory:()=>{let r=Y(Ae),i=Y(Nn),o;return s=>{r.runOutsideAngular(()=>{i.destroyed&&!o?setTimeout(()=>{throw s}):(o??=i.get(lr),o.handleError(s))})}}}]}function gD(t){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:t?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:t?.runCoalescing??!1}}var tY=(()=>{class t{subscription=new gt;initialized=!1;zone=Y(Ae);pendingTasks=Y(Ds);initialize(){if(this.initialized)return;this.initialized=!0;let n=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(n=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Ae.assertNotInAngularZone(),queueMicrotask(()=>{n!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(n),n=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Ae.assertInAngularZone(),n??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var mD=(()=>{class t{applicationErrorHandler=Y(xi);appRef=Y(bs);taskService=Y(Ds);ngZone=Y(Ae);zonelessEnabled=Y(Ou);tracing=Y(Ac,{optional:!0});disableScheduling=Y(CA,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new gt;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(s_):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(Y(BE,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof ku||!this.zoneIsDefined)}notify(n){if(!this.zonelessEnabled&&n===5)return;let r=!1;switch(n){case 0:{this.appRef.dirtyFlags|=2;break}case 3:case 2:case 4:case 5:case 1:{this.appRef.dirtyFlags|=4;break}case 6:{this.appRef.dirtyFlags|=2,r=!0;break}case 12:{this.appRef.dirtyFlags|=16,r=!0;break}case 13:{this.appRef.dirtyFlags|=2,r=!0;break}case 11:{r=!0;break}default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(r))return;let i=this.useMicrotaskScheduler?WP:ik;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>i(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(n){return!(this.disableScheduling&&!n||this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(s_+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let n=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(r){this.taskService.remove(n),this.applicationErrorHandler(r)}finally{this.cleanup()}this.useMicrotaskScheduler=!0,WP(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(n)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let n=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(n)}}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function nY(){return Lo("NgZoneless"),Xn([{provide:Lr,useExisting:mD},{provide:Ae,useClass:ku},{provide:Ou,useValue:!0},{provide:BE,useValue:!1},[]])}function rY(){return typeof $localize<"u"&&$localize.locale||xf}var Ff=new z("",{providedIn:"root",factory:()=>Y(Ff,{optional:!0,skipSelf:!0})||rY()});var U_=class{destroyed=!1;listeners=null;errorHandler=Y(lr,{optional:!0});destroyRef=Y(Hn);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new J(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let n=this.listeners?.indexOf(e);n!==void 0&&n!==-1&&this.listeners?.splice(n,1)}}}emit(e){if(this.destroyed){console.warn(Ts(953,!1));return}if(this.listeners===null)return;let n=Te(null);try{for(let r of this.listeners)try{r(e)}catch(i){this.errorHandler?.handleError(i)}}finally{Te(n)}}};function Uf(t){return BL(t)}function Vf(t,e){return Zh(t,e?.equal)}var ED=class{[rn];constructor(e){this[rn]=e}destroy(){this[rn].destroy()}};function _D(t,e){let n=e?.injector??Y(ze),r=e?.manualCleanup!==!0?n.get(Hn):null,i,o=n.get(bu,null,{optional:!0}),s=n.get(Lr);return o!==null?(i=sY(o.view,s,t),r instanceof af&&r._lView===o.view&&(r=null)):i=aY(t,n.get(_f),s),i.injector=n,r!==null&&(i.onDestroyFn=r.onDestroy(()=>i.destroy())),new ED(i)}var sF=Ee(B({},GL),{cleanupFns:void 0,zone:null,onDestroyFn:_c,run(){let t=wu(!1);try{jL(this)}finally{wu(t)}},cleanup(){if(!this.cleanupFns?.length)return;let t=Te(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],Te(t)}}}),iY=Ee(B({},sF),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){ec(this),this.onDestroyFn(),this.cleanup(),this.scheduler.remove(this)}}),oY=Ee(B({},sF),{consumerMarkedDirty(){this.view[ye]|=8192,As(this.view),this.notifier.notify(13)},destroy(){ec(this),this.onDestroyFn(),this.cleanup(),this.view[Co]?.delete(this)}});function sY(t,e,n){let r=Object.create(oY);return r.view=t,r.zone=typeof Zone<"u"?Zone.current:null,r.notifier=e,r.fn=aF(r,n),t[Co]??=new Set,t[Co].add(r),r.consumerMarkedDirty(r),r}function aY(t,e,n){let r=Object.create(iY);return r.fn=aF(r,t),r.scheduler=e,r.notifier=n,r.zone=typeof Zone<"u"?Zone.current:null,r.scheduler.add(r),r.notifier.notify(12),r}function aF(t,e){return()=>{e(n=>(t.cleanupFns??=[]).push(n))}}var gF=Symbol("InputSignalNode#UNSET"),TY=Ee(B({},uE),{transformFn:void 0,applyValueToInputSignal(t,e){Tu(t,e)}});function mF(t,e){let n=Object.create(TY);n.value=t,n.transformFn=e?.transform;function r(){if(gu(n),n.value===gF){let i=null;throw new J(-950,i)}return n.value}return r[rn]=n,r}var yY=new z("");yY.__NG_ELEMENT_ID__=t=>{let e=$t();if(e===null)throw new J(204,!1);if(e.type&2)return e.value;if(t&8)return null;throw new J(204,!1)};function FSe(t){return new U_}function cF(t,e){return mF(t,e)}function IY(t){return mF(gF,t)}var USe=(cF.required=IY,cF);function lF(t,e){return Qk(e)}function vY(t,e){return Jk(e)}var VSe=(lF.required=vY,lF);function SY(t,e,n){let r=new p_(n);return Promise.resolve(r)}function uF(t){for(let e=t.length-1;e>=0;e--)if(t[e]!==void 0)return t[e]}var V_=new z(""),AY=new z("");function Bf(t){return!t.moduleRef}function CY(t){let e=Bf(t)?t.r3Injector:t.moduleRef.injector,n=e.get(Ae);return n.run(()=>{Bf(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();let r=e.get(xi),i;if(n.runOutsideAngular(()=>{i=n.onError.subscribe({next:r})}),Bf(t)){let o=()=>e.destroy(),s=t.platformInjector.get(V_);s.add(o),e.onDestroy(()=>{i.unsubscribe(),s.delete(o)})}else{let o=()=>t.moduleRef.destroy(),s=t.platformInjector.get(V_);s.add(o),t.moduleRef.onDestroy(()=>{yf(t.allPlatformModules,t.moduleRef),i.unsubscribe(),s.delete(o)})}return RY(r,n,()=>{let o=e.get(Ds),s=o.add(),a=e.get(iD);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(Ff,xf);if(R1(c||xf),!e.get(AY,!0))return Bf(t)?e.get(bs):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(Bf(t)){let d=e.get(bs);return t.rootComponent!==void 0&&d.bootstrap(t.rootComponent),d}else return EF?.(t.moduleRef,t.allPlatformModules),t.moduleRef}).finally(()=>{o.remove(s)})})})}var EF;function dF(){EF=DY}function DY(t,e){let n=t.injector.get(bs);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>n.bootstrap(r));else if(t.instance.ngDoBootstrap)t.instance.ngDoBootstrap(n);else throw new J(-403,!1);e.push(t)}function RY(t,e,n){try{let r=n();return k_(r)?r.catch(i=>{throw e.runOutsideAngular(()=>t(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>t(r)),r}}var _F=(()=>{class t{_injector;_modules=[];_destroyListeners=[];_destroyed=!1;constructor(n){this._injector=n}bootstrapModuleFactory(n,r){let i=r?.scheduleInRootZone,o=()=>sk(r?.ngZone,Ee(B({},gD({eventCoalescing:r?.ngZoneEventCoalescing,runCoalescing:r?.ngZoneRunCoalescing})),{scheduleInRootZone:i})),s=r?.ignoreChangesOutsideZone,a=[oF({ngZoneFactory:o,ignoreChangesOutsideZone:s}),{provide:Lr,useExisting:mD},bP],c=i1(n.moduleType,this.injector,a);return dF(),CY({moduleRef:c,allPlatformModules:this._modules,platformInjector:this.injector})}bootstrapModule(n,r=[]){let i=oD({},r);return dF(),SY(this.injector,i,n).then(o=>this.bootstrapModuleFactory(o,i))}onDestroy(n){this._destroyListeners.push(n)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new J(404,!1);this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());let n=this._injector.get(V_,null);n&&(n.forEach(r=>r()),n.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static \u0275fac=function(r){return new(r||t)($(ze))};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})(),DD=null;function NY(t){if(ND())throw new J(400,!1);E1(),DD=t;let e=t.get(_F);return OY(t),e}function RD(t,e,n=[]){let r=`Platform: ${e}`,i=new z(r);return(o=[])=>{let s=ND();if(!s){let a=[...n,...o,{provide:i,useValue:!0}];s=t?.(a)??NY(wY(a,r))}return bY(i)}}function wY(t=[],e){return ze.create({name:e,providers:[{provide:uf,useValue:"platform"},{provide:V_,useValue:new Set([()=>DD=null])},...t]})}function bY(t){let e=ND();if(!e)throw new J(-401,!1);return e}function ND(){return DD?.get(_F)??null}function OY(t){let e=t.get(I_,null);bi(t,()=>{e?.forEach(n=>n())})}function wD(){return!1}var MY=(()=>{class t{static __NG_ELEMENT_ID__=LY}return t})();function LY(t){return PY($t(),ne(),(t&16)===16)}function PY(t,e,n){if(Do(t)&&!n){let r=kr(t.index,e);return new Rs(r,r)}else if(t.type&175){let r=e[wn];return new Rs(r,e)}return null}var TD=class{constructor(){}supports(e){return JC(e)}create(e){return new yD(e)}},xY=(t,e)=>e,yD=class{length=0;collection;_linkedRecords=null;_unlinkedRecords=null;_previousItHead=null;_itHead=null;_itTail=null;_additionsHead=null;_additionsTail=null;_movesHead=null;_movesTail=null;_removalsHead=null;_removalsTail=null;_identityChangesHead=null;_identityChangesTail=null;_trackByFn;constructor(e){this._trackByFn=e||xY}forEachItem(e){let n;for(n=this._itHead;n!==null;n=n._next)e(n)}forEachOperation(e){let n=this._itHead,r=this._removalsHead,i=0,o=null;for(;n||r;){let s=!r||n&&n.currentIndex<hF(r,i,o)?n:r,a=hF(s,i,o),c=s.currentIndex;if(s===r)i--,r=r._nextRemoved;else if(n=n._next,s.previousIndex==null)i++;else{o||(o=[]);let l=a-i,d=c-i;if(l!=d){for(let f=0;f<l;f++){let g=f<o.length?o[f]:o[f]=0,E=g+f;d<=E&&E<l&&(o[f]=g+1)}let h=s.previousIndex;o[h]=d-l}}a!==c&&e(s,a,c)}}forEachPreviousItem(e){let n;for(n=this._previousItHead;n!==null;n=n._nextPrevious)e(n)}forEachAddedItem(e){let n;for(n=this._additionsHead;n!==null;n=n._nextAdded)e(n)}forEachMovedItem(e){let n;for(n=this._movesHead;n!==null;n=n._nextMoved)e(n)}forEachRemovedItem(e){let n;for(n=this._removalsHead;n!==null;n=n._nextRemoved)e(n)}forEachIdentityChange(e){let n;for(n=this._identityChangesHead;n!==null;n=n._nextIdentityChange)e(n)}diff(e){if(e==null&&(e=[]),!JC(e))throw new J(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let n=this._itHead,r=!1,i,o,s;if(Array.isArray(e)){this.length=e.length;for(let a=0;a<this.length;a++)o=e[a],s=this._trackByFn(a,o),n===null||!Object.is(n.trackById,s)?(n=this._mismatch(n,o,s,a),r=!0):(r&&(n=this._verifyReinsertion(n,o,s,a)),Object.is(n.item,o)||this._addIdentityChange(n,o)),n=n._next}else i=0,Vk(e,a=>{s=this._trackByFn(i,a),n===null||!Object.is(n.trackById,s)?(n=this._mismatch(n,a,s,i),r=!0):(r&&(n=this._verifyReinsertion(n,a,s,i)),Object.is(n.item,a)||this._addIdentityChange(n,a)),n=n._next,i++}),this.length=i;return this._truncate(n),this.collection=e,this.isDirty}get isDirty(){return this._additionsHead!==null||this._movesHead!==null||this._removalsHead!==null||this._identityChangesHead!==null}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;e!==null;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;e!==null;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,n,r,i){let o;return e===null?o=this._itTail:(o=e._prev,this._remove(e)),e=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null),e!==null?(Object.is(e.item,n)||this._addIdentityChange(e,n),this._reinsertAfter(e,o,i)):(e=this._linkedRecords===null?null:this._linkedRecords.get(r,i),e!==null?(Object.is(e.item,n)||this._addIdentityChange(e,n),this._moveAfter(e,o,i)):e=this._addAfter(new ID(n,r),o,i)),e}_verifyReinsertion(e,n,r,i){let o=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null);return o!==null?e=this._reinsertAfter(o,e._prev,i):e.currentIndex!=i&&(e.currentIndex=i,this._addToMoves(e,i)),e}_truncate(e){for(;e!==null;){let n=e._next;this._addToRemovals(this._unlink(e)),e=n}this._unlinkedRecords!==null&&this._unlinkedRecords.clear(),this._additionsTail!==null&&(this._additionsTail._nextAdded=null),this._movesTail!==null&&(this._movesTail._nextMoved=null),this._itTail!==null&&(this._itTail._next=null),this._removalsTail!==null&&(this._removalsTail._nextRemoved=null),this._identityChangesTail!==null&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,n,r){this._unlinkedRecords!==null&&this._unlinkedRecords.remove(e);let i=e._prevRemoved,o=e._nextRemoved;return i===null?this._removalsHead=o:i._nextRemoved=o,o===null?this._removalsTail=i:o._prevRemoved=i,this._insertAfter(e,n,r),this._addToMoves(e,r),e}_moveAfter(e,n,r){return this._unlink(e),this._insertAfter(e,n,r),this._addToMoves(e,r),e}_addAfter(e,n,r){return this._insertAfter(e,n,r),this._additionsTail===null?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e}_insertAfter(e,n,r){let i=n===null?this._itHead:n._next;return e._next=i,e._prev=n,i===null?this._itTail=e:i._prev=e,n===null?this._itHead=e:n._next=e,this._linkedRecords===null&&(this._linkedRecords=new B_),this._linkedRecords.put(e),e.currentIndex=r,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){this._linkedRecords!==null&&this._linkedRecords.remove(e);let n=e._prev,r=e._next;return n===null?this._itHead=r:n._next=r,r===null?this._itTail=n:r._prev=n,e}_addToMoves(e,n){return e.previousIndex===n||(this._movesTail===null?this._movesTail=this._movesHead=e:this._movesTail=this._movesTail._nextMoved=e),e}_addToRemovals(e){return this._unlinkedRecords===null&&(this._unlinkedRecords=new B_),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,this._removalsTail===null?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,n){return e.item=n,this._identityChangesTail===null?this._identityChangesTail=this._identityChangesHead=e:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=e,e}},ID=class{item;trackById;currentIndex=null;previousIndex=null;_nextPrevious=null;_prev=null;_next=null;_prevDup=null;_nextDup=null;_prevRemoved=null;_nextRemoved=null;_nextAdded=null;_nextMoved=null;_nextIdentityChange=null;constructor(e,n){this.item=e,this.trackById=n}},vD=class{_head=null;_tail=null;add(e){this._head===null?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,n){let r;for(r=this._head;r!==null;r=r._nextDup)if((n===null||n<=r.currentIndex)&&Object.is(r.trackById,e))return r;return null}remove(e){let n=e._prevDup,r=e._nextDup;return n===null?this._head=r:n._nextDup=r,r===null?this._tail=n:r._prevDup=n,this._head===null}},B_=class{map=new Map;put(e){let n=e.trackById,r=this.map.get(n);r||(r=new vD,this.map.set(n,r)),r.add(e)}get(e,n){let r=e,i=this.map.get(r);return i?i.get(e,n):null}remove(e){let n=e.trackById;return this.map.get(n).remove(e)&&this.map.delete(n),e}get isEmpty(){return this.map.size===0}clear(){this.map.clear()}};function hF(t,e,n){let r=t.previousIndex;if(r===null)return r;let i=0;return n&&r<n.length&&(i=n[r]),r+e+i}var SD=class{constructor(){}supports(e){return e instanceof Map||P_(e)}create(){return new AD}},AD=class{_records=new Map;_mapHead=null;_appendAfter=null;_previousMapHead=null;_changesHead=null;_changesTail=null;_additionsHead=null;_additionsTail=null;_removalsHead=null;_removalsTail=null;get isDirty(){return this._additionsHead!==null||this._changesHead!==null||this._removalsHead!==null}forEachItem(e){let n;for(n=this._mapHead;n!==null;n=n._next)e(n)}forEachPreviousItem(e){let n;for(n=this._previousMapHead;n!==null;n=n._nextPrevious)e(n)}forEachChangedItem(e){let n;for(n=this._changesHead;n!==null;n=n._nextChanged)e(n)}forEachAddedItem(e){let n;for(n=this._additionsHead;n!==null;n=n._nextAdded)e(n)}forEachRemovedItem(e){let n;for(n=this._removalsHead;n!==null;n=n._nextRemoved)e(n)}diff(e){if(!e)e=new Map;else if(!(e instanceof Map||P_(e)))throw new J(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let n=this._mapHead;if(this._appendAfter=null,this._forEach(e,(r,i)=>{if(n&&n.key===i)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{let o=this._getOrCreateRecordForKey(i,r);n=this._insertBeforeOrAppend(n,o)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;r!==null;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,n){if(e){let r=e._prev;return n._next=e,n._prev=r,e._prev=n,r&&(r._next=n),e===this._mapHead&&(this._mapHead=n),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(e,n){if(this._records.has(e)){let i=this._records.get(e);this._maybeAddToChanges(i,n);let o=i._prev,s=i._next;return o&&(o._next=s),s&&(s._prev=o),i._next=null,i._prev=null,i}let r=new CD(e);return this._records.set(e,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;e!==null;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;e!=null;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,n){Object.is(n,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=n,this._addToChanges(e))}_addToAdditions(e){this._additionsHead===null?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){this._changesHead===null?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,n){e instanceof Map?e.forEach(n):Object.keys(e).forEach(r=>n(e[r],r))}},CD=class{key;previousValue=null;currentValue=null;_nextPrevious=null;_next=null;_prev=null;_nextAdded=null;_nextRemoved=null;_nextChanged=null;constructor(e){this.key=e}};function fF(){return new bD([new TD])}var bD=(()=>{class t{factories;static \u0275prov=Q({token:t,providedIn:"root",factory:fF});constructor(n){this.factories=n}static create(n,r){if(r!=null){let i=r.factories.slice();n=n.concat(i)}return new t(n)}static extend(n){return{provide:t,useFactory:()=>{let r=Y(t,{optional:!0,skipSelf:!0});return t.create(n,r||fF())}}}find(n){let r=this.factories.find(i=>i.supports(n));if(r!=null)return r;throw new J(901,!1)}}return t})();function pF(){return new G_([new SD])}var G_=(()=>{class t{static \u0275prov=Q({token:t,providedIn:"root",factory:pF});factories;constructor(n){this.factories=n}static create(n,r){if(r){let i=r.factories.slice();n=n.concat(i)}return new t(n)}static extend(n){return{provide:t,useFactory:()=>{let r=Y(t,{optional:!0,skipSelf:!0});return t.create(n,r||pF())}}}find(n){let r=this.factories.find(i=>i.supports(n));if(r)return r;throw new J(901,!1)}}return t})();var TF=RD(null,"core",[]),yF=(()=>{class t{constructor(n){}static \u0275fac=function(r){return new(r||t)($(bs))};static \u0275mod=ws({type:t});static \u0275inj=So({})}return t})();function BSe(t){return typeof t=="boolean"?t:t!=null&&t!=="false"}function GSe(t,e=NaN){return!isNaN(parseFloat(t))&&!isNaN(Number(t))?Number(t):e}function jSe(t,e){let n=Is(t),r=e.elementInjector||Su();return new Bu(n).create(r,e.projectableNodes,e.hostElement,e.environmentInjector,e.directives,e.bindings)}var SF=null;function $i(){return SF}function OD(t){SF??=t}var Gf=class{},MD=(()=>{class t{historyGo(n){throw new Error("")}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:()=>Y(AF),providedIn:"platform"})}return t})();var AF=(()=>{class t extends MD{_location;_history;_doc=Y(on);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return $i().getBaseHref(this._doc)}onPopState(n){let r=$i().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",n,!1),()=>r.removeEventListener("popstate",n)}onHashChange(n){let r=$i().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",n,!1),()=>r.removeEventListener("hashchange",n)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(n){this._location.pathname=n}pushState(n,r,i){this._history.pushState(n,r,i)}replaceState(n,r,i){this._history.replaceState(n,r,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(n=0){this._history.go(n)}getState(){return this._history.state}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:()=>new t,providedIn:"platform"})}return t})();function CF(t,e){return t?e?t.endsWith("/")?e.startsWith("/")?t+e.slice(1):t+e:e.startsWith("/")?t+e:`${t}/${e}`:t:e}function IF(t){let e=t.search(/#|\?|$/);return t[e-1]==="/"?t.slice(0,e-1)+t.slice(e):t}function Os(t){return t&&t[0]!=="?"?`?${t}`:t}var j_=(()=>{class t{historyGo(n){throw new Error("")}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:()=>Y(RF),providedIn:"root"})}return t})(),DF=new z(""),RF=(()=>{class t extends j_{_platformLocation;_baseHref;_removeListenerFns=[];constructor(n,r){super(),this._platformLocation=n,this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??Y(on).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}prepareExternalUrl(n){return CF(this._baseHref,n)}path(n=!1){let r=this._platformLocation.pathname+Os(this._platformLocation.search),i=this._platformLocation.hash;return i&&n?`${r}${i}`:r}pushState(n,r,i,o){let s=this.prepareExternalUrl(i+Os(o));this._platformLocation.pushState(n,r,s)}replaceState(n,r,i,o){let s=this.prepareExternalUrl(i+Os(o));this._platformLocation.replaceState(n,r,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}static \u0275fac=function(r){return new(r||t)($(MD),$(DF,8))};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),NF=(()=>{class t{_subject=new Rt;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(n){this._locationStrategy=n;let r=this._locationStrategy.getBaseHref();this._basePath=UY(IF(vF(r))),this._locationStrategy.onPopState(i=>{this._subject.next({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(n=!1){return this.normalize(this._locationStrategy.path(n))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(n,r=""){return this.path()==this.normalize(n+Os(r))}normalize(n){return t.stripTrailingSlash(FY(this._basePath,vF(n)))}prepareExternalUrl(n){return n&&n[0]!=="/"&&(n="/"+n),this._locationStrategy.prepareExternalUrl(n)}go(n,r="",i=null){this._locationStrategy.pushState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+Os(r)),i)}replaceState(n,r="",i=null){this._locationStrategy.replaceState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+Os(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(n=0){this._locationStrategy.historyGo?.(n)}onUrlChange(n){return this._urlChangeListeners.push(n),this._urlChangeSubscription??=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}),()=>{let r=this._urlChangeListeners.indexOf(n);this._urlChangeListeners.splice(r,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(n="",r){this._urlChangeListeners.forEach(i=>i(n,r))}subscribe(n,r,i){return this._subject.subscribe({next:n,error:r??void 0,complete:i??void 0})}static normalizeQueryParams=Os;static joinWithSlash=CF;static stripTrailingSlash=IF;static \u0275fac=function(r){return new(r||t)($(j_))};static \u0275prov=Q({token:t,factory:()=>kY(),providedIn:"root"})}return t})();function kY(){return new NF($(j_))}function FY(t,e){if(!t||!e.startsWith(t))return e;let n=e.substring(t.length);return n===""||["/",";","?","#"].includes(n[0])?n:e}function vF(t){return t.replace(/\/index.html$/,"")}function UY(t){if(new RegExp("^(https?:)?//").test(t)){let[,n]=t.split(/\/\/[^\/]+/);return n}return t}var bn=(function(t){return t[t.Format=0]="Format",t[t.Standalone=1]="Standalone",t})(bn||{}),tt=(function(t){return t[t.Narrow=0]="Narrow",t[t.Abbreviated=1]="Abbreviated",t[t.Wide=2]="Wide",t[t.Short=3]="Short",t})(tt||{}),Qn=(function(t){return t[t.Short=0]="Short",t[t.Medium=1]="Medium",t[t.Long=2]="Long",t[t.Full=3]="Full",t})(Qn||{}),xo={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function PF(t){return mr(t)[Ot.LocaleId]}function xF(t,e,n){let r=mr(t),i=[r[Ot.DayPeriodsFormat],r[Ot.DayPeriodsStandalone]],o=Fr(i,e);return Fr(o,n)}function kF(t,e,n){let r=mr(t),i=[r[Ot.DaysFormat],r[Ot.DaysStandalone]],o=Fr(i,e);return Fr(o,n)}function FF(t,e,n){let r=mr(t),i=[r[Ot.MonthsFormat],r[Ot.MonthsStandalone]],o=Fr(i,e);return Fr(o,n)}function UF(t,e){let r=mr(t)[Ot.Eras];return Fr(r,e)}function jf(t,e){let n=mr(t);return Fr(n[Ot.DateFormat],e)}function Hf(t,e){let n=mr(t);return Fr(n[Ot.TimeFormat],e)}function $f(t,e){let r=mr(t)[Ot.DateTimeFormat];return Fr(r,e)}function Wf(t,e){let n=mr(t),r=n[Ot.NumberSymbols][e];if(typeof r>"u"){if(e===xo.CurrencyDecimal)return n[Ot.NumberSymbols][xo.Decimal];if(e===xo.CurrencyGroup)return n[Ot.NumberSymbols][xo.Group]}return r}function VF(t){if(!t[Ot.ExtraData])throw new J(2303,!1)}function BF(t){let e=mr(t);return VF(e),(e[Ot.ExtraData][2]||[]).map(r=>typeof r=="string"?LD(r):[LD(r[0]),LD(r[1])])}function GF(t,e,n){let r=mr(t);VF(r);let i=[r[Ot.ExtraData][0],r[Ot.ExtraData][1]],o=Fr(i,e)||[];return Fr(o,n)||[]}function Fr(t,e){for(let n=e;n>-1;n--)if(typeof t[n]<"u")return t[n];throw new J(2304,!1)}function LD(t){let[e,n]=t.split(":");return{hours:+e,minutes:+n}}var VY=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,H_={},BY=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,GY=256;function jF(t,e,n,r){let i=QY(t);jY(e),e=Po(n,e)||e;let s=[],a;for(;e;)if(a=BY.exec(e),a){s=s.concat(a.slice(1));let d=s.pop();if(!d)break;e=d}else{s.push(e);break}let c=i.getTimezoneOffset();r&&(c=$F(r,c),i=XY(i,r));let l="";return s.forEach(d=>{let h=KY(d);l+=h?h(i,n,c):d==="''"?"'":d.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}function jY(t){if(t.length>GY)throw new J(2300,!1)}function K_(t,e,n){let r=new Date(0);return r.setFullYear(t,e,n),r.setHours(0,0,0),r}function Po(t,e){let n=PF(t);if(H_[n]??={},H_[n][e])return H_[n][e];let r="";switch(e){case"shortDate":r=jf(t,Qn.Short);break;case"mediumDate":r=jf(t,Qn.Medium);break;case"longDate":r=jf(t,Qn.Long);break;case"fullDate":r=jf(t,Qn.Full);break;case"shortTime":r=Hf(t,Qn.Short);break;case"mediumTime":r=Hf(t,Qn.Medium);break;case"longTime":r=Hf(t,Qn.Long);break;case"fullTime":r=Hf(t,Qn.Full);break;case"short":let i=Po(t,"shortTime"),o=Po(t,"shortDate");r=$_($f(t,Qn.Short),[i,o]);break;case"medium":let s=Po(t,"mediumTime"),a=Po(t,"mediumDate");r=$_($f(t,Qn.Medium),[s,a]);break;case"long":let c=Po(t,"longTime"),l=Po(t,"longDate");r=$_($f(t,Qn.Long),[c,l]);break;case"full":let d=Po(t,"fullTime"),h=Po(t,"fullDate");r=$_($f(t,Qn.Full),[d,h]);break}return r&&(H_[n][e]=r),r}function $_(t,e){return e&&(t=t.replace(/\{([^}]+)}/g,function(n,r){return e!=null&&r in e?e[r]:n})),t}function ri(t,e,n="-",r,i){let o="";(t<0||i&&t<=0)&&(i?t=-t+1:(t=-t,o=n));let s=String(t);for(;s.length<e;)s="0"+s;return r&&(s=s.slice(s.length-e)),o+s}function HY(t,e){return ri(t,3).substring(0,e)}function Pt(t,e,n=0,r=!1,i=!1){return function(o,s){let a=$Y(t,o);if((n>0||a>-n)&&(a+=n),t===3)a===0&&n===-12&&(a=12);else if(t===6)return HY(a,e);let c=Wf(s,xo.MinusSign);return ri(a,e,c,r,i)}}function $Y(t,e){switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate();case 3:return e.getHours();case 4:return e.getMinutes();case 5:return e.getSeconds();case 6:return e.getMilliseconds();case 7:return e.getDay();default:throw new J(2301,!1)}}function ut(t,e,n=bn.Format,r=!1){return function(i,o){return WY(i,o,t,e,n,r)}}function WY(t,e,n,r,i,o){switch(n){case 2:return FF(e,i,r)[t.getMonth()];case 1:return kF(e,i,r)[t.getDay()];case 0:let s=t.getHours(),a=t.getMinutes();if(o){let l=BF(e),d=GF(e,i,r),h=l.findIndex(f=>{if(Array.isArray(f)){let[g,E]=f,I=s>=g.hours&&a>=g.minutes,S=s<E.hours||s===E.hours&&a<E.minutes;if(g.hours<E.hours){if(I&&S)return!0}else if(I||S)return!0}else if(f.hours===s&&f.minutes===a)return!0;return!1});if(h!==-1)return d[h]}return xF(e,i,r)[s<12?0:1];case 3:return UF(e,r)[t.getFullYear()<=0?0:1];default:let c=n;throw new J(2302,!1)}}function W_(t){return function(e,n,r){let i=-1*r,o=Wf(n,xo.MinusSign),s=i>0?Math.floor(i/60):Math.ceil(i/60);switch(t){case 0:return(i>=0?"+":"")+ri(s,2,o)+ri(Math.abs(i%60),2,o);case 1:return"GMT"+(i>=0?"+":"")+ri(s,1,o);case 2:return"GMT"+(i>=0?"+":"")+ri(s,2,o)+":"+ri(Math.abs(i%60),2,o);case 3:return r===0?"Z":(i>=0?"+":"")+ri(s,2,o)+":"+ri(Math.abs(i%60),2,o);default:throw new J(2310,!1)}}}var zY=0,q_=4;function qY(t){let e=K_(t,zY,1).getDay();return K_(t,0,1+(e<=q_?q_:q_+7)-e)}function HF(t){let e=t.getDay(),n=e===0?-3:q_-e;return K_(t.getFullYear(),t.getMonth(),t.getDate()+n)}function PD(t,e=!1){return function(n,r){let i;if(e){let o=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,s=n.getDate();i=1+Math.floor((s+o)/7)}else{let o=HF(n),s=qY(o.getFullYear()),a=o.getTime()-s.getTime();i=1+Math.round(a/6048e5)}return ri(i,t,Wf(r,xo.MinusSign))}}function z_(t,e=!1){return function(n,r){let o=HF(n).getFullYear();return ri(o,t,Wf(r,xo.MinusSign),e)}}var xD={};function KY(t){if(xD[t])return xD[t];let e;switch(t){case"G":case"GG":case"GGG":e=ut(3,tt.Abbreviated);break;case"GGGG":e=ut(3,tt.Wide);break;case"GGGGG":e=ut(3,tt.Narrow);break;case"y":e=Pt(0,1,0,!1,!0);break;case"yy":e=Pt(0,2,0,!0,!0);break;case"yyy":e=Pt(0,3,0,!1,!0);break;case"yyyy":e=Pt(0,4,0,!1,!0);break;case"Y":e=z_(1);break;case"YY":e=z_(2,!0);break;case"YYY":e=z_(3);break;case"YYYY":e=z_(4);break;case"M":case"L":e=Pt(1,1,1);break;case"MM":case"LL":e=Pt(1,2,1);break;case"MMM":e=ut(2,tt.Abbreviated);break;case"MMMM":e=ut(2,tt.Wide);break;case"MMMMM":e=ut(2,tt.Narrow);break;case"LLL":e=ut(2,tt.Abbreviated,bn.Standalone);break;case"LLLL":e=ut(2,tt.Wide,bn.Standalone);break;case"LLLLL":e=ut(2,tt.Narrow,bn.Standalone);break;case"w":e=PD(1);break;case"ww":e=PD(2);break;case"W":e=PD(1,!0);break;case"d":e=Pt(2,1);break;case"dd":e=Pt(2,2);break;case"c":case"cc":e=Pt(7,1);break;case"ccc":e=ut(1,tt.Abbreviated,bn.Standalone);break;case"cccc":e=ut(1,tt.Wide,bn.Standalone);break;case"ccccc":e=ut(1,tt.Narrow,bn.Standalone);break;case"cccccc":e=ut(1,tt.Short,bn.Standalone);break;case"E":case"EE":case"EEE":e=ut(1,tt.Abbreviated);break;case"EEEE":e=ut(1,tt.Wide);break;case"EEEEE":e=ut(1,tt.Narrow);break;case"EEEEEE":e=ut(1,tt.Short);break;case"a":case"aa":case"aaa":e=ut(0,tt.Abbreviated);break;case"aaaa":e=ut(0,tt.Wide);break;case"aaaaa":e=ut(0,tt.Narrow);break;case"b":case"bb":case"bbb":e=ut(0,tt.Abbreviated,bn.Standalone,!0);break;case"bbbb":e=ut(0,tt.Wide,bn.Standalone,!0);break;case"bbbbb":e=ut(0,tt.Narrow,bn.Standalone,!0);break;case"B":case"BB":case"BBB":e=ut(0,tt.Abbreviated,bn.Format,!0);break;case"BBBB":e=ut(0,tt.Wide,bn.Format,!0);break;case"BBBBB":e=ut(0,tt.Narrow,bn.Format,!0);break;case"h":e=Pt(3,1,-12);break;case"hh":e=Pt(3,2,-12);break;case"H":e=Pt(3,1);break;case"HH":e=Pt(3,2);break;case"m":e=Pt(4,1);break;case"mm":e=Pt(4,2);break;case"s":e=Pt(5,1);break;case"ss":e=Pt(5,2);break;case"S":e=Pt(6,1);break;case"SS":e=Pt(6,2);break;case"SSS":e=Pt(6,3);break;case"Z":case"ZZ":case"ZZZ":e=W_(0);break;case"ZZZZZ":e=W_(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":e=W_(1);break;case"OOOO":case"ZZZZ":case"zzzz":e=W_(2);break;default:return null}return xD[t]=e,e}function $F(t,e){t=t.replace(/:/g,"");let n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(n)?e:n}function YY(t,e){return t=new Date(t.getTime()),t.setMinutes(t.getMinutes()+e),t}function XY(t,e,n){let i=t.getTimezoneOffset(),o=$F(e,i);return YY(t,-1*(o-i))}function QY(t){if(wF(t))return t;if(typeof t=="number"&&!isNaN(t))return new Date(t);if(typeof t=="string"){if(t=t.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(t)){let[i,o=1,s=1]=t.split("-").map(a=>+a);return K_(i,o-1,s)}let n=parseFloat(t);if(!isNaN(t-n))return new Date(n);let r;if(r=t.match(VY))return JY(r)}let e=new Date(t);if(!wF(e))throw new J(2311,!1);return e}function JY(t){let e=new Date(0),n=0,r=0,i=t[8]?e.setUTCFullYear:e.setFullYear,o=t[8]?e.setUTCHours:e.setHours;t[9]&&(n=Number(t[9]+t[10]),r=Number(t[9]+t[11])),i.call(e,Number(t[1]),Number(t[2])-1,Number(t[3]));let s=Number(t[4]||0)-n,a=Number(t[5]||0)-r,c=Number(t[6]||0),l=Math.floor(parseFloat("0."+(t[7]||0))*1e3);return o.call(e,s,a,c,l),e}function wF(t){return t instanceof Date&&!isNaN(t.valueOf())}var kD=/\s+/,bF=[],ZY=(()=>{class t{_ngEl;_renderer;initialClasses=bF;rawClass;stateMap=new Map;constructor(n,r){this._ngEl=n,this._renderer=r}set klass(n){this.initialClasses=n!=null?n.trim().split(kD):bF}set ngClass(n){this.rawClass=typeof n=="string"?n.trim().split(kD):n}ngDoCheck(){for(let r of this.initialClasses)this._updateState(r,!0);let n=this.rawClass;if(Array.isArray(n)||n instanceof Set)for(let r of n)this._updateState(r,!0);else if(n!=null)for(let r of Object.keys(n))this._updateState(r,!!n[r]);this._applyStateDiff()}_updateState(n,r){let i=this.stateMap.get(n);i!==void 0?(i.enabled!==r&&(i.changed=!0,i.enabled=r),i.touched=!0):this.stateMap.set(n,{enabled:r,changed:!0,touched:!0})}_applyStateDiff(){for(let n of this.stateMap){let r=n[0],i=n[1];i.changed?(this._toggleClass(r,i.enabled),i.changed=!1):i.touched||(i.enabled&&this._toggleClass(r,!1),this.stateMap.delete(r)),i.touched=!1}}_toggleClass(n,r){n=n.trim(),n.length>0&&n.split(kD).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}static \u0275fac=function(r){return new(r||t)(st(Ns),st(L_))};static \u0275dir=Hi({type:t,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return t})();var Y_=class{$implicit;ngForOf;index;count;constructor(e,n,r,i){this.$implicit=e,this.ngForOf=n,this.index=r,this.count=i}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},WF=(()=>{class t{_viewContainer;_template;_differs;set ngForOf(n){this._ngForOf=n,this._ngForOfDirty=!0}set ngForTrackBy(n){this._trackByFn=n}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(n,r,i){this._viewContainer=n,this._template=r,this._differs=i}set ngForTemplate(n){n&&(this._template=n)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let n=this._ngForOf;!this._differ&&n&&(this._differ=this._differs.find(n).create(this.ngForTrackBy))}if(this._differ){let n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}}_applyChanges(n){let r=this._viewContainer;n.forEachOperation((i,o,s)=>{if(i.previousIndex==null)r.createEmbeddedView(this._template,new Y_(i.item,this._ngForOf,-1,-1),s===null?void 0:s);else if(s==null)r.remove(o===null?void 0:o);else if(o!==null){let a=r.get(o);r.move(a,s),OF(a,i)}});for(let i=0,o=r.length;i<o;i++){let a=r.get(i).context;a.index=i,a.count=o,a.ngForOf=this._ngForOf}n.forEachIdentityChange(i=>{let o=r.get(i.currentIndex);OF(o,i)})}static ngTemplateContextGuard(n,r){return!0}static \u0275fac=function(r){return new(r||t)(st(ji),st(Vi),st(bD))};static \u0275dir=Hi({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return t})();function OF(t,e){t.context.$implicit=e.item}var e7=(()=>{class t{_viewContainer;_context=new X_;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(n,r){this._viewContainer=n,this._thenTemplateRef=r}set ngIf(n){this._context.$implicit=this._context.ngIf=n,this._updateView()}set ngIfThen(n){MF(n,!1),this._thenTemplateRef=n,this._thenViewRef=null,this._updateView()}set ngIfElse(n){MF(n,!1),this._elseTemplateRef=n,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(n,r){return!0}static \u0275fac=function(r){return new(r||t)(st(ji),st(Vi))};static \u0275dir=Hi({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return t})(),X_=class{$implicit=null;ngIf=null};function MF(t,e){if(t&&!t.createEmbeddedView)throw new J(2020,!1)}var Q_=class{_viewContainerRef;_templateRef;_created=!1;constructor(e,n){this._viewContainerRef=e,this._templateRef=n}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}},FD=(()=>{class t{_defaultViews=[];_defaultUsed=!1;_caseCount=0;_lastCaseCheckIndex=0;_lastCasesMatched=!1;_ngSwitch;set ngSwitch(n){this._ngSwitch=n,this._caseCount===0&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(n){this._defaultViews.push(n)}_matchCase(n){let r=n===this._ngSwitch;return this._lastCasesMatched||=r,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),r}_updateDefaultCases(n){if(this._defaultViews.length>0&&n!==this._defaultUsed){this._defaultUsed=n;for(let r of this._defaultViews)r.enforceState(n)}}static \u0275fac=function(r){return new(r||t)};static \u0275dir=Hi({type:t,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}})}return t})(),t7=(()=>{class t{ngSwitch;_view;ngSwitchCase;constructor(n,r,i){this.ngSwitch=i,i._addCase(),this._view=new Q_(n,r)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}static \u0275fac=function(r){return new(r||t)(st(ji),st(Vi),st(FD,9))};static \u0275dir=Hi({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}})}return t})(),n7=(()=>{class t{constructor(n,r,i){i._addDefault(new Q_(n,r))}static \u0275fac=function(r){return new(r||t)(st(ji),st(Vi),st(FD,9))};static \u0275dir=Hi({type:t,selectors:[["","ngSwitchDefault",""]]})}return t})();var r7=(()=>{class t{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(n,r,i){this._ngEl=n,this._differs=r,this._renderer=i}set ngStyle(n){this._ngStyle=n,!this._differ&&n&&(this._differ=this._differs.find(n).create())}ngDoCheck(){if(this._differ){let n=this._differ.diff(this._ngStyle);n&&this._applyChanges(n)}}_setStyle(n,r){let[i,o]=n.split("."),s=i.indexOf("-")===-1?void 0:ni.DashCase;r!=null?this._renderer.setStyle(this._ngEl.nativeElement,i,o?`${r}${o}`:r,s):this._renderer.removeStyle(this._ngEl.nativeElement,i,s)}_applyChanges(n){n.forEachRemovedItem(r=>this._setStyle(r.key,null)),n.forEachAddedItem(r=>this._setStyle(r.key,r.currentValue)),n.forEachChangedItem(r=>this._setStyle(r.key,r.currentValue))}static \u0275fac=function(r){return new(r||t)(st(Ns),st(G_),st(L_))};static \u0275dir=Hi({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return t})(),i7=(()=>{class t{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;constructor(n){this._viewContainerRef=n}ngOnChanges(n){if(this._shouldRecreateView(n)){let r=this._viewContainerRef;if(this._viewRef&&r.remove(r.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let i=this._createContextForwardProxy();this._viewRef=r.createEmbeddedView(this.ngTemplateOutlet,i,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(n){return!!n.ngTemplateOutlet||!!n.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(n,r,i)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,r,i):!1,get:(n,r,i)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,r,i)}})}static \u0275fac=function(r){return new(r||t)(st(ji))};static \u0275dir=Hi({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[vC]})}return t})();function zF(t,e){return new J(2100,!1)}var o7=/(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g,s7=(()=>{class t{transform(n){if(n==null)return null;if(typeof n!="string")throw zF(t,n);return n.replace(o7,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}static \u0275fac=function(r){return new(r||t)};static \u0275pipe=Mf({name:"titlecase",type:t,pure:!0})}return t})();var a7="mediumDate",qF=new z(""),KF=new z(""),c7=(()=>{class t{locale;defaultTimezone;defaultOptions;constructor(n,r,i){this.locale=n,this.defaultTimezone=r,this.defaultOptions=i}transform(n,r,i,o){if(n==null||n===""||n!==n)return null;try{let s=r??this.defaultOptions?.dateFormat??a7,a=i??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return jF(n,s,o||this.locale,a)}catch(s){throw zF(t,s.message)}}static \u0275fac=function(r){return new(r||t)(st(Ff,16),st(qF,24),st(KF,24))};static \u0275pipe=Mf({name:"date",type:t,pure:!0})}return t})();function l7(t,e){return{key:t,value:e}}var u7=(()=>{class t{differs;constructor(n){this.differs=n}differ;keyValues=[];compareFn=LF;transform(n,r=LF){if(!n||!(n instanceof Map)&&typeof n!="object")return null;this.differ??=this.differs.find(n).create();let i=this.differ.diff(n),o=r!==this.compareFn;return i&&(this.keyValues=[],i.forEachItem(s=>{this.keyValues.push(l7(s.key,s.currentValue))})),(i||o)&&(r&&this.keyValues.sort(r),this.compareFn=r),this.keyValues}static \u0275fac=function(r){return new(r||t)(st(G_,16))};static \u0275pipe=Mf({name:"keyvalue",type:t,pure:!1})}return t})();function LF(t,e){let n=t.key,r=e.key;if(n===r)return 0;if(n==null)return 1;if(r==null)return-1;if(typeof n=="string"&&typeof r=="string")return n<r?-1:1;if(typeof n=="number"&&typeof r=="number")return n-r;if(typeof n=="boolean"&&typeof r=="boolean")return n<r?-1:1;let i=String(n),o=String(r);return i==o?0:i<o?-1:1}var UD=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=ws({type:t});static \u0275inj=So({})}return t})();function zf(t,e){e=encodeURIComponent(e);for(let n of t.split(";")){let r=n.indexOf("="),[i,o]=r==-1?[n,""]:[n.slice(0,r),n.slice(r+1)];if(i.trim()===e)return decodeURIComponent(o)}return null}var Dc=class{};var VD="browser";function YF(t){return t===VD}var qf=class{_doc;constructor(e){this._doc=e}manager},Kf=(()=>{class t extends qf{constructor(n){super(n)}supports(n){return!0}addEventListener(n,r,i,o){return n.addEventListener(r,i,o),()=>this.removeEventListener(n,r,i,o)}removeEventListener(n,r,i,o){return n.removeEventListener(r,i,o)}static \u0275fac=function(r){return new(r||t)($(on))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),Z_=new z(""),eT=(()=>{class t{_zone;_plugins;_eventNameToPlugin=new Map;constructor(n,r){this._zone=r,n.forEach(s=>{s.manager=this});let i=n.filter(s=>!(s instanceof Kf));this._plugins=i.slice().reverse();let o=n.find(s=>s instanceof Kf);o&&this._plugins.push(o)}addEventListener(n,r,i,o){return this._findPluginFor(r).addEventListener(n,r,i,o)}getZone(){return this._zone}_findPluginFor(n){let r=this._eventNameToPlugin.get(n);if(r)return r;if(r=this._plugins.find(o=>o.supports(n)),!r)throw new J(5101,!1);return this._eventNameToPlugin.set(n,r),r}static \u0275fac=function(r){return new(r||t)($(Z_),$(Ae))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),BD="ng-app-id";function XF(t){for(let e of t)e.remove()}function QF(t,e){let n=e.createElement("style");return n.textContent=t,n}function d7(t,e,n,r){let i=t.head?.querySelectorAll(`style[${BD}="${e}"],link[${BD}="${e}"]`);if(i)for(let o of i)o.removeAttribute(BD),o instanceof HTMLLinkElement?r.set(o.href.slice(o.href.lastIndexOf("/")+1),{usage:0,elements:[o]}):o.textContent&&n.set(o.textContent,{usage:0,elements:[o]})}function jD(t,e){let n=e.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),n}var tT=(()=>{class t{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(n,r,i,o={}){this.doc=n,this.appId=r,this.nonce=i,d7(n,r,this.inline,this.external),this.hosts.add(n.head)}addStyles(n,r){for(let i of n)this.addUsage(i,this.inline,QF);r?.forEach(i=>this.addUsage(i,this.external,jD))}removeStyles(n,r){for(let i of n)this.removeUsage(i,this.inline);r?.forEach(i=>this.removeUsage(i,this.external))}addUsage(n,r,i){let o=r.get(n);o?o.usage++:r.set(n,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,i(n,this.doc)))})}removeUsage(n,r){let i=r.get(n);i&&(i.usage--,i.usage<=0&&(XF(i.elements),r.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])XF(n);this.hosts.clear()}addHost(n){this.hosts.add(n);for(let[r,{elements:i}]of this.inline)i.push(this.addElement(n,QF(r,this.doc)));for(let[r,{elements:i}]of this.external)i.push(this.addElement(n,jD(r,this.doc)))}removeHost(n){this.hosts.delete(n)}addElement(n,r){return this.nonce&&r.setAttribute("nonce",this.nonce),n.appendChild(r)}static \u0275fac=function(r){return new(r||t)($(on),$(y_),$(qu,8),$(Oo))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),GD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},$D=/%COMP%/g;var ZF="%COMP%",h7=`_nghost-${ZF}`,f7=`_ngcontent-${ZF}`,p7=!0,eU=new z("",{providedIn:"root",factory:()=>p7});function g7(t){return f7.replace($D,t)}function m7(t){return h7.replace($D,t)}function tU(t,e){return e.map(n=>n.replace($D,t))}var nT=(()=>{class t{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(n,r,i,o,s,a,c=null,l=null){this.eventManager=n,this.sharedStylesHost=r,this.appId=i,this.removeStylesOnCompDestroy=o,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.platformIsServer=!1,this.defaultRenderer=new Yf(n,s,a,this.platformIsServer,this.tracingService)}createRenderer(n,r){if(!n||!r)return this.defaultRenderer;let i=this.getOrCreateRenderer(n,r);return i instanceof J_?i.applyToHost(n):i instanceof Xf&&i.applyStyles(),i}getOrCreateRenderer(n,r){let i=this.rendererByCompId,o=i.get(r.id);if(!o){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,h=this.platformIsServer,f=this.tracingService;switch(r.encapsulation){case No.Emulated:o=new J_(c,l,r,this.appId,d,s,a,h,f);break;case No.ShadowDom:return new HD(c,l,n,r,s,a,this.nonce,h,f);default:o=new Xf(c,l,r,d,s,a,h,f);break}i.set(r.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(n){this.rendererByCompId.delete(n)}static \u0275fac=function(r){return new(r||t)($(eT),$(tT),$(y_),$(eU),$(on),$(Ae),$(qu),$(Ac,8))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),Yf=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,n,r,i,o){this.eventManager=e,this.doc=n,this.ngZone=r,this.platformIsServer=i,this.tracingService=o}destroy(){}destroyNode=null;createElement(e,n){return n?this.doc.createElementNS(GD[n]||n,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,n){(JF(e)?e.content:e).appendChild(n)}insertBefore(e,n,r){e&&(JF(e)?e.content:e).insertBefore(n,r)}removeChild(e,n){n.remove()}selectRootElement(e,n){let r=typeof e=="string"?this.doc.querySelector(e):e;if(!r)throw new J(-5104,!1);return n||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,n,r,i){if(i){n=i+":"+n;let o=GD[i];o?e.setAttributeNS(o,n,r):e.setAttribute(n,r)}else e.setAttribute(n,r)}removeAttribute(e,n,r){if(r){let i=GD[r];i?e.removeAttributeNS(i,n):e.removeAttribute(`${r}:${n}`)}else e.removeAttribute(n)}addClass(e,n){e.classList.add(n)}removeClass(e,n){e.classList.remove(n)}setStyle(e,n,r,i){i&(ni.DashCase|ni.Important)?e.style.setProperty(n,r,i&ni.Important?"important":""):e.style[n]=r}removeStyle(e,n,r){r&ni.DashCase?e.style.removeProperty(n):e.style[n]=""}setProperty(e,n,r){e!=null&&(e[n]=r)}setValue(e,n){e.nodeValue=n}listen(e,n,r,i){if(typeof e=="string"&&(e=$i().getGlobalEventTarget(this.doc,e),!e))throw new J(5102,!1);let o=this.decoratePreventDefault(r);return this.tracingService?.wrapEventListener&&(o=this.tracingService.wrapEventListener(e,n,o)),this.eventManager.addEventListener(e,n,o,i)}decoratePreventDefault(e){return n=>{if(n==="__ngUnwrap__")return e;e(n)===!1&&n.preventDefault()}}};function JF(t){return t.tagName==="TEMPLATE"&&t.content!==void 0}var HD=class extends Yf{sharedStylesHost;hostEl;shadowRoot;constructor(e,n,r,i,o,s,a,c,l){super(e,o,s,c,l),this.sharedStylesHost=n,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let d=i.styles;d=tU(i.id,d);for(let f of d){let g=document.createElement("style");a&&g.setAttribute("nonce",a),g.textContent=f,this.shadowRoot.appendChild(g)}let h=i.getExternalStyles?.();if(h)for(let f of h){let g=jD(f,o);a&&g.setAttribute("nonce",a),this.shadowRoot.appendChild(g)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,n){return super.appendChild(this.nodeOrShadowRoot(e),n)}insertBefore(e,n,r){return super.insertBefore(this.nodeOrShadowRoot(e),n,r)}removeChild(e,n){return super.removeChild(null,n)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},Xf=class extends Yf{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,n,r,i,o,s,a,c,l){super(e,o,s,a,c),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=i;let d=r.styles;this.styles=l?tU(l,d):d,this.styleUrls=r.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&Ic.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},J_=class extends Xf{contentAttr;hostAttr;constructor(e,n,r,i,o,s,a,c,l){let d=i+"-"+r.id;super(e,n,r,o,s,a,c,l,d),this.contentAttr=g7(d),this.hostAttr=m7(d)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,n){let r=super.createElement(e,n);return super.setAttribute(r,this.contentAttr,""),r}};var rT=class t extends Gf{supportsDOMEvents=!0;static makeCurrent(){OD(new t)}onAndCancel(e,n,r,i){return e.addEventListener(n,r,i),()=>{e.removeEventListener(n,r,i)}}dispatchEvent(e,n){e.dispatchEvent(n)}remove(e){e.remove()}createElement(e,n){return n=n||this.getDefaultDocument(),n.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,n){return n==="window"?window:n==="document"?e:n==="body"?e.body:null}getBaseHref(e){let n=E7();return n==null?null:_7(n)}resetBaseElement(){Qf=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return zf(document.cookie,e)}},Qf=null;function E7(){return Qf=Qf||document.head.querySelector("base"),Qf?Qf.getAttribute("href"):null}function _7(t){return new URL(t,document.baseURI).pathname}var iT=class{addToWindow(e){Lt.getAngularTestability=(r,i=!0)=>{let o=e.findTestabilityInTree(r,i);if(o==null)throw new J(5103,!1);return o},Lt.getAllAngularTestabilities=()=>e.getAllTestabilities(),Lt.getAllAngularRootElements=()=>e.getAllRootElements();let n=r=>{let i=Lt.getAllAngularTestabilities(),o=i.length,s=function(){o--,o==0&&r()};i.forEach(a=>{a.whenStable(s)})};Lt.frameworkStabilizers||(Lt.frameworkStabilizers=[]),Lt.frameworkStabilizers.push(n)}findTestabilityInTree(e,n,r){if(n==null)return null;let i=e.getTestability(n);return i??(r?$i().isShadowRoot(n)?this.findTestabilityInTree(e,n.host,!0):this.findTestabilityInTree(e,n.parentElement,!0):null)}},T7=(()=>{class t{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),nU=["alt","control","meta","shift"],y7={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},I7={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},rU=(()=>{class t extends qf{constructor(n){super(n)}supports(n){return t.parseEventName(n)!=null}addEventListener(n,r,i,o){let s=t.parseEventName(r),a=t.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>$i().onAndCancel(n,s.domEventName,a,o))}static parseEventName(n){let r=n.toLowerCase().split("."),i=r.shift();if(r.length===0||!(i==="keydown"||i==="keyup"))return null;let o=t._normalizeKey(r.pop()),s="",a=r.indexOf("code");if(a>-1&&(r.splice(a,1),s="code."),nU.forEach(l=>{let d=r.indexOf(l);d>-1&&(r.splice(d,1),s+=l+".")}),s+=o,r.length!=0||o.length===0)return null;let c={};return c.domEventName=i,c.fullKey=s,c}static matchEventFullKeyCode(n,r){let i=y7[n.key]||n.key,o="";return r.indexOf("code.")>-1&&(i=n.code,o="code."),i==null||!i?!1:(i=i.toLowerCase(),i===" "?i="space":i==="."&&(i="dot"),nU.forEach(s=>{if(s!==i){let a=I7[s];a(n)&&(o+=s+".")}}),o+=i,o===r)}static eventCallback(n,r,i){return o=>{t.matchEventFullKeyCode(o,n)&&i.runGuarded(()=>r(o))}}static _normalizeKey(n){return n==="esc"?"escape":n}static \u0275fac=function(r){return new(r||t)($(on))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})();function v7(){rT.makeCurrent()}function S7(){return new lr}function A7(){return CC(document),document}var C7=[{provide:Oo,useValue:VD},{provide:I_,useValue:v7,multi:!0},{provide:on,useFactory:A7}],D7=RD(TF,"browser",C7);var R7=[{provide:Ku,useClass:iT},{provide:x_,useClass:Lf,deps:[Ae,Pf,Ku]},{provide:Lf,useClass:Lf,deps:[Ae,Pf,Ku]}],N7=[{provide:uf,useValue:"root"},{provide:lr,useFactory:S7},{provide:Z_,useClass:Kf,multi:!0,deps:[on]},{provide:Z_,useClass:rU,multi:!0,deps:[on]},nT,tT,eT,{provide:bo,useExisting:nT},{provide:Dc,useClass:T7},[]],w7=(()=>{class t{constructor(){}static \u0275fac=function(r){return new(r||t)};static \u0275mod=ws({type:t});static \u0275inj=So({providers:[...N7,...R7],imports:[UD,yF]})}return t})();var Nc=class{},Jf=class{},Ms=class t{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
|
|
5
5
|
`).forEach(n=>{let r=n.indexOf(":");if(r>0){let i=n.slice(0,r),o=n.slice(r+1).trim();this.addHeaderEntry(i,o)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((n,r)=>{this.addHeaderEntry(r,n)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([n,r])=>{this.setHeaderEntries(n,r)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let n=this.headers.get(e.toLowerCase());return n&&n.length>0?n[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,n){return this.clone({name:e,value:n,op:"a"})}set(e,n){return this.clone({name:e,value:n,op:"s"})}delete(e,n){return this.clone({name:e,value:n,op:"d"})}maybeSetNormalizedName(e,n){this.normalizedNames.has(n)||this.normalizedNames.set(n,e)}init(){this.lazyInit&&(this.lazyInit instanceof t?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init();for(let[n,r]of e.headers.entries())this.headers.set(n,r),this.normalizedNames.set(n,e.normalizedNames.get(n))}clone(e){let n=new t;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof t?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([e]),n}applyUpdate(e){let n=e.name.toLowerCase();switch(e.op){case"a":case"s":let r=e.value;if(typeof r=="string"&&(r=[r]),r.length===0)return;this.maybeSetNormalizedName(e.name,n);let i=e.op==="a"?(this.headers.get(n)||[]).slice():[];i.push(...r),this.headers.set(n,i);break;case"d":let o=e.value;if(o===void 0)this.headers.delete(n),this.normalizedNames.delete(n);else{let s=Array.isArray(o)?o:[o],a=this.headers.get(n);if(!a)return;a=a.filter(c=>s.indexOf(c)===-1),a.length===0?(this.headers.delete(n),this.normalizedNames.delete(n)):this.headers.set(n,a)}break}}addHeaderEntry(e,n){let r=e.toLowerCase();this.maybeSetNormalizedName(e,r),this.headers.has(r)?this.headers.get(r).push(n):this.headers.set(r,[n])}setHeaderEntries(e,n){let r=(Array.isArray(n)?n:[n]).map(o=>o.toString()),i=e.toLowerCase();this.headers.set(i,r),this.maybeSetNormalizedName(e,i)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(n=>e(this.normalizedNames.get(n),this.headers.get(n)))}};var sT=class{encodeKey(e){return iU(e)}encodeValue(e){return iU(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function b7(t,e){let n=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(i=>{let o=i.indexOf("="),[s,a]=o==-1?[e.decodeKey(i),""]:[e.decodeKey(i.slice(0,o)),e.decodeValue(i.slice(o+1))],c=n.get(s)||[];c.push(a),n.set(s,c)}),n}var O7=/%(\d[a-f0-9])/gi,M7={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function iU(t){return encodeURIComponent(t).replace(O7,(e,n)=>M7[n]??e)}function oT(t){return`${t}`}var ko=class t{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new sT,e.fromString){if(e.fromObject)throw new J(2805,!1);this.map=b7(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(n=>{let r=e.fromObject[n],i=Array.isArray(r)?r.map(oT):[oT(r)];this.map.set(n,i)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let n=this.map.get(e);return n?n[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,n){return this.clone({param:e,value:n,op:"a"})}appendAll(e){let n=[];return Object.keys(e).forEach(r=>{let i=e[r];Array.isArray(i)?i.forEach(o=>{n.push({param:r,value:o,op:"a"})}):n.push({param:r,value:i,op:"a"})}),this.clone(n)}set(e,n){return this.clone({param:e,value:n,op:"s"})}delete(e,n){return this.clone({param:e,value:n,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let n=this.encoder.encodeKey(e);return this.map.get(e).map(r=>n+"="+this.encoder.encodeValue(r)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let n=new t({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat(e),n}init(){if(this.map===null&&(this.map=new Map),this.cloneFrom!==null){this.cloneFrom.init();for(let[e,n]of this.cloneFrom.map.entries())this.map.set(e,n);this.updates.forEach(e=>{switch(e.op){case"a":case"s":let n=e.op==="a"?(this.map.get(e.param)||[]).slice():[];n.push(oT(e.value)),this.map.set(e.param,n);break;case"d":if(e.value!==void 0){let r=(this.map.get(e.param)||[]).slice(),i=r.indexOf(oT(e.value));i!==-1&&r.splice(i,1),r.length>0?this.map.set(e.param,r):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null}}};var aT=class{map=new Map;set(e,n){return this.map.set(e,n),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}};function L7(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function oU(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer}function sU(t){return typeof Blob<"u"&&t instanceof Blob}function aU(t){return typeof FormData<"u"&&t instanceof FormData}function P7(t){return typeof URLSearchParams<"u"&&t instanceof URLSearchParams}var cU="Content-Type",lU="Accept",dU="X-Request-URL",hU="text/plain",fU="application/json",x7=`${fU}, ${hU}, */*`,Yu=class t{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;referrer;integrity;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(e,n,r,i){this.url=n,this.method=e.toUpperCase();let o;if(L7(this.method)||i?(this.body=r!==void 0?r:null,o=i):o=r,o){if(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,this.keepalive=!!o.keepalive,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params),o.priority&&(this.priority=o.priority),o.cache&&(this.cache=o.cache),o.credentials&&(this.credentials=o.credentials),typeof o.timeout=="number"){if(o.timeout<1||!Number.isInteger(o.timeout))throw new J(2822,"");this.timeout=o.timeout}o.mode&&(this.mode=o.mode),o.redirect&&(this.redirect=o.redirect),o.integrity&&(this.integrity=o.integrity),o.referrer!==void 0&&(this.referrer=o.referrer),this.transferCache=o.transferCache}if(this.headers??=new Ms,this.context??=new aT,!this.params)this.params=new ko,this.urlWithParams=n;else{let s=this.params.toString();if(s.length===0)this.urlWithParams=n;else{let a=n.indexOf("?"),c=a===-1?"?":a<n.length-1?"&":"";this.urlWithParams=n+c+s}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||oU(this.body)||sU(this.body)||aU(this.body)||P7(this.body)?this.body:this.body instanceof ko?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||aU(this.body)?null:sU(this.body)?this.body.type||null:oU(this.body)?null:typeof this.body=="string"?hU:this.body instanceof ko?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?fU:null}clone(e={}){let n=e.method||this.method,r=e.url||this.url,i=e.responseType||this.responseType,o=e.keepalive??this.keepalive,s=e.priority||this.priority,a=e.cache||this.cache,c=e.mode||this.mode,l=e.redirect||this.redirect,d=e.credentials||this.credentials,h=e.referrer??this.referrer,f=e.integrity||this.integrity,g=e.transferCache??this.transferCache,E=e.timeout??this.timeout,I=e.body!==void 0?e.body:this.body,S=e.withCredentials??this.withCredentials,L=e.reportProgress??this.reportProgress,V=e.headers||this.headers,K=e.params||this.params,oe=e.context??this.context;return e.setHeaders!==void 0&&(V=Object.keys(e.setHeaders).reduce((ge,te)=>ge.set(te,e.setHeaders[te]),V)),e.setParams&&(K=Object.keys(e.setParams).reduce((ge,te)=>ge.set(te,e.setParams[te]),K)),new t(n,r,I,{params:K,headers:V,context:oe,reportProgress:L,responseType:i,withCredentials:S,transferCache:g,keepalive:o,cache:a,priority:s,timeout:E,mode:c,redirect:l,credentials:d,referrer:h,integrity:f})}},Rc=(function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t})(Rc||{}),Qu=class{headers;status;statusText;url;ok;type;redirected;constructor(e,n=200,r="OK"){this.headers=e.headers||new Ms,this.status=e.status!==void 0?e.status:n,this.statusText=e.statusText||r,this.url=e.url||null,this.redirected=e.redirected,this.ok=this.status>=200&&this.status<300}},cT=class t extends Qu{constructor(e={}){super(e)}type=Rc.ResponseHeader;clone(e={}){return new t({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},Zf=class t extends Qu{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=Rc.Response;clone(e={}){return new t({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0,redirected:e.redirected??this.redirected})}},Xu=class extends Qu{name="HttpErrorResponse";message;error;ok=!1;constructor(e){super(e,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}},k7=200,F7=204;function WD(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials,credentials:t.credentials,transferCache:t.transferCache,timeout:t.timeout,keepalive:t.keepalive,priority:t.priority,cache:t.cache,mode:t.mode,redirect:t.redirect,integrity:t.integrity,referrer:t.referrer}}var pU=(()=>{class t{handler;constructor(n){this.handler=n}request(n,r,i={}){let o;if(n instanceof Yu)o=n;else{let c;i.headers instanceof Ms?c=i.headers:c=new Ms(i.headers);let l;i.params&&(i.params instanceof ko?l=i.params:l=new ko({fromObject:i.params})),o=new Yu(n,r,i.body!==void 0?i.body:null,{headers:c,context:i.context,params:l,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials,transferCache:i.transferCache,keepalive:i.keepalive,priority:i.priority,cache:i.cache,mode:i.mode,redirect:i.redirect,credentials:i.credentials,referrer:i.referrer,integrity:i.integrity,timeout:i.timeout})}let s=lt(o).pipe(sS(c=>this.handler.handle(c)));if(n instanceof Yu||i.observe==="events")return s;let a=s.pipe(mn(c=>c instanceof Zf));switch(i.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return a.pipe(De(c=>{if(c.body!==null&&!(c.body instanceof ArrayBuffer))throw new J(2806,!1);return c.body}));case"blob":return a.pipe(De(c=>{if(c.body!==null&&!(c.body instanceof Blob))throw new J(2807,!1);return c.body}));case"text":return a.pipe(De(c=>{if(c.body!==null&&typeof c.body!="string")throw new J(2808,!1);return c.body}));default:return a.pipe(De(c=>c.body))}case"response":return a;default:throw new J(2809,!1)}}delete(n,r={}){return this.request("DELETE",n,r)}get(n,r={}){return this.request("GET",n,r)}head(n,r={}){return this.request("HEAD",n,r)}jsonp(n,r){return this.request("JSONP",n,{params:new ko().append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(n,r={}){return this.request("OPTIONS",n,r)}patch(n,r,i={}){return this.request("PATCH",n,WD(i,r))}post(n,r,i={}){return this.request("POST",n,WD(i,r))}put(n,r,i={}){return this.request("PUT",n,WD(i,r))}static \u0275fac=function(r){return new(r||t)($(Nc))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})();var U7=new z("");function gU(t,e){return e(t)}function V7(t,e){return(n,r)=>e.intercept(n,{handle:i=>t(i,r)})}function B7(t,e,n){return(r,i)=>bi(n,()=>e(r,o=>t(o,i)))}var mU=new z(""),qD=new z(""),EU=new z(""),KD=new z("",{providedIn:"root",factory:()=>!0});function G7(){let t=null;return(e,n)=>{t===null&&(t=(Y(mU,{optional:!0})??[]).reduceRight(V7,gU));let r=Y(Fi);if(Y(KD)){let o=r.add();return t(e,n).pipe(Qh(o))}else return t(e,n)}}var lT=(()=>{class t extends Nc{backend;injector;chain=null;pendingTasks=Y(Fi);contributeToStability=Y(KD);constructor(n,r){super(),this.backend=n,this.injector=r}handle(n){if(this.chain===null){let r=this.injector.get(Nc,null,{skipSelf:!0}),i=r!==null&&this.backend===r,o=this.injector.get(EU,[],i?{self:!0}:void 0),s=Array.from(new Set([...this.injector.get(qD),...o]));this.chain=s.reduceRight((a,c)=>B7(a,c,this.injector),gU)}if(this.contributeToStability){let r=this.pendingTasks.add();return this.chain(n,i=>this.backend.handle(i)).pipe(Qh(r))}else return this.chain(n,r=>this.backend.handle(r))}static \u0275fac=function(r){return new(r||t)($(Jf),$(Nn))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})();var j7=/^\)\]\}',?\n/,H7=RegExp(`^${dU}:`,"m");function $7(t){return"responseURL"in t&&t.responseURL?t.responseURL:H7.test(t.getAllResponseHeaders())?t.getResponseHeader(dU):null}var zD=(()=>{class t{xhrFactory;constructor(n){this.xhrFactory=n}handle(n){if(n.method==="JSONP")throw new J(-2800,!1);let r=this.xhrFactory;return lt(null).pipe(Mr(()=>new fe(o=>{let s=r.build();if(s.open(n.method,n.urlWithParams),n.withCredentials&&(s.withCredentials=!0),n.headers.forEach((S,L)=>s.setRequestHeader(S,L.join(","))),n.headers.has(lU)||s.setRequestHeader(lU,x7),!n.headers.has(cU)){let S=n.detectContentTypeHeader();S!==null&&s.setRequestHeader(cU,S)}if(n.timeout&&(s.timeout=n.timeout),n.responseType){let S=n.responseType.toLowerCase();s.responseType=S!=="json"?S:"text"}let a=n.serializeBody(),c=null,l=()=>{if(c!==null)return c;let S=s.statusText||"OK",L=new Ms(s.getAllResponseHeaders()),V=$7(s)||n.url;return c=new cT({headers:L,status:s.status,statusText:S,url:V}),c},d=()=>{let{headers:S,status:L,statusText:V,url:K}=l(),oe=null;L!==F7&&(oe=typeof s.response>"u"?s.responseText:s.response),L===0&&(L=oe?k7:0);let ge=L>=200&&L<300;if(n.responseType==="json"&&typeof oe=="string"){let te=oe;oe=oe.replace(j7,"");try{oe=oe!==""?JSON.parse(oe):null}catch(C){oe=te,ge&&(ge=!1,oe={error:C,text:oe})}}ge?(o.next(new Zf({body:oe,headers:S,status:L,statusText:V,url:K||void 0})),o.complete()):o.error(new Xu({error:oe,headers:S,status:L,statusText:V,url:K||void 0}))},h=S=>{let{url:L}=l(),V=new Xu({error:S,status:s.status||0,statusText:s.statusText||"Unknown Error",url:L||void 0});o.error(V)},f=h;n.timeout&&(f=S=>{let{url:L}=l(),V=new Xu({error:new DOMException("Request timed out","TimeoutError"),status:s.status||0,statusText:s.statusText||"Request timeout",url:L||void 0});o.error(V)});let g=!1,E=S=>{g||(o.next(l()),g=!0);let L={type:Rc.DownloadProgress,loaded:S.loaded};S.lengthComputable&&(L.total=S.total),n.responseType==="text"&&s.responseText&&(L.partialText=s.responseText),o.next(L)},I=S=>{let L={type:Rc.UploadProgress,loaded:S.loaded};S.lengthComputable&&(L.total=S.total),o.next(L)};return s.addEventListener("load",d),s.addEventListener("error",h),s.addEventListener("timeout",f),s.addEventListener("abort",h),n.reportProgress&&(s.addEventListener("progress",E),a!==null&&s.upload&&s.upload.addEventListener("progress",I)),s.send(a),o.next({type:Rc.Sent}),()=>{s.removeEventListener("error",h),s.removeEventListener("abort",h),s.removeEventListener("load",d),s.removeEventListener("timeout",f),n.reportProgress&&(s.removeEventListener("progress",E),a!==null&&s.upload&&s.upload.removeEventListener("progress",I)),s.readyState!==s.DONE&&s.abort()}})))}static \u0275fac=function(r){return new(r||t)($(Dc))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),_U=new z(""),W7="XSRF-TOKEN",z7=new z("",{providedIn:"root",factory:()=>W7}),q7="X-XSRF-TOKEN",K7=new z("",{providedIn:"root",factory:()=>q7}),ep=class{},Y7=(()=>{class t{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(n,r){this.doc=n,this.cookieName=r}getToken(){let n=this.doc.cookie||"";return n!==this.lastCookieString&&(this.parseCount++,this.lastToken=zf(n,this.cookieName),this.lastCookieString=n),this.lastToken}static \u0275fac=function(r){return new(r||t)($(on),$(z7))};static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})(),X7=/^(?:https?:)?\/\//i;function Q7(t,e){if(!Y(_U)||t.method==="GET"||t.method==="HEAD"||X7.test(t.url))return e(t);let n=Y(ep).getToken(),r=Y(K7);return n!=null&&!t.headers.has(r)&&(t=t.clone({headers:t.headers.set(r,n)})),e(t)}var YD=(function(t){return t[t.Interceptors=0]="Interceptors",t[t.LegacyInterceptors=1]="LegacyInterceptors",t[t.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",t[t.NoXsrfProtection=3]="NoXsrfProtection",t[t.JsonpSupport=4]="JsonpSupport",t[t.RequestsMadeViaParent=5]="RequestsMadeViaParent",t[t.Fetch=6]="Fetch",t})(YD||{});function J7(t,e){return{\u0275kind:t,\u0275providers:e}}function Z7(...t){let e=[pU,zD,lT,{provide:Nc,useExisting:lT},{provide:Jf,useFactory:()=>Y(U7,{optional:!0})??Y(zD)},{provide:qD,useValue:Q7,multi:!0},{provide:_U,useValue:!0},{provide:ep,useClass:Y7}];for(let n of t)e.push(...n.\u0275providers);return Xn(e)}var uU=new z("");function eX(){return J7(YD.LegacyInterceptors,[{provide:uU,useFactory:G7},{provide:qD,useExisting:uU,multi:!0}])}var XD=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275prov=Q({token:t,factory:function(r){let i=null;return r?i=new(r||t):i=$(tX),i},providedIn:"root"})}return t})(),tX=(()=>{class t extends XD{_doc;constructor(n){super(),this._doc=n}sanitize(n,r){if(r==null)return null;switch(n){case vt.NONE:return r;case vt.HTML:return Bi(r,"HTML")?gr(r):A_(this._doc,String(r)).toString();case vt.STYLE:return Bi(r,"Style")?gr(r):r;case vt.SCRIPT:if(Bi(r,"Script"))return gr(r);throw new J(5200,!1);case vt.URL:return Bi(r,"URL")?gr(r):Cf(String(r));case vt.RESOURCE_URL:if(Bi(r,"ResourceURL"))return gr(r);throw new J(5201,!1);default:throw new J(5202,!1)}}bypassSecurityTrustHtml(n){return NC(n)}bypassSecurityTrustStyle(n){return wC(n)}bypassSecurityTrustScript(n){return bC(n)}bypassSecurityTrustUrl(n){return OC(n)}bypassSecurityTrustResourceUrl(n){return MC(n)}static \u0275fac=function(r){return new(r||t)($(on))};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var qt={production:!1,staging:!0,firebaseLogLevel:"error",firebaseConfig:{apiKey:"AIzaSyAzcW2n1JhY_zhkXmuFcwe550AkwmYeJ0w",authDomain:"snipply-sdk-staging.firebaseapp.com",projectId:"snipply-sdk-staging",storageBucket:"snipply-sdk-staging.appspot.com",messagingSenderId:"877538579326",appId:"1:877538579326:web:f793f73f2b7dc770c4992f"},firebaseNotificationsDatabaseURL:"https://snipply-sdk-staging-notifications.firebaseio.com",segmentAnalyticsWriteKey:"ndJ0KZs5LkL6jny5a43FXXQkTF5bgPFt",useEmulators:!1,debugMode:!1,cloudFunction:{sa:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/sa",getIceServers:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/geticeservers",validateClient:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/validateclient",convertRecording:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/convertrecordingv2",chatgptCompletion:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/chatgptcompletion",rewriterAskAi:"https://staging.velt.dev/v2/rewriter/ask-ai",whisperTranscription:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/whispertranscription",getPlanDetails:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/getplandetails",getAllowedDocuments:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/getalloweddocuments",getNotificationsForDocuments:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/getnotificationsfordocuments",videoBackend:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/videobackend",processRecording:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/processrecording",sdkProxy:"https://staging.velt.dev/v2/core/a",screenshot:"https://staging.velt.dev/v2/screenshots/capture",usCentral1:{setEncryptedData:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/setencrypteddata"},asiaSouthEast1:{setEncryptedData:"https://asia-southeast1-snipply-sdk-staging.cloudfunctions.net/setencrypteddataau"},europeWest1:{setEncryptedData:"https://europe-west1-snipply-sdk-staging.cloudfunctions.net/setencrypteddataeu"},asiaNorthEast1:{setEncryptedData:"https://asia-northeast1-snipply-sdk-staging.cloudfunctions.net/setencrypteddatajp"},australiaSouthEast1:{setEncryptedData:"https://australia-southeast1-snipply-sdk-staging.cloudfunctions.net/setencrypteddataau1"}}};var On=class On{static showLogs(){try{return qt.debugMode||!!sessionStorage.getItem("debugMode")||!!sessionStorage.getItem("forceDebugMode")}catch(e){return On.catch("Error in showLogs: ",e),!1}}};On.log=On.showLogs()?console.log:()=>{},On.warn=On.showLogs()?console.warn:()=>{},On.error=On.showLogs()?console.error:()=>{},On.debug=On.showLogs()?console.debug:()=>{},On.info=On.showLogs()?console.info:()=>{},On.logsEnabled=!0,On.catch=(e,n)=>{try{On.logsEnabled&&(n!==void 0?console.warn("Velt: ",e,n):console.warn("Velt: ",e))}catch{}};var M=On;var lDe={NEWLY_ADDED:"newlyAdded",ADDED:"added",UPDATED:"updated",DELETED:"deleted",APPROVED:"approved",ASSIGNED:"assigned",STATUS_CHANGED:"statusChanged",PRIORITY_CHANGED:"priorityChanged",ACCESS_MODE_CHANGED:"accessModeChanged",CUSTOM_LIST_CHANGED:"customListChanged",ACCEPTED:"accepted",REJECTED:"rejected",REACTION_ADDED:"reactionAdded",REACTION_DELETED:"reactionDeleted",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed",SUGGESTION_ACCEPTED:"suggestionAccepted",SUGGESTION_REJECTED:"suggestionRejected"},uDe={COMMENT_ANNOTATION_ADD:"comment_annotation.add",COMMENT_ANNOTATION_DELETE:"comment_annotation.delete",COMMENT_ADD:"comment.add",COMMENT_DELETE:"comment.delete",COMMENT_UPDATE:"comment.update",REACTION_ADD:"reaction.add",REACTION_DELETE:"reaction.delete",ATTACHMENT_ADD:"attachment.add",ATTACHMENT_DELETE:"attachment.delete",RECORDER_ANNOTATION_ADD:"recorder_annotation.add",RECORDER_ANNOTATION_UPDATE:"recorder_annotation.update",RECORDER_ANNOTATION_DELETE:"recorder_annotation.delete",ACTIVITY_SAVE:"activity.save"},dDe={STATUS_CHANGE:"comment_annotation.status_change",PRIORITY_CHANGE:"comment_annotation.priority_change",ASSIGN:"comment_annotation.assign",ACCESS_MODE_CHANGE:"comment_annotation.access_mode_change",CUSTOM_LIST_CHANGE:"comment_annotation.custom_list_change",APPROVE:"comment_annotation.approve",ACCEPT:"comment.accept",REJECT:"comment.reject",SUGGESTION_ACCEPT:"comment_annotation.suggestion_accept",SUGGESTION_REJECT:"comment_annotation.suggestion_reject",REACTION_ADD:"comment.reaction_add",REACTION_DELETE:"comment.reaction_delete",SUBSCRIBE:"comment_annotation.subscribe",UNSUBSCRIBE:"comment_annotation.unsubscribe"},hDe={ADD_COMMENT_ANNOTATION:"addCommentAnnotation",ADD_COMMENT_ANNOTATION_DRAFT:"addCommentAnnotationDraft",DELETE_COMMENT_ANNOTATION:"deleteCommentAnnotation",APPROVE_COMMENT_ANNOTATION:"approveCommentAnnotation",ACCEPT_COMMENT_ANNOTATION:"acceptCommentAnnotation",REJECT_COMMENT_ANNOTATION:"rejectCommentAnnotation",SUBSCRIBE_COMMENT_ANNOTATION:"subscribeCommentAnnotation",UNSUBSCRIBE_COMMENT_ANNOTATION:"unsubscribeCommentAnnotation",ASSIGN_USER:"assignUser",UPDATE_STATUS:"updateStatus",UPDATE_PRIORITY:"updatePriority",UPDATE_ACCESS:"updateAccess",RESOLVE_COMMENT:"resolveComment",ADD_COMMENT:"addComment",ADD_COMMENT_DRAFT:"addCommentDraft",UPDATE_COMMENT:"updateComment",DELETE_COMMENT:"deleteComment",ADD_ATTACHMENT:"addAttachment",DELETE_ATTACHMENT:"deleteAttachment",DELETE_RECORDING:"deleteRecording",COPY_LINK:"copyLink",ADD_REACTION:"addReaction",DELETE_REACTION:"deleteReaction",TOGGLE_REACTION:"toggleReaction",COMMENT_SIDEBAR_DATA_INIT:"commentSidebarDataInit",COMMENT_SIDEBAR_DATA_UPDATE:"commentSidebarDataUpdate",AUTOCOMPLETE_SEARCH:"autocompleteSearch",COMPOSER_CLICKED:"composerClicked",COMPOSER_TEXT_CHANGE:"composerTextChange",LINK_CLICKED:"linkClicked",COMMENT_PIN_CLICKED:"commentPinClicked",COMMENT_BUBBLE_CLICKED:"commentBubbleClicked",COMMENT_TOOL_CLICK:"commentToolClick",COMMENT_TOOL_CLICKED:"commentToolClicked",SIDEBAR_BUTTON_CLICK:"sidebarButtonClick",SIDEBAR_BUTTON_CLICKED:"sidebarButtonClicked",SIDEBAR_OPEN:"sidebarOpen",SIDEBAR_CLOSE:"sidebarClose",FULLSCREEN_CLICK:"fullscreenClick",COMMENT_CLICK:"commentClick",COMMENT_NAVIGATION_BUTTON_CLICK:"commentNavigationButtonClick",ATTACHMENT_DOWNLOAD_CLICKED:"attachmentDownloadClicked",COMMENT_SAVED:"commentSaved",COMMENT_SAVE_TRIGGERED:"commentSaveTriggered",VISIBILITY_OPTION_CLICKED:"visibilityOptionClicked",SUGGESTION_ACCEPTED:"suggestionAccepted",SUGGESTION_REJECTED:"suggestionRejected",COMMENT_ACTION_CLICKED:"commentActionClicked"},fDe={TRANSCRIPTION_DONE:"transcriptionDone",RECORDING_DONE:"recordingDone",RECORDING_EDIT_DONE:"recordingEditDone",DELETE_RECORDING:"deleteRecording",ERROR:"error",RECORDING_SAVE_INITIATED:"recordingSaveInitiated",RECORDING_STARTED:"recordingStarted",RECORDING_PAUSED:"recordingPaused",RECORDING_RESUMED:"recordingResumed",RECORDING_CANCELLED:"recordingCancelled",RECORDING_STOPPED:"recordingStopped",RECORDING_DONE_LOCAL:"recordingDoneLocal"},pDe={TEXT_SELECTED:"textSelected"},gDe={SUGGESTION_CREATED:"suggestionCreated",SUGGESTION_APPROVED:"suggestionApproved",SUGGESTION_REJECTED:"suggestionRejected",SUGGESTION_STALE:"suggestionStale",TARGET_EDIT_START:"targetEditStart",TARGET_EDIT_COMMIT:"targetEditCommit"},Wi={PERMISSION_PROVIDER:"permissionProvider",USER_RESOLVER:"userResolver",COMMENT_RESOLVER:"commentResolver",ATTACHMENT_RESOLVER:"attachmentResolver",REACTION_RESOLVER:"reactionResolver",RECORDER_RESOLVER:"recorderResolver",NOTIFICATION_RESOLVER:"notificationResolver",ACTIVITY_RESOLVER:"activityResolver",VELT_BUTTON_CLICK:"veltButtonClick",USER_UPDATE:"userUpdate",INIT_UPDATE:"initUpdate",DOCUMENT_INIT:"documentInit",ERROR:"error"},mDe={ACCESS_REQUESTED:"accessRequested",ACCESS_REQUEST_CANCELED:"accessRequestCanceled",ACCESS_ACCEPTED:"accessAccepted",ACCESS_REJECTED:"accessRejected",EDITOR_ASSIGNED:"editorAssigned",VIEWER_ASSIGNED:"viewerAssigned",EDITOR_ON_DIFFERENT_TAB_DETECTED:"editorOnDifferentTabDetected"},EDe={MULTIPLE_USERS_ONLINE:"multipleUsersOnline",USER_STATE_CHANGE:"userStateChange"},_De={SETTINGS_UPDATED:"settingsUpdated"},TDe={UPDATE_DATA:"updateData"},rX=(function(t){return t.ADDED="added",t.UPDATED="updated",t.DELETED="deleted",t.APPROVED="approved",t.RESOLVED="resolved",t})(rX||{}),iX=(function(t){return t.INVITE="invite",t.REMOVE="remove",t})(iX||{}),oX=(function(t){return t.CREATED="created",t.JOINED="joined",t})(oX||{}),sX=(function(t){return t.UPDATE_DATA="updateData",t})(sX||{}),aX=(function(t){return t.ADDED="added",t.UPDATED="updated",t.DELETED="deleted",t.APPROVED="approved",t.RESOLVED="resolved",t})(aX||{}),cX=(function(t){return t.ADDED="added",t.UPDATED="updated",t.DELETED="deleted",t})(cX||{}),yDe={ADDED:"added",UPDATED:"updated",DELETED:"deleted"},lX=(function(t){return t.FIRST_VIEWED="firstViewed",t})(lX||{}),QD=(function(t){return t.AREA="area",t.ARROW="arrow",t.AUDIO_HUDDLE="audioHuddle",t.COMMENT="comment",t.MULTI_THREAD="multiThread",t.CURSOR="cursor",t.HUDDLE="huddle",t.LIVE_STATE_SYNC="liveStateSync",t.PRESENCE="presence",t.TAG="tag",t.RECORDER="recorder",t.REWRITER="rewriter",t.LIVE_SELECTION="liveSelection",t.NOTIFICATION="notification",t.REACTION="reaction",t.ACTIVITY="activity",t.VIEWS="views",t.USER_INVITE="userInvite",t.USER_REQUEST="userRequest",t.VIDEO_PLAYER="videoPlayer",t.CRDT="crdt",t})(QD||{}),uX=(function(t){return t.AREA="area",t.ARROW="arrow",t.AUDIO_HUDDLE="audioHuddle",t.COMMENT="comment",t.MULTI_THREAD="multiThread",t.CURSOR="cursor",t.HUDDLE="huddle",t.LIVE_STATE_SYNC="liveStateSync",t.PRESENCE="presence",t.TAG="tag",t.RECORDER="recorder",t.REWRITER="rewriter",t.LIVE_SELECTION="liveSelection",t.NOTIFICATION="notification",t.REACTION="reaction",t.AREA_COMMENT="areaComment",t.INLINE_COMMENT="inlineComment",t.COMMENT_SIDEBAR="commentSidebar",t})(uX||{}),Er=(function(t){return t.DESKTOP="Desktop",t.MOBILE="Mobile",t.TABLET="Tablet",t.MONITOR="Monitor",t.UNKNOWN="Unknown",t})(Er||{}),Ju=(function(t){return t.PORTRAIT="portrait",t.LANDSCAPE="landscape",t.UNKNOWN="unknown",t})(Ju||{}),uT=(function(t){return t.Portrait="(orientation: portrait)",t.Landscape="(orientation: landscape)",t})(uT||{}),dX=(function(t){return t.DIFFERENT_DEVICE="differentDevice",t.ELEMENT_DELETED="elementDeleted",t})(dX||{}),Zu=(function(t){return t.ADMIN="Admin",t.COMMENTER="Commenter",t})(Zu||{}),Mn={PUBLIC:"public",RESTRICTED:"restricted",ORGANIZATION_PRIVATE:"organizationPrivate"},hX=(function(t){return t.DEFAULT="default",t.DYNAMIC_ID="dynamicId",t})(hX||{}),dT={PUBLIC:"public",PRIVATE:"private"},fX=(function(t){return t.MINIMAL="minimal",t.VERBOSE="verbose",t})(fX||{}),pX=(function(t){return t.DEFAULT="default",t.EXPANDED="expanded",t})(pX||{}),gX=(function(t){return t.TOTAL="total",t.UNREAD="unread",t})(gX||{}),IDe={ONLINE:"online",OFFLINE:"offline",PENDING_INIT:"pendingInit",PENDING_DATA:"pendingData"},vDe={ALL:"all",ORGANIZATION:"organization",ORGANIZATION_USER_GROUP:"organizationUserGroup",DOCUMENT:"document",FOLDER:"folder"},SDe={AND:"and",OR:"or"},mX=(function(t){return t.RESTRICTED_SELF="restrictedSelf",t.RESTRICTED_SELECTED_PEOPLE="restrictedSelectedPeople",t.ORGANIZATION_PRIVATE="organizationPrivate",t.PUBLIC="public",t})(mX||{});var U=class U{};U.SNIPPYLY_HOST_URL_PROD="https://snippyly.com",U.SNIPPYLY_HOST_URL_STAGING="https://snippyly-staging.web.app",U.USER_TYPE_ANONYMOUS="anonymous",U.USER_TYPE_SIGNED_IN="signedIn",U.LOCALSTORAGE_DATA_ID="snippylytempdata",U.NO_ORGANIZATION_ID="veltNoOrganization",U.DEFAULT_QUERY_HASH="default",U.LISTENER_BATCH_SIZE=5,U.LISTENER_CONTEXT_BATCH_SIZE=25,U.FIRESTORE_MAX_DISJUNCTIONS=30,U.FIRESTORE_IN_QUERY_LIMIT=30,U.DEFAULT_VELT_CONTEXT="default:velt",U.VISIBILITY_SELF_PREFIX="__velt_private_self:",U.VISIBILITY_ORG_PREFIX="organizationPrivate:",U.FIREBASE_PARTIAL_PATH_ORGANIZATIONS="organizations",U.FIREBASE_PARTIAL_PATH_FOLDERS="folders",U.FIREBASE_PARTIAL_PATH_DOCS="docs",U.FIREBASE_PARTIAL_PATH_DOCUMENT_CONFIGURATIONS="documentConfigurations",U.FIREBASE_PARTIAL_PATH_PRESENCE="presence",U.FIREBASE_PARTIAL_PATH_ORGANIZATION_USERS="orgIamUsers",U.FIREBASE_PARTIAL_PATH_CENTRAL_USERS="users",U.FIREBASE_PARTIAL_PATH_FOLDER_USERS="folderIamUsers",U.FIREBASE_PARTIAL_PATH_DOCUMENT_USERS="docIamUsers",U.FIREBASE_PARTIAL_PATH_CURSOR="cursor",U.FIREBASE_PARTIAL_PATH_ARROW="arrow",U.FIREBASE_PARTIAL_PATH_AREA="area",U.FIREBASE_PARTIAL_PATH_COMMENT="comment",U.FIREBASE_PARTIAL_PATH_LOCATION="location",U.FIREBASE_PARTIAL_PATH_MULTI_THREAD="multiThread",U.FIREBASE_PARTIAL_PATH_TAG="tag",U.FIREBASE_PARTIAL_PATH_SELECTION="selection",U.FIREBASE_PARTIAL_PATH_AUDIO_HUDDLE="audioHuddle",U.FIREBASE_PARTIAL_PATH_HUDDLE="huddle",U.FIREBASE_PARTIAL_PATH_CONTACTS="contacts",U.FIREBASE_PARTIAL_PATH_GROUPS="groups",U.FIREBASE_PARTIAL_PATH_NOTIFICATION_DOCS="notificationsDocs",U.FIREBASE_PARTIAL_PATH_NOTIFICATION_USERS="notificationsUsers",U.FIREBASE_PARTIAL_PATH_DOC_NOTIFICATION="notificationsDocs__notification",U.FIREBASE_PARTIAL_PATH_USER_NOTIFICATION="notificationsUsers__notification",U.FIREBASE_PARTIAL_PATH_USER_NOTIFICATION_INDEX="userNotificationIndex",U.FIREBASE_PARTIAL_PATH_GLOBAL="global",U.FIREBASE_PARTIAL_PATH_LOGINS="logins",U.FIREBASE_PARTIAL_PATH_METADATA="metadata",U.FIREBASE_PARTIAL_PATH_ORGANIZATION_METADATA="metadata",U.FIREBASE_PARTIAL_PATH_ORGANIZATION_GROUPS="groups",U.FIREBASE_PARTIAL_PATH_LOCATIONS="locations",U.FIREBASE_PARTIAL_PATH_RECORDER="recorder",U.FIREBASE_PARTIAL_PATH_FOLLOW_ALONG="flock",U.FIREBASE_PARTIAL_PATH_SYNC_VIDEO_PLAYER="syncVideoPlayer",U.FIREBASE_PARTIAL_PATH_LIVE_STATE="liveState",U.FIREBASE_PARTIAL_PATH_IAM="iam",U.FIREBASE_PARTIAL_PATH_REACTION="reaction",U.FIREBASE_PARTIAL_PATH_CRDT="crdt",U.FIREBASE_PARTIAL_PATH_VIEWS="views",U.FIREBASE_PARTIAL_PATH_NOTIFICATION_VIEWS="notificationViews",U.FIREBASE_PARTIAL_PATH_DOCUMENT_VIEWS="documentViews",U.FIREBASE_PARTIAL_PATH_LOCATION_VIEWS="locationViews",U.FIREBASE_PARTIAL_PATH_NOTIFICATIONS="notifications",U.FIREBASE_PARTIAL_PATH_ORGANIZATION_NOTIFICATIONS="notifications",U.FIREBASE_PARTIAL_PATH_LAST_NOTIFICATION_TIMESTAMP="lastNotificationTimestamp",U.FIREBASE_PARTIAL_PATH_ACTIVITIES="activities",U.FIREBASE_PARTIAL_PATH_LAST_ACTIVITY_TIMESTAMP="lastActivityTimestamp",U.FIREBASE_PARTIAL_PATH_HEARTBEAT="heartbeat",U.FIREBASE_PARTIAL_PATH_HEARTBEAT_BY_DOCUMENT="heartbeatByDocument",U.FIREBASE_PARTIAL_PATH_USERS="users",U.FIREBASE_PARTIAL_PATH_PERMISSIONS_USERS="permissions",U.FIREBASE_PARTIAL_PATH_USER_REQUESTS="userRequests",U.FIREBASE_PARTIAL_PATH_FEEDBACK="feedback",U.FIREBASE_PARTIAL_PATH_BUGS="bugs",U.FIREBASE_PARTIAL_PATH_CONTACT_US="contactUs",U.FIREBASE_PARTIAL_PATH_CUSTOMER_METADATA="metadata",U.PRESENCE_STATUS_ONLINE="online",U.PRESENCE_STATUS_OFFLINE="offline",U.PRESENCE_STATUS_AWAY="away",U.IMG_URL_NOT_FOUND="https://snippyly.com/assets/icons/anon-user.svg",U.IMG_CLASS_NOT_FOUND="presence-avatar-image-small",U.AVATAR_COLOR_LIST=["#a259fe","#9746ff","#19bcfe","#FE8947","#2c83fc","#0dcf82","#ffcb00","#ff7162","#FFD600","#A5A7FE","#67DBF4","#FDA192"],U.TEXT_COLOR_MAP={"#a259fe":"#ffffff","#9746ff":"#ffffff","#19bcfe":"#ffffff","#FE8947":"#ffffff","#2c83fc":"#ffffff","#0dcf82":"#141416","#ffcb00":"#141416","#ff7162":"#ffffff","#FFD600":"#141416","#A5A7FE":"#141416","#67DBF4":"#141416","#FDA192":"#141416"},U.UNREAD_COMMENTS_CHECK_FROM_DATE="2024-02-05",U.DEFAULT_ANNOTATION_COLOR="#a259fe",U.REGEX_EMAIL=/(\+|@)+([a-zA-Z0-9._+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi,U.REGEX_URL=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)(?::[0-9]+)?((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_0-9]*)#?(?:[\.\!\/\\\w0-9=]*))?)/gi,U.REGEX_URL_FOR_USER_NAME=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi,U.REGEX_SPECIAL_CHARS=/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,U.SNIPPYLY_HIGHLIGHT="snippyly-highlight",U.SNIPPYLY_HIGHLIGHT_PREVIEW="snippyly-highlight-preview",U.SNIPPYLY_HIGHLIGHT_USER="snippyly-highlight-user",U.SNIPPYLY_HIGHLIGHT_USER_NAME="snippyly-highlight-user-name",U.SNIPPYLY_HIGHLIGHT_USER_TEXT="snippyly-highlight-user-text",U.VELT_LIVE_SELECTION_ON_ELEMENT="velt-live-selection-on-element",U.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT="velt-live-selection-on-element-default",U.VELT_LIVE_SELECTION_ON_TEXT="velt-live-selection-on-text",U.VELT_LIVE_SELECTION_ON_TEXT_DEFAULT="velt-live-selection-on-text-default",U.VELT_IGNORE_CHANGE_DETECTION="velt-ignore-change-detection",U.VELT_CUSTOM_CSS="velt-custom-css",U.TAGS={SNIPPYLY_ROOT:"snippyly-root",SNIPPYLY_PRESENCE:"snippyly-presence",SNIPPYLY_CURSOR:"snippyly-cursor",SNIPPYLY_COMMENT_TOOL:"snippyly-comment-tool",SNIPPYLY_COMMENTS:"snippyly-comments",SNIPPYLY_TAG_TOOL:"snippyly-tag-tool",SNIPPYLY_TAGS:"snippyly-tags",SNIPPYLY_RECORDER_NOTES:"snippyly-recorder-notes",SNIPPYLY_RECORDER_CONTROL_PANEL:"snippyly-recorder-control-panel",SNIPPYLY_RECORDER_CONTROL_PANEL_INTERNAL:"snippyly-recorder-control-panel-internal",SNIPPYLY_RECORDER_PLAYER:"snippyly-recorder-player",SNIPPYLY_TEXT_HIGHLIGHT:"snippyly-text-highlight",SNIPPYLY_COMMENT_TEXT_PORTAL:"snippyly-comment-text-portal",SNIPPYLY_COMMENT_TEXT:"snippyly-comment-text",SNIPPYLY_COMMENTS_SIDEBAR:"snippyly-comments-sidebar",SNIPPYLY_COMMENT_BUBBLE:"snippyly-comment-bubble",SNIPPYLY_HIGHLIGHT_USER_TEXT:"snippyly-highlight-user-text",SNIPPYLY_AUDIO_HUDDLE:"snippyly-audio-huddle",SNIPPYLY_VIDEO_HUDDLE:"snippyly-video-huddle",SNIPPYLY_HUDDLE:"snippyly-huddle",SNIPPYLY_HUDDLE_TOOL:"snippyly-huddle-tool",SNIPPYLY_RECORDER_TOOL:"snippyly-recorder-tool",SNIPPYLY_PLUGIN:"snippyly-plugin",SNIPPYLY_MENU:"snippyly-menu",SNIPPYLY_COMMENT_DIALOG:"snippyly-comment-dialog",SNIPPYLY_SIDEBAR_BUTTON:"snippyly-sidebar-button",SNIPPYLY_REWRITER:"snippyly-rewriter",SNIPPYLY_USER_INVITE_TOOL:"snippyly-user-invite-tool",SNIPPYLY_USER_REQUEST_TOOL:"snippyly-user-request-tool",SNIPPYLY_USER_AVATAR:"snippyly-user-avatar",SNIPPYLY_ARROW_TOOL:"snippyly-arrow-tool",SNIPPYLY_ARROWS:"snippyly-arrows",SNIPPYLY_AREA_TOOL:"snippyly-area-tool",SNIPPYLY_AREAS:"snippyly-areas",VELT_ROOT:"velt-root",VELT_PRESENCE:"velt-presence",VELT_CURSOR:"velt-cursor",VELT_COMMENT_TOOL:"velt-comment-tool",VELT_COMMENTS:"velt-comments",VELT_TAG_TOOL:"velt-tag-tool",VELT_TAGS:"velt-tags",VELT_RECORDER_NOTES:"velt-recorder-notes",VELT_RECORDER_CONTROL_PANEL:"velt-recorder-control-panel",VELT_RECORDER_CONTROL_PANEL_EMBED:"velt-recorder-control-panel-embed",SNIPPYLY_RECORDER_CONTROL_PANEL_EMBED:"snippyly-recorder-control-panel-embed",VELT_RECORDER_PLAYER:"velt-recorder-player",VELT_RECORDER_PLAYER_EMBED:"velt-recorder-player-embed",SNIPPYLY_RECORDER_PLAYER_EMBED:"snippyly-recorder-player-embed",VELT_VIDEO_EDITOR:"velt-video-editor",VELT_TEXT_HIGHLIGHT:"velt-text-highlight",VELT_COMMENT_TEXT_PORTAL:"velt-comment-text-portal",VELT_COMMENTS_SIDEBAR:"velt-comments-sidebar",VELT_COMMENTS_SIDEBAR_V2:"velt-comments-sidebar-v2",VELT_COMMENT_SIDEBAR_SKELETON_V2:"velt-comment-sidebar-skeleton-v2",VELT_COMMENT_SIDEBAR_PANEL_V2:"velt-comment-sidebar-panel-v2",VELT_COMMENT_SIDEBAR_LIST_V2:"velt-comment-sidebar-list-v2",VELT_COMMENT_SIDEBAR_LIST_ITEM_V2:"velt-comment-sidebar-list-item-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_V2:"velt-comment-sidebar-filter-dropdown-content-list-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_CATEGORY_V2:"velt-comment-sidebar-filter-dropdown-content-list-category-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_CATEGORY_LABEL_V2:"velt-comment-sidebar-filter-dropdown-content-list-category-label-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_CATEGORY_CONTENT_V2:"velt-comment-sidebar-filter-dropdown-content-list-category-content-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_ITEM_V2:"velt-comment-sidebar-filter-dropdown-content-list-item-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_ITEM_INDICATOR_V2:"velt-comment-sidebar-filter-dropdown-content-list-item-indicator-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_ITEM_LABEL_V2:"velt-comment-sidebar-filter-dropdown-content-list-item-label-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_ITEM_COUNT_V2:"velt-comment-sidebar-filter-dropdown-content-list-item-count-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_V2:"velt-comment-sidebar-filter-dropdown-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_TRIGGER_V2:"velt-comment-sidebar-filter-dropdown-trigger-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_V2:"velt-comment-sidebar-filter-dropdown-content-v2",VELT_COMMENT_SIDEBAR_FILTER_BUTTON_V2:"velt-comment-sidebar-filter-button-v2",VELT_COMMENT_SIDEBAR_FILTER_BUTTON_V2_APPLIED_ICON:"velt-comment-sidebar-filter-button-v2-applied-icon",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2:"velt-comment-sidebar-filter-container-v2",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION:"velt-comment-sidebar-filter-container-v2-section",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_FIELD:"velt-comment-sidebar-filter-container-v2-section-field",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_LIST:"velt-comment-sidebar-filter-container-v2-section-list",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_LABEL:"velt-comment-sidebar-filter-container-v2-section-label",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL:"velt-comment-sidebar-filter-container-v2-section-control",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION_LIST:"velt-comment-sidebar-filter-container-v2-section-option-list",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION:"velt-comment-sidebar-filter-container-v2-section-option",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION_CHECKBOX:"velt-comment-sidebar-filter-container-v2-section-option-checkbox",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_VALUE:"velt-comment-sidebar-filter-container-v2-section-control-value",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_CHIP:"velt-comment-sidebar-filter-container-v2-section-control-chip",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_CHIP_LIST:"velt-comment-sidebar-filter-container-v2-section-control-chip-list",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_SEARCH:"velt-comment-sidebar-filter-container-v2-section-control-search",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_CHEVRON:"velt-comment-sidebar-filter-container-v2-section-control-chevron",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION_NAME:"velt-comment-sidebar-filter-container-v2-section-option-name",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION_COUNT:"velt-comment-sidebar-filter-container-v2-section-option-count",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_TITLE:"velt-comment-sidebar-filter-container-v2-title",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_CLOSE_BUTTON:"velt-comment-sidebar-filter-container-v2-close-button",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_GROUP_BY:"velt-comment-sidebar-filter-container-v2-group-by",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_RESET_BUTTON:"velt-comment-sidebar-filter-container-v2-reset-button",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_APPLY_BUTTON:"velt-comment-sidebar-filter-container-v2-apply-button",VELT_COMMENT_SIDEBAR_SEARCH_V2:"velt-comment-sidebar-search-v2",VELT_COMMENT_SIDEBAR_SEARCH_V2_ICON:"velt-comment-sidebar-search-v2-icon",VELT_COMMENT_SIDEBAR_SEARCH_V2_INPUT:"velt-comment-sidebar-search-v2-input",VELT_COMMENT_SIDEBAR_FULLSCREEN_BUTTON_V2:"velt-comment-sidebar-fullscreen-button-v2",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2:"velt-comment-sidebar-list-group-header-v2",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2_LABEL:"velt-comment-sidebar-list-group-header-v2-label",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2_COUNT:"velt-comment-sidebar-list-group-header-v2-count",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2_SEPARATOR:"velt-comment-sidebar-list-group-header-v2-separator",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2_CHEVRON:"velt-comment-sidebar-list-group-header-v2-chevron",VELT_COMMENT_SIDEBAR_HEADER_V2:"velt-comment-sidebar-header-v2",VELT_COMMENT_SIDEBAR_CLOSE_BUTTON_V2:"velt-comment-sidebar-close-button-v2",VELT_COMMENT_SIDEBAR_EMPTY_PLACEHOLDER_V2:"velt-comment-sidebar-empty-placeholder-v2",VELT_COMMENT_SIDEBAR_RESET_FILTER_BUTTON_V2:"velt-comment-sidebar-reset-filter-button-v2",VELT_COMMENT_SIDEBAR_PAGE_MODE_COMPOSER_V2:"velt-comment-sidebar-page-mode-composer-v2",VELT_COMMENT_SIDEBAR_FOCUSED_THREAD_V2:"velt-comment-sidebar-focused-thread-v2",VELT_COMMENT_SIDEBAR_FOCUSED_THREAD_BACK_BUTTON_V2:"velt-comment-sidebar-focused-thread-back-button-v2",VELT_COMMENT_SIDEBAR_FOCUSED_THREAD_DIALOG_CONTAINER_V2:"velt-comment-sidebar-focused-thread-dialog-container-v2",VELT_COMMENT_BUBBLE:"velt-comment-bubble",VELT_COMMENT_BUBBLE_AVATAR:"velt-comment-bubble-avatar",VELT_COMMENT_BUBBLE_COMMENTS_COUNT:"velt-comment-bubble-comments-count",VELT_COMMENT_BUBBLE_UNREAD_ICON:"velt-comment-bubble-unread-icon",VELT_COMMENT_THREAD:"velt-comment-thread",VELT_COMMENT_PIN:"velt-comment-pin",VELT_COMMENT_PIN_EMBED:"velt-comment-pin-embed",SNIPPYLY_COMMENT_PIN_EMBED:"snippyly-comment-pin-embed",VELT_COMMENT_PIN_NUMBER:"velt-comment-pin-number",VELT_COMMENT_PIN_INDEX:"velt-comment-pin-index",VELT_COMMENT_PIN_TRIANGLE:"velt-comment-pin-triangle",VELT_COMMENT_PIN_PRIVATE_COMMENT_INDICATOR:"velt-comment-pin-private-comment-indicator",VELT_COMMENT_PIN_GHOST_COMMENT_INDICATOR:"velt-comment-pin-ghost-comment-indicator",VELT_COMMENT_PIN_UNREAD_COMMENT_INDICATOR:"velt-comment-pin-unread-comment-indicator",VELT_SIDEBAR_BUTTON_ICON:"velt-sidebar-button-icon",VELT_SIDEBAR_BUTTON_COMMENTS_COUNT:"velt-sidebar-button-comments-count",VELT_SIDEBAR_BUTTON_UNREAD_ICON:"velt-sidebar-button-unread-icon",VELT_COMMENT_TEXT:"velt-comment-text",VELT_CHART_COMMENT:"velt-chart-comment",VELT_CANVAS_COMMENT:"velt-canvas-comment",VELT_INLINE_COMMENTS_SECTION:"velt-inline-comments-section",VELT_INLINE_COMMENTS_SECTION_SKELETON:"velt-inline-comments-section-skeleton",VELT_INLINE_COMMENTS_SECTION_PANEL:"velt-inline-comments-section-panel",VELT_INLINE_COMMENTS_SECTION_LIST:"velt-inline-comments-section-list",VELT_INLINE_COMMENTS_SECTION_COMPOSER_CONTAINER:"velt-inline-comments-section-composer-container",VELT_INLINE_COMMENTS_SECTION_COMMENT_COUNT:"velt-inline-comments-section-comment-count",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN:"velt-inline-comments-section-sorting-dropdown",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_TRIGGER:"velt-inline-comments-section-sorting-dropdown-trigger",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_TRIGGER_NAME:"velt-inline-comments-section-sorting-dropdown-trigger-name",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_TRIGGER_ICON:"velt-inline-comments-section-sorting-dropdown-trigger-icon",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT:"velt-inline-comments-section-sorting-dropdown-content",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT_ITEM:"velt-inline-comments-section-sorting-dropdown-content-item",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT_ITEM_ICON:"velt-inline-comments-section-sorting-dropdown-content-item-icon",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT_ITEM_TICK:"velt-inline-comments-section-sorting-dropdown-content-item-tick",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT_ITEM_NAME:"velt-inline-comments-section-sorting-dropdown-content-item-name",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN:"velt-inline-comments-section-filter-dropdown",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_TRIGGER:"velt-inline-comments-section-filter-dropdown-trigger",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_TRIGGER_NAME:"velt-inline-comments-section-filter-dropdown-trigger-name",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_TRIGGER_ARROW:"velt-inline-comments-section-filter-dropdown-trigger-arrow",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT:"velt-inline-comments-section-filter-dropdown-content",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_LIST:"velt-inline-comments-section-filter-dropdown-content-list",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_LIST_ITEM:"velt-inline-comments-section-filter-dropdown-content-list-item",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_LIST_ITEM_CHECKBOX:"velt-inline-comments-section-filter-dropdown-content-list-item-checkbox",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_LIST_ITEM_LABEL:"velt-inline-comments-section-filter-dropdown-content-list-item-label",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_APPLY_BUTTON:"velt-inline-comments-section-filter-dropdown-content-apply-button",VELT_COMMENTS_MINIMAP:"velt-comments-minimap",VELT_HIGHLIGHT_USER_TEXT:"velt-highlight-user-text",VELT_AUDIO_HUDDLE:"velt-audio-huddle",VELT_VIDEO_HUDDLE:"velt-video-huddle",VELT_HUDDLE:"velt-huddle",VELT_HUDDLE_TOOL:"velt-huddle-tool",VELT_RECORDER_TOOL:"velt-recorder-tool",SUPERFLOW_TOOLBAR:"superflow-toolbar",VELT_MENU:"velt-menu",VELT_COMMENT_DIALOG:"velt-comment-dialog-internal",VELT_SIDEBAR_BUTTON:"velt-sidebar-button",VELT_COMMENTS_SIDEBAR_BUTTON:"velt-comments-sidebar-button",VELT_REWRITER:"velt-rewriter",VELT_USER_INVITE_TOOL:"velt-user-invite-tool",VELT_USER_REQUEST_TOOL:"velt-user-request-tool",VELT_USER_AVATAR:"velt-user-avatar",VELT_ARROW_TOOL:"velt-arrow-tool",VELT_ARROWS:"velt-arrows",VELT_AREA_TOOL:"velt-area-tool",VELT_AREAS:"velt-areas",VELT_INLINE_COMMENT:"velt-inline-comment",VELT_VIDEO_PLAYER:"velt-video-player",VELT_VIDEO_COMMENTS_TIMELINE:"velt-comment-player-timeline",VELT_REACTION_TOOL:"velt-reaction-tool",SNIPPYLY_REACTION_TOOL:"snippyly-reaction-tool",VELT_REACTION_PIN:"velt-reaction-pin",SNIPPYLY_REACTION_PIN:"snippyly-reaction-pin",VELT_INLINE_REACTIONS_SECTION:"velt-inline-reactions-section",SNIPPYLY_INLINE_REACTIONS_SECTION:"snippyly-inline-reactions-section",VELT_VIEW_ANALYTICS:"velt-view-analytics",VELT_NOTIFICATIONS_TOOL:"velt-notifications-tool",VELT_NOTIFICATIONS_TOOL_ICON:"velt-notifications-tool-icon",VELT_NOTIFICATIONS_TOOL_UNREAD_ICON:"velt-notifications-tool-unread-icon",VELT_NOTIFICATIONS_TOOL_LABEL:"velt-notifications-tool-label",VELT_NOTIFICATIONS_TOOL_UNREAD_COUNT:"velt-notifications-tool-unread-count",VELT_NOTIFICATIONS_PANEL:"velt-notifications-panel",VELT_NOTIFICATIONS_PANEL_TITLE:"velt-notifications-panel-title",VELT_NOTIFICATIONS_PANEL_TITLE_TEXT:"velt-notifications-panel-title-text",VELT_NOTIFICATIONS_PANEL_HEADER:"velt-notifications-panel-header",VELT_NOTIFICATIONS_PANEL_HEADER_TAB_FOR_YOU:"velt-notifications-panel-header-tab-for-you",VELT_NOTIFICATIONS_PANEL_HEADER_TAB_PEOPLE:"velt-notifications-panel-header-tab-people",VELT_NOTIFICATIONS_PANEL_HEADER_TAB_DOCUMENTS:"velt-notifications-panel-header-tab-documents",VELT_NOTIFICATIONS_PANEL_HEADER_TAB_ALL:"velt-notifications-panel-header-tab-all",VELT_NOTIFICATIONS_PANEL_CONTENT:"velt-notifications-panel-content",VELT_NOTIFICATIONS_PANEL_CONTENT_FOR_YOU:"velt-notifications-panel-content-for-you",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL:"velt-notifications-panel-content-all",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE:"velt-notifications-panel-content-people",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS:"velt-notifications-panel-content-documents",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST:"velt-notifications-panel-content-list",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM:"velt-notifications-panel-content-list-item",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_AVATAR:"velt-notifications-panel-content-list-item-avatar",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_UNREAD:"velt-notifications-panel-content-list-item-unread",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_HEADLINE:"velt-notifications-panel-content-list-item-headline",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_BODY:"velt-notifications-panel-content-list-item-body",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_FILE_NAME:"velt-notifications-panel-content-list-item-file-name",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_TIME:"velt-notifications-panel-content-list-item-time",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_LIST:"velt-notifications-panel-content-all-list",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_LIST_ITEM:"velt-notifications-panel-content-all-list-item",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_LIST_ITEM_LABEL:"velt-notifications-panel-content-all-list-item-label",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_LIST_ITEM_CONTENT:"velt-notifications-panel-content-all-list-item-content",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST:"velt-notifications-panel-content-people-list",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM:"velt-notifications-panel-content-people-list-item",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM_AVATAR:"velt-notifications-panel-content-people-list-item-avatar",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM_NAME:"velt-notifications-panel-content-people-list-item-name",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM_COUNT:"velt-notifications-panel-content-people-list-item-count",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM_CONTENT:"velt-notifications-panel-content-people-list-item-content",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST:"velt-notifications-panel-content-documents-list",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM:"velt-notifications-panel-content-documents-list-item",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM_NAME:"velt-notifications-panel-content-documents-list-item-name",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM_COUNT:"velt-notifications-panel-content-documents-list-item-count",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM_CONTENT:"velt-notifications-panel-content-documents-list-item-content",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM_UNREAD:"velt-notifications-panel-content-documents-list-item-unread",VELT_NOTIFICATIONS_PANEL_CONTENT_LOAD_MORE:"velt-notifications-panel-content-load-more",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_READ_CONTAINER:"velt-notifications-panel-content-all-read-container",VELT_NOTIFICATIONS_PANEL_CLOSE_BUTTON:"velt-notifications-panel-close-button",VELT_NOTIFICATIONS_PANEL_READ_ALL_BUTTON:"velt-notifications-panel-read-all-button",VELT_NOTIFICATIONS_PANEL_VIEW_ALL_BUTTON:"velt-notifications-panel-view-all-button",VELT_NOTIFICATIONS_PANEL_SKELETON:"velt-notifications-panel-skeleton",VELT_NOTIFICATIONS_PANEL_SETTINGS_BUTTON:"velt-notifications-panel-settings-button",VELT_NOTIFICATIONS_PANEL_SETTINGS:"velt-notifications-panel-settings",VELT_NOTIFICATIONS_PANEL_SETTINGS_HEADER:"velt-notifications-panel-settings-header",VELT_NOTIFICATIONS_PANEL_SETTINGS_HEADER_TITLE:"velt-notifications-panel-settings-header-title",VELT_NOTIFICATIONS_PANEL_SETTINGS_TITLE:"velt-notifications-panel-settings-title",VELT_NOTIFICATIONS_PANEL_SETTINGS_DESCRIPTION:"velt-notifications-panel-settings-description",VELT_NOTIFICATIONS_PANEL_SETTINGS_LIST:"velt-notifications-panel-settings-list",VELT_NOTIFICATIONS_PANEL_SETTINGS_MUTE_ALL_TITLE:"velt-notifications-panel-settings-mute-all-title",VELT_NOTIFICATIONS_PANEL_SETTINGS_MUTE_ALL_DESCRIPTION:"velt-notifications-panel-settings-mute-all-description",VELT_NOTIFICATIONS_PANEL_SETTINGS_MUTE_ALL_TOGGLE:"velt-notifications-panel-settings-mute-all-toggle",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION:"velt-notifications-panel-settings-accordion",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_TRIGGER:"velt-notifications-panel-settings-accordion-trigger",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_TRIGGER_LABEL:"velt-notifications-panel-settings-accordion-trigger-label",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_TRIGGER_ICON:"velt-notifications-panel-settings-accordion-trigger-icon",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_TRIGGER_SELECTED_VALUE:"velt-notifications-panel-settings-accordion-trigger-selected-value",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_CONTENT:"velt-notifications-panel-settings-accordion-content",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_CONTENT_ITEM:"velt-notifications-panel-settings-accordion-content-item",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_CONTENT_ITEM_LABEL:"velt-notifications-panel-settings-accordion-content-item-label",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_CONTENT_ITEM_ICON:"velt-notifications-panel-settings-accordion-content-item-icon",VELT_NOTIFICATIONS_PANEL_SETTINGS_BACK_BUTTON:"velt-notifications-panel-settings-back-button",VELT_NOTIFICATIONS_PANEL_SETTINGS_FOOTER:"velt-notifications-panel-settings-footer",VELT_NOTIFICATIONS_HISTORY_PANEL:"velt-notifications-history-panel",VELT_WIREFRAME:"velt-wireframe",VELT_AUTOCOMPLETE:"velt-autocomplete",VELT_AUTOCOMPLETE_PANEL:"velt-autocomplete-panel",VELT_AUTOCOMPLETE_OPTION:"velt-autocomplete-option",VELT_AUTOCOMPLETE_OPTION_ICON:"velt-autocomplete-option-icon",VELT_AUTOCOMPLETE_OPTION_NAME:"velt-autocomplete-option-name",VELT_AUTOCOMPLETE_OPTION_DESCRIPTION:"velt-autocomplete-option-description",VELT_AUTOCOMPLETE_OPTION_ERROR_ICON:"velt-autocomplete-option-error-icon",VELT_AUTOCOMPLETE_GROUP_OPTION:"velt-autocomplete-group-option",VELT_AUTOCOMPLETE_TOOL:"velt-autocomplete-tool",VELT_AUTOCOMPLETE_EMPTY:"velt-autocomplete-empty",VELT_AUTOCOMPLETE_CHIP:"velt-autocomplete-chip",VELT_AUTOCOMPLETE_CHIP_TOOLTIP:"velt-autocomplete-chip-tooltip",VELT_AUTOCOMPLETE_CHIP_TOOLTIP_ICON:"velt-autocomplete-chip-tooltip-icon",VELT_AUTOCOMPLETE_CHIP_TOOLTIP_NAME:"velt-autocomplete-chip-tooltip-name",VELT_AUTOCOMPLETE_CHIP_TOOLTIP_DESCRIPTION:"velt-autocomplete-chip-tooltip-description",VELT_AUTOCOMPLETE_CONTEXT_WRAPPER:"velt-autocomplete-context-wrapper",VELT_ACTIVITY_LOG:"velt-activity-log",VELT_ACTIVITY_LOG_HEADER:"velt-activity-log-header",VELT_ACTIVITY_LOG_HEADER_TITLE:"velt-activity-log-header-title",VELT_ACTIVITY_LOG_HEADER_CLOSE_BUTTON:"velt-activity-log-header-close-button",VELT_ACTIVITY_LOG_HEADER_FILTER:"velt-activity-log-header-filter",VELT_ACTIVITY_LOG_HEADER_FILTER_TRIGGER:"velt-activity-log-header-filter-trigger",VELT_ACTIVITY_LOG_HEADER_FILTER_TRIGGER_LABEL:"velt-activity-log-header-filter-trigger-label",VELT_ACTIVITY_LOG_HEADER_FILTER_TRIGGER_ICON:"velt-activity-log-header-filter-trigger-icon",VELT_ACTIVITY_LOG_HEADER_FILTER_CONTENT:"velt-activity-log-header-filter-content",VELT_ACTIVITY_LOG_HEADER_FILTER_CONTENT_ITEM:"velt-activity-log-header-filter-content-item",VELT_ACTIVITY_LOG_HEADER_FILTER_CONTENT_ITEM_LABEL:"velt-activity-log-header-filter-content-item-label",VELT_ACTIVITY_LOG_HEADER_FILTER_CONTENT_ITEM_ICON:"velt-activity-log-header-filter-content-item-icon",VELT_ACTIVITY_LOG_LOADING:"velt-activity-log-loading",VELT_ACTIVITY_LOG_LIST:"velt-activity-log-list",VELT_ACTIVITY_LOG_LIST_DATE_GROUP:"velt-activity-log-list-date-group",VELT_ACTIVITY_LOG_LIST_DATE_GROUP_LABEL:"velt-activity-log-list-date-group-label",VELT_ACTIVITY_LOG_LIST_ITEM:"velt-activity-log-list-item",VELT_ACTIVITY_LOG_LIST_ITEM_ICON:"velt-activity-log-list-item-icon",VELT_ACTIVITY_LOG_LIST_ITEM_AVATAR:"velt-activity-log-list-item-avatar",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT:"velt-activity-log-list-item-content",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT_USER:"velt-activity-log-list-item-content-user",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT_ACTION:"velt-activity-log-list-item-content-action",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT_TARGET:"velt-activity-log-list-item-content-target",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT_DETAIL:"velt-activity-log-list-item-content-detail",VELT_ACTIVITY_LOG_LIST_ITEM_TIME:"velt-activity-log-list-item-time",VELT_ACTIVITY_LOG_LIST_SHOW_MORE:"velt-activity-log-list-show-more",VELT_ACTIVITY_LOG_EMPTY:"velt-activity-log-empty",VELT_ACTIVITY_LOG_CONTEXT_WRAPPER:"velt-activity-log-context-wrapper",VELT_COMMENT_DIALOG_VISIBILITY_BANNER:"velt-comment-dialog-visibility-banner",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_ICON:"velt-comment-dialog-visibility-banner-icon",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_TEXT:"velt-comment-dialog-visibility-banner-text",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN:"velt-comment-dialog-visibility-banner-dropdown",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER:"velt-comment-dialog-visibility-banner-dropdown-trigger",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_LABEL:"velt-comment-dialog-visibility-banner-dropdown-trigger-label",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST:"velt-comment-dialog-visibility-banner-dropdown-trigger-avatar-list",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST_ITEM:"velt-comment-dialog-visibility-banner-dropdown-trigger-avatar-list-item",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST_REMAINING_COUNT:"velt-comment-dialog-visibility-banner-dropdown-trigger-avatar-list-remaining-count",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_ICON:"velt-comment-dialog-visibility-banner-dropdown-trigger-icon",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT:"velt-comment-dialog-visibility-banner-dropdown-content",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM:"velt-comment-dialog-visibility-banner-dropdown-content-item",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM_ICON:"velt-comment-dialog-visibility-banner-dropdown-content-item-icon",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM_LABEL:"velt-comment-dialog-visibility-banner-dropdown-content-item-label",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_USER_PICKER:"velt-comment-dialog-visibility-banner-dropdown-content-user-picker",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ORG_PICKER:"velt-comment-dialog-visibility-banner-dropdown-content-org-picker",VELT_COMMENT_COMPOSER:"velt-comment-composer",VELT_SKELETON_LOADER:"velt-skeleton-loader",VELT_SHADOW_DOM_INTERNAL:"velt-shadow-dom-internal",VELT_SINGLE_EDITOR_MODE_PANEL:"velt-single-editor-mode-panel",VELT_MULTI_THREAD_COMMENT_DIALOG:"velt-multi-thread-comment-dialog",VELT_MULTI_THREAD_COMMENT_DIALOG_LIST:"velt-multi-thread-comment-dialog-list",VELT_MULTI_THREAD_COMMENT_DIALOG_PANEL:"velt-multi-thread-comment-dialog-panel",VELT_MULTI_THREAD_COMMENT_DIALOG_COMPOSER_CONTAINER:"velt-multi-thread-comment-dialog-composer-container",VELT_MULTI_THREAD_COMMENT_DIALOG_COMMENT_COUNT:"velt-multi-thread-comment-dialog-comment-count",VELT_MULTI_THREAD_COMMENT_DIALOG_EMPTY_PLACEHOLDER:"velt-multi-thread-comment-dialog-empty-placeholder",VELT_MULTI_THREAD_COMMENT_DIALOG_CLOSE_BUTTON:"velt-multi-thread-comment-dialog-close-button",VELT_MULTI_THREAD_COMMENT_DIALOG_NEW_THREAD_BUTTON:"velt-multi-thread-comment-dialog-new-thread-button",VELT_MULTI_THREAD_COMMENT_DIALOG_RESET_FILTER_BUTTON:"velt-multi-thread-comment-dialog-reset-filter-button",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN:"velt-multi-thread-comment-dialog-minimal-filter-dropdown",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_TRIGGER:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-trigger",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_FILTER_ALL:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-filter-all",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_FILTER_READ:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-filter-read",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_FILTER_RESOLVED:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-filter-resolved",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_FILTER_UNREAD:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-filter-unread",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_SELECTED_ICON:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-selected-icon",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_SORT_DATE:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-sort-date",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_SORT_UNREAD:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-sort-unread",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN:"velt-multi-thread-comment-dialog-minimal-actions-dropdown",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN_TRIGGER:"velt-multi-thread-comment-dialog-minimal-actions-dropdown-trigger",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN_CONTENT:"velt-multi-thread-comment-dialog-minimal-actions-dropdown-content",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN_CONTENT_MARK_ALL_READ:"velt-multi-thread-comment-dialog-minimal-actions-dropdown-content-mark-all-read",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN_CONTENT_MARK_ALL_RESOLVED:"velt-multi-thread-comment-dialog-minimal-actions-dropdown-content-mark-all-resolved",VELT_TEXT_COMMENT:"velt-text-comment",VELT_TEXT_COMMENT_TOOL:"velt-text-comment-tool",VELT_TEXT_COMMENT_TOOLBAR:"velt-text-comment-toolbar",VELT_TEXT_COMMENT_TOOLBAR_COMMENT_ANNOTATION:"velt-text-comment-toolbar-comment-annotation",VELT_TEXT_COMMENT_TOOLBAR_DIVIDER:"velt-text-comment-toolbar-divider",VELT_TEXT_COMMENT_TOOLBAR_COPYWRITER:"velt-text-comment-toolbar-copywriter",VELT_TEXT_COMMENT_TOOLBAR_GENERIC:"velt-text-comment-toolbar-generic"},U.ATTRIBUTES={VELT_COMMENT_CONTAINER:"data-velt-comment-container",VELT_TARGET_COMMENT_ELEMENT_ID:"data-velt-target-comment-element-id",VELT_COMMENT_TYPE:"data-velt-comment-type",TARGET_INLINE_COMMENT_ELEMENT_ID:"target-inline-comment-element-id",TARGET_COMMENT_ELEMENT_ID:"target-comment-element-id",TARGET_ELEMENT_ID:"target-element-id",VELT_ID:"data-velt-id",VELT_ELEMENT:"data-velt-element",VELT_SCREEN_RECORDER_PANEL:"data-velt-screen-recorder-panel",VELT_SOURCE_ID:"data-velt-source-id",VELT_ANNOTATION_ID:"data-velt-annotation-id",VELT_ANNOTATION_IDS:"data-velt-annotation-ids",VELT_COMMENT_PIN_HOST:"data-velt-comment-pin-host",VELT_COMMENT_PIN_HOST_STATIC:"data-velt-comment-pin-host-static",VELT_COMMENT_DISABLED:"data-velt-comment-disabled",VELT_MANUAL_COMMENT_CONTAINER:"data-velt-manual-comment-container",VELT_COMMENT_PIN_ACTIVE:"data-velt-comment-pin-active",VELT_INLINE_COMMENT_SECTION_CONFIG:"data-velt-inline-comment-section-config",VELT_TARGET_INLINE_COMMENT_ELEMENT_ID:"data-velt-target-inline-comment-element-id",VELT_TAG_PIN_HOST:"data-velt-tag-pin-host",VELT_TAG_PIN_HOST_STATIC:"data-velt-tag-pin-host-static",VELT_TAG_DISABLED:"data-velt-tag-disabled",VELT_RECORDER_PIN_HOST:"data-velt-recorder-pin-host",VELT_RECORDER_PIN_HOST_STATIC:"data-velt-recorder-pin-host-static",VELT_RECORDER_DISABLED:"data-velt-recorder-disabled",VELT_ANNOTATION_DRAFT:"data-velt-annotation-draft",VELT_ANNOTATION_EDIT_COMMENT:"data-velt-annotation-edit-comment",VELT_DOCUMENT_ID:"data-velt-document-id",VELT_LOCATION:"data-velt-location",VELT_LOCATION_ID:"data-velt-location-id",VELT_THEME:"data-velt-theme",VELT_IGNORE:"data-velt-ignore",EMBED_MODE:"embed-mode",DEFAULT_CURSOR:"default-cursor",VELT_HUDDLE_ON_CURSOR_MODE:"data-velt-huddle-on-cursor-mode",VELT_SELECTION_ENABLED:"data-live-selection-enabled",VELT_LIVE_SELECTION_ENABLED:"data-velt-live-selection-enabled",VELT_LIVE_SELECTION_USER_INDICATOR_POSITION:"data-velt-live-selection-user-indicator-position",VELT_LIVE_SELECTION_USER_INDICATOR_TYPE:"data-velt-live-selection-user-indicator-type",VELT_SELECTION_CONFIG:"data-live-selection-config",VELT_POPOVER_MODE:"data-velt-popover-mode",VELT_ELEMENT_CACHE_ID:"data-velt-cache-id",VELT_ARROW_PIN_HOST:"data-velt-arrow-pin-host",VELT_ARROW_PIN_HOST_STATIC:"data-velt-arrow-pin-host-static",VELT_ARROW_DISABLED:"data-velt-arrow-disabled",VELT_AREA_PIN_HOST:"data-velt-area-pin-host",VELT_AREA_PIN_HOST_STATIC:"data-velt-area-pin-host-static",VELT_AREA_DISABLED:"data-velt-area-disabled",VELT_AREA_PIN_ACTIVE:"data-velt-area-pin-active",VELT_SUGGESTION_TARGET:"data-velt-suggestion-target",VELT_ONGOING_RECORDING:"data-velt-ongoing-recording",VELT_COMMENT_RECORDING:"data-velt-comment-recording",SYNC_VIDEO_PLAYER_ID:"data-sync-video-player-id",SYNC_VIDEO_PLAYER:"data-sync-video-player",VELT_INLINE_COMMENT_ID:"inline-comment-id",VELT_PDF_VIEWER:"data-velt-pdf-viewer",VELT_SYNC_STATE:"data-velt-sync-state",VELT_SYNC_ACCESS:"data-velt-sync-access",VELT_SYNC_ACCESS_AUTO:"data-velt-sync-access-auto",VELT_SYNC_ACCESS_DISABLED:"data-velt-sync-access-disabled",VELT_SINGLE_EDITOR_MODE_CONTAINER:"data-velt-single-editor-mode-container",VELT_IFRAME_CONTAINER:"data-velt-iframe-container",VELT_IFRAME_CONTAINER_STATIC:"data-velt-iframe-container-static",VELT_IS_FIRST_COMPONENT:"data-velt-is-first-component",VELT_DOWNLOAD_BUTTON:"velt-download-button",VELT_COMMENT_DIALOG_PORTAL_INTERNAL:"velt-comment-dialog-portal-internal",ANNOTATION_ID:"annotation-id",MULTI_THREAD_ANNOTATION_ID:"multi-thread-annotation-id",SLATE_EDITOR:"data-slate-editor"},U.INJECTION_STYLE_PROPS={VELT_AVATAR_COLOR:"data-velt-avatar-color",VELT_COMMENT_PRIORITY_COLOR:"data-velt-priority-color"},U.BODY_CLASSES={VELT_PIN_DRAGGING:"velt-pin-dragging"},U.INJECTION_ATTRIBUTES={VELT_AVATAR_IMG:"data-velt-avatar-img",VELT_COMMENT_LENGTH:"data-velt-comment-thread-length"},U.SESSION_STORAGE={SNIPPYLY_AUTO_SELECT_ANNOTATION_ID:"snippylyAutoSelectAnnotationId",SNIPPYLY_SELECTED_ANNOTATION_ID:"snippylySelectedAnnotationId",SNIPPYLY_COMMENT_SIDEBAR_FILTERS:"snippylyCommentSidebarFilters",SNIPPYLY_COMMENT_SIDEBAR_GROUP_BY:"snippylyCommentSidebarGroupBy",SNIPPYLY_COMMENT_DIALOG_AUTO_POPULATE_TEXT:"snippylyCommentDialogAutoPopulateText",SNIPPYLY_HUDDLE_DATA:"snippylyHuddleData",VELT_TAB_ID:"veltTabId",VELT_COMMENT_SIDEBAR_FILTERS_RESET:"veltCommentSidebarFiltersReset",VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE:"veltCommentSidebarCustomActionsState",VELT_CURSOR_MULTIPLE_USERS_DETECTED:"veltCursorMultipleUsersDetected",VELT_PRESENCE_MULTIPLE_USERS_DETECTED:"veltPresenceMultipleUsersDetected",VELT_PRESENCE_MULTIPLE_USERS_ONLINE:"veltPresenceMultipleUsersOnline",VELT_CUSTOM_PRIORITY_MAP:"veltCustomPriorityMap",VELT_CUSTOM_STATUS_MAP:"veltCustomStatusMap",VELT_CUSTOM_CATEGORY_MAP:"veltCustomCategoryMap"},U.LOCAL_STORAGE={SNIPPYLY_DEFAULT_MEDIA_SOURCE_OPTIONS:"snippylyDefaultMediaSourceOptions",SNIPPYLY_QUEUED_COMMENT:"snippylyQueuedComment",VELT_USER:"_vu",VELT_IDENTIFY_USER:"_viu",VELT_USER_FORCE_RE_LOGGED_IN:"_vurli",VELT_VERSION:"_vv",VELT_ADVANCED_QUERIES:"_vadq",VELT_COMMENT_VIEWS_MIGRATED:"_vcvm",VELT_AUTH_PROXY_HOST:"_vaph",VELT_PORTABLE_SESSION:"_vps",VELT_PORTABLE_SIGNED_OUT:"_vpso"},U.NON_NESTABLE_ELEMENTS={img:!0,video:!0,audio:!0,input:!0,meter:!0,progress:!0,select:!0,textarea:!0,svg:!0,"lottie-player":!0,"ng-lottie":!0,canvas:!0,hr:!0,iframe:!0},U.INGNORE_MUTATION_OBSERVER_CHANGE_TAGS={svg:!0},U.SELECTION_ENABLED_ELEMENTS={input:!0,textarea:!0,select:!0,button:!0},U.URL_PARAMS={REVIEW_MODE:"review",REVIEW_DOC_ID:"sreviewId",SNIPPYLY_USER:"snippyly-user",COMMENT_ID:"scommentId",TAG_ID:"stagId",RECORDER_ID:"srecorderId",PROJECT_INSTALL:"sprojectInstall"},U.VELT_BASE_REM_UNIT="--velt-base-rem-unit",U.VELT_VIEWPORT_WIDTH="--legacy-velt-viewport-width",U.VELT_VIEWPORT_HEIGHT="--legacy-velt-viewport-height",U.VELT_SELECTION_COLOR="--velt-selection-color",U.VELT_MIN_ARROW_LENGTH=100,U.VELT_ARROW_VIEWPORT_PADDING=20,U.LIVE_STATE_REQUEST_EDITOR_ACCESS_WAIT_TIME=5,U.CURSOR={COMMENT_PIN:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0iIzYyNURGNSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV8yMDMyXzIzNjgxIiBmaWxsPSJ3aGl0ZSI+CjxwYXRoIGQ9Ik0wLjM1Mjk0MSAxOEMwLjE1ODAxNyAxOCAtNi45MDcxNWUtMDkgMTcuODQyIC0xLjU0Mjc1ZS0wOCAxNy42NDcxTC0zLjkzNDAyZS0wNyA5Qy02LjEwNjczZS0wNyA0LjAyOTQ0IDQuMDI5NDQgLTEuNzYxMzJlLTA3IDkgLTMuOTM0MDJlLTA3Vi0zLjkzNDAyZS0wN0MxMy45NzA2IC02LjEwNjczZS0wNyAxOCA0LjAyOTQ0IDE4IDlWOUMxOCAxMy45NzA2IDEzLjk3MDYgMTggOSAxOEwwLjM1Mjk0MSAxOFoiLz4KPC9tYXNrPgo8cGF0aCBkPSJNMC4zNTI5NDEgMThDMC4xNTgwMTcgMTggLTYuOTA3MTVlLTA5IDE3Ljg0MiAtMS41NDI3NWUtMDggMTcuNjQ3MUwtMy45MzQwMmUtMDcgOUMtNi4xMDY3M2UtMDcgNC4wMjk0NCA0LjAyOTQ0IC0xLjc2MTMyZS0wNyA5IC0zLjkzNDAyZS0wN1YtMy45MzQwMmUtMDdDMTMuOTcwNiAtNi4xMDY3M2UtMDcgMTggNC4wMjk0NCAxOCA5VjlDMTggMTMuOTcwNiAxMy45NzA2IDE4IDkgMThMMC4zNTI5NDEgMThaIiBmaWxsPSIjMTQxNDE2Ii8+CjxwYXRoIGQ9Ik0wLjM1Mjk0MSAxOEMwLjE1ODAxNyAxOCAtNi45MDcxNWUtMDkgMTcuODQyIC0xLjU0Mjc1ZS0wOCAxNy42NDcxTC0zLjkzNDAyZS0wNyA5Qy02LjEwNjczZS0wNyA0LjAyOTQ0IDQuMDI5NDQgLTEuNzYxMzJlLTA3IDkgLTMuOTM0MDJlLTA3Vi0zLjkzNDAyZS0wN0MxMy45NzA2IC02LjEwNjczZS0wNyAxOCA0LjAyOTQ0IDE4IDlWOUMxOCAxMy45NzA2IDEzLjk3MDYgMTggOSAxOEwwLjM1Mjk0MSAxOFoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfMjAzMl8yMzY4MSkiLz4KPC9zdmc+Cg==') 0 31, auto",TAG_PIN:"url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMzIgMzIiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczpieD0iaHR0cHM6Ly9ib3h5LXN2Zy5jb20iPgogIDxlbGxpcHNlIHN0eWxlPSJzdHJva2U6IHJnYigwLCAwLCAwKTsgZmlsbDogcmdiKDE2MiwgODksIDI1NCk7IHBhaW50LW9yZGVyOiBmaWxsOyBzdHJva2Utd2lkdGg6IDBweDsiIGN4PSIxNiIgY3k9IjE2IiByeD0iMTYiIHJ5PSIxNiIvPgogIDxwYXRoIGQ9Ik0gOS4zMzMgMjIgQyA5LjMzMyAyMiA4IDIyIDggMjAuNjY3IEMgOCAxOS4zMzMgOS4zMzMgMTUuMzMzIDE2IDE1LjMzMyBDIDIyLjY2NyAxNS4zMzMgMjQgMTkuMzMzIDI0IDIwLjY2NyBDIDI0IDIyIDIyLjY2NyAyMiAyMi42NjcgMjIgTCA5LjMzMyAyMiBaIE0gMTYgMTQgQyAxOS4wNzkgMTQgMjEuMDA0IDEwLjY2NyAxOS40NjQgOCBDIDE4Ljc1IDYuNzYyIDE3LjQyOSA2IDE2IDYgQyAxMi45MjEgNiAxMC45OTYgOS4zMzMgMTIuNTM2IDEyIEMgMTMuMjUgMTMuMjM3IDE0LjU3MSAxNCAxNiAxNCBaIiBzdHlsZT0iZmlsbDogcmdiKDI1NSwgMjU1LCAyNTUpOyIgYng6b3JpZ2luPSIwLjUgMC41Ii8+Cjwvc3ZnPg==') 16 16, auto",ARROW_PIN:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNiAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44MDU0IDEwLjAyMDdDMTQuNTQxMiA5Ljk5MTMxIDE1LjExMzggOS4zNzA5OCAxNS4wODQzIDguNjM1MThMMTQuODMwNiAyLjI4OTM5QzE0LjgwMjggMS41OTQ4NiAxNC4yNDYxIDEuMDM4MTkgMTMuNTUxNiAxLjAxMDQxTDcuMjA1NzEgMC43NTY1MzdDNi40Njk5MiAwLjcyNzEwMiA1Ljg0OTU4IDEuMjk5NzIgNS44MjAxNSAyLjAzNTUxQzUuNzkwNzEgMi43NzEzIDYuMzYzMzMgMy4zOTE2NCA3LjA5OTEyIDMuNDIxMDdMMTAuNDAyMSAzLjU1MzIxTDEuMjQxNzcgMTIuNzEzNkMwLjcyMTA2NyAxMy4yMzQzIDAuNzIxMDY3IDE0LjA3ODUgMS4yNDE3NyAxNC41OTkyQzEuNzYyNDYgMTUuMTE5OSAyLjYwNjY4IDE1LjExOTkgMy4xMjczOCAxNC41OTkyTDEyLjI4NzcgNS40Mzg4NkwxMi40MTk4IDguNzQxNzVDMTIuNDQ5MiA5LjQ3NzU0IDEzLjA2OTYgMTAuMDUwMiAxMy44MDU0IDEwLjAyMDdaIiBmaWxsPSIjOEY5NUIyIi8+Cjwvc3ZnPgo=) 15 0, auto",AREA_PIN:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNiAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44MDU0IDEwLjAyMDdDMTQuNTQxMiA5Ljk5MTMxIDE1LjExMzggOS4zNzA5OCAxNS4wODQzIDguNjM1MThMMTQuODMwNiAyLjI4OTM5QzE0LjgwMjggMS41OTQ4NiAxNC4yNDYxIDEuMDM4MTkgMTMuNTUxNiAxLjAxMDQxTDcuMjA1NzEgMC43NTY1MzdDNi40Njk5MiAwLjcyNzEwMiA1Ljg0OTU4IDEuMjk5NzIgNS44MjAxNSAyLjAzNTUxQzUuNzkwNzEgMi43NzEzIDYuMzYzMzMgMy4zOTE2NCA3LjA5OTEyIDMuNDIxMDdMMTAuNDAyMSAzLjU1MzIxTDEuMjQxNzcgMTIuNzEzNkMwLjcyMTA2NyAxMy4yMzQzIDAuNzIxMDY3IDE0LjA3ODUgMS4yNDE3NyAxNC41OTkyQzEuNzYyNDYgMTUuMTE5OSAyLjYwNjY4IDE1LjExOTkgMy4xMjczOCAxNC41OTkyTDEyLjI4NzcgNS40Mzg4NkwxMi40MTk4IDguNzQxNzVDMTIuNDQ5MiA5LjQ3NzU0IDEzLjA2OTYgMTAuMDUwMiAxMy44MDU0IDEwLjAyMDdaIiBmaWxsPSIjOEY5NUIyIi8+Cjwvc3ZnPgo=) 16 0, auto"},U.VIDEO_POSTER_DEFAULT_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADIAQMAAABoEU4WAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAGUExURQAAAAEAAKSl0/gAAAAxSURBVFjD7dBBDQAgCABARjKjGZUofi0Ac+4uwkUAAAAAAMCIpYD/bQVNSsEtFfCaA8vLAaMbkVUtAAAAAElFTkSuQmCC",U.HUDDLE_TYPE_CONFIGS={audio:{audio:!0,video:!1,presentation:!1},video:{audio:!0,video:!0,presentation:!1},presentation:{audio:!1,video:!1,presentation:!0}},U.RecorderModes={VIDEO:"video",AUDIO:"audio",SCREEN:"screen",ALL:"all"},U.CommentAnnotationStatusMap={OPEN:{id:"OPEN",name:"Open",color:"var(--velt-accent, #625DF5)",lightColor:"var(--velt-accent-light, #E7E8FA)",type:"default",svg:`
|
|
6
6
|
<svg
|
|
7
7
|
width="16"
|
|
@@ -145,12 +145,12 @@ ${n.map((r,i)=>`${i+1}) ${r.toString()}`).join(`
|
|
|
145
145
|
`:"")+s+` Recent session events (most recent last, times relative to now):
|
|
146
146
|
`+(o.length?o.join(`
|
|
147
147
|
`):" (no events recorded)")+`
|
|
148
|
-
This block prints once per distinct problem. If a realtime feature looks stuck, copy it into the issue \u2014 it contains no credentials.`)}catch{}}var rne={fetch:(t,e)=>fetch(t,e)},ine=5e3;function one(t){return`${t.replace(/\/+$/,"")}/operations/getProjectConfig`}function sne(t,e){return y(this,null,function*(){let n=typeof AbortController<"u"?new AbortController:null,r,i=new Promise(o=>{r=setTimeout(()=>{try{n?.abort()}catch{}o(null)},ine)});try{return yield Promise.race([rne.fetch(t,n?Ee(B({},e),{signal:n.signal}):e),i])}finally{r!==void 0&&clearTimeout(r)}})}function KG(t){return y(this,null,function*(){let{apiEndpoint:e,token:n}=t;if(!e||!n)return null;if(!zc(e))return console.error(`Velt [portable backend]: refusing to send the session token to an insecure apiEndpoint (${e}). Project config was not read; https is required (http is allowed on loopback only).`),null;try{let r=yield sne(one(e),{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({})});if(!r)return null;let i=yield r.json();return!i||i.ok!==!0||!i.data?null:{isPrivateCommentsEnabled:i.data.isPrivateCommentsEnabled===!0,activityConfig:i.data.activityConfig??null}}catch{return null}})}var ane=["unauthenticated","permission-denied","not-found","invalid-argument","failed-precondition","resource-exhausted"],YG=[...ane,"unimplemented"];function XG(t){return!!t&&t.backend==="portable"&&typeof t.wsEndpoint=="string"&&typeof t.apiEndpoint=="string"}var Ske="getaccess-any-user",Ake="ordered-deltas";var dy={import:()=>import("./velt-portable.js")},Tr=null,bp=!1;function QG(t){if(Tr)Tr=Tr.then(()=>dy.import().then(e=>{bp=!0,e.default(t)})).catch(e=>{M.catch("Error re-establishing portable session after re-identify: ",e)});else{let e=dy.import().then(n=>{bp=!0,n.default(t)}).catch(n=>{Tr===e&&(Tr=null),bp=!1,console.warn("Velt [portable backend]: failed to load the portable transport chunk (velt-portable.js). Portable features are disabled for this page load.",n)});Tr=e}return Tr}function JG(){Tr&&(Tr=Tr.then(()=>bp?dy.import().then(t=>{t.teardownPortableBackend()}):void 0).catch(t=>{M.catch("Error tearing down portable backend session: ",t)}))}function ZG(){Tr&&(Tr=Tr.then(()=>bp?dy.import().then(t=>{t.checkPortableBackendLiveness?.()}):void 0).catch(t=>{M.catch("Error checking portable backend liveness: ",t)}))}var e2=(()=>{let e=class e{constructor(r){this.loggingService=r,this.initLocalStorageData()}initLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: initLocalStorageData","color: green;"),this.getLocalStorageData(),this.getSessionStorageData()}getLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: getLocalStorageData","color: green;");try{let r=localStorage?.getItem(F.LOCALSTORAGE_DATA_ID);if(r)return JSON.parse(r);{let i=new bc;return this.setLocalStorageData(i),i}}catch(r){return this.loggingService.catch("Error in getLocalStorageData:",r),new bc}}setLocalStorageData(r){this.loggingService.log("%c[WB] Calling FUNCTION: setLocalStorageData","color: green;");try{if(r){let i=JSON.stringify(r);localStorage?.setItem(F.LOCALSTORAGE_DATA_ID,i)}}catch(i){this.loggingService.catch("Error in setLocalStorageData:",i)}}deleteLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: deleteLocalStorageData","color: green;"),localStorage?.removeItem(F.LOCALSTORAGE_DATA_ID)}getSessionStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: getSessionStorageData","color: green;");try{let r=sessionStorage?.getItem(F.LOCALSTORAGE_DATA_ID);if(r)return JSON.parse(r);{let i=new bc;return this.setSessionStorageData(i),i}}catch(r){return this.loggingService.catch("Error in getSessionStorageData:",r),new bc}}setSessionStorageData(r){this.loggingService.log("%c[WB] Calling FUNCTION: setSessionStorageData","color: green;");try{if(r){let i=JSON.stringify(r);sessionStorage?.setItem(F.LOCALSTORAGE_DATA_ID,i)}}catch(i){this.loggingService.catch("Error in setSessionStorageData:",i)}}deleteSessionStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: deleteSessionStorageData","color: green;");try{sessionStorage?.removeItem(F.LOCALSTORAGE_DATA_ID)}catch(r){this.loggingService.catch("Error in deleteSessionStorageData:",r)}}};e.\u0275fac=function(i){return new(i||e)($(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var t2=(()=>{let e=class e{constructor(r,i){this.localStorageService=r,this.loggingService=i,this.avatarList=[{userId:"1",name:"Bear",photoUrl:"https://snippyly.com/assets/avatars/avatar-bear.svg",type:"anonymous"},{userId:"2",name:"Beaver",photoUrl:"https://snippyly.com/assets/avatars/avatar-beaver.svg",type:"anonymous"},{userId:"3",name:"Bunny",photoUrl:"https://snippyly.com/assets/avatars/avatar-bunny.svg",type:"anonymous"},{userId:"4",name:"Cat",photoUrl:"https://snippyly.com/assets/avatars/avatar-cat.svg",type:"anonymous"},{userId:"5",name:"Cow",photoUrl:"https://snippyly.com/assets/avatars/avatar-cow.svg",type:"anonymous"},{userId:"6",name:"Dinosaur",photoUrl:"https://snippyly.com/assets/avatars/avatar-dinosaur.svg",type:"anonymous"},{userId:"7",name:"Elephant",photoUrl:"https://snippyly.com/assets/avatars/avatar-elephant.svg",type:"anonymous"},{userId:"8",name:"Monkey",photoUrl:"https://snippyly.com/assets/avatars/avatar-monkey.svg",type:"anonymous"},{userId:"9",name:"Hedgehog",photoUrl:"https://snippyly.com/assets/avatars/avatar-hedgehog.svg",type:"anonymous"},{userId:"10",name:"Hippo",photoUrl:"https://snippyly.com/assets/avatars/avatar-hippo.svg",type:"anonymous"},{userId:"11",name:"Horse",photoUrl:"https://snippyly.com/assets/avatars/avatar-horse.svg",type:"anonymous"},{userId:"12",name:"Kitten",photoUrl:"https://snippyly.com/assets/avatars/avatar-kitten.svg",type:"anonymous"},{userId:"13",name:"Octopus",photoUrl:"https://snippyly.com/assets/avatars/avatar-octopus.svg",type:"anonymous"},{userId:"14",name:"Oink",photoUrl:"https://snippyly.com/assets/avatars/avatar-oink.svg",type:"anonymous"},{userId:"15",name:"Panda",photoUrl:"https://snippyly.com/assets/avatars/avatar-panda.svg",type:"anonymous"},{userId:"16",name:"Penguin",photoUrl:"https://snippyly.com/assets/avatars/avatar-penguin.svg",type:"anonymous"},{userId:"17",name:"Rabbit",photoUrl:"https://snippyly.com/assets/avatars/avatar-rabbit.svg",type:"anonymous"},{userId:"18",name:"Tiger",photoUrl:"https://snippyly.com/assets/avatars/avatar-tiger.svg",type:"anonymous"}],this.loggingService.log("%c[WB] Creating SERVICE AvatarService","color: blue;")}getSessionAvatar(){this.loggingService.log("%c[WB] Calling FUNCTION: getSessionAvatar","color: green;");try{let r=new zi,i=this.localStorageService.getSessionStorageData();if(i.snippylyAvatar)r=i.snippylyAvatar;else{let o=this.generateUserAvatar();i.snippylyAvatar=o,this.localStorageService.setSessionStorageData(i)}return r}catch(r){return this.loggingService.catch("Error in getSessionAvatar:",r),new zi}}generateUserAvatar(){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserAvatar","color: green;");try{let r=Math.floor(Math.random()*this.avatarList.length),i=this.avatarList[r];return i.color=this.generateUserColor(),i}catch(r){return this.loggingService.catch("Error in generateUserAvatar:",r),this.avatarList[0]}}generateUserColor(r){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserColor","color: green;");try{if(r)return F.AVATAR_COLOR_LIST[r%F.AVATAR_COLOR_LIST.length];let i=Math.floor(Math.random()*F.AVATAR_COLOR_LIST.length);return F.AVATAR_COLOR_LIST[i]}catch(i){return this.loggingService.catch("Error in generateUserColor:",i),""}}generateUserImage(){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserImage","color: green;");try{return this.getSessionAvatar().photoUrl}catch(r){return this.loggingService.catch("Error in generateUserImage:",r),""}}};e.\u0275fac=function(i){return new(i||e)($(e2),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var n2=(()=>{let e=class e{constructor(r){this.loggingService=r,this.actionSubjects=new Map,this.subscriptions=[]}triggerAction(r,i){try{this.actionSubjects.has(r)||this.actionSubjects.set(r,new Rt),this.actionSubjects.get(r)?.next(i)}catch(o){this.loggingService.catch("Error in CoreActionsService triggerAction: ",o)}}onAction(r){try{this.actionSubjects.has(r)||this.actionSubjects.set(r,new Rt);let i=this.actionSubjects.get(r);return i?i.asObservable():lt(null)}catch(i){return this.loggingService.catch("Error in CoreActionsService onAction: ",i),lt(null)}}};e.\u0275fac=function(i){return new(i||e)($(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function r2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function dne(t){if(Array.isArray(t))return t}function hne(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(d){l=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}function fne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
148
|
+
This block prints once per distinct problem. If a realtime feature looks stuck, copy it into the issue \u2014 it contains no credentials.`)}catch{}}var rne={fetch:(t,e)=>fetch(t,e)},ine=5e3;function one(t){return`${t.replace(/\/+$/,"")}/operations/getProjectConfig`}function sne(t,e){return y(this,null,function*(){let n=typeof AbortController<"u"?new AbortController:null,r,i=new Promise(o=>{r=setTimeout(()=>{try{n?.abort()}catch{}o(null)},ine)});try{return yield Promise.race([rne.fetch(t,n?Ee(B({},e),{signal:n.signal}):e),i])}finally{r!==void 0&&clearTimeout(r)}})}function KG(t){return y(this,null,function*(){let{apiEndpoint:e,token:n}=t;if(!e||!n)return null;if(!zc(e))return console.error(`Velt [portable backend]: refusing to send the session token to an insecure apiEndpoint (${e}). Project config was not read; https is required (http is allowed on loopback only).`),null;try{let r=yield sne(one(e),{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({})});if(!r)return null;let i=yield r.json();return!i||i.ok!==!0||!i.data?null:{isPrivateCommentsEnabled:i.data.isPrivateCommentsEnabled===!0,activityConfig:i.data.activityConfig??null}}catch{return null}})}var ane=["unauthenticated","permission-denied","not-found","invalid-argument","failed-precondition","resource-exhausted"],YG=[...ane,"unimplemented"];function XG(t){return!!t&&t.backend==="portable"&&typeof t.wsEndpoint=="string"&&typeof t.apiEndpoint=="string"}var Ske="getaccess-any-user",Ake="ordered-deltas",Cke="doc-notification-views",Dke="fetch-folders-include-children",Rke="notification-timestamp-by-document",Nke="per-editor-crdt-fold";var dy={import:()=>import("./velt-portable.js")},Tr=null,bp=!1;function QG(t){if(Tr)Tr=Tr.then(()=>dy.import().then(e=>{bp=!0,e.default(t)})).catch(e=>{M.catch("Error re-establishing portable session after re-identify: ",e)});else{let e=dy.import().then(n=>{bp=!0,n.default(t)}).catch(n=>{Tr===e&&(Tr=null),bp=!1,console.warn("Velt [portable backend]: failed to load the portable transport chunk (velt-portable.js). Portable features are disabled for this page load.",n)});Tr=e}return Tr}function JG(){Tr&&(Tr=Tr.then(()=>bp?dy.import().then(t=>{t.teardownPortableBackend()}):void 0).catch(t=>{M.catch("Error tearing down portable backend session: ",t)}))}function ZG(){Tr&&(Tr=Tr.then(()=>bp?dy.import().then(t=>{t.checkPortableBackendLiveness?.()}):void 0).catch(t=>{M.catch("Error checking portable backend liveness: ",t)}))}var e2=(()=>{let e=class e{constructor(r){this.loggingService=r,this.initLocalStorageData()}initLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: initLocalStorageData","color: green;"),this.getLocalStorageData(),this.getSessionStorageData()}getLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: getLocalStorageData","color: green;");try{let r=localStorage?.getItem(F.LOCALSTORAGE_DATA_ID);if(r)return JSON.parse(r);{let i=new bc;return this.setLocalStorageData(i),i}}catch(r){return this.loggingService.catch("Error in getLocalStorageData:",r),new bc}}setLocalStorageData(r){this.loggingService.log("%c[WB] Calling FUNCTION: setLocalStorageData","color: green;");try{if(r){let i=JSON.stringify(r);localStorage?.setItem(F.LOCALSTORAGE_DATA_ID,i)}}catch(i){this.loggingService.catch("Error in setLocalStorageData:",i)}}deleteLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: deleteLocalStorageData","color: green;"),localStorage?.removeItem(F.LOCALSTORAGE_DATA_ID)}getSessionStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: getSessionStorageData","color: green;");try{let r=sessionStorage?.getItem(F.LOCALSTORAGE_DATA_ID);if(r)return JSON.parse(r);{let i=new bc;return this.setSessionStorageData(i),i}}catch(r){return this.loggingService.catch("Error in getSessionStorageData:",r),new bc}}setSessionStorageData(r){this.loggingService.log("%c[WB] Calling FUNCTION: setSessionStorageData","color: green;");try{if(r){let i=JSON.stringify(r);sessionStorage?.setItem(F.LOCALSTORAGE_DATA_ID,i)}}catch(i){this.loggingService.catch("Error in setSessionStorageData:",i)}}deleteSessionStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: deleteSessionStorageData","color: green;");try{sessionStorage?.removeItem(F.LOCALSTORAGE_DATA_ID)}catch(r){this.loggingService.catch("Error in deleteSessionStorageData:",r)}}};e.\u0275fac=function(i){return new(i||e)($(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var t2=(()=>{let e=class e{constructor(r,i){this.localStorageService=r,this.loggingService=i,this.avatarList=[{userId:"1",name:"Bear",photoUrl:"https://snippyly.com/assets/avatars/avatar-bear.svg",type:"anonymous"},{userId:"2",name:"Beaver",photoUrl:"https://snippyly.com/assets/avatars/avatar-beaver.svg",type:"anonymous"},{userId:"3",name:"Bunny",photoUrl:"https://snippyly.com/assets/avatars/avatar-bunny.svg",type:"anonymous"},{userId:"4",name:"Cat",photoUrl:"https://snippyly.com/assets/avatars/avatar-cat.svg",type:"anonymous"},{userId:"5",name:"Cow",photoUrl:"https://snippyly.com/assets/avatars/avatar-cow.svg",type:"anonymous"},{userId:"6",name:"Dinosaur",photoUrl:"https://snippyly.com/assets/avatars/avatar-dinosaur.svg",type:"anonymous"},{userId:"7",name:"Elephant",photoUrl:"https://snippyly.com/assets/avatars/avatar-elephant.svg",type:"anonymous"},{userId:"8",name:"Monkey",photoUrl:"https://snippyly.com/assets/avatars/avatar-monkey.svg",type:"anonymous"},{userId:"9",name:"Hedgehog",photoUrl:"https://snippyly.com/assets/avatars/avatar-hedgehog.svg",type:"anonymous"},{userId:"10",name:"Hippo",photoUrl:"https://snippyly.com/assets/avatars/avatar-hippo.svg",type:"anonymous"},{userId:"11",name:"Horse",photoUrl:"https://snippyly.com/assets/avatars/avatar-horse.svg",type:"anonymous"},{userId:"12",name:"Kitten",photoUrl:"https://snippyly.com/assets/avatars/avatar-kitten.svg",type:"anonymous"},{userId:"13",name:"Octopus",photoUrl:"https://snippyly.com/assets/avatars/avatar-octopus.svg",type:"anonymous"},{userId:"14",name:"Oink",photoUrl:"https://snippyly.com/assets/avatars/avatar-oink.svg",type:"anonymous"},{userId:"15",name:"Panda",photoUrl:"https://snippyly.com/assets/avatars/avatar-panda.svg",type:"anonymous"},{userId:"16",name:"Penguin",photoUrl:"https://snippyly.com/assets/avatars/avatar-penguin.svg",type:"anonymous"},{userId:"17",name:"Rabbit",photoUrl:"https://snippyly.com/assets/avatars/avatar-rabbit.svg",type:"anonymous"},{userId:"18",name:"Tiger",photoUrl:"https://snippyly.com/assets/avatars/avatar-tiger.svg",type:"anonymous"}],this.loggingService.log("%c[WB] Creating SERVICE AvatarService","color: blue;")}getSessionAvatar(){this.loggingService.log("%c[WB] Calling FUNCTION: getSessionAvatar","color: green;");try{let r=new zi,i=this.localStorageService.getSessionStorageData();if(i.snippylyAvatar)r=i.snippylyAvatar;else{let o=this.generateUserAvatar();i.snippylyAvatar=o,this.localStorageService.setSessionStorageData(i)}return r}catch(r){return this.loggingService.catch("Error in getSessionAvatar:",r),new zi}}generateUserAvatar(){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserAvatar","color: green;");try{let r=Math.floor(Math.random()*this.avatarList.length),i=this.avatarList[r];return i.color=this.generateUserColor(),i}catch(r){return this.loggingService.catch("Error in generateUserAvatar:",r),this.avatarList[0]}}generateUserColor(r){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserColor","color: green;");try{if(r)return F.AVATAR_COLOR_LIST[r%F.AVATAR_COLOR_LIST.length];let i=Math.floor(Math.random()*F.AVATAR_COLOR_LIST.length);return F.AVATAR_COLOR_LIST[i]}catch(i){return this.loggingService.catch("Error in generateUserColor:",i),""}}generateUserImage(){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserImage","color: green;");try{return this.getSessionAvatar().photoUrl}catch(r){return this.loggingService.catch("Error in generateUserImage:",r),""}}};e.\u0275fac=function(i){return new(i||e)($(e2),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var n2=(()=>{let e=class e{constructor(r){this.loggingService=r,this.actionSubjects=new Map,this.subscriptions=[]}triggerAction(r,i){try{this.actionSubjects.has(r)||this.actionSubjects.set(r,new Rt),this.actionSubjects.get(r)?.next(i)}catch(o){this.loggingService.catch("Error in CoreActionsService triggerAction: ",o)}}onAction(r){try{this.actionSubjects.has(r)||this.actionSubjects.set(r,new Rt);let i=this.actionSubjects.get(r);return i?i.asObservable():lt(null)}catch(i){return this.loggingService.catch("Error in CoreActionsService onAction: ",i),lt(null)}}};e.\u0275fac=function(i){return new(i||e)($(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function r2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function dne(t){if(Array.isArray(t))return t}function hne(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(d){l=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}function fne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
149
149
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pne(t,e){return dne(t)||hne(t,e)||gne(t,e)||fne()}function gne(t,e){if(t){if(typeof t=="string")return r2(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r2(t,e):void 0}}var _2=Object.entries,i2=Object.setPrototypeOf,mne=Object.isFrozen,Ene=Object.getPrototypeOf,_ne=Object.getOwnPropertyDescriptor,Qt=Object.freeze,ln=Object.seal,gd=Object.create,T2=typeof Reflect<"u"&&Reflect,kN=T2.apply,FN=T2.construct;Qt||(Qt=function(e){return e});ln||(ln=function(e){return e});kN||(kN=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(n,i)});FN||(FN=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});var Yc=kt(Array.prototype.forEach),Tne=kt(Array.prototype.lastIndexOf),o2=kt(Array.prototype.pop),Op=kt(Array.prototype.push),yne=kt(Array.prototype.splice),md=Array.isArray,Pp=kt(String.prototype.toLowerCase),bN=kt(String.prototype.toString),s2=kt(String.prototype.match),Mp=kt(String.prototype.replace),a2=kt(String.prototype.indexOf),Ine=kt(String.prototype.trim),vne=kt(Number.prototype.toString),Sne=kt(Boolean.prototype.toString),c2=typeof BigInt>"u"?null:kt(BigInt.prototype.toString),l2=typeof Symbol>"u"?null:kt(Symbol.prototype.toString),nr=kt(Object.prototype.hasOwnProperty),Lp=kt(Object.prototype.toString),Pn=kt(RegExp.prototype.test),Kc=Ane(TypeError);function kt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return kN(t,e,r)}}function Ane(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return FN(t,n)}}function xe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pp;if(i2&&i2(t,null),!md(e))return t;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){let o=n(i);o!==i&&(mne(e)||(e[r]=o),i=o)}t[i]=!0}return t}function Cne(t){for(let e=0;e<t.length;e++)nr(t,e)||(t[e]=null);return t}function Ir(t){let e=gd(null);for(let r of _2(t)){var n=pne(r,2);let i=n[0],o=n[1];nr(t,i)&&(md(o)?e[i]=Cne(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=Ir(o):e[i]=o)}return e}function Dne(t){switch(typeof t){case"string":return t;case"number":return vne(t);case"boolean":return Sne(t);case"bigint":return c2?c2(t):"0";case"symbol":return l2?l2(t):"Symbol()";case"undefined":return Lp(t);case"function":case"object":{if(t===null)return Lp(t);let e=t,n=Gr(e,"toString");if(typeof n=="function"){let r=n(e);return typeof r=="string"?r:Lp(r)}return Lp(t)}default:return Lp(t)}}function Gr(t,e){for(;t!==null;){let r=_ne(t,e);if(r){if(r.get)return kt(r.get);if(typeof r.value=="function")return kt(r.value)}t=Ene(t)}function n(){return null}return n}function Rne(t){try{return Pn(t,""),!0}catch{return!1}}var u2=Qt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ON=Qt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),MN=Qt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Nne=Qt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),LN=Qt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),wne=Qt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),d2=Qt(["#text"]),h2=Qt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),PN=Qt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),f2=Qt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),hy=Qt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bne=ln(/{{[\w\W]*|^[\w\W]*}}/g),One=ln(/<%[\w\W]*|^[\w\W]*%>/g),Mne=ln(/\${[\w\W]*/g),Lne=ln(/^data-[\-\w.\u00B7-\uFFFF]+$/),Pne=ln(/^aria-[\-\w]+$/),p2=ln(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xne=ln(/^(?:\w+script|data):/i),kne=ln(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fne=ln(/^html$/i),Une=ln(/^[a-z][.\w]*(-[.\w]+)+$/i),g2=ln(/<[/\w!]/g),m2=ln(/<[/\w]/g),Vne=ln(/<\/no(script|embed|frames)/i),Bne=ln(/\/>/i),yr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},y2=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Gne=Qt(xe({},y2)),jne=(function(){let t={};return Yc(y2,e=>{t[e]=ln(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),Qt(t)})(),Hne=function(){return typeof window>"u"?null:window},$ne=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));let o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},E2=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ks=function(e,n,r,i){return nr(e,n)&&md(e[n])?xe(i.base?Ir(i.base):{},e[n],i.transform):r},xN=function(e,n,r){let i=nr(e,n)?e[n]:void 0;return i&&typeof i=="object"?Ir(i):r()};function I2(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hne(),e=W=>I2(W);if(e.version="3.4.15",e.removed=[],!t||!t.document||t.document.nodeType!==yr.document||!t.Element)return e.isSupported=!1,e;let n=t.document,r=n,i=r.currentScript;t.DocumentFragment;let o=t.HTMLTemplateElement,s=t.Node,a=t.Element,c=t.NodeFilter,l=t.NamedNodeMap;l===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;let d=t.DOMParser,h=t.trustedTypes,f=a.prototype,g=Gr(f,"cloneNode"),E=Gr(f,"remove"),I=Gr(f,"removeAttributeNode"),S=Gr(f,"nextSibling"),L=Gr(f,"childNodes"),V=Gr(f,"parentNode"),K=Gr(f,"shadowRoot"),oe=Gr(f,"attributes"),ge=s&&s.prototype?Gr(s.prototype,"nodeType"):null,te=s&&s.prototype?Gr(s.prototype,"nodeName"):null,C=s&&s.prototype?Gr(s.prototype,"ownerDocument"):null,v=function(T){return ge?ge(T):T.nodeType},A=function(T){return te?te(T):T.nodeName};if(typeof o=="function"){let W=n.createElement("template");W.content&&W.content.ownerDocument&&(n=W.content.ownerDocument)}let R,N="",O,D=!1,Vn=0,es=function(){if(Vn>0)throw Kc('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ts=function(T){es(),Vn++;try{return R.createHTML(T)}finally{Vn--}},Da=function(T){es(),Vn++;try{return R.createScriptURL(T)}finally{Vn--}},Ra=function(){return D||(O=$ne(h,i),D=!0),O},ns=n,Fl=ns.implementation,hm=ns.createNodeIterator,_i=ns.createDocumentFragment,nn=ns.getElementsByTagName,kv=r.importNode,He=E2();e.isSupported=typeof _2=="function"&&typeof V=="function"&&Fl&&Fl.createHTMLDocument!==void 0;let Fv=bne,Na=One,Uv=Mne,Vv=Lne,Ul=Pne,Vl=xne,Bl=kne,wh=Une,Gl=p2,Je=null,jl=xe({},[...u2,...ON,...MN,...LN,...d2]),rt=null,bh=xe({},[...h2,...PN,...f2,...hy]),sr=Object.seal(gd(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),rs=null,Hl=null,Wr=Object.seal(gd(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),fm=!0,wa=!0,$l=!1,Wl=!0,dt=!1,yt=!0,wr=!1,zl=!1,ba=null,ql=null,co=!1,lo=!1,Oa=!1,is=!1,pm=!0,gm=!1,Kl="user-content-",Yl=!0,Xl=!1,br={},Ti=null,Ql=xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),yi=null,Oh=xe({},["audio","video","img","source","image","track"]),Ma=null,Mh=xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ii="http://www.w3.org/1998/Math/MathML",La="http://www.w3.org/2000/svg",ct="http://www.w3.org/1999/xhtml",uo=ct,ho=!1,fo=null,Bv=xe({},[Ii,La,ct],bN),mm=Qt(["mi","mo","mn","ms","mtext"]),vi=xe({},mm),Em=Qt(["annotation-xml"]),Lh=xe({},Em),Jl=xe({},["title","style","font","a","script"]),os=null,Ph=["application/xhtml+xml","text/html"],Zl="text/html",$e=null,po=null,_m=n.createElement("form"),eu=function(T){return T instanceof RegExp||T instanceof Function},Pa=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(po&&po===T)return;(!T||typeof T!="object")&&(T={}),T=Ir(T),os=Ph.indexOf(T.PARSER_MEDIA_TYPE)===-1?Zl:T.PARSER_MEDIA_TYPE,$e=os==="application/xhtml+xml"?bN:Pp,Je=Ks(T,"ALLOWED_TAGS",jl,{transform:$e}),rt=Ks(T,"ALLOWED_ATTR",bh,{transform:$e}),fo=Ks(T,"ALLOWED_NAMESPACES",Bv,{transform:bN}),Ma=Ks(T,"ADD_URI_SAFE_ATTR",Mh,{transform:$e,base:Mh}),yi=Ks(T,"ADD_DATA_URI_TAGS",Oh,{transform:$e,base:Oh}),Ti=Ks(T,"FORBID_CONTENTS",Ql,{transform:$e}),rs=Ks(T,"FORBID_TAGS",Ir({}),{transform:$e}),Hl=Ks(T,"FORBID_ATTR",Ir({}),{transform:$e}),br=nr(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?Ir(T.USE_PROFILES):T.USE_PROFILES:!1,fm=T.ALLOW_ARIA_ATTR!==!1,wa=T.ALLOW_DATA_ATTR!==!1,$l=T.ALLOW_UNKNOWN_PROTOCOLS||!1,Wl=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,dt=T.SAFE_FOR_TEMPLATES||!1,yt=T.SAFE_FOR_XML!==!1,wr=T.WHOLE_DOCUMENT||!1,lo=T.RETURN_DOM||!1,Oa=T.RETURN_DOM_FRAGMENT||!1,is=T.RETURN_TRUSTED_TYPE||!1,co=T.FORCE_BODY||!1,pm=T.SANITIZE_DOM!==!1,gm=T.SANITIZE_NAMED_PROPS||!1,Yl=T.KEEP_CONTENT!==!1,Xl=T.IN_PLACE||!1,Gl=Rne(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:p2,uo=typeof T.NAMESPACE=="string"?T.NAMESPACE:ct,vi=xN(T,"MATHML_TEXT_INTEGRATION_POINTS",()=>xe({},mm)),Lh=xN(T,"HTML_INTEGRATION_POINTS",()=>xe({},Em));let w=xN(T,"CUSTOM_ELEMENT_HANDLING",()=>gd(null));if(sr=gd(null),nr(w,"tagNameCheck")&&eu(w.tagNameCheck)&&(sr.tagNameCheck=w.tagNameCheck),nr(w,"attributeNameCheck")&&eu(w.attributeNameCheck)&&(sr.attributeNameCheck=w.attributeNameCheck),nr(w,"allowCustomizedBuiltInElements")&&typeof w.allowCustomizedBuiltInElements=="boolean"&&(sr.allowCustomizedBuiltInElements=w.allowCustomizedBuiltInElements),ln(sr),dt&&(wa=!1),Oa&&(lo=!0),br&&(Je=xe({},d2),rt=gd(null),br.html===!0&&(xe(Je,u2),xe(rt,h2)),br.svg===!0&&(xe(Je,ON),xe(rt,PN),xe(rt,hy)),br.svgFilters===!0&&(xe(Je,MN),xe(rt,PN),xe(rt,hy)),br.mathMl===!0&&(xe(Je,LN),xe(rt,f2),xe(rt,hy))),Wr.tagCheck=null,Wr.attributeCheck=null,nr(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?Wr.tagCheck=T.ADD_TAGS:md(T.ADD_TAGS)&&(Je===jl&&(Je=Ir(Je)),xe(Je,T.ADD_TAGS,$e))),nr(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?Wr.attributeCheck=T.ADD_ATTR:md(T.ADD_ATTR)&&(rt===bh&&(rt=Ir(rt)),xe(rt,T.ADD_ATTR,$e))),nr(T,"ADD_FORBID_CONTENTS")&&md(T.ADD_FORBID_CONTENTS)&&(Ti===Ql&&(Ti=Ir(Ti)),xe(Ti,T.ADD_FORBID_CONTENTS,$e)),Yl&&(Je["#text"]=!0),wr&&xe(Je,["html","head","body"]),Je.table&&(xe(Je,["tbody"]),delete rs.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw Kc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Kc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let G=R;R=T.TRUSTED_TYPES_POLICY;try{N=ts("")}catch(ee){throw R=G,ee}}else T.TRUSTED_TYPES_POLICY===null?(R=void 0,N=""):(R===void 0&&(R=Ra()),R&&typeof N=="string"&&(N=ts("")));Qt&&Qt(T),po=T},xh=xe({},[...ON,...MN,...Nne]),kh=xe({},[...LN,...wne]),Gv=function(T,w,G){return w.namespaceURI===ct?T==="svg":w.namespaceURI===Ii?T==="svg"&&(G==="annotation-xml"||vi[G]):!!xh[T]},tu=function(T,w,G){return w.namespaceURI===ct?T==="math":w.namespaceURI===La?T==="math"&&Lh[G]:!!kh[T]},Tm=function(T,w,G){return w.namespaceURI===La&&!Lh[G]||w.namespaceURI===Ii&&!vi[G]?!1:!kh[T]&&(Jl[T]||!xh[T])},Fh=function(T){let w=V(T);(!w||!w.tagName)&&(w={namespaceURI:uo,tagName:"template"});let G=Pp(T.tagName),ee=Pp(w.tagName);return fo[T.namespaceURI]?T.namespaceURI===La?Gv(G,w,ee):T.namespaceURI===Ii?tu(G,w,ee):T.namespaceURI===ct?Tm(G,w,ee):!!(os==="application/xhtml+xml"&&fo[T.namespaceURI]):!1},Kn=function(T){Op(e.removed,{element:T});try{V(T).removeChild(T)}catch{if(E(T),!V(T))throw Kc("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Si=function(T,w,G){try{I(T,w)}catch{try{T.removeAttribute(G)}catch{}}},ss=function(T){xa(T);let w=L(T);if(w){let ee=[];Yc(w,ce=>{Op(ee,ce)}),Yc(ee,ce=>{try{E(ce)}catch{}})}let G=oe(T);if(G)for(let ee=G.length-1;ee>=0;--ee){let ce=G[ee],de=ce&&ce.name;typeof de=="string"&&Si(T,ce,de)}},go=function(T,w,G){if(!G)try{G=w.getAttributeNode(T)}catch{G=null}Op(e.removed,{attribute:G||null,from:w});try{G?I(w,G):w.removeAttribute(T)}catch{try{w.removeAttribute(T)}catch{}}if(T==="is")if(lo||Oa)try{Kn(w)}catch{}else try{w.setAttribute(T,"")}catch{}},ym=function(T){let w=oe(T);if(w)for(let G=w.length-1;G>=0;--G){let ee=w[G],ce=ee&&ee.name;typeof ce!="string"||rt[$e(ce)]||Si(T,ee,ce)}},xa=function(T){let w=[T];for(;w.length>0;){let G=w.pop();v(G)===yr.element&&ym(G);let ce=L(G);if(ce)for(let de=ce.length-1;de>=0;--de)w.push(ce[de])}},Uh=function(T,w){return yt?T==="patchsrc"?!0:T==="for"&&w!=="label"&&w!=="output":!1},Vh=function(T){if(!yt)return;let w=[T];for(;w.length>0;){let G=w.pop(),ee=v(G);if(ee===yr.processingInstruction||ee===yr.comment&&Pn(m2,G.data)){try{E(G)}catch{}continue}if(ee===yr.element){let de=G,et=$e(A(G));try{de.hasAttribute&&de.hasAttribute("patchsrc")&&de.removeAttribute("patchsrc"),de.hasAttribute&&de.hasAttribute("for")&&Uh("for",et)&&de.removeAttribute("for")}catch{}}let ce=L(G);if(ce)for(let de=ce.length-1;de>=0;--de)w.push(ce[de])}},nu=function(T){let w=null,G=null;if(co)T="<remove></remove>"+T;else{let de=s2(T,/^[\r\n\t ]+/);G=de&&de[0]}os==="application/xhtml+xml"&&uo===ct&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");let ee=R?ts(T):T;if(uo===ct)try{w=new d().parseFromString(ee,os)}catch{}if(!w||!w.documentElement){w=Fl.createDocument(uo,"template",null);try{w.documentElement.innerHTML=ho?N:ee}catch{}}let ce=w.body||w.documentElement;return T&&G&&ce.insertBefore(n.createTextNode(G),ce.childNodes[0]||null),uo===ct?nn.call(w,wr?"html":"body")[0]:wr?w.documentElement:ce},Bh=function(T){let w=C?C(T):T.ownerDocument;return hm.call(w||T,T,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ka=function(T){return T=Mp(T,Fv," "),T=Mp(T,Na," "),T=Mp(T,Uv," "),T},Gh=function(T){var w;T.normalize();let G=C?C(T):T.ownerDocument,ee=hm.call(G||T,T,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),ce=ee.nextNode();for(;ce;)ce.data=ka(ce.data),ce=ee.nextNode();let de=(w=T.querySelectorAll)===null||w===void 0?void 0:w.call(T,"template");de&&Yc(de,et=>{mo(et.content)&&Gh(et.content)})},ru=function(T){let w=te?te(T):null;return typeof w!="string"||$e(w)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==oe(T)||typeof T.removeAttribute!="function"||typeof T.removeAttributeNode!="function"||typeof T.getAttributeNode!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==ge(T)||T.childNodes!==L(T)},mo=function(T){if(!ge||typeof T!="object"||T===null)return!1;try{return ge(T)===yr.documentFragment}catch{return!1}},as=function(T){if(!ge||typeof T!="object"||T===null)return!1;try{return typeof ge(T)=="number"}catch{return!1}};function Or(W,T,w){W.length!==0&&Yc(W,G=>{G.call(e,T,w,po)})}let Eo=function(T,w){return!!(yt&&T.hasChildNodes()&&!as(T.firstElementChild)&&Pn(g2,T.textContent)&&Pn(g2,T.innerHTML)||yt&&T.namespaceURI===ct&&Gne[w]&&(as(T.firstElementChild)||typeof T.textContent=="string"&&Pn(jne[w],T.textContent))||T.nodeType===yr.processingInstruction||yt&&T.nodeType===yr.comment&&Pn(m2,T.data))},Yn=function(T,w){if(T instanceof RegExp)return Pn(T,w);if(T instanceof Function){for(var G=arguments.length,ee=new Array(G>2?G-2:0),ce=2;ce<G;ce++)ee[ce-2]=arguments[ce];return!!T(w,...ee)}return!1},iu=function(T,w,G){if(!rs[w]&&cs(w)&&Yn(sr.tagNameCheck,w))return!1;if(Yl&&!Ti[w]){let ee=V(T),ce=L(T);if(ce&&ee){let de=ce.length;for(let et=de-1;et>=0;--et){let ht=T===G?g(ce[et],!0):ce[et];ee.insertBefore(ht,S(T))}}}return Kn(T),!0},Fa=function(T,w,G,ee){return T.length===0?w:w===G||w===ee?Ir(w):w},jh=function(T,w){return T===w||V(T)!==null?!1:(Xl&&xa(T),!0)},Ze=function(T,w){if(Or(He.beforeSanitizeElements,T,null),jh(T,w))return!0;if(ru(T))return Kn(T),!0;let G=$e(A(T));if(Je=Fa(He.uponSanitizeElement,Je,jl,ba),Or(He.uponSanitizeElement,T,{tagName:G,allowedTags:Je}),jh(T,w))return!0;if(Eo(T,G))return Kn(T),!0;if(rs[G]||!(Wr.tagCheck instanceof Function&&Wr.tagCheck(G))&&!Je[G]){let ce=iu(T,G,w);return ce===!1&&Or(He.afterSanitizeElements,T,null),ce}if(v(T)===yr.element&&!Fh(T)||(G==="noscript"||G==="noembed"||G==="noframes")&&Pn(Vne,T.innerHTML))return Kn(T),!0;if(dt&&T.nodeType===yr.text){let ce=ka(T.textContent);T.textContent!==ce&&(Op(e.removed,{element:T.cloneNode()}),T.textContent=ce)}return Or(He.afterSanitizeElements,T,null),!1},Ua=function(T,w,G){if(Hl[w]||Uh(w,T)||pm&&(w==="id"||w==="name")&&(G in n||G in _m))return!1;let ee=rt[w]||Wr.attributeCheck instanceof Function&&Wr.attributeCheck(w,T);return wa&&Pn(Vv,w)||fm&&Pn(Ul,w)?!0:ee?Ma[w]||Pn(Gl,Mp(G,Bl,""))||(w==="src"||w==="xlink:href"||w==="href")&&T!=="script"&&a2(G,"data:")===0&&yi[T]||$l&&!Pn(Vl,Mp(G,Bl,""))?!0:!G:cs(T)&&Yn(sr.tagNameCheck,T)&&Yn(sr.attributeNameCheck,w,T)||w==="is"&&sr.allowCustomizedBuiltInElements&&Yn(sr.tagNameCheck,G)},Va=xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),cs=function(T){return!Va[Pp(T)]&&Pn(wh,T)},jv=function(T,w,G,ee){if(R&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!G)switch(h.getAttributeType(T,w)){case"TrustedHTML":return ts(ee);case"TrustedScriptURL":return Da(ee)}return ee},Im=function(T,w,G,ee){try{return G?T.setAttributeNS(G,w,ee):T.setAttribute(w,ee),ru(T)?(Kn(T),!1):!0}catch{return go(w,T),!1}},vm=function(T){Or(He.beforeSanitizeAttributes,T,null);let w=T.attributes;if(!w||ru(T))return;rt=Fa(He.uponSanitizeAttribute,rt,bh,ql);let G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:rt,forceKeepAttr:void 0},ee=w.length,ce=$e(T.nodeName);for(;ee--;){let de=w[ee],et=de.name,ht=de.namespaceURI,In=de.value,It=$e(et),$h=In,pn=et==="value"?$h:Ine($h),ls=!1;if(G.attrName=It,G.attrValue=pn,G.keepAttr=!0,G.forceKeepAttr=void 0,Or(He.uponSanitizeAttribute,T,G),pn=G.attrValue,gm&&(It==="id"||It==="name")&&a2(pn,Kl)!==0&&(go(et,T,de),pn=Kl+pn,ls=!0),yt&&Pn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,pn)){go(et,T,de);continue}if(It==="attributename"&&s2(pn,"href")){go(et,T,de);continue}if(!G.forceKeepAttr){if(!G.keepAttr){go(et,T,de);continue}if(!Wl&&Pn(Bne,pn)){go(et,T,de);continue}if(dt&&(pn=ka(pn)),!Ua(ce,It,pn)){go(et,T,de);continue}pn=jv(ce,It,ht,pn),pn!==$h&&Im(T,et,ht,pn)&&ls&&o2(e.removed)}}Or(He.afterSanitizeAttributes,T,null)},ou=function(T){let w=null,G=Bh(T);for(Or(He.beforeSanitizeShadowDOM,T,null);w=G.nextNode();)if(Or(He.uponSanitizeShadowNode,w,null),Ze(w,T),vm(w),mo(w.content)&&ou(w.content),v(w)===yr.element){let ee=K(w);mo(ee)&&(Hh(ee),ou(ee))}Or(He.afterSanitizeShadowDOM,T,null)},Hh=function(T){let w=[{node:T,shadow:null}];for(;w.length>0;){let G=w.pop();if(G.shadow){ou(G.shadow);continue}let ee=G.node,de=v(ee)===yr.element,et=L(ee);if(et)for(let ht=et.length-1;ht>=0;--ht)w.push({node:et[ht],shadow:null});if(de){let ht=te?te(ee):null;if(typeof ht=="string"&&$e(ht)==="template"){let In=ee.content;mo(In)&&w.push({node:In,shadow:null})}}if(de){let ht=K(ee);mo(ht)&&w.push({node:null,shadow:ht},{node:ht,shadow:null})}}};return e.sanitize=function(W){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,G=null,ee=null,ce=null;if(ho=!W,ho&&(W="<!-->"),typeof W!="string"&&!as(W)&&(W=Dne(W),typeof W!="string"))throw Kc("dirty is not a string, aborting");if(!e.isSupported)return W;zl?(Je=ba,rt=ql):Pa(T),(He.uponSanitizeElement.length>0||He.uponSanitizeAttribute.length>0)&&(Je=Ir(Je)),He.uponSanitizeAttribute.length>0&&(rt=Ir(rt)),e.removed=[];let de=Xl&&typeof W!="string"&&as(W);if(de){Vh(W);let In=A(W);if(typeof In=="string"){let It=$e(In);if(!Je[It]||rs[It])throw ss(W),Kc("root node is forbidden and cannot be sanitized in-place")}if(ru(W))throw ss(W),Kc("root node is clobbered and cannot be sanitized in-place");try{Hh(W)}catch(It){throw ss(W),It}}else if(as(W))w=nu("<!---->"),G=w.ownerDocument.importNode(W,!0),G.nodeType===yr.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?w=G:w.appendChild(G),Hh(w);else{if(!lo&&!dt&&!wr&&W.indexOf("<")===-1)return R&&is?ts(W):W;if(w=nu(W),!w)return lo?null:is?N:""}w&&co&&Kn(w.firstChild);let et=de?W:w;try{let In=Bh(et);for(;ee=In.nextNode();)Ze(ee,et),vm(ee),mo(ee.content)&&ou(ee.content)}catch(In){throw de&&(ss(W),Yc(e.removed,It=>{It.element&&xa(It.element)})),In}if(de)return Yc(e.removed,In=>{In.element&&xa(In.element)}),dt&&Gh(W),W;if(lo){if(dt&&Gh(w),Oa)for(ce=_i.call(w.ownerDocument);w.firstChild;)ce.appendChild(w.firstChild);else ce=w;return(rt.shadowroot||rt.shadowrootmode)&&(ce=kv.call(r,ce,!0)),ce}let ht=wr?w.outerHTML:w.innerHTML;return wr&&Je["!doctype"]&&w.ownerDocument&&w.ownerDocument.doctype&&w.ownerDocument.doctype.name&&Pn(Fne,w.ownerDocument.doctype.name)&&(ht="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
150
|
-
`+ht),dt&&(ht=ka(ht)),R&&is?ts(ht):ht},e.setConfig=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pa(W),zl=!0,ba=Je,ql=rt},e.clearConfig=function(){po=null,zl=!1,ba=null,ql=null,R=O,N=""},e.isValidAttribute=function(W,T,w){po||Pa({});let G=$e(W),ee=$e(T);return Ua(G,ee,w)},e.addHook=function(W,T){typeof T=="function"&&nr(He,W)&&Op(He[W],T)},e.removeHook=function(W,T){if(nr(He,W)){if(T!==void 0){let w=Tne(He[W],T);return w===-1?void 0:yne(He[W],w,1)[0]}return o2(He[W])}},e.removeHooks=function(W){nr(He,W)&&(He[W]=[])},e.removeAllHooks=function(){He=E2()},e}var fy=I2();var Wne=/^\/\/\*\[@id='([^']+)'\]/;function UN(t){try{if(typeof t!="string")return null;let e=Wne.exec(t);if(!e)return null;let n=e[1],r=t.slice(e[0].length);if(!r)return{rootId:n,segments:[]};if(!r.startsWith("/"))return null;let i=[],o="",s=0,a=null;for(let c=1;c<r.length;c++){let l=r[c];if(a){l===a&&(a=null),o+=l;continue}if(l==="'"||l==='"')a=l;else if(l==="[")s++;else if(l==="]")s--;else if(l==="/"&&s===0){if(!o)return null;i.push(o),o="";continue}o+=l}return!o||a||s!==0?null:(i.push(o),{rootId:n,segments:i})}catch{return null}}var zne=[/:r[0-9a-z]+:/i,/_r_[0-9a-z]+_/i,/«r[0-9a-z]+»/i,/^radix-/i];function S2(t){try{return t?zne.some(e=>e.test(t)):!1}catch{return!1}}function Pke(t){if(Array.isArray(t))return v2(t);if(!t||typeof t!="object"||!("documentIds"in t))return{documentIds:null};let e=t.documentIds;return Array.isArray(e)?v2(e):{documentIds:[],problem:"not-an-array"}}function v2(t){let e=t.filter(n=>typeof n=="string"||typeof n=="number"&&Number.isFinite(n)).map(n=>String(n)).filter(n=>n.length>0);return B({documentIds:Array.from(new Set(e)).sort()},e.length<t.length?{problem:"dropped-entries"}:{})}function xke(t,e){return t===null||e===null?t===e:t.length===e.length&&t.every((n,r)=>n===e[r])}var A2={ADD_TAGS:["velt-skeleton-loader"],ADD_ATTR:["border-radius","target"]},C2=(()=>{let e=class e{constructor(r,i,o,s){this.analyticsService=r,this.rendererFactory2=i,this.loggingService=o,this.sanitizer=s,this.smoothScrollShieldHandler=null,this.smoothScrollShieldLoadListener=null,this.isVideoEditorHandlingDelete=!1,this.pageScrollHeight=0,this.enableRectSelectionSubject$=new ie(!1),this.enableRectSelection$=this.enableRectSelectionSubject$.asObservable(),this.scrollableElementsIds$=new ie([]),this.mousedown=!1,this.windowMouseDown$=new Rt,this.windowPointerMove$=new ie(null),this.windowPointerUp$=new ie(null),this.documentSelectionChange$=new ie(null),this.windowClick$=new ie(null),this.windowScroll$=new ie(null),this.windowResize$=new ie(null),this.windowKeyupBackspace$=new ie(null),this.windowKeyupDelete$=new ie(null),this.windowKeyupEsc$=new ie(null),this.windowPopState$=new ie(null),this.documentClick$=new ie(null),this.documentClickSubject$=new Rt,this.documentFocus$=new ie(null),this.windowKeydownShift$=new ie(null),this.windowKeyupShift$=new ie(null),this.mutation$=new ie(null),this.childListMutation$=new ie(null),this.networkStatus$=new ie(!1),this.xpathCache=new Map,this.xpathCacheId=new Map,this.selectedAnnotationsMap$=new ie({}),this.selectedAnnotationsLocationMap$=new ie({}),this.selectedAnnotationsContextIdMap$=new ie({}),this.recordingInProgress$=new ie({}),this.deleteAnnotations$=new ie([]),this.pinHighlighterClass$=new ie(null),this.dialogOpenedInSidebar$=new ie(!1),this.textHighlighterClass$=new ie(null),this.commentPinHighlighter$=new ie(!1),this.deviceInfo$=new ie(new Ur),this.customCss$=new ie(null),this.mutationObserver=null,this.animationFilterEnabled=!1,this.animationLibraryDetected=null,this.staticAnimationCache=new WeakMap,this.ANIMATION_LIBRARY_SELECTOR=["[data-gsap]",".gsap-marker-start",".gsap-marker-end","[data-gsap-id]",".swiper-slide",".swiper-wrapper",".swiper-pagination",".swiper-pagination-bullet","[data-aos]"].join(", "),this.previousMousePosition={pageX:0,pageY:0,clientX:0,clientY:0},this.currentMousePosition={pageX:0,pageY:0,clientX:0,clientY:0,element:{xpath:"",topPercentage:0,leftPercentage:0}},this.nodeMap={},this.unlistenElementScroll={},this.tabId=null,this.dynamicIdPatterns=[/^yui_[a-z0-9_]+$/i],this.excludeClassList=["show-pin-cursor"],this.filterSnippylyNodes=a=>{try{let c=[];return a.forEach(l=>{if(!qi(l))if(l instanceof HTMLElement){if(l.className.includes("cdk-overlay-container")||l.className.includes("cdk-overlay-connected-position-bounding-box"))return;if(l.className.includes("cdk-overlay")){let d=!1;l.childNodes.forEach(h=>{qi(h)&&(d=!0)}),d||c.push(l)}else c.push(l)}else c.push(l)}),c}catch(c){return this.loggingService.catch("Error in DomService filterSnippylyNodes: ",c),[]}},this.loggingService.log("%c[WB] Creating CLASS: DomService","color: blue;");try{this.analyticsService.setDomService(this),this.renderer=this.rendererFactory2.createRenderer(null,null);let a=this.calculateScreenSize();this.currentScreenSize$=new ie(a),this.currentMousePosition$=new ie(this.currentMousePosition),this.detectNetworkStatusChange(),this.getScrollableElementsIds$().pipe(Ya(),eE(([c,l])=>{try{let d=l.filter(f=>!c.includes(f)),h=c.filter(f=>!l.includes(f));h.length&&h.map(g=>document.getElementById(g)).filter(g=>g).forEach(g=>{this.unlistenElementScroll&&this.unlistenElementScroll[g.id]&&this.unlistenElementScroll[g.id]()}),d.length&&d.map(g=>document.getElementById(g)).filter(g=>g).forEach(g=>{this.unlistenElementScroll[g.id]=this.renderer.listen(g,"scroll",E=>{let I=this.calculateScreenSize();this.currentScreenSize$.next(I)})})}catch(d){this.loggingService.catch("Error in DomService getScrollableElementsIds subscription: ",d)}})).subscribe(()=>{},c=>{this.loggingService.catch("Error in DomService getScrollableElementsIds subscription: ",c)}),this.getSelectedAnnotationsMap$().subscribe(c=>{Object.keys(c||{})?.length?jV("snippylyUserScalableNo","viewport","width=device-width, user-scalable=no"):HV("snippylyUserScalableNo")},c=>{this.loggingService.catch("Error in DomService getSelectedAnnotationsMap$ subscription: ",c)})}catch(a){this.loggingService.catch("Error in DomService constructor: ",a)}}setDocService(r){try{this.docService=r,this.subscribeToDomEvents()}catch(i){this.loggingService.catch("Error in DomService setDocService: ",i)}}setDynamicIdPatterns(r){try{let i=r.map(o=>typeof o=="string"?new RegExp(o):o).filter(Boolean);i.length&&(this.dynamicIdPatterns=i)}catch(i){this.loggingService.catch("Error in DomService setDynamicIdPatterns: ",i)}}isLikelyDynamicId(r){try{return r?this.dynamicIdPatterns.some(i=>i.test(r)):!1}catch{return!1}}isGeneratedId(r){return this.isLikelyDynamicId(r)||S2(r)}getStableAttributes(r){try{let i={};if(!r.getAttributeNames)return i;let o=new Set(["id","class","style"]);return r.getAttributeNames().forEach(a=>{if(o.has(a)||a.includes("snippyly")||a.includes("velt"))return;let c=r.getAttribute(a);c&&c.length<=256&&(i[a]=c)}),i}catch{return{}}}buildStableElementSelector(r,i){try{if(Object.keys(i).length===0)return;let s=[r.tagName?.toLowerCase()],a=["data-","aria-","role","name","title","type"];return Object.keys(i).sort((l,d)=>{let h=a.findIndex(g=>l.startsWith(g)),f=a.findIndex(g=>d.startsWith(g));return(h===-1?99:h)-(f===-1?99:f)}).slice(0,4).forEach(l=>{let d=CSS.escape(i[l]);s.push(`[${l}="${d}"]`)}),s.join("")}catch{return}}getVisibleText(r,i=400){try{let o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null),s="",a,c=0;for(;(a=o.nextNode())&&s.length<i;){let l=(a.textContent||"").replace(/\s+/g," ").trim();if(l&&(s+=(s?" ":"")+l),c++,c>100)break}return s.slice(0,i)}catch{return""}}hashText(r){try{return DV(r)}catch{return}}generateRobustXPath(r,i){try{let o=i?.maxDepth||10,s=i?.useAbsolutePath||!1,a=[],c=r,l=0;for(;c&&c!==document.documentElement&&l<o;){let g=this.buildRobustXPathSegment(c);if(g&&(a.unshift(g),this.isStrongAnchorSegment(g)))break;c=c.parentElement,l++}if(a.length===0)return;let h=(s?"/":"//")+a.join("/");return a.some(g=>g.includes("[@")||g.includes("[contains(@class"))?h:void 0}catch{return}}buildRobustXPathSegment(r){try{let i=r.tagName.toLowerCase(),o=r.id;if(o&&!this.isLikelyDynamicId(o)&&document.querySelectorAll(`[id="${CSS.escape(o)}"]`).length===1)return`*[@id=${this.escapeXPathValue(o)}]`;let s=["data-region","data-instanceid","data-action","data-key","data-block","data-activityid"];for(let g of s){let E=r.getAttribute(g);if(E)return`${i}[@${g}=${this.escapeXPathValue(E)}]`}let a=Array.from(r.attributes).filter(g=>g.name.startsWith("data-")&&!g.name.includes("snippyly")&&!g.name.includes("velt")&&g.value.length<100).sort((g,E)=>g.value.length-E.value.length);if(a.length>0){let g=a[0];return`${i}[@${g.name}=${this.escapeXPathValue(g.value)}]`}let c=r.getAttribute("role");if(c)return`${i}[@role=${this.escapeXPathValue(c)}]`;let l=r.getAttribute("aria-label");if(l&&l.length<50)return`${i}[@aria-label=${this.escapeXPathValue(l)}]`;let d=r.getAttribute("name");if(d)return`${i}[@name=${this.escapeXPathValue(d)}]`;let h=r.getAttribute("type");if(h)return`${i}[@type=${this.escapeXPathValue(h)}]`;let f=Array.from(r.classList||[]).filter(g=>g.length>0&&g.length<40&&!g.includes("yui")&&!g.includes("velt")&&!g.includes("snippyly")&&!this.excludeClassList.includes(g)).slice(0,2);if(f.length>0){let g=f.map(E=>`contains(@class, ${this.escapeXPathValue(E)})`).join(" and ");return`${i}[${g}]`}if(r.parentElement){let g=Array.from(r.parentElement.children).filter(E=>E.tagName===r.tagName);if(g.length>1){let E=g.indexOf(r)+1;return`${i}[${E}]`}}return i}catch{return}}isStrongAnchorSegment(r){try{return!!(r.includes("[@id=")||["main","navigation","banner","contentinfo","complementary","search"].some(s=>r.includes(`[@role='${s}']`))||["data-region","data-instanceid","data-activityid"].some(s=>r.includes(`[@${s}=`)))}catch{return!1}}escapeXPathValue(r,i=!0){try{return r.includes("'")?r.includes('"')?`concat(${r.split("'").map(a=>`'${a}'`).join(`,"'",`)})`:i?`"${r}"`:r:i?`'${r}'`:r}catch{try{return`concat(${r.split("'").map(c=>`'${c}'`).join(`,"'",`)})`}catch{return i?`'${r}'`:r}}}getElementFromRobustXPath(r){try{return document.evaluate(r,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch{return null}}getAllElementsFromRobustXPath(r){try{let i=document.evaluate(r,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),o=[];for(let s=0;s<i.snapshotLength;s++){let a=i.snapshotItem(s);a instanceof Element&&o.push(a)}return o}catch{return[]}}generateAnchorRecord(r,i){try{let o=this.generateAnchorRecordForElement(r,i),s=null;if(r.parentElement&&r.parentElement instanceof HTMLElement&&rd(r.parentElement)&&r.parentElement!==document.body&&(s=r.parentElement),o&&s){let a=this.generateAnchorRecordForElement(s,i);a&&(o.parent=a)}return o}catch(o){return this.loggingService.catch("Error in DomService generateAnchorRecord: ",o),null}}generateAnchorRecordForElement(r,i){try{if(!r)return null;let o=r,s=o.tagName?.toUpperCase();if(!s)return null;let a=o.id&&!this.isLikelyDynamicId(o.id)?o.id:void 0,c=this.getStableAttributes(o),l=this.buildStableElementSelector(o,c),d=this.getVisibleText(o),h=this.hashText(d||""),f=this.generateRobustXPath(o),g=this.getXPath(o,!1,!1,void 0,{ignoreGeneratedIds:i?.ignoreGeneratedIds}),E=this.getXPath(o,!0),I=this.getXPath(o,!0,!0);return{version:"1.0",id:a,tagName:s,elementSelector:l,robustXPath:f||void 0,xPath:g||void 0,fXPath:E||void 0,cfXPath:I||void 0,contentHash:h?{value:h,algorithm:"md5",source:"textContent"}:void 0,createdAt:Date.now()}}catch(o){return this.loggingService.catch("Error in DomService generateAnchorRecordForElement: ",o),null}}resolveAnchorRecord(r){try{let i=[],o=null,s=(h,f,g=0)=>{let E=[],I=g;if(E.push({method:f,score:g}),r.tagName&&h.tagName?.toUpperCase()===r.tagName&&(I+=10,E.push({method:"tagName-match",score:10})),r.contentHash?.value){let S=this.getVisibleText(h);this.hashText(S)===r.contentHash.value&&(I+=30,E.push({method:"contentHash-match",score:30}))}i.push({el:h,score:I,by:f,scoreBreakdown:E})};if(r.id){let h=document.querySelectorAll(`#${CSS.escape(r.id)}`);if(h.length===1)return{element:h[0],matchedBy:"id",score:90};h.length>1&&h.forEach(f=>s(f,"id-duplicate",70))}if(r.elementSelector){let h=document.querySelectorAll(r.elementSelector);if(h.length===1)return{element:h[0],matchedBy:"element-selector",score:80};h.forEach(f=>s(f,"element-selector-duplicate",60))}r.robustXPath&&this.getAllElementsFromRobustXPath(r.robustXPath).slice(0,20).forEach(E=>s(E,"robustXPath",50)),r?.parent&&(o=this.resolveAnchorRecord(r.parent),o.element&&o.element.querySelectorAll(r.tagName?.toLowerCase()||"*").forEach(f=>s(f,"parent+tag",40)));let a=(h,f,g)=>{if(!h)return;let E=this.getElementFromXPath(h);E&&s(E,f||"xpath",g||30)};if(a(r.xPath,"xPath",30),a(r.cfXPath,"cfXPath",30),a(r.fXPath,"fXPath",30),r.contentHash?.value&&i.length===0){let f=g=>{let E=0;for(let I=0;I<g.length&&E<400;I++){let S=g[I];if(E++,!this.isElementVisible(S))continue;let L=this.getVisibleText(S),V=this.hashText(L);V&&V===r.contentHash?.value&&s(S,"contentHash",15)}};if(o?.element&&o?.element instanceof Element){let g=o?.element?.querySelectorAll("*");f(g)}}if(!i.length)return{element:null};i.sort((h,f)=>f.score-h.score);let c=i[0].score,l=i.filter(h=>h.score===c);if(l.length>1){let h=[{path:r.xPath,label:"xPath"},{path:r.cfXPath,label:"cfXPath"},{path:r.fXPath,label:"fXPath"}];for(let f of h)if(f.path){let g=this.getElementFromXPath(f.path);if(g){let E=l.find(I=>I.el===g);if(E)return{element:E.el,matchedBy:`${E.by}+position`,score:E.score,scoreBreakdown:E.scoreBreakdown}}}}let d=i[0];return{element:d.el,matchedBy:d.by,score:d.score,scoreBreakdown:d.scoreBreakdown}}catch(i){return this.loggingService.catch("Error in DomService resolveAnchorRecord: ",i),{element:null}}}subscribeToDomEvents(){try{this.docService?.getDocumentPaths$().pipe(De(r=>{r?(this.onWindowResize(),this.onWindowScroll(),this.onPointerDown(),this.onWindowClick(),this.onWindowKeyupBackspace(),this.onWindowKeyupDelete(),this.onWindowKeyupEsc(),this.onWindowPopState(),this.onWindowKeydownShift(),this.onWindowKeyupShift(),this.addPointerMoveListener(),this.addPointerUpListener(),this.addSelectionChangeListener(),this.onDocumentFocus(),this.setupSmoothScrollShield()):(this.unsubscribeFromWindowResize(),this.unsubscribeFromWindowScroll(),this.unsubscribeFromPointerDown(),this.unsubscribeFromWindowClick(),this.unsubscribeFromWindowKeyupBackspace(),this.unsubscribeFromWindowKeyupDelete(),this.unsubscribeFromWindowKeyupEsc(),this.unsubscribeFromWindowPopState(),this.unsubscribeFromWindowKeydownShift(),this.unsubscribeFromWindowKeyupShift(),this.unsubscribeFromPointerMoveListener(),this.unsubscribeFromPointerUpListener(),this.unsubscribeFromSelectionChangeListener(),this.unsubscribeFromDocumentFocus(),this.unsetMutationObserver(),this.teardownSmoothScrollShield())})).subscribe(),this.onDocumentClick()}catch(r){this.loggingService.catch("Error in DomService subscribeToDomEvents: ",r)}}setScrollableElementsIds(r){try{r&&r.length&&this.scrollableElementsIds$.next(Array.from(new Set(r)))}catch(i){this.loggingService.catch("Error in DomService setScrollableElementsIds: ",i)}}getScrollableElementsIds$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getScrollableElementsIds$","color: green;"),this.scrollableElementsIds$.asObservable()}removeScrollableElementsIds(){this.scrollableElementsIds$.next([])}setMutationObserver(r){try{this.mutationObserver||(this.loggingService.log("%c[WB] Calling DomService FUNCTION: setMutationObserver","color: green;"),this.loggingService.log("%c[WB] setMutationObserver from: "+r,"color: green;"),this.animationFilterEnabled=this.detectAnimationLibraries(),this.loggingService.log("%c[WB] Animation filter:","color: green;",this.animationFilterEnabled?"ENABLED (library detected)":"DISABLED (no library)"),this.mutationObserver=new MutationObserver(i=>{try{if(i?.find(s=>s?.attributeName===F.VELT_IGNORE_CHANGE_DETECTION))return;let o=i.filter(s=>s.type==="childList").filter(s=>{let a=s.target;return s.removedNodes.forEach(c=>{let l=c;if(typeof l.getAttribute=="function"){let d=l.getAttribute(F.ATTRIBUTES.VELT_ELEMENT_CACHE_ID);if(d!==null&&d!==""){let h=this.xpathCacheId.get(d);h!==void 0&&(this.xpathCacheId.delete(d),this.xpathCache.delete(h))}}}),qi(a)?!1:!!(this.filterSnippylyNodes(s.addedNodes).length||this.filterSnippylyNodes(s.removedNodes).length)});this.animationFilterEnabled?this.childListMutation$.next(o.filter(s=>!this.isAnimatingElement(s.target))):this.childListMutation$.next(o),o.push(...i.filter(s=>s.type==="attributes").filter(s=>!qi(s.target)).filter(s=>this.filterSnippylyNodes([s.target]).length).filter(s=>{if(s){let a=s.target;return a?.classList?.contains("snippyly-sidebar-panel")?!1:a?!a.getAttribute(F.VELT_IGNORE_CHANGE_DETECTION):!0}return!0})),o=o.filter(s=>{let a=!0;return Object.keys(F.INGNORE_MUTATION_OBSERVER_CHANGE_TAGS).forEach(c=>{s.target?.closest(c)&&(a=!1)}),a}),o=o.filter(s=>s.target&&rd(s.target)),this.animationFilterEnabled&&(o=o.filter(s=>!this.isAnimatingElement(s.target))),o.length&&this.mutation$.next(o)}catch(o){this.loggingService.catch("Error in DomService change detection: ",o)}}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0}))}catch(i){this.loggingService.catch("Error in DomService change detection: ",i)}}detectAnimationLibraries(){try{if(this.animationLibraryDetected!==null)return this.animationLibraryDetected;let r=window;return r.gsap||r.TweenMax||r.TweenLite||r.TimelineMax||r.TimelineLite?(this.loggingService.log("%c[WB] Detected animation library: GSAP","color: green;"),this.animationLibraryDetected=!0,!0):r.Swiper?(this.loggingService.log("%c[WB] Detected animation library: Swiper","color: green;"),this.animationLibraryDetected=!0,!0):r.AOS?(this.loggingService.log("%c[WB] Detected animation library: AOS","color: green;"),this.animationLibraryDetected=!0,!0):r.anime?(this.loggingService.log("%c[WB] Detected animation library: Anime.js","color: green;"),this.animationLibraryDetected=!0,!0):r.lottie||r.Lottie||r.bodymovin?(this.loggingService.log("%c[WB] Detected animation library: Lottie","color: green;"),this.animationLibraryDetected=!0,!0):document.querySelector("[data-framer-component-type]")?(this.loggingService.log("%c[WB] Detected animation library: Framer Motion","color: green;"),this.animationLibraryDetected=!0,!0):document.querySelector(this.ANIMATION_LIBRARY_SELECTOR)?(this.loggingService.log("%c[WB] Detected animation library: DOM markers","color: green;"),this.animationLibraryDetected=!0,!0):(this.loggingService.log("%c[WB] No animation library detected","color: green;"),this.animationLibraryDetected=!1,!1)}catch{return this.animationLibraryDetected=!1,!1}}isAnimatingElement(r){try{if(!r||typeof r.closest!="function")return!1;let i=window;if(i.gsap&&typeof i.gsap.isTweening=="function"){if(i.gsap.isTweening(r))return!0;if(typeof i.gsap.getTweensOf=="function")try{if(i.gsap.getTweensOf(r).length>0)return!0}catch{}}else if(i.TweenMax&&typeof i.TweenMax.isTweening=="function"){if(i.TweenMax.isTweening(r))return!0;if(typeof i.TweenMax.getTweensOf=="function")try{if(i.TweenMax.getTweensOf(r).length>0)return!0}catch{}}let o=r.style?.cssText||"";if(o){let l=o.includes("transform")||o.includes("translate3d")||o.includes("translate(")||o.includes("scale3d")||o.includes("rotate"),d=o.includes("will-change")&&o.includes("transform"),h=o.includes("transform-style")&&o.includes("preserve-3d");if(l&&(d||h))return!0}if(r.style&&(r.style.animation!==""&&r.style.animation!=="none"||r.style.transition!==""&&r.style.transition!=="none")||r.classList?.contains("animate")||r.classList?.contains("animating")||r.classList?.contains("animated")||r.classList?.contains("animation"))return!0;let s=this.staticAnimationCache.get(r);if(s!==void 0)return s;let a=!1,c=r.className||"";return typeof c=="string"&&(c.includes("slider")&&(c.includes("bullet")||c.includes("pagination"))&&(a=!0),c.includes("swiper-pagination")&&(a=!0)),!a&&(r.hasAttribute("data-aos")||r.hasAttribute("data-motion"))&&(a=!0),!a&&r.closest(this.ANIMATION_LIBRARY_SELECTOR)&&(a=!0),this.staticAnimationCache.set(r,a),a}catch{return!1}}unsetMutationObserver(){try{this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null,this.staticAnimationCache=new WeakMap,this.animationLibraryDetected=null,this.animationFilterEnabled=!1)}catch(r){this.loggingService.catch("Error in DomService unsetMutationObserver: ",r)}}detectNetworkStatusChange(){this.loggingService.log("%c[WB] Calling FUNCTION: detectNetworkStatusChange","color: green;");try{gs(wi(window,"offline").pipe(De(()=>!1)),wi(window,"online").pipe(De(()=>!0)),new fe(r=>{r.next(navigator.onLine),r.complete()})).subscribe(r=>{this.networkStatus$.next(r)})}catch(r){this.loggingService.catch("Error in DomService detectNetworkStatusChange: ",r)}}onWindowResize(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowResize","color: green;");try{this.unsubscribeFromWindowResize(),this.unlistenWindowResize=this.renderer.listen("window","resize",r=>{this.windowResize$.next(r);let i=this.calculateScreenSize();this.deviceInfo$.next(new Ur),this.currentScreenSize$.next(i)})}catch(r){this.loggingService.catch("Error in DomService onWindowResize: ",r)}}unsubscribeFromWindowResize(){try{this.unlistenWindowResize&&typeof this.unlistenWindowResize=="function"&&(this.unlistenWindowResize(),this.unlistenWindowResize=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowResize: ",r)}}onWindowScroll(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowScroll","color: green;");try{this.unsubscribeFromWindowScroll(),this.unlistenWindowScroll=this.renderer.listen("window","scroll",r=>{this.windowScroll$.next(r);let i=this.calculateScreenSize();this.currentScreenSize$.next(i)})}catch(r){this.loggingService.catch("Error in DomService onWindowScroll: ",r)}}unsubscribeFromWindowScroll(){try{this.unlistenWindowScroll&&typeof this.unlistenWindowScroll=="function"&&(this.unlistenWindowScroll(),this.unlistenWindowScroll=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowScroll: ",r)}}setupSmoothScrollShield(){this.loggingService.log("%c[WB] Calling FUNCTION: setupSmoothScrollShield","color: green;");try{if(typeof window>"u"||typeof document>"u"||this.smoothScrollShieldHandler)return;if(this.isSmoothScrollLibPresent()){this.attachSmoothScrollShield();return}if(document.readyState!=="complete"&&!this.smoothScrollShieldLoadListener){let r=()=>{this.smoothScrollShieldLoadListener=null;try{if(this.smoothScrollShieldHandler)return;this.isSmoothScrollLibPresent()&&this.attachSmoothScrollShield()}catch(i){this.loggingService.catch("Error in DomService smooth-scroll shield load re-check: ",i)}};window.addEventListener("load",r,{once:!0}),this.smoothScrollShieldLoadListener=()=>window.removeEventListener("load",r)}}catch(r){this.loggingService.catch("Error in DomService setupSmoothScrollShield: ",r)}}isSmoothScrollLibPresent(){try{if(typeof window>"u"||typeof document>"u")return!1;if(window.ET_SmoothScroll)return!0;let i=document.body;return!!(i&&i.classList&&i.classList.contains("et_smooth_scroll"))}catch(r){return this.loggingService.catch("Error in DomService isSmoothScrollLibPresent: ",r),!1}}attachSmoothScrollShield(){if(this.smoothScrollShieldHandler)return;let r=/^(VELT-|SUPERFLOW-|SNIPPYLY-)/,i=s=>{try{let a=typeof s.composedPath=="function"?s.composedPath():[];for(let c=0;c<a.length;c++){let l=a[c];if(!(!l||l.nodeType!==1)&&l.tagName&&r.test(l.tagName)){s.stopImmediatePropagation();return}}}catch(a){this.loggingService.catch("Error in DomService smoothScrollShield handler: ",a)}};this.smoothScrollShieldHandler=i;let o={capture:!0,passive:!0};window.addEventListener("wheel",i,o),window.addEventListener("mousewheel",i,o),window.addEventListener("touchmove",i,o),this.unlistenWindowWheelShield=()=>window.removeEventListener("wheel",i,o),this.unlistenWindowMouseWheelShield=()=>window.removeEventListener("mousewheel",i,o),this.unlistenWindowTouchMoveShield=()=>window.removeEventListener("touchmove",i,o)}teardownSmoothScrollShield(){this.loggingService.log("%c[WB] Calling FUNCTION: teardownSmoothScrollShield","color: green;");try{try{this.smoothScrollShieldLoadListener&&typeof this.smoothScrollShieldLoadListener=="function"&&(this.smoothScrollShieldLoadListener(),this.smoothScrollShieldLoadListener=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (load): ",r)}try{this.unlistenWindowWheelShield&&typeof this.unlistenWindowWheelShield=="function"&&(this.unlistenWindowWheelShield(),this.unlistenWindowWheelShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (wheel): ",r)}try{this.unlistenWindowMouseWheelShield&&typeof this.unlistenWindowMouseWheelShield=="function"&&(this.unlistenWindowMouseWheelShield(),this.unlistenWindowMouseWheelShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (mousewheel): ",r)}try{this.unlistenWindowTouchMoveShield&&typeof this.unlistenWindowTouchMoveShield=="function"&&(this.unlistenWindowTouchMoveShield(),this.unlistenWindowTouchMoveShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (touchmove): ",r)}this.smoothScrollShieldHandler=null}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield: ",r)}}onPointerDown(){this.loggingService.log("%c[WB] Calling FUNCTION: onPointerDown","color: green;");try{this.unsubscribeFromPointerDown(),this.unlistenPointerDown=this.renderer.listen("window","pointerdown",r=>{this.mousedown=!0,this.windowMouseDown$.next(r),this.setPointerPosition(r)})}catch(r){this.loggingService.catch("Error in DomService onPointerDown: ",r)}}unsubscribeFromPointerDown(){try{this.unlistenPointerDown&&typeof this.unlistenPointerDown=="function"&&(this.unlistenPointerDown(),this.unlistenPointerDown=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerDown: ",r)}}onWindowClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupBackspace","color: green;");try{this.unsubscribeFromWindowClick(),this.unlistenWindowClick=this.renderer.listen("window","click",r=>{this.windowClick$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowClick: ",r)}}unsubscribeFromWindowClick(){try{this.unlistenWindowClick&&typeof this.unlistenWindowClick=="function"&&(this.unlistenWindowClick(),this.unlistenWindowClick=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowClick: ",r)}}onWindowKeyupBackspace(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupBackspace","color: green;");try{this.unsubscribeFromWindowKeyupBackspace(),this.unlistenWindowKeyupBackspace=this.renderer.listen("window","keyup.backspace",r=>{this.isVideoEditorHandlingDelete||this.windowKeyupBackspace$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupBackspace: ",r)}}unsubscribeFromWindowKeyupBackspace(){try{this.unlistenWindowKeyupBackspace&&typeof this.unlistenWindowKeyupBackspace=="function"&&(this.unlistenWindowKeyupBackspace(),this.unlistenWindowKeyupBackspace=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupBackspace: ",r)}}onWindowKeyupDelete(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupDelete","color: green;");try{this.unsubscribeFromWindowKeyupDelete(),this.unlistenWindowKeyupDelete=this.renderer.listen("window","keyup.delete",r=>{this.isVideoEditorHandlingDelete||this.windowKeyupDelete$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupDelete: ",r)}}unsubscribeFromWindowKeyupDelete(){try{this.unlistenWindowKeyupDelete&&typeof this.unlistenWindowKeyupDelete=="function"&&(this.unlistenWindowKeyupDelete(),this.unlistenWindowKeyupDelete=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupDelete: ",r)}}onWindowKeyupEsc(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupEsc","color: green;");try{this.unsubscribeFromWindowKeyupEsc(),this.unlistenWindowKeyupEsc=this.renderer.listen("window","keyup.esc",r=>{this.windowKeyupEsc$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupEsc: ",r)}}unsubscribeFromWindowKeyupEsc(){try{this.unlistenWindowKeyupEsc&&typeof this.unlistenWindowKeyupEsc=="function"&&(this.unlistenWindowKeyupEsc(),this.unlistenWindowKeyupEsc=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupEsc: ",r)}}onWindowPopState(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowPopState","color: green;");try{this.unsubscribeFromWindowPopState(),this.unlistenWindowPopState=this.renderer.listen("window","popstate",r=>{this.windowPopState$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowPopState: ",r)}}unsubscribeFromWindowPopState(){try{this.unlistenWindowPopState&&typeof this.unlistenWindowPopState=="function"&&(this.unlistenWindowPopState(),this.unlistenWindowPopState=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowPopState: ",r)}}onDocumentClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onDocumentClick","color: green;");try{this.unsubscribeFromDocumentClick(),this.documentClickListener=r=>{r?.target?.tagName?.toLowerCase()!==F.TAGS.SUPERFLOW_TOOLBAR&&(this.documentClick$.next(r),this.documentClickSubject$.next(r))},document.addEventListener("click",this.documentClickListener,!0)}catch(r){this.loggingService.catch("Error in DomService onDocumentClick: ",r)}}unsubscribeFromDocumentClick(){try{this.documentClickListener&&typeof this.documentClickListener=="function"&&(document.removeEventListener("click",this.documentClickListener,!0),this.documentClickListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromDocumentClick: ",r)}}onDocumentFocus(){this.loggingService.log("%c[WB] Calling FUNCTION: onDocumentFocus","color: green;");try{this.unsubscribeFromDocumentFocus(),this.documentFocusListener=r=>{this.documentFocus$.next(r)},document.addEventListener("focus",this.documentFocusListener,!0)}catch(r){this.loggingService.catch("Error in DomService onDocumentFocus: ",r)}}unsubscribeFromDocumentFocus(){try{this.documentFocusListener&&typeof this.documentFocusListener=="function"&&(document.removeEventListener("focus",this.documentFocusListener,!0),this.documentFocusListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromDocumentFocus: ",r)}}onWindowKeydownShift(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeydownShift","color: green;");try{this.unsubscribeFromWindowKeydownShift(),this.unlistenWindowKeydownShift=this.renderer.listen("window","keydown.shift",r=>{this.windowKeydownShift$.next(r),this.windowKeyupShift$.next(null)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeydownShift: ",r)}}unsubscribeFromWindowKeydownShift(){try{this.unlistenWindowKeydownShift&&typeof this.unlistenWindowKeydownShift=="function"&&(this.unlistenWindowKeydownShift(),this.unlistenWindowKeydownShift=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeydownShift: ",r)}}onWindowKeyupShift(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupShift","color: green;");try{this.unsubscribeFromWindowKeyupShift(),this.unlistenWindowKeyupShift=this.renderer.listen("window","keyup.shift",r=>{this.windowKeyupShift$.next(r),this.windowKeydownShift$.next(null)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupShift: ",r)}}unsubscribeFromWindowKeyupShift(){try{this.unlistenWindowKeyupShift&&typeof this.unlistenWindowKeyupShift=="function"&&(this.unlistenWindowKeyupShift(),this.unlistenWindowKeyupShift=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupShift: ",r)}}onWindowKeydown$(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeydown$","color: green;");try{return wi(window,"keydown")}catch(r){return this.loggingService.catch("Error in DomService onWindowKeydown$: ",r),Wa}}addPointerMoveListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerMoveListener","color: green;");try{this.unsubscribeFromPointerMoveListener(),this.unlistenPointerMoveListener=this.renderer.listen("document","pointermove",r=>{this.windowPointerMove$.next(r),this.mouseMoveEvent=r})}catch(r){this.loggingService.catch("Error in DomService addPointerMoveListener: ",r)}}unsubscribeFromPointerMoveListener(){try{this.unlistenPointerMoveListener&&typeof this.unlistenPointerMoveListener=="function"&&(this.unlistenPointerMoveListener(),this.unlistenPointerMoveListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerMoveListener: ",r)}}addPointerUpListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerUpListener","color: green;");try{this.unsubscribeFromPointerUpListener(),this.unlistenPointerUpListener=this.renderer.listen("document","pointerup",r=>{this.windowPointerUp$.next(r)})}catch(r){this.loggingService.catch("Error in DomService addPointerUpListener: ",r)}}unsubscribeFromPointerUpListener(){try{this.unlistenPointerUpListener&&typeof this.unlistenPointerUpListener=="function"&&(this.unlistenPointerUpListener(),this.unlistenPointerUpListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerUpListener: ",r)}}addSelectionChangeListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerUpListener","color: green;");try{this.unsubscribeFromSelectionChangeListener(),this.unlistenSelectionChangeListener=this.renderer.listen("document","selectionchange",r=>{this.documentSelectionChange$.next(r)})}catch(r){this.loggingService.catch("Error in DomService addPointerUpListener: ",r)}}unsubscribeFromSelectionChangeListener(){try{this.unlistenSelectionChangeListener&&typeof this.unlistenSelectionChangeListener=="function"&&(this.unlistenSelectionChangeListener(),this.unlistenSelectionChangeListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromSelectionChangeListener: ",r)}}updateCurrentMousePosition(r){try{if(this.currentMousePosition.pageX=r.pageX,this.currentMousePosition.pageY=r.pageY,this.currentMousePosition.clientX=r.clientX,this.currentMousePosition.clientY=r.clientY,r.target){let i=this.getXPath(r.target),o=r.target;if(i?.includes("name()='svg'")){let h=this.getXPath(i);h&&(o=h.iterateNext()||r.target)}let s=o.getBoundingClientRect(),a=r.clientX-s.x,c=r.clientY-s.y,l=a*100/(s.width||1),d=c*100/(s.height||1);this.currentMousePosition.element={xpath:i,topPercentage:d,leftPercentage:l}}else this.currentMousePosition.element=null;this.currentMousePosition$.next(this.currentMousePosition)}catch(i){this.loggingService.catch("Error in DomService updateCurrentMousePosition: ",i)}}getTargetElementForCursorPosition(r,i=!0,o=!1,s=!0,a,c=!0,l,d){try{let h=r,f=h?.touches?.length?h.touches[0]?.clientX:h?.clientX,g=h?.touches?.length?h.touches[0]?.clientY:h?.clientY;l&&(f=l.clientX,g=l.clientY);let E=this.getBackgroundElement(f,g,i,o);if(E&&a&&typeof a=="function"&&(E=a(E)),E){let I=this.getXPath(E,!1,!1,void 0,d),S=this.getXPath(E,!0),L=E.getBoundingClientRect(),V=f-L.x,K=g-L.y,oe=V*100/(L.width||1),ge=K*100/(L.height||1),te={xpath:I,fXpath:S,leftPercentage:oe,topPercentage:ge};if(s){let C=this.getXPath(E,!0,!0);te.cfXpath=C}if(c){let C=this.generateAnchorRecord(E,d);C&&(te.anchor=C)}return te}else return null}catch(h){return this.loggingService.catch("Error in DomService getTargetElementForCommentPinAnnotation: ",h),null}}getBackgroundElement(r,i,o=!0,s=!1){try{let a=document.elementsFromPoint(r,i),c=[];a.forEach(d=>{qi(d)?c=[]:rd(d)&&c.push(d)}),s&&(c=c.filter(d=>this.isElementVisibleOnScreen(d)));let l=0;return o||c?.forEach((d,h)=>{d.tagName.toLowerCase()==="svg"&&(l=h)}),c[l]}catch(a){return this.loggingService.catch("Error in DomService getBackgroundElement: ",a),null}}getBackgroundVeltElement(r,i){try{let o=document.elementsFromPoint(r,i),s=[];return o.forEach(a=>{qi(a)&&rd(a)&&s.push(a)}),s[0]}catch(o){return this.loggingService.catch("Error in DomService getBackgroundSnippylyElement: ",o),null}}setPointerPosition(r){this.loggingService.log("%c[WB] Calling FUNCTION: setPointerPosition","color: green;");try{this.previousMousePosition.pageX=r.pageX,this.previousMousePosition.pageY=r.pageY,this.currentMousePosition.pageX=r.pageX,this.currentMousePosition.pageY=r.pageY}catch(i){this.loggingService.catch("Error in DomService setPointerPosition: ",i)}}getCurrentWindowSize$(r){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentWindowSize","color: green;"),this.currentScreenSize$.asObservable()}getCurrentMousePosition$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentMousePosition","color: green;"),this.currentMousePosition$.asObservable()}getCurrentWindowSizeValue(){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentWindowSizeValue","color: green;"),this.currentScreenSize$.value}getTopLeftPosition(){this.loggingService.log("%c[WB] Calling FUNCTION: getTopLeftPosition","color: green;");try{let r=document?.body?.getBoundingClientRect()||document?.documentElement?.getBoundingClientRect(),i=this.currentMousePosition?.pageX||r.x+200,o=Math.min(i,r.width/2),s=Math.abs(r.y),a=r.y-20;return s>50&&(a=Math.abs(r.y)+180),this.loggingService.log(r),this.loggingService.log(o),this.loggingService.log(a),{topPositionX:o,topPositionY:a}}catch(r){return this.loggingService.catch("Error in DomService getTopLeftPosition: ",r),{topPositionX:0,topPositionY:0}}}toggleSelection(){this.enableRectSelectionSubject$.next(!this.enableRectSelectionSubject$.value)}enableSelection(){this.enableRectSelectionSubject$.next(!0)}disableSelection(){this.enableRectSelectionSubject$.next(!1)}setPinHighlighterClass(r){this.pinHighlighterClass$.next(r)}setTextHighlighterClass(r){this.textHighlighterClass$.next(r)}getTextHighlighterClass(){return this.textHighlighterClass$.asObservable()}enableCommentPinHighlighter(){this.commentPinHighlighter$.next(!0)}disableCommentPinHighlighter(){this.commentPinHighlighter$.next(!1)}getCommentPinHighlighter$(){return this.commentPinHighlighter$.asObservable()}getCommentPinHighlighter(){return this.commentPinHighlighter$?.value}highlightElement(r,i,o){if(r&&!Oc(r)){if(!o&&this.getCommentPinHighlighter()&&(this.pinHighlighterClass$.value?this.addClassToElement(r,this.pinHighlighterClass$.value):this.addClassToElement(r,F.SNIPPYLY_HIGHLIGHT)),i&&!r.hasAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)){let s=r.style.getPropertyValue("cursor"),a=r.style.getPropertyPriority("cursor"),c=s?{defaultCursorValue:s,defaultCursorPriority:a}:"";r.setAttribute(F.ATTRIBUTES.DEFAULT_CURSOR,c?JSON.stringify(c):""),r.style.setProperty("cursor",i,"important")}r.setAttribute(F.SNIPPYLY_HIGHLIGHT,"true"),r.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true")}}removeHighlightFromElement(r){if(r&&(this.pinHighlighterClass$.value&&this.removeClassFromElement(r,this.pinHighlighterClass$.value),this.removeClassFromElement(r,F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.VELT_IGNORE_CHANGE_DETECTION),r.hasAttribute(F.ATTRIBUTES.DEFAULT_CURSOR))){try{if(r.style.removeProperty("cursor"),r.getAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)){let i=JSON.parse(r.getAttribute(F.ATTRIBUTES.DEFAULT_CURSOR));r.style.setProperty("cursor",i.defaultCursorValue,i.defaultCursorPriority)}}catch{}r.removeAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)}}highlightUserElement(r,i,o,s=!1){try{r&&(this.addClassToElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT),s&&this.addClassToElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT),r.setAttribute(F.SNIPPYLY_HIGHLIGHT,"true"),r.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true"),i&&!r.style.getPropertyValue(F.VELT_SELECTION_COLOR)&&r.style.setProperty(F.VELT_SELECTION_COLOR,i),o&&r.setAttribute(F.SNIPPYLY_HIGHLIGHT_USER_NAME,o))}catch(a){this.loggingService.catch("Error in DomService highlightUserElement: ",a)}}removeHighlightUserFromElement(r){try{r&&(this.removeClassFromElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT),this.removeClassFromElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.VELT_IGNORE_CHANGE_DETECTION),r.removeAttribute(F.VELT_SELECTION_COLOR),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT_USER_NAME),r.style.removeProperty(F.VELT_SELECTION_COLOR))}catch(i){this.loggingService.catch("Error in DomService removeHighlightUserFromElement: ",i)}}previewHighlightElement(r){r&&r.setAttribute(F.SNIPPYLY_HIGHLIGHT_PREVIEW,"true")}removePreviewHighlightFromElement(r){r&&r.removeAttribute(F.SNIPPYLY_HIGHLIGHT_PREVIEW)}getXPath(r,i=!1,o=!1,s,a){try{let c=this.calculateXPath(r,i,o,s,a);if(c&&typeof c=="string"&&c.includes("/svg")){let l=c.split("/"),d=!1;l.forEach((h,f)=>{h.includes("svg")&&(d=!0),d&&(l[f]="svg:"+h)}),c=l.join("/")}return c}catch(c){this.loggingService.catch("Error in DomService getXPath:",c)}}namespaceResolver(r){return r==="svg"?"http://www.w3.org/2000/svg":null}calculateXPath(r,i,o,s,a){try{if(r){if(typeof r=="string")return document.evaluate(r,s||document,this.namespaceResolver,XPathResult.ANY_TYPE,null);if(!r||r.nodeType!=1)return"";if(r.id&&document.querySelectorAll(`[id='${r.id}']`)?.length===1&&!i&&!(a?.ignoreGeneratedIds&&this.isGeneratedId(r.id)))return"//*[@id='"+r.id+"']";if(o&&r.className&&r.className.split){let l=r.className?.split(" ")?.filter(d=>!d?.includes("snippyly")&&!d?.includes("velt")&&!["show-pin-cursor"].includes(d))[0];if(l){let d=this.calculateXPath(r.parentNode,i,o,s,a)+"/"+r.tagName.toLowerCase(),h=Array.from(r.parentNode?.children||[]).filter(f=>f.nodeType===1&&f.tagName===r.tagName?f.className?.split(" ")?.filter(E=>E?.includes("snippyly")||E?.includes("velt")||["show-pin-cursor"].includes(E))[0]===l:!1);if(h.length>1){let f=h.indexOf(r)+1;d+=`[contains(concat(' ', normalize-space(@class), ' '), ' ${l} ')][${f}]`}else d+=`[contains(concat(' ', normalize-space(@class), ' '), ' ${l} ')]`;return d}}let c=[].filter.call(r.parentNode?.children?r.parentNode?.children:[],function(l){return l.tagName==r.tagName});return this.calculateXPath(r.parentNode,i,o,void 0,a)+"/"+r.tagName.toLowerCase()+(c.length>1?"["+([].indexOf.call(c,r)+1)+"]":"")}}catch(c){this.loggingService.catch("Error in DomService calculateXPath:",c)}}getElementFromXPath(r,i=document){try{if(this.xpathCache.has(r)){let s=this.xpathCache.get(r);if(s!==void 0&&document.contains(s))return s;this.xpathCache.delete(r)}let o=this.getXPath(r,!1,!1,i);if(o){let s=o?.iterateNext();if(s!==null&&typeof s.setAttribute=="function"&&!Oc(s)){let a=nd();s.setAttribute(F.ATTRIBUTES.VELT_ELEMENT_CACHE_ID,a),this.xpathCacheId.set(a,r)}return this.xpathCache.set(r,s),s}return null}catch(o){return this.loggingService.catch("Error in DomService getElementFromXPath:",o),null}}getElementFromTargetElement(r){try{let i=null;if(r?.anchor){let o=this.resolveAnchorRecord(r.anchor);o?.element&&(i=o.element)}else r?.xpath?i=this.getElementFromXPath(r.xpath):r?.cfXpath?i=this.getElementFromXPath(r.cfXpath):r?.fXpath&&(i=this.getElementFromXPath(r.fXpath));return i}catch(i){return this.loggingService.catch("Error in DomService getElementFromTargetElement:",i),null}}resolveIdScopedTarget(r){try{let i=r?.anchor?.xPath||r?.xpath,o=UN(i);if(!i||!o||this.isGeneratedId(o.rootId))return{applicable:!1,element:null};let s=this.getUniqueElementById(o.rootId);if(!s||!this.isElementVisible(s)||!rd(s))return{applicable:!0,element:null};let a=d=>!!d&&s.contains(d)&&this.isElementVisible(d),c=this.getElementFromXPath(i);if(a(c))return{applicable:!0,element:c,matchedBy:"exact"};let l=r?.anchor?.robustXPath;if(l&&UN(l)?.rootId===o.rootId){let d=this.getElementFromRobustXPath(l);if(a(d))return{applicable:!0,element:d,matchedBy:"robust"}}return{applicable:!0,element:s,matchedBy:"root"}}catch(i){return this.loggingService.catch("Error in DomService resolveIdScopedTarget: ",i),{applicable:!1,element:null}}}getUniqueElementById(r){try{let i=document.querySelectorAll(`[id="${CSS.escape(r)}"]`);return i.length===1?i[0]:null}catch{return null}}getElementFromTargetTextRange(r){try{let i=null;if(r?.commonAncestorContainerAnchor){let o=this.resolveAnchorRecord(r.commonAncestorContainerAnchor);o?.element&&(i=o.element)}else r?.commonAncestorContainer&&(i=this.getElementFromXPath(r.commonAncestorContainer));return i}catch(i){return this.loggingService.catch("Error in DomService getElementFromTargetTextRange:",i),null}}calculateScreenSize(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowResize","color: green;");try{let r=[document?.body?.clientHeight||0,document?.documentElement?.clientHeight||0,window?.innerHeight||0],i=[document?.body?.clientWidth||0,document?.documentElement?.clientWidth||0,window?.innerWidth||0];this.calculatePageScrollHeight(),this.loggingService.log(this.pageScrollHeight),this.loggingService.log(this.nodeMap),this.highestNode=this.nodeMap[this.pageScrollHeight];let o=new rp;return o.screenWidth=Math.max(...i),o.screenHeight=Math.max(...r),o.screenScrollHeight=this.pageScrollHeight,o}catch(r){return this.loggingService.catch("Error in DomService calculateScreenSize:",r),new rp}}calculatePageScrollHeight(){this.loggingService.log("%c[WB] Calling FUNCTION: calculatePageScrollHeight","color: green;");try{this.pageScrollHeight=0,this.findLongestNode(document?.documentElement?.childNodes)}catch(r){this.loggingService.catch("Error in DomService calculatePageScrollHeight: ",r)}}removeSnippylyContent(r){this.loggingService.log("%c[WB] Calling FUNCTION: removeSnippylyContent","color: green;");try{let o=new DOMParser().parseFromString(r,"text/html");o.querySelectorAll("[data-snippyly-cache-id]").forEach(f=>{f.removeAttribute("data-snippyly-cache-id")}),o.querySelectorAll("[data-velt-cache-id]").forEach(f=>{f.removeAttribute("data-velt-cache-id")}),o.querySelectorAll(".comment-text-highlight").forEach(f=>{f?.parentNode?.insertBefore(document.createTextNode(f?.textContent),f),f.remove()});let l=document.createNodeIterator(o,NodeFilter.SHOW_COMMENT),d;for(;d=l.nextNode();)d?.remove();return this.mergeAdjacentTextNodes(o.body),this.sanitizeHtml(o.body.innerHTML)}catch(i){return this.loggingService.catch("Error in DomService removeSnippylyContent: ",i),r}}mergeAdjacentTextNodes(r){try{let i=r.firstChild;for(;i;){if(i.nodeType===Node.TEXT_NODE){let o=i.nextSibling;for(;o&&o.nodeType===Node.TEXT_NODE;)i.textContent+=o.textContent,o.remove(),o=i.nextSibling}i=i.nextSibling}}catch(i){this.loggingService.catch("Error in DomService mergeAdjacentTextNodes: ",i)}}findLongestNode(r){try{for(let i=r.length-1;i>=0;i--){if(r[i]?.scrollHeight&&r[i]?.clientHeight){let o=Math.max(r[i]?.scrollHeight,r[i]?.clientHeight);this.pageScrollHeight=Math.max(o,this.pageScrollHeight),this.nodeMap[o]=r[i]}r[i]?.childNodes?.length&&this.findLongestNode(r[i]?.childNodes)}}catch(i){this.loggingService.catch("Error in DomService findLongestNode: ",i)}}resetSelectedAnnotationsMap(r=!0,i){try{let o=Array.from(document.querySelectorAll(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`)),s=this.getDraftCommentAnnotationDialogs()||[];o.push(...s),o=Array.from(new Set(o));let a=o.map(h=>h.classList.contains("velt-annotation-draft-checked")?(h.classList.remove("velt-annotation-draft-checked"),null):(this.removeClassFromElement(h,"velt-comment-dialog-shake"),setTimeout(()=>{this.addClassToElement(h,"velt-comment-dialog-shake"),h.getAttribute(F.ATTRIBUTES.VELT_ANNOTATION_EDIT_COMMENT)||h.classList.contains("velt-annotation-draft-checked")||this.addClassToElement(h,"velt-annotation-draft-checked")},100),h.getAttribute(F.ATTRIBUTES.VELT_ANNOTATION_DRAFT))).filter(h=>h),c=Object.keys(this.getRecordingInProgress()||{});a=[...a,...c];let l=this.selectedAnnotationsMap$.value;if(r&&this.selectedAnnotationsMap$.value&&Object.keys(this.selectedAnnotationsMap$.value).length){let h=[];Object.keys(l).forEach(f=>{if(l[f]?.type==="tag"){let g=l[f];g?.to?.length||a.includes(f)||h.push(g)}else l[f]?.comments?.length||a.includes(f)||h.push(l[f])}),this.deleteAnnotations$.next(h),this.deleteAnnotations$.next([])}let d={};Object.keys(l).forEach(h=>{a.includes(h)&&(d[h]=l[h]),i&&(i==="comment"?["comment","videoPin"].includes(l[h]?.type)||(d[h]=l[h]):l[h]?.type!==i&&(d[h]=l[h]))}),Object.keys(d).forEach(h=>{let f=d[h]?.multiThreadAnnotationId;f&&!d[f]&&(d[f]={annotationId:f,type:"multiThread"})}),JSON.stringify(this.selectedAnnotationsMap$.value)!==JSON.stringify(d)&&this.selectedAnnotationsMap$.next(d),this.setDialogOpenedInSidebar(!1)}catch(o){this.loggingService.catch("Error in DomService resetSelectedAnnotationsMap: ",o)}}setRecordingInProgress(r,i){try{if(i)this.recordingInProgress$.next(Ee(B({},this.recordingInProgress$.value),{[r]:i}));else{let o=this.recordingInProgress$.value;delete o[r],this.recordingInProgress$.next(o)}}catch(o){this.loggingService.catch("Error in DomService setRecordingInProgress: ",o)}}resetRecordingInProgress(){try{this.recordingInProgress$.next({})}catch(r){this.loggingService.catch("Error in DomService resetRecordingInProgress: ",r)}}getRecordingInProgress(){try{return this.recordingInProgress$.value}catch(r){return this.loggingService.catch("Error in DomService getRecordingInProgress: ",r),{}}}getDraftCommentAnnotationDialogs(){try{let r=[],i=Array.from(document.querySelectorAll(`${F.TAGS.SNIPPYLY_COMMENT_DIALOG}`)),o=Array.from(document.querySelectorAll(`${F.TAGS.VELT_COMMENT_DIALOG}`));return[...i,...o].forEach(a=>{if(a?.shadowRoot){let c=a.shadowRoot.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);c&&r.push(c)}else{let c=a.querySelector(`${F.TAGS.VELT_SHADOW_DOM_INTERNAL}`);if(c?.shadowRoot){let l=c.shadowRoot?.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);l&&r.push(l)}else{let l=a.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);l&&r.push(l)}}}),r}catch(r){return this.loggingService.catch("Error in DomService getDraftCommentAnnotationDialogs: ",r),[]}}getSelectedAnnotationsMap(r){try{let i=this.selectedAnnotationsMap$.value;if(r){let o={};return Object.keys(i).forEach(s=>{r==="comment"?["comment","videoPin"].includes(i[s].type)&&(o[s]=i[s]):i[s].type===r&&(o[s]=i[s])}),o}else return i}catch(i){return this.loggingService.catch("Error in DomService getSelectedAnnotationsMap: ",i),{}}}getSelectedAnnotationsMap$(r){return this.selectedAnnotationsMap$.asObservable().pipe(De(i=>{if(r){let o={};return Object.keys(i).forEach(s=>{i[s].type===r&&(o[s]=i[s])}),o}else return i}))}getSelectedComments$(){return this.selectedAnnotationsMap$.asObservable().pipe(De(r=>Object.values(r)))}getSelectedAnnotationsLocationMap(){try{return this.selectedAnnotationsLocationMap$.value}catch(r){return this.loggingService.catch("Error in DomService getSelectedAnnotationsLocationMap: ",r),{}}}getSelectedAnnotationsLocationMap$(){return this.selectedAnnotationsLocationMap$.asObservable()}getSelectedAnnotationsContextIdMap(){try{return this.selectedAnnotationsContextIdMap$.value}catch(r){return this.loggingService.catch("Error in DomService getSelectedAnnotationsContextIdMap: ",r),{}}}getSelectedAnnotationsContextIdMap$(){return this.selectedAnnotationsContextIdMap$.asObservable()}toggleAnnotationSelection(r,i,o,s=!1,a,c){try{o==="sidebarShowReplies"?this.setDialogOpenedInSidebar(!0):this.setDialogOpenedInSidebar(!1);let l=JSON.parse(JSON.stringify(this.selectedAnnotationsMap$.value||{})),d=JSON.parse(JSON.stringify(this.selectedAnnotationsLocationMap$.value||{})),h=JSON.parse(JSON.stringify(this.selectedAnnotationsContextIdMap$.value||{}));l[r.annotationId]&&!s?delete l[r.annotationId]:((!this.windowKeydownShift$.value||s)&&(l={}),l[r.annotationId]=r,d[r.annotationId]=i,c&&(h[r.annotationId]=c),a=r?.multiThreadAnnotationId||a,a&&(l[a]={annotationId:a,type:"multiThread"},d[a]=i,c&&(h[a]=c))),this.selectedAnnotationsMap$.next(l),Object.keys(d).forEach(f=>{l[f]||delete d[f]}),this.selectedAnnotationsLocationMap$.next(d),Object.keys(h).forEach(f=>{l[f]||delete h[f]}),this.selectedAnnotationsContextIdMap$.next(h)}catch(l){this.loggingService.catch("Error in DomService toggleAnnotationSelection: ",l)}}setSelectedAnnotationLocation(r,i){try{let o=JSON.parse(JSON.stringify(this.getSelectedAnnotationsLocationMap()||{}));o?.[r]!==i&&(o[r]=i,this.selectedAnnotationsLocationMap$.next(o))}catch(o){this.loggingService.catch("Error in DomService setSelectedAnnotationLocation: ",o)}}updateSelectedAnnotationInMap(r){try{let i=this.selectedAnnotationsMap$.value;r.forEach(o=>{i[o.annotationId]&&(i[o.annotationId]=o)}),this.selectedAnnotationsMap$.next(i)}catch(i){this.loggingService.catch("Error in DomService updateSelectedAnnotationInMap: ",i)}}getDeleteCommmentAnnotations$(){try{return this.deleteAnnotations$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getDeleteCommmentAnnotations$: ",r),lt([])}}getHighestNode(){return this.loggingService.log("%c[WB] Calling FUNCTION: getHighestNode","color: green;"),this.highestNode}onWindowMouseDown$(){return this.windowMouseDown$.asObservable()}onWindowPointerMove$(){return this.windowPointerMove$.asObservable()}onWindowPointerMove(){return this.windowPointerMove$.value}onWindowPointerUp$(){return this.windowPointerUp$.asObservable()}onSelectionChange$(){return this.documentSelectionChange$.asObservable()}onWindowClick$(){return this.windowClick$.asObservable()}onWindowScroll$(){return this.windowScroll$.asObservable()}onWindowResize$(){return this.windowResize$.asObservable()}onWindowKeyupBackspace$(){return this.windowKeyupBackspace$.asObservable()}onWindowKeyupDelete$(){return this.windowKeyupDelete$.asObservable()}onWindowKeyupEsc$(){return this.windowKeyupEsc$.asObservable()}onWindowPopState$(){return this.windowPopState$.asObservable()}onDocumentClick$(){return this.documentClick$.asObservable()}getLastDocumentClick(){return this.documentClick$.value}onDocumentClickSubject$(){return this.documentClickSubject$.asObservable()}onDocumentFocus$(){return this.documentFocus$.asObservable()}onDomChange$(r){try{return this.mutationObserver||this.setMutationObserver(r),this.mutation$.asObservable()}catch(i){return this.loggingService.catch("Error in DomService onDomChange$: ",i),lt([])}}getChildListMutation$(){return this.childListMutation$.asObservable()}onNetworkStatusChange$(){return this.networkStatus$.asObservable()}getNetworkStatus(){return this.networkStatus$.value}getElementOffset(r,i){try{let o={offsetTop:0,offsetLeft:0},s=r;if(s===i){let a=window.getComputedStyle(r);a.position==="static"&&a.transformStyle!="preserve-3d"&&a.transform=="none"&&(o.offsetLeft=r?.offsetLeft||0,o.offsetTop=r?.offsetTop||0)}if(s!==i)if(r?.closest("svg"))for(;s&&s!==i;){let c=window.getComputedStyle(s);if(s.tagName.toLowerCase()==="svg"||s instanceof SVGElement){let l=s.parentElement;if(l){let d=l.getBoundingClientRect(),h=s.getBoundingClientRect();o.offsetLeft+=h.left-d.left,o.offsetTop+=h.top-d.top}}else c.position==="static"?c.transformStyle!="preserve-3d"&&c.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0):(o.offsetLeft+=s.offsetLeft,o.offsetTop+=s.offsetTop);if(s=s.parentElement,r instanceof SVGElement&&s===i){let l=window.getComputedStyle(s);l.position==="static"&&l.transformStyle!="preserve-3d"&&l.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0)}}else{let c=window.getComputedStyle(s);c.position==="static"?c.transformStyle!="preserve-3d"&&c.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0):(o.offsetLeft+=s.offsetLeft,o.offsetTop+=s.offsetTop)}return o}catch(o){return this.loggingService.catch("Error in DomService getElementOffset: ",o),{offsetTop:0,offsetLeft:0}}}isElementVisible(r){try{if(typeof r?.getBoundingClientRect=="function"){let{width:i,height:o,top:s,bottom:a}=r?.getBoundingClientRect();return i>0||o>0||s<window.innerHeight&&a>0}else return!1}catch(i){return this.loggingService.catch("Error in DomService isElementVisible: ",i),!1}}isElementVisibleOnScreen(r){try{if(r){if(!(r instanceof Element))return!1;let i=r,o=window.getComputedStyle(i);return!(o.display==="none"||o.visibility==="hidden"||parseFloat(o.opacity)===0)}return!1}catch(i){return this.loggingService.catch("Error in DomService isElementVisibleOnScreen: ",i),!1}}getClickAndDragPointsObservable(){return new fe(r=>{let i=wi(document,"mousedown").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),o=wi(document,"mousemove").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),s=wi(document,"mouseup").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),c=i.pipe(Mr(l=>o.pipe(Ya(),De(([d,h])=>({startPoint:l,prevPoint:d,curPoint:h})),ps(s)))).subscribe(r);return()=>c.unsubscribe()})}drawRectangle(r,i){let o=document.querySelector(".rectangle");o||(o=document.createElement("div"),this.addClassToElement(o,"rectangle"),o.setAttribute(F.ATTRIBUTES.VELT_COMMENT_DISABLED,"true"),o.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true"),document.body.appendChild(o));let s=Math.abs(i.x-r.x),a=Math.abs(i.y-r.y),c=Math.min(r.x,i.x),l=Math.min(r.y,i.y);return o.style.width=`${s}px`,o.style.height=`${a}px`,o.style.left=`${c}px`,o.style.top=`${l}px`,o.style.position="absolute",o.style.border="2px dashed #f00",o.style.pointerEvents="none",o.style.zIndex="2147483577",o}getRange(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: getRange","color: green;"),window.getSelection()?.toString()){let r=window.getSelection();if(r?.rangeCount)return r.getRangeAt(0)}return null}catch(r){return this.loggingService.catch("Error in DomService getRange: ",r),null}}clearTextSelection(){try{this.loggingService.log("%c[WB] Calling FUNCTION: clearTextSelection","color: green;"),window.getSelection&&(window.getSelection()?.empty?window.getSelection()?.empty():window.getSelection()?.removeAllRanges&&window.getSelection()?.removeAllRanges())}catch(r){this.loggingService.catch("Error in DomService clearTextSelection: ",r)}}getTargetTextRangeFromSelectionRange(r){try{let i={},o=r.commonAncestorContainer;o?.nodeType===Node.TEXT_NODE&&(o=o.parentElement);let s=document.body;if(o){let c=this.getTextXPath(o);this.isXpathWithId(c)&&(s=o)}let a=this.getAdditionalLocationContainer(o);if(a&&(s=a),i.commonAncestorContainer=this.getTextXPath(s),i.commonAncestorContainer){let c=this.getElementFromXPath(i.commonAncestorContainer);if(c){i.commonAncestorContainerFXpath=this.getXPath(c,!0),i.commonAncestorContainerCFXpath=this.getXPath(c,!0,!0);let l=this.generateAnchorRecord(c);l&&(i.commonAncestorContainerAnchor=l)}}return i.text=r.toString(),i.occurrence=gR(s,0,r.startContainer,r.startOffset,r.toString())+1,i}catch(i){this.loggingService.catch("Error in DomService getTargetTextRangeFromSelectionRange: ",i);return}}getTextXPath(r){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: getTextXPath","color: green;"),r.nodeType===Node.TEXT_NODE){let i=1,o=r.previousSibling;for(;o;)o.nodeType===Node.TEXT_NODE&&i++,o=o.previousSibling;return this.getXPath(r.parentElement)}else return this.getXPath(r)}catch(i){this.loggingService.catch("Error in DomService getTextXPath: ",i);return}}getHostElement(r){try{if(F.NON_NESTABLE_ELEMENTS[r?.tagName?.toLowerCase()]){let o=r?.closest("picture");return o?o?.parentElement:r.parentElement}let i=r.closest("svg");return i?i?.parentElement:r}catch(i){return this.loggingService.catch("Error in DomService getHostElement: ",i),r}}isElementInsideAdditionalLocationContainer(r){try{return!!r?.closest(`[${F.ATTRIBUTES.VELT_LOCATION}], [${F.ATTRIBUTES.VELT_LOCATION_ID}]`)}catch(i){return this.loggingService.catch("Error in DomService isElementInsideAdditionalLocationContainer: ",i),!1}}getAdditionalLocationContainer(r){try{return r?.closest(`[${F.ATTRIBUTES.VELT_LOCATION}], [${F.ATTRIBUTES.VELT_LOCATION_ID}]`)||null}catch(i){return this.loggingService.catch("Error in DomService getAdditionalLocationContainer: ",i),null}}isXpathWithId(r){try{return typeof r=="string"?!!r?.includes("[@id="):!1}catch(i){return this.loggingService.catch("Error in DomService isXpathWithId: ",i),!1}}getListedElements({elementIds:r,elementClassNames:i,elementQuerySelectors:o}){try{let s=[];if(r?.length)for(let a=0;a<r.length;a++){let c=document.getElementById(r[a]);c&&s.push(c)}if(i?.length)for(let a=0;a<i.length;a++){let c=document.getElementsByClassName(i[a]);for(let l=0;l<c.length;l++){let d=c[l];d&&d instanceof HTMLElement&&s.push(d)}}if(o?.length)for(let a=0;a<o.length;a++){let c=document.querySelectorAll(o[a]);for(let l=0;l<c.length;l++){let d=c[l];d&&d instanceof HTMLElement&&s.push(d)}}return s}catch(s){return this.loggingService.catch("Error in DomService getListedElements: ",s),[]}}isElementInsideListedElementIds(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.getElementById(i[o]);if(s&&s.contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementIds: ",o),!1}}isElementInsideListedElementClassNames(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.getElementsByClassName(i[o]);for(let a=0;a<s.length;a++)if(s[a].contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementClassNames: ",o),!1}}isElementInsideListedElementQuerySelectors(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.querySelectorAll(i[o]);for(let a=0;a<s.length;a++)if(s[a].contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementQuerySelectors: ",o),!1}}addClassToElement(r,i){try{this.loggingService.log("%c[WB] Calling FUNCTION: addClassToElement","color: green;"),r&&(r.classList?.contains(i)||r.classList?.add(i))}catch(o){this.loggingService.catch("Error in DomService addClassToElement: ",o)}}removeClassFromElement(r,i){try{this.loggingService.log("%c[WB] Calling FUNCTION: removeClassFromElement","color: green;"),r&&r.classList?.contains(i)&&r.classList?.remove(i)}catch(o){this.loggingService.catch("Error in DomService removeClassFromElement: ",o)}}isElementInsideParentWithAttribute(r,i,o){try{let s=r;for(;s&&s!==document.body;){if(s?.getAttribute&&s?.getAttribute(i)===o)return!0;s=s.parentElement}return!1}catch(s){return this.loggingService.catch("Error in DomService isElementInsideParentWithAttribute: ",s),!1}}setVideoEditorHandlingDelete(r){try{this.isVideoEditorHandlingDelete=r}catch(i){this.loggingService.catch("Error in DomService setVideoEditorHandlingDelete: ",i)}}isVideoEditorHandlingDeleteKey(){try{return this.isVideoEditorHandlingDelete}catch(r){return this.loggingService.catch("Error in DomService isVideoEditorHandlingDeleteKey: ",r),!1}}setCustomCss(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomCss","color: green;"),this.customCss$.next(r)}catch(i){this.loggingService.catch("Error in DomService setCustomCss: ",i)}}getCustomCss$(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getCustomCss$","color: green;"),this.customCss$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getCustomCss$: ",r),lt(null)}}injectCustomCss(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: injectCustomCss","color: green;");let i=this.customCss$.value;if(i){let o=r?.shadowRoot?.querySelector(`[${F.VELT_CUSTOM_CSS}]`);if(o&&o.remove(),i?.type==="link"){let s=document.createElement("link");s.href=i?.value,s.rel="stylesheet",s.setAttribute(F.VELT_CUSTOM_CSS,"true"),r?.shadowRoot?.appendChild(s)}else{let s=document.createElement("style");s.innerHTML=this.sanitizeHtml(i?.value),s.setAttribute(F.VELT_CUSTOM_CSS,"true"),r?.shadowRoot?.appendChild(s)}}}catch(i){this.loggingService.catch("Error in DomService injectCustomCss: ",i)}}subscribeInjectCustomCss(r){try{return this.customCss$.subscribe(()=>{this.injectCustomCss(r?.nativeElement)})}catch(i){return this.loggingService.catch("Error in DomService subscribeInjectCustomCss: ",i),new gt}}trimCommentHtml(r){try{let i=document.createElement("div");i.innerHTML=r,this.removeEmptyElements(i);let o=i.innerHTML;return o=o.replace(e.MULTIPLE_NBSP_REGEX," ").replace(e.TRIM_NBSP_REGEX,"").trim(),o}catch(i){return this.loggingService.catch("Error in DomService trimCommentHtml: ",i),r}}removeEmptyElements(r){try{let s=function(a){return o.test(a.innerHTML)};var i=s;let o=/^\s*(<br\s*\/?>)?\s*$/;for(;r.firstChild&&s(r.firstChild);)r.removeChild(r.firstChild);for(;r.lastChild&&s(r.lastChild);)r.removeChild(r.lastChild)}catch(o){this.loggingService.catch("Error in DomService removeEmptyElements: ",o)}}normalizeWhitespace(r){try{r.childNodes.forEach(i=>{i.nodeType===Node.TEXT_NODE?i.nodeValue=i.nodeValue?.replace(/\s+/g," ").trim()??"":i.nodeType===Node.ELEMENT_NODE&&this.normalizeWhitespace(i)})}catch(i){this.loggingService.catch("Error in DomService normalizeWhitespace: ",i)}}sanitizeHtml(r){try{return this.loggingService.log("%c[WB] Calling FUNCTION: sanitizeHtml","color: green;"),fy.sanitize(r,A2)}catch(i){return this.loggingService.catch("Error in DomService sanitizeHtml: ",i),""}}sanitizeHtmlForPaste(r){try{let i=this.convertStylesToTags(r);return fy.sanitize(i,{ALLOWED_TAGS:["b","strong","i","em","u","a","br"],ALLOWED_ATTR:["href","target","rel"]})}catch(i){return this.loggingService.catch("Error in DomService sanitizeHtmlForPaste: ",i),""}}convertStylesToTags(r){try{let i=document.createElement("div");return i.innerHTML=r,this.convertBlockElementsToBr(i),this.processNodeStyles(i),i.innerHTML}catch(i){return this.loggingService.catch("Error in DomService convertStylesToTags: ",i),r}}convertBlockElementsToBr(r){try{let i=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE","SECTION","ARTICLE","HEADER","FOOTER"],o;for(;(o=r.querySelector(i.join(",")))!==null;){let s=o.parentNode;if(!s)break;for(;o.firstChild;)s.insertBefore(o.firstChild,o);o.nextSibling&&s.insertBefore(document.createElement("br"),o),s.removeChild(o)}}catch(i){this.loggingService.catch("Error in DomService convertBlockElementsToBr: ",i)}}processNodeStyles(r){try{let i=Array.from(r.childNodes);for(let o of i)if(o.nodeType===Node.ELEMENT_NODE){this.processNodeStyles(o);let s=o,a=s.style,c=o,l=a?.fontWeight;if(l==="bold"||l==="700"||l==="800"||l==="900"){let d=s.tagName?.toLowerCase();if(d!=="b"&&d!=="strong"){let h=document.createElement("b");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}if(a?.fontStyle==="italic"){let d=s.tagName?.toLowerCase();if(d!=="i"&&d!=="em"){let h=document.createElement("i");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}if((a?.textDecorationLine?.includes("underline")||a?.textDecoration?.includes("underline"))&&s.tagName?.toLowerCase()!=="u"){let h=document.createElement("u");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}}catch(i){this.loggingService.catch("Error in DomService processNodeStyles: ",i)}}sanitizeSvg(r){try{return fy.sanitize(r,A2)}catch(i){return this.loggingService.catch("Error in DomService sanitizeSvg: ",i),r}}setDeviceInfo(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDeviceInfo","color: green;");let r=new Ur;this.deviceInfo$.next(r)}catch(r){this.loggingService.catch("Error in DomService setDeviceInfo: ",r)}}getDeviceInfo$(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getDeviceInfo$","color: green;"),this.deviceInfo$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getDeviceInfo$: ",r),lt(new Ur)}}getTabId(){try{let r=sessionStorage.getItem(F.SESSION_STORAGE.VELT_TAB_ID);!r&&this.tabId&&(r=this.tabId,sessionStorage.setItem(F.SESSION_STORAGE.VELT_TAB_ID,r)),!this.tabId&&r&&(this.tabId=r);let i=this.getTabIdFromWindowName();return(!r||r!==i)&&(r=nd(),this.tabId=r,sessionStorage.setItem(F.SESSION_STORAGE.VELT_TAB_ID,r),this.setTabIdToWindowName(r)),r}catch(r){return this.loggingService.catch("Error in DomService getTabId: ",r),null}}getTabIdFromWindowName(){try{return window.name}catch(r){return this.loggingService.catch("Error in DomService getTabIdFromWindowName: ",r),null}}setTabIdToWindowName(r){try{window.name=r}catch(i){this.loggingService.catch("Error in DomService setTabIdToWindowName: ",i)}}getDeviceInfo(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getDeviceInfo","color: green;"),this.deviceInfo$.value}catch(r){return this.loggingService.catch("Error in DomService getDeviceInfo: ",r),new Ur}}isMobileDevice(){try{return new Ur().getDeviceType()===Er.MOBILE}catch(r){return this.loggingService.catch("Error in DomService isMobileDevice: ",r),!1}}isTabletDevice(){try{return new Ur().getDeviceType()===Er.TABLET}catch(r){return this.loggingService.catch("Error in DomService isTabletDevice: ",r),!1}}isDesktopDevice(){try{return new Ur().getDeviceType()===Er.DESKTOP}catch(r){return this.loggingService.catch("Error in DomService isDesktopDevice: ",r),!1}}deepCloneElement(r){try{var i=document.createElement(r?.tagName);return Array.from(r.attributes).forEach(o=>{i.setAttribute(o.nodeName,o.nodeValue)}),r.childNodes.forEach(o=>{o.nodeType===Node.ELEMENT_NODE?i.appendChild(this.deepCloneElement(o)):o.nodeType===Node.TEXT_NODE&&i.appendChild(document.createTextNode(o.nodeValue))}),i}catch(o){return this.loggingService.catch("Error in DomService deepCloneElement: ",o),r}}setRandomNumberToElementRecursive(r){try{if(!r)return;let i=Math.random().toString(36).substring(7);r&&r.setAttribute&&typeof r.setAttribute=="function"&&(r.getAttribute("velt-wireframe-id")||r.setAttribute("velt-wireframe-id",i)),Array.from(r.children).forEach(s=>{this.setRandomNumberToElementRecursive(s)})}catch(i){this.loggingService.catch("Error in DomService setRandomNumberToElementRecursive: ",i)}}setDialogOpenedInSidebar(r){this.dialogOpenedInSidebar$.next(r)}getDialogOpenedInSidebar(){return this.dialogOpenedInSidebar$.asObservable()}removeWireframeSuffixFromTags(r){if(!r)return;Array.from(r.children).forEach(o=>{if(this.removeWireframeSuffixFromTags(o),o.tagName.toLowerCase().endsWith("-wireframe")){let s=o.tagName.toLowerCase().replace("-wireframe",""),a=document.createElement(s);for(Array.from(o.attributes).forEach(c=>{a.setAttribute(c.name,c.value)});o.firstChild;)a.appendChild(o.firstChild);o.parentNode.replaceChild(a,o)}})}isMonitorDevice(){try{return new Ur().getDeviceType()===Er.MONITOR}catch(r){return this.loggingService.catch("Error in DomService isMonitorDevice: ",r),!1}}isElementOriginallyStatic(r){try{return window.getComputedStyle(r).position==="static"||r.hasAttribute(F.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_AREA_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_RECORDER_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_ARROW_PIN_HOST_STATIC)}catch(i){return this.loggingService.catch("Error in DomService isElementOriginallyStatic: ",i),!1}}};e.MULTIPLE_NBSP_REGEX=/(?: \s*){2,}/g,e.TRIM_NBSP_REGEX=/^(?: \s*)+|(?: \s*)+$/g,e.\u0275fac=function(i){return new(i||e)($(zs),$(bo),$(bt),$(XD))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function Xc(t){let e=t?.refreshToken;return typeof e=="string"&&e.length>0?e:void 0}var VN=Symbol("velt-auth-state-pending");function Yne(t,e){let n=B(B({},t),e||{});return n.userId=t.userId,n.userSnippylyId=t.userSnippylyId,n.type=t.type,n.organizationId=t.organizationId,n.clientOrganizationId=t.clientOrganizationId,n.groupId=t.groupId,n.clientGroupId=t.clientGroupId,n.contacts=t.contacts,n.plan=t.plan,n.isAdmin=t.isAdmin,n.isReadOnly=t.isReadOnly,n.isAnonymous=t.isAnonymous,n.isGuest=t.isGuest,n.color=e?.color||t.color,n.textColor=e?.textColor||t.textColor,n.initial=e?.initial||n.name?.charAt(0).toUpperCase()||n.email?.charAt(0).toUpperCase()||t.initial,n?.photoUrl===void 0&&(n.photoUrl=null),n}function D2(t,e){if(!e.length)return!0;if(t.length!==e.length)return!1;let n=new Set(t);return e.every(r=>n.has(r))}var Ed=(()=>{let e=class e{constructor(r,i,o,s,a,c,l,d,h){this.afAuth=r,this.configService=i,this.avatarService=o,this.coreActionsService=s,this.domService=a,this.functions=c,this.analyticsService=l,this.loggingService=d,this.serviceBook=h,this.endpointsService=Y(ly),this.portableBackend$=new ie(null),this.portableAuthUser$=new ie(null),this.user$=new ie(null),this.userOptions$=new ie(null),this.userContacts$=new ie(null),this.userOrganization$=new ie(null),this.isPrivateCommentsEnabled$=new ie(!1),this.providedUser=new zi,this.portableRefreshTimer=null,this.portableToken=null,this.portableRefreshInFlightEpoch=null,this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0,this.portableRefreshWarnedEpoch=null,this.portableVisibilityHandler=null,this.loggedInUserResolveRetryDelaysMs=[2e3,8e3,3e4],this.loggedInUserResolveRetryInFlightUserId=null,this.firebaseConfig$=new ie(null),this.advancedQueries$=new ie(null),this.planDetails$=new ie(null),this.signOutPreviousUser$=new ie(null),this.preSignOutFunctions=new Map,this.autoLoginCalled=!1,this.portableAutoLoginCalled=!1,this.portableAutoLoginInFlight=Promise.resolve(),this.portableSessionEpoch=0,this.portableLocalSessionEnds=0,this.portableSignOutOwnsEpochBump=!1,this.pendingPortableRestore=null,this.portableResumeUserId=null,this.portableStorageHandler=null,this.portableSessionIdentity=null,this.reportedPortableRefreshCodes=new Set,this.autoLoginRequired=!0,this.config=null,this.getPlanDetailsCalled=!1,this.forceReLoggedIn=!1,this.lastLoggedInUserData=null,this.sessionReLoginCount=0,this.SESSION_RE_LOGIN_COUNT_LIMIT=10,this.sessionReLoginSubscription=null,this.onRetrySubscription=null,this.authProviderListenerGeneration=0,this.TOKEN_EXPIRED_ERROR_COUNT_LIMIT=3,this.tokenExpiredErrorCount=0,this.cachedActivityConfig=null,this.viewsService=null,this.crdtService=null,this.portableSavedSessionRaw=null,this.portableRenewalStopped=null,this.portableSessionStartedAt=0,this.portablePersistInFlight=Promise.resolve(),this.loggingService.log("%c[WB] Creating CLASS: AuthService","color: blue;"),this.serviceBook.observe(fT).subscribe(f=>{this.commentService=f??void 0}),this.serviceBook.observe(pT).subscribe(f=>{this.reactionService=f??void 0}),this.serviceBook.observe(gT).subscribe(f=>{this.areaService=f??void 0}),this.serviceBook.observe(TU).subscribe(f=>{this.activityService=f??void 0,f&&this.cachedActivityConfig&&f.setActivityFeatureConfig(this.cachedActivityConfig)}),this.serviceBook.observe(yU).subscribe(f=>{this.viewsService=f??null}),this.serviceBook.observe(IU).subscribe(f=>{this.crdtService=f??null});try{try{let f=this.configService.getAuthProxyHost();if(f){let g=this.afAuth?.config;g&&(g.apiHost=f,g.tokenApiHost=f)}}catch{}this.analyticsService.setAuthService(this),this.configService.getConfig$().subscribe(f=>{this.config=f}),this.forceReLoggedIn=localStorage.getItem(F.LOCAL_STORAGE.VELT_USER_FORCE_RE_LOGGED_IN)==="true",this.sessionReLoginSubscription=hd(this.afAuth).pipe(Qa(this.afAuth.currentUser),Ya(),Mr(([f,g])=>this.domService.onNetworkStatusChange$().pipe(mn(E=>E),En(1),De(()=>({previousUser:f,currentUser:g}))))).subscribe(E=>y(this,[E],function*({previousUser:f,currentUser:g}){if(!g&&f){let I=f?.stsTokenManager?.expirationTime,S=new Date().getTime(),L=I-S;S>I&&(this.analyticsService.trackEvent(St.Events.Core.SDK_SESSION_TOKEN_EXPIRED,{apiKey:this.apiKey,user:this.getUserForTelemetry(this.user$.value??void 0),lastLoggedInUserData:this.lastLoggedInUserData?{user:this.getUserForTelemetry(this.lastLoggedInUserData.user),autoLogin:this.lastLoggedInUserData.autoLogin,hasAuthToken:!!this.lastLoggedInUserData.userOptions?.authToken}:null,timeLeft:L,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.user$.value?.userSnippylyId),this.user$.value&&f?.uid===this.user$.value?.userSnippylyId&&this.lastLoggedInUserData?.user?.userSnippylyId===this.user$.value?.userSnippylyId&&(this.sessionReLoginCount>this.SESSION_RE_LOGIN_COUNT_LIMIT?(this.analyticsService.trackEvent(St.Events.Core.SDK_SESSION_RE_LOGIN_COUNT_EXCEEDED,{apiKey:this.apiKey,clientUserId:this.lastLoggedInUserData.user.userId,snippylyUserId:this.lastLoggedInUserData.user.userSnippylyId,timeLeft:L,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.user$.value?.userSnippylyId),this.sessionReLoginSubscription?.unsubscribe()):(this.sessionReLoginCount++,this.analyticsService.trackEvent(St.Events.Core.SDK_SESSION_RE_LOGIN_TRIGGERED,{apiKey:this.apiKey,clientUserId:this.lastLoggedInUserData.user.userId,snippylyUserId:this.lastLoggedInUserData.user.userSnippylyId,user:this.getUserForTelemetry(this.lastLoggedInUserData.user),timeLeft:L,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.lastLoggedInUserData.user.userSnippylyId),this.lastLoggedInUserData.user=yield this.updateUserWithColorAndTextColor(this.lastLoggedInUserData.user),this.initializeClient(this.lastLoggedInUserData.user,this.lastLoggedInUserData.userOptions,this.lastLoggedInUserData.initializeClientToken,this.lastLoggedInUserData.autoLogin,"internal-sessionReLogin"))))}}),f=>{this.loggingService.catch("Error in AuthService sessionReLoginSubscription: ",f)}),this.getUser$().pipe(yo(cp)).subscribe(f=>{let g=_R(f);this.coreActionsService.triggerAction(Wi.USER_UPDATE,g),this.coreActionsService.triggerAction(Wi.INIT_UPDATE,{event:Wi.USER_UPDATE,payload:{user:g}})})}catch(f){this.loggingService.catch("Error in AuthService constructor: ",f)}}setApiKey(r,i){this.loggingService.log("%c[WB] Calling FUNCTION: setApiKey","color: green;",r);try{if(this.apiKey){this.loggingService.log("API key is already set");return}this.apiKey=r,this.configService.setApiKey(this.apiKey),i||(i=new yT),this.configService.initConfig(i);let o=this.configService.getProxyConfig();if(o?.authHost)try{let s=this.afAuth?.config;s&&(s.apiHost=o.authHost,s.tokenApiHost=o.authHost)}catch(s){this.loggingService.catch("Error setting auth proxy config: ",s)}else try{let s=this.afAuth?.config;s&&s.apiHost!=="identitytoolkit.googleapis.com"&&(s.apiHost="identitytoolkit.googleapis.com",s.tokenApiHost="securetoken.googleapis.com")}catch(s){this.loggingService.catch("Error resetting auth proxy config: ",s)}i.debugMode?sessionStorage.setItem("debugMode","true"):sessionStorage.removeItem("debugMode"),this.autoLoginCalled||hd(this.afAuth).pipe(En(1)).subscribe(s=>y(this,null,function*(){if(this.autoLoginCalled=!0,s){let a=yield Np(s,!0).catch(c=>null);if(a){let{user:c}=a?.claims;this.autoLoginRequired&&(c=yield this.updateUserWithColorAndTextColor(c),this.initializeClient(c,this.buildAutoLoginOptions(),new Date().getTime(),!0,"internal-autoLogin"))}}})),!this.portableAutoLoginCalled&&this.configService.getEnablePortableBackend()===!0&&(this.portableAutoLoginCalled=!0,this.portableAutoLoginInFlight=this.autoLoginPortableSession())}catch(o){this.loggingService.catch("Error in setApiKey: ",o)}}setUsersService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUsersService","color: green;"),this.usersService=r}catch(i){this.loggingService.catch("Error in setUsersService: ",i)}}setUserPermissionService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserPermissionService","color: green;"),this.userPermissionService=r}catch(i){this.loggingService.catch("Error in setUserPermissionService: ",i)}}setDocService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDocService","color: green;"),this.docService=r}catch(i){this.loggingService.catch("Error in setDocService: ",i)}}setContactService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setContactService","color: green;"),this.contactService=r}catch(i){this.loggingService.catch("Error in setContactService: ",i)}}setIamService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setIamService","color: green;"),this.iamService=r}catch(i){this.loggingService.catch("Error in setIamService: ",i)}}setCommentService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentService","color: green;"),this.commentService=r}catch(i){this.loggingService.catch("Error in setCommentService: ",i)}}setCommonDbService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommonDbService","color: green;"),this.commonDbService=r}catch(i){this.loggingService.catch("Error in setCommonDbService: ",i)}}validateOrganizationId(r){if(this.isVersionGreaterThanOrEqualTo4()&&!r?.organizationId)if(this.analyticsService.trackEvent(St.Events.Core.SDK_VALIDATE_CLIENT_FAILED,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,message:"Organization Id is not set",forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r)},!0,r.userSnippylyId),this.configService.getSF())this.loggingService.catch("OrganizationId is not set in Identify method",void 0,void 0,!0);else throw new Error("OrganizationId is not set in Identify method")}setVeltAuthProvider(r){return y(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: setVeltAuthProvider","color: green;");try{this.onRetrySubscription?.unsubscribe(),this.authProviderListenerGeneration++;let i=null;if(!r.user)return null;r.generateToken&&typeof r.generateToken=="function"&&(i=yield r.generateToken());let o=yield ER(()=>window.Velt.identify(r.user,B(B({},r.options||{}),i&&{authToken:i}),{fromProvider:!0}).catch(s=>(r.onError&&typeof r.onError=="function"&&r.onError(s),Promise.reject(s))),r.retryConfig||{retryCount:0,retryDelay:0});return o&&r.generateToken&&typeof r.generateToken=="function"&&(this.onRetrySubscription=this.coreActionsService.onAction(Wi.ERROR).pipe(mn(s=>s.code==="token_expired"),En(10)).subscribe(s=>y(this,null,function*(){if(s.code==="token_expired"){let a=this.authProviderListenerGeneration,c=()=>a===this.authProviderListenerGeneration,l=this.docService?.getDocumentIds()?.map(I=>({id:I.clientDocumentId}))??[],d=this.docService?.getOptionsFromDocumentPaths()??void 0,h=[],f=this.docService?.getLocation();f&&h.push(f.location);let g=this.docService?.getLocations();if(g&&Object.values(g).forEach(I=>{h.push(I.location)}),(yield ER(()=>y(this,null,function*(){try{let I=yield r.generateToken?.();return c()&&I?window.Velt.identify(r.user,B(B({},r.options||{}),I&&{authToken:I}),{fromProvider:!0}):!0}catch{return!1}}),r.retryConfig||{retryCount:0,retryDelay:0}))&&c()){let I=this.docService?.getDocumentIds()?.map(V=>V.clientDocumentId)??[];D2(l.map(V=>V.id),I)&&(yield this.docService?.setDocuments({documents:l,options:d,source:"internal"}));let S=[],L=this.docService?.getLocation();L?.location?.id&&S.push(L.location.id),Object.values(this.docService?.getLocations()??{}).forEach(V=>{V?.location?.id&&S.push(V.location.id)}),D2(h.map(V=>V?.id).filter(Boolean),S)&&(yield this.docService?.setLocations({locations:h,source:"internal",options:{appendLocation:!f}}))}}}))),o}catch(i){return this.loggingService.catch("Error in setVeltAuthProvider: ",i),null}})}setUserToStorage(r){return y(this,null,function*(){try{if(r){let i=yield wT(r,r?.userId??"");localStorage.setItem(F.LOCAL_STORAGE.VELT_IDENTIFY_USER,i)}}catch(i){this.loggingService.catch("Error in setUserToStorage: ",i)}})}getUserFromStorage(r){return y(this,null,function*(){try{let i=localStorage.getItem(F.LOCAL_STORAGE.VELT_IDENTIFY_USER);return i?yield sp(i,r?.userId??""):null}catch(i){return this.loggingService.catch("Error in getUserFromStorage: ",i),null}})}setIsPrivateCommentsEnabled(r){try{this.isPrivateCommentsEnabled$.next(r)}catch(i){this.loggingService.catch("Error in setIsPrivateCommentsEnabled: ",i)}}getIsPrivateCommentsEnabled(){return this.isPrivateCommentsEnabled$.value}getIsPrivateCommentsEnabled$(){return this.isPrivateCommentsEnabled$.asObservable()}updateUserWithColorAndTextColor(r){return y(this,null,function*(){try{let i=JSON.parse(JSON.stringify(r??{})),o=yield this.getUserFromStorage(i);return!o||Object.keys(o).length===0?(delete i?.color,delete i?.textColor,i):(o?.color&&(i.color=o?.color),o?.textColor&&(i.textColor=o?.textColor),i)}catch(i){return this.loggingService.catch("Error in updateUserWithColorAndTextColor: ",i),r}})}updateUserIfRequired(r){return y(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserIfRequired","color: green;");try{let i=yield this.getUserFromStorage(r),o={};r.color&&r.color!==i?.color&&(o.color=r.color),r.textColor&&r.textColor!==i?.textColor&&(o.textColor=r.textColor),Object.keys(o).length>0&&r.clientOrganizationId&&this.docService?.addUserInfoToOrganization({organizationId:r.clientOrganizationId,user:Ee(B({},o),{userId:r.userId})})}catch(i){this.loggingService.catch("Error in updateUserIfRequired: ",i)}})}initializeClient(r,i,o,s,a){return y(this,null,function*(){try{if(this.autoLoginRequired=!1,this.portableResumeUserId=null,this.userOptions$.next(i),this.initializeClientToken)this.pendingUserLogin=r,this.pendingUserLoginSource=a;else{r.userSnippylyId=PV(this.configService.getApiKey(),r.userId),this.pendingUserLogin=void 0,this.pendingUserLoginSource=void 0,this.initializeClientToken=o;let c=this.portableSessionEpoch,l=this.portableLocalSessionEnds,d=yield hd(this.afAuth).pipe(En(1)).toPromise().catch(E=>null),h=!0;this.providedUser=JSON.parse(JSON.stringify(r));let f=!d&&s?this.takePendingPortableRestore(r,i):null,g=f?.envelope??null;if(g){if(this.loggingService.log("%c[WB] Calling FUNCTION: restorePortableSession","color: green;"),this.validateOrganizationId(r),!(yield this.applyIdentifyResponse(r,g.res,s)))return;h=!1,this.trackAutoAuthSuccess(r,a)}else if(!d&&s&&a==="internal-autoLogin"&&this.configService?.getEnablePortableBackend()===!0)return f?.resume?(Wn("session.resume-skipped",f.overtaken?"overtaken":"not restorable"),this.loggingService.log("Velt [portable backend]: not following the session another page saved; waiting for identify().")):f?.overtaken?(Wn("session.restore-discarded"),this.loggingService.log("Velt [portable backend]: discarding a reload restore that a sign-out or a new identify overtook."),this.clearPersistedPortableSessionIfUnchanged(f.raw)):(this.loggingService.log("Velt [portable backend]: nothing restorable on reload; waiting for identify()."),this.clearPersistedPortableSession()),this.initializeClientToken=0,this.checkForPendingLogin(),null;if(d){let E=yield Np(d,!0).catch(V=>null);if(!E)return;let{user:I,firebaseConfig:S,advancedQueries:L}=E.claims;d?.uid!==r?.userSnippylyId||r?.groupId!==I?.groupId||r?.organizationId!==I?.organizationId||i?.forceReset||!s&&r?.organizationId&&!this.forceReLoggedIn||this.forceReLoginRequiredForAdvancedQueries(r)||this.forceReLoginRequiredForRegion(r,S)||this.forceReLoginRequiredForCommentViews(r)?(localStorage.setItem(F.LOCAL_STORAGE.VELT_USER_FORCE_RE_LOGGED_IN,"true"),localStorage.setItem(F.LOCAL_STORAGE.VELT_COMMENT_VIEWS_MIGRATED,"true"),this.forceReLoggedIn=!0,yield this.signOutUser("internal"),c=this.portableSessionEpoch,l=this.portableLocalSessionEnds):(this.loggingService.log("%c[WB] Calling FUNCTION: reinitializeCurrentUser","color: green;"),this.loggingService.log("Keeping user"),yield this.updateUserIfRequired(r),this.validateOrganizationId(r),this.setFirebaseConfig(S),this.setAdvancedQueries(L),I&&(this.providedUser.isAdmin=!!I.isAdmin),this.initializeSignedInUser(d,s,r),h=!1,this.trackAutoAuthSuccess(r,a))}else if(h&&c===this.portableSessionEpoch&&this.isPortableIdentityChange(r,i)){let E=this.signOutUser("internal");c=this.portableSessionEpoch,l=this.portableLocalSessionEnds,yield E}if(h){this.analyticsService.trackEvent(St.Events.Core.SDK_VALIDATE_CLIENT_TRIGGERED,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r),source:a},!0,r.userSnippylyId,r.userId);let E=yield this.requestIdentify(r,i?.authToken);if(E.error){if(this.analyticsService.trackEvent(St.Events.Core.SDK_VALIDATE_CLIENT_FAILED,Ee(B({apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,message:E.error,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r)},E),{source:a}),!0,r.userSnippylyId,r.userId),E.error&&typeof E.error=="string")if(this.isTokenExpiredIdentifyError(E))this.emitIdentifyTokenExpiredError(E,r,a);else{let S=E;this.coreActionsService.triggerAction(Wi.ERROR,S)}throw E}else this.tokenExpiredErrorCount=0;if(this.shouldHandlePortableBackend(E)&&this.isPortableIdentifyOvertaken(c,l,s))return this.loggingService.log("Velt [portable backend]: discarding an identify response that a sign-out overtook."),this.initializeClientToken=0,this.checkForPendingLogin(),null;if(this.shouldHandlePortableBackend(E)&&c!==this.portableSessionEpoch&&(this.autoLoginRequired=!1,this.portableResumeUserId=null),this.analyticsService.trackEvent(St.Events.Core.SDK_VALIDATE_CLIENT_SUCCESS,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r),source:a},!0,r.userSnippylyId,r.userId),this.validateOrganizationId(r),!(yield this.applyIdentifyResponse(r,E,s)))return}this.initializeClientToken=0,this.lastLoggedInUserData={user:r,userOptions:i,initializeClientToken:o,autoLogin:s},this.checkForPendingLogin()}return r}catch(c){return this.initializeClientToken=0,this.checkForPendingLogin(),this.loggingService.catch("Error in initializeClient: ",c),i?.throwError?Promise.reject(c):Promise.resolve(null)}})}isPortableIdentifyOvertaken(r,i,o){let s=this.portableSessionEpoch-r;return o?s!==0:s!==this.portableLocalSessionEnds-i}isPortableIdentityChange(r,i){try{if(!this.portableAuthUser$.value)return!1;let o=this.portableSessionIdentity?.user??this.user$.value;return o?o.userSnippylyId!==r?.userSnippylyId||r?.groupId!==o.groupId||r?.organizationId!==o.organizationId||!!i?.forceReset:!1}catch(o){return this.loggingService.catch("Error in isPortableIdentityChange: ",o),!1}}isVersionGreaterThanOrEqualTo4(){try{let r=xc();return(r?parseInt(r.split(".")?.[0]||"0"):0)>=4}catch(r){return this.loggingService.catch("Error in isVersionGreaterThanOrEqualTo4: ",r),!1}}isVersion4Point5(){try{let r=xc();if(r){let i=r.split("."),o=parseInt(i[0]||"0"),s=parseInt(i[1]||"0"),a=parseInt(i[2]||"0");if(o>=4&&s>=5)return o===4&&s===5&&a===0?!r.toLowerCase().includes("beta"):!0}return!1}catch(r){return this.loggingService.catch("Error in isVersion4Point5: ",r),!1}}forceReLoginRequiredForAdvancedQueries(r){try{let i=this.isVersionGreaterThanOrEqualTo4(),o=!1;try{let s=localStorage.getItem(F.LOCAL_STORAGE.VELT_ADVANCED_QUERIES);s&&(o=JSON.parse(s)?.advancedQueriesEnabled)}catch(s){this.loggingService.catch("Error in forceReLoginRequiredForAdvancedQueries: ",s)}return!!(i&&r.organizationId&&!o)}catch(i){return this.loggingService.catch("Error in forceReLoginRequiredForAdvancedQueries: ",i),!1}}forceReLoginRequiredForCommentViews(r){try{let i=this.isVersion4Point5(),o=!1;try{let s=localStorage.getItem(F.LOCAL_STORAGE.VELT_COMMENT_VIEWS_MIGRATED);s&&(o=JSON.parse(s))}catch(s){this.loggingService.catch("Error in forceReLoginRequiredForCommentViews: ",s)}return!!(i&&r.organizationId&&!o)}catch(i){return this.loggingService.catch("Error in forceReLoginRequiredForCommentViews: ",i),!1}}forceReLoginRequiredForRegion(r,i){try{return!!(this.isVersionGreaterThanOrEqualTo4()&&r.organizationId&&!i?.region)}catch(o){return this.loggingService.catch("Error in forceReLoginRequiredForRegion: ",o),!1}}checkForPendingLogin(){this.pendingUserLogin&&this.initializeClient(this.pendingUserLogin,this.userOptions$?.value||{},new Date().getTime(),void 0,this.pendingUserLoginSource)}setFirebaseConfig(r){this.loggingService.log("%c[WB] Calling FUNCTION: setFirebaseConfig","color: green;");try{this.firebaseConfig$.value||this.firebaseConfig$.next({firebaseOptions:B(B({},this.endpointsService.getFirebaseConfig()),r)})}catch(i){this.loggingService.catch("Error in setFirebaseConfig: ",i)}}requestIdentify(r,i){return y(this,null,function*(){let o=xc();this.usersService?.userResolverConfigured?.()&&(r=IR(r));let s=this.endpointsService.getPortableIdentifyUrl();return s?FG({url:s,apiKey:this.apiKey,user:r,version:o,authToken:i}):(yield pd(this.functions,od({url:this.endpointsService.getCloudFunctionUrl("validateClient"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:1200*1e3})({apiKey:this.apiKey,user:r,version:o,authToken:i}))?.data})}requestPortableRefresh(r){return y(this,null,function*(){let i=this.endpointsService.getPortableIdentifyUrl();if(!i||Pc(i)){let o="the portable identify URL is not configured; the renewal credential was not sent";return{error:o,code:"network_error",message:o,source:"identify"}}return BG({url:VG(i,"refresh"),apiKey:this.apiKey,refreshToken:r,timeoutMs:xG()})})}reportPortableRefreshMisconfigured(r){try{let i=String(r?.code??"unknown");if(this.reportedPortableRefreshCodes.has(i))return;if(this.reportedPortableRefreshCodes.add(i),i===e.PORTABLE_NO_CREDENTIAL_ENVELOPE.code){console.error("Velt [portable backend]: this session has no renewal credential for the configured gateway (the identify answer carried no refreshToken, or selfHosted.portableBackendUrl changed after sign-in), so it cannot be renewed: it is signed out and the app must identify() again. Every identify answer from portable-v0.1.6 or later carries one.");return}let o=r?.message?` (${r.message})`:"";console.error(i==="invalid-argument"?`Velt [portable backend]: the gateway rejected the session renewal as malformed: invalid-argument${o}. The SDK and gateway versions disagree on /identify/refresh; renewal is stopped for this session.`:`Velt [portable backend]: the gateway refused the session renewal: ${i}${o}. A deployment setting is wrong (the allowed origins, or the identify configuration for this API key). Renewal is stopped for this session; after the setting is fixed, a reload renews from the saved session.`)}catch{}}emitIdentifyTokenExpiredError(r,i,o){if(this.tokenExpiredErrorCount++,this.tokenExpiredErrorCount<=this.TOKEN_EXPIRED_ERROR_COUNT_LIMIT){let s={code:"token_expired",message:"Token expired",error:r?.error,source:r?.source};this.coreActionsService.triggerAction(Wi.ERROR,s)}else{let s={code:"too_many_retries",message:"Token expired. Too many retries.",error:r?.error,source:r?.source};this.coreActionsService.triggerAction(Wi.ERROR,s),this.analyticsService.trackEvent(St.Events.Core.SDK_JWT_EXPIRED_RETRY_EXCEEDED,{apiKey:this.apiKey,clientUserId:i.userId,snippylyUserId:i.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,source:o},!0,i.userSnippylyId,i.userId)}}isTokenExpiredIdentifyError(r){try{return r?.code==="token_expired"||!!r?.error?.toLowerCase?.()?.includes("token expired")}catch{return!1}}shouldHandlePortableBackend(r){try{return this.configService?.getEnablePortableBackend()===!0&&XG(r)}catch(i){return this.loggingService.catch("Error in shouldHandlePortableBackend: ",i),!1}}applyIdentifyResponse(r,i,o){return y(this,null,function*(){if(this.shouldHandlePortableBackend(i)){this.portableSessionEpoch++;let s=this.portableSessionEpoch,a=Xc(i),c=a?this.endpointsService.getPortableIdentifyUrl()??void 0:void 0;if(this.portableSessionIdentity=B({user:r,epoch:s},a?{refreshToken:a,refreshTokenIssuer:c}:{}),this.portableSessionStartedAt=Date.now(),this.handlePortableBackendResponse(i),yield this.applyPortableProjectConfig(i),s!==this.portableSessionEpoch)return Wn("session.adopt-discarded"),this.loggingService.log("Velt [portable backend]: discarding a portable sign-in that a sign-out or a new identify overtook."),!0;this.initializePortableSignedInUser(r,i)}else if(i.firebaseConfig){this.clearPortableBackendState(),this.setFirebaseConfig(i.firebaseConfig),yield this.signInWithCustomToken(r,i.token),this.loggingService.log("new signed in user",this.afAuth.currentUser);let s=yield Np(this.afAuth.currentUser,!0).catch(l=>null);if(!s)return!1;let{user:a,advancedQueries:c}=s.claims;this.setAdvancedQueries(c),this.providedUser.isAdmin=!!a?.isAdmin,this.initializeSignedInUser(this.afAuth.currentUser,o,r)}return!0})}applyPortableProjectConfig(r){return y(this,null,function*(){try{let i=yield KG({apiEndpoint:r?.apiEndpoint,token:r?.token});if(!i)return;this.setIsPrivateCommentsEnabled(i.isPrivateCommentsEnabled);let o=i.activityConfig??{immutable:!1,isEnabled:!1};this.cachedActivityConfig=o,this.activityService?.setActivityFeatureConfig(o)}catch(i){this.loggingService.catch("Error in applyPortableProjectConfig: ",i)}})}handlePortableBackendResponse(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: handlePortableBackendResponse","color: green;"),this.portableBackend$.next({backend:r?.backend,wsEndpoint:r?.wsEndpoint,apiEndpoint:r?.apiEndpoint}),QG({backend:r?.backend,token:r?.token??null,wsEndpoint:r?.wsEndpoint,apiEndpoint:r?.apiEndpoint}),this.schedulePortableTokenRefresh(r?.token??null)}catch(i){this.loggingService.catch("Error in handlePortableBackendResponse: ",i)}}schedulePortableTokenRefresh(r){try{if(this.clearPortableTokenRefresh(),this.portableToken=r,!r)return;this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0;let i=$G(wp(r),Date.now());if(i!==null?this.armPortableRefreshTimer(i,"expiry"):this.loggingService.log("Velt [portable backend]: no proactive token refresh scheduled (token expiry unreadable or already past)."),typeof document<"u"&&typeof document.addEventListener=="function"){this.portableVisibilityHandler=o=>{try{let s=wN(this.portableToken,Date.now());if(Wn(`page.${o?.type??"lifecycle"}`,`visibility=${typeof document<"u"?document.visibilityState:"?"} credentialExpired=${s}`),o?.type==="pageshow"&&o.persisted===!1)return;s?this.refreshPortableToken("focus"):this.checkPortableSessionAgainstStorage(`page.${o?.type??"lifecycle"}`),ZG()}catch{}};for(let o of e.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS)document.addEventListener(o,this.portableVisibilityHandler);typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("pageshow",this.portableVisibilityHandler)}this.armPortableStorageListener()}catch(i){this.loggingService.catch("Error scheduling portable token refresh: ",i)}}readStoredPortableSessionRaw(){try{return localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{return}}readPortableSavedSession(r){return y(this,null,function*(){try{let i;try{i=localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{return{verdict:"persist"}}if(!i){let a=this.readPortableSignOutAt();return{verdict:a!==null&&a>=this.portableSessionStartedAt?"stop":"persist"}}if(i===this.portableSavedSessionRaw)return{verdict:"persist"};let o=null;try{o=yield sp(i,this.apiKey??"")}catch{o=null}return o?.v!==1||o?.apiKey!==this.apiKey||!o?.user?.userId?{verdict:"renew-only"}:o.user.userId!==r?{verdict:"stop"}:{verdict:"persist",sharedRefreshToken:(o?.portableBackendUrl??null)===(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)?Xc(o?.res):void 0}}catch(i){return this.loggingService.catch("Error in AuthService readPortableSavedSession: ",i),{verdict:"persist"}}})}recordPortableSignOut(){try{if(!this.apiKey)return;let r={};try{let i=JSON.parse(localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)??"{}");i&&typeof i=="object"&&!Array.isArray(i)&&(r=i)}catch{r={}}r[this.apiKey]=Date.now(),localStorage.setItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT,JSON.stringify(r))}catch{}}armPortableRefreshTimer(r,i){this.cancelPortableRefreshTimer(),this.portableRefreshTimer=setTimeout(()=>this.refreshPortableToken(i),r)}cancelPortableRefreshTimer(){this.portableRefreshTimer&&(clearTimeout(this.portableRefreshTimer),this.portableRefreshTimer=null)}readPortableSignOutAt(){try{let r=JSON.parse(localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)??"null"),i=r&&this.apiKey?r[this.apiKey]:void 0;return typeof i=="number"&&Number.isFinite(i)?i:null}catch{return null}}clearPortableTokenRefresh(){try{if(this.cancelPortableRefreshTimer(),this.portableVisibilityHandler&&typeof document<"u")for(let r of e.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS)document.removeEventListener(r,this.portableVisibilityHandler);this.portableVisibilityHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("pageshow",this.portableVisibilityHandler),this.portableVisibilityHandler=null,this.portableStorageHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("storage",this.portableStorageHandler),this.portableStorageHandler=null}catch{}}refreshPortableToken(r){return y(this,null,function*(){let i=this.portableSessionEpoch;if(this.portableRefreshInFlightEpoch!==i){this.portableRefreshInFlightEpoch=i;try{let o=this.portableSessionIdentity,s=o?.user;if(!o||o.epoch!==i||!s?.userId||!this.portableBackend$.value)return;if(this.portableRenewalStopped?.epoch===i){Wn("credential.refresh-skipped",`${this.portableRenewalStopped.reason}; waiting for identify()`);return}let a=yield this.readPortableSavedSession(s.userId);if(i!==this.portableSessionEpoch)return;if(a.verdict==="stop"){this.endPortableSessionFromAnotherPage(s,`refresh:${r}`);return}let c=a.sharedRefreshToken,l=this.endpointsService.getPortableIdentifyUrl()??void 0;c&&l&&this.portableSessionIdentity&&c!==this.portableSessionIdentity.refreshToken&&(Wn("credential.shared-adopted"),this.portableSessionIdentity=Ee(B({},this.portableSessionIdentity),{refreshToken:c,refreshTokenIssuer:l}));let d=this.portableSessionIdentity??o,h=d.refreshToken&&d.refreshTokenIssuer===l?d.refreshToken:void 0;if(!h){this.reportPortableRefreshMisconfigured(e.PORTABLE_NO_CREDENTIAL_ENVELOPE),this.endPortableSessionForDeadCredential(s,e.PORTABLE_NO_CREDENTIAL_ENVELOPE,r);return}this.loggingService.log(`Velt [portable backend]: refreshing the gateway credential (${r}).`),Wn("credential.refresh-requested",`reason=${r} via=refresh`);let f=yield this.requestPortableRefresh(h);if(i!==this.portableSessionEpoch){Wn("credential.refresh-discarded",`reason=${r}`),this.loggingService.log("Velt [portable backend]: discarding a credential refresh that a sign-out or a new identify overtook.");return}if(!this.shouldHandlePortableBackend(f)||!f?.token){if(f?.code===RN){this.endPortableSessionForDeadCredential(s,f,r);return}if(NN.has(f?.code)){Wn("credential.refresh-misconfigured",`code=${f?.code}`),this.portableRenewalStopped={epoch:i,reason:`renewal refused: ${f?.code}`},this.cancelPortableRefreshTimer(),this.reportPortableRefreshMisconfigured(f);return}this.portableRefreshFailures++,this.portableRefreshFailures>=e.PORTABLE_REFRESH_WARN_AFTER_FAILURES&&this.reportPortableRefreshFailing(f,i);let S=Date.now();wN(this.portableToken,S)&&this.portableRefreshFailuresPastExpiry++,this.armPortableRefreshTimer(WG(wp(this.portableToken),S,this.portableRefreshFailuresPastExpiry),r);return}let g=this.readStoredPortableSessionRaw(),E=yield this.readPortableSavedSession(s.userId);if(i!==this.portableSessionEpoch){Wn("credential.refresh-discarded",`reason=${r}`);return}if(E.verdict==="stop"){this.endPortableSessionFromAnotherPage(s,`refresh-answered:${r}`);return}Wn("credential.refreshed"),this.handlePortableBackendResponse(f);let I=Xc(f)??h;this.portableSessionIdentity?.epoch===i&&(this.portableSessionIdentity=Ee(B({},this.portableSessionIdentity),{refreshToken:I,refreshTokenIssuer:l})),E.verdict==="persist"&&this.persistPortableSession(s,Ee(B({},f),{refreshToken:I}),{expectStoredRaw:g})}catch(o){this.loggingService.catch("Error refreshing portable token: ",o)}finally{this.portableRefreshInFlightEpoch===i&&(this.portableRefreshInFlightEpoch=null)}}})}reportPortableRefreshFailing(r,i){try{if(this.portableRefreshWarnedEpoch===i)return;this.portableRefreshWarnedEpoch=i,console.warn(`Velt [portable backend]: could not renew the gateway credential (${this.portableRefreshFailures} attempts in a row${r?.code?`, last: ${r.code}`:""}). The SDK keeps retrying \u2014 every 30 s while the current token is valid; once it has expired, after 30 s, doubling up to every 16 minutes, and each time the page becomes active again \u2014 and the realtime session is unavailable from the moment the token expires until a renewal succeeds. Check that the gateway's /identify/refresh endpoint is reachable and the API key is enabled.`)}catch{}}endPortableSessionForDeadCredential(r,i,o){Wn("credential.refresh-credential-invalid",`reason=${o}`),this.portableSavedSessionRaw&&this.clearPersistedPortableSessionIfUnchanged(this.portableSavedSessionRaw),this.endPortableSessionLocally(r),this.emitIdentifyTokenExpiredError(i,r,"internal-portableRefresh")}endPortableSessionFromAnotherPage(r,i){Wn("session.ended-elsewhere",i),this.loggingService.log("Velt [portable backend]: another page signed out or signed in another user; this page's session ends too."),this.endPortableSessionLocally(r)}checkPortableSessionAgainstStorage(r){return y(this,null,function*(){try{let i=this.portableSessionEpoch,o=this.portableSessionIdentity;if(!o||o.epoch!==i||!o.user?.userId)return;let{verdict:s}=yield this.readPortableSavedSession(o.user.userId);s==="stop"&&i===this.portableSessionEpoch&&this.endPortableSessionFromAnotherPage(o.user,r)}catch(i){this.loggingService.catch("Error checking the portable session against storage: ",i)}})}armPortableStorageListener(){try{if(this.portableStorageHandler||typeof window>"u"||typeof window.addEventListener!="function")return;this.portableStorageHandler=r=>{try{let i=r?.key;if(i!==null&&i!==F.LOCAL_STORAGE.VELT_PORTABLE_SESSION&&i!==F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)return;this.portableSessionIdentity?this.checkPortableSessionAgainstStorage("storage"):this.portableResumeUserId&&this.resumePortableSessionFromAnotherPage()}catch{}},window.addEventListener("storage",this.portableStorageHandler)}catch(r){this.loggingService.catch("Error arming the portable storage listener: ",r)}}resumePortableSessionFromAnotherPage(){let r=this.portableResumeUserId;!r||this.portableSessionIdentity||this.initializeClientToken||!this.autoLoginRequired||this.configService?.getEnablePortableBackend()!==!0||(this.portableAutoLoginInFlight=this.portableAutoLoginInFlight.then(()=>this.autoLoginPortableSession({onlyUserId:r})).catch(()=>{}))}initializePortableSignedInUser(r,i){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: initializePortableSignedInUser","color: green;"),!i?.token){this.portableAuthUser$.value&&(this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState());return}let o=new zi;o.type="signedIn",o=B(B({},o),r),o.color=o.color||this.getUserAvatarColor(o.userId),o.textColor=o.textColor||this.getUserTextColor(o.userId),o.initial=o.initial||o.name?.charAt(0).toUpperCase()||o.email?.charAt(0).toUpperCase(),this.setUserToStorage(o),this.persistPortableSession(o,i);let s=Object.assign({},o);delete s.contacts,this.analyticsService.identifyUser(o.userSnippylyId,s,{forceReset:this.userOptions$.value?.forceReset}),this.user$.next(o),this.portableAuthUser$.next({uid:o.userSnippylyId})}catch(o){this.loggingService.catch("Error in initializePortableSignedInUser: ",o)}}clearPortableBackendState(){try{this.portableSignOutOwnsEpochBump||this.portableSessionEpoch++,this.releasePortableSession({clearStorage:!0})}catch(r){this.loggingService.catch("Error clearing portable backend state: ",r)}}releasePortableSession(r){this.pendingPortableRestore=null,this.portableSessionIdentity=null,r.clearStorage&&(this.portableAutoLoginCalled||this.configService?.getEnablePortableBackend()===!0)&&this.clearPersistedPortableSession(),!(!this.portableBackend$.value&&!this.portableAuthUser$.value)&&(this.clearPortableTokenRefresh(),this.portableToken=null,this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0,this.portableBackend$.next(null),this.portableAuthUser$.next(null),this.user$.next(null),JG())}endPortableSessionLocally(r){try{this.userPermissionService?.invalidateAllPermissionsState(),this.portableSessionEpoch++,this.portableLocalSessionEnds++,this.resetServicesCache(),this.user$.next(null),this.releasePortableSession({clearStorage:!1}),this.autoLoginRequired=!0,this.portableResumeUserId=r?.userId??null,this.armPortableStorageListener()}catch(i){this.loggingService.catch("Error ending the portable session: ",i)}}trackAutoAuthSuccess(r,i){this.analyticsService.trackEvent(St.Events.Core.SDK_USER_AUTH_SUCCESS,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,authType:"auto",forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r),source:i})}buildAutoLoginOptions(){return this.userOptions$?.value?Ee(B({},this.userOptions$.value),{replaceContacts:!1,replaceGroupContacts:!1,replacePrivateContacts:!1}):{}}persistPortableSession(r,i,o){let s=this.portableSessionEpoch;return this.portablePersistInFlight=this.portablePersistInFlight.then(()=>this.writePortableSessionEnvelope(r,i,s,o?.expectStoredRaw)).catch(()=>{}),this.portablePersistInFlight}writePortableSessionEnvelope(r,i,o,s){return y(this,null,function*(){try{if(!i?.token||!r?.userId||!this.apiKey)return;let a=this.user$.value;if(a?.userSnippylyId&&r.userSnippylyId&&a.userSnippylyId!==r.userSnippylyId)return;let c=this.getUserWithoutContacts(r);if(!c)return;let l={v:1,apiKey:this.apiKey,portableBackendUrl:this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null,user:c,res:B({backend:i.backend,wsEndpoint:i.wsEndpoint,apiEndpoint:i.apiEndpoint,token:i.token},Xc(i)?{refreshToken:Xc(i)}:{})},d=yield wT(l,this.apiKey);if(o!==this.portableSessionEpoch){this.loggingService.log("Velt [portable backend]: dropping a session envelope write that a sign-out or a new identify overtook.");return}if(s!==void 0&&localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)!==s){this.loggingService.log("Velt [portable backend]: not re-persisting a refreshed credential \u2014 another page changed the saved session meanwhile.");return}let h=this.readPortableSignOutAt();if(h!==null&&h>this.portableSessionStartedAt){this.loggingService.log("Velt [portable backend]: not persisting the session \u2014 another page signed out after it began.");return}typeof d=="string"&&!d.startsWith("{")&&d!==JSON.stringify(l)&&(localStorage.setItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION,d),this.portableSavedSessionRaw=d)}catch(a){this.loggingService.catch("Error in writePortableSessionEnvelope: ",a)}})}readPersistedPortableSession(){return y(this,null,function*(){try{let r=localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION);if(!r)return null;let i=yield sp(r,this.apiKey??"");return i?i.v!==1||i.apiKey!==this.apiKey||!i.user?.userId||!i.res?.token?(this.clearPersistedPortableSession(),null):(this.portableSavedSessionRaw=r,{envelope:i,raw:r}):null}catch(r){return this.loggingService.catch("Error in readPersistedPortableSession: ",r),null}})}clearPersistedPortableSession(){this.portableSavedSessionRaw=null;try{localStorage.removeItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{}}clearPersistedPortableSessionIfUnchanged(r){try{r&&localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)===r&&this.clearPersistedPortableSession()}catch{}}isPortableTokenNearExpiry(r){let i=wp(r);return i===null||i-Date.now()<=3e4}isPortableRestoreConfigured(){try{let r=this.endpointsService?.getPortableIdentifyUrl?.();return this.configService?.getEnablePortableBackend()===!0&&!!r&&!Pc(r)}catch{return!1}}isRestorablePortableSession(r,i,o){try{if(!this.isPortableRestoreConfigured()||o?.forceReset||r.portableBackendUrl!==(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)||!zc(r.res?.apiEndpoint)||r.user?.userSnippylyId!==i?.userSnippylyId)return!1;let s=this.user$.value;return s?.userSnippylyId&&s.userSnippylyId!==r.user.userSnippylyId||this.isPortableTokenNearExpiry(r.res.token)?!1:this.shouldHandlePortableBackend(r.res)}catch(s){return this.loggingService.catch("Error in isRestorablePortableSession: ",s),!1}}takePendingPortableRestore(r,i){let o=this.pendingPortableRestore;if(this.pendingPortableRestore=null,!o)return null;let s=o.resume===!0;return o.epoch!==this.portableSessionEpoch?{envelope:null,overtaken:!0,raw:o.raw,resume:s}:{envelope:this.isRestorablePortableSession(o.envelope,r,i)?o.envelope:null,overtaken:!1,raw:o.raw,resume:s}}autoLoginPortableSession(r){return y(this,null,function*(){let i=this.portableSessionEpoch,o=()=>i!==this.portableSessionEpoch||!this.autoLoginRequired,s=!!r?.onlyUserId;try{let a=yield this.readPersistedPortableSession(),c=a?.envelope;if(!a||!c||o()||s&&c.user?.userId!==r?.onlyUserId)return;if(!this.isPortableRestoreConfigured()){s||this.clearPersistedPortableSession();return}if(c.portableBackendUrl!==(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)){s||(this.loggingService.log("Velt [portable backend]: the persisted session belongs to a different gateway; dropped."),this.clearPersistedPortableSession());return}let l=c;if(this.isPortableTokenNearExpiry(c.res.token)){let h=Xc(c.res);if(!h){this.loggingService.log("Velt [portable backend]: the persisted session has no renewal credential; waiting for identify()."),this.clearPersistedPortableSessionIfUnchanged(a.raw);return}Wn("credential.restore-renew","via=refresh");let f=yield this.requestPortableRefresh(h);if(o())return;if(!this.shouldHandlePortableBackend(f)||!f?.token){if(f?.code==="network_error"){this.loggingService.log("Velt [portable backend]: could not reach the gateway to renew the persisted session; keeping it for the next attempt.");return}if(NN.has(f?.code)&&this.reportPortableRefreshMisconfigured(f),f?.code!==RN){this.loggingService.log(`Velt [portable backend]: the persisted session's renewal was refused for now (${f?.code??"no code"}); keeping it for the next attempt.`);return}this.loggingService.log("Velt [portable backend]: the persisted session could not be renewed on reload; waiting for identify()."),this.clearPersistedPortableSessionIfUnchanged(a.raw);return}let g=Xc(f)??h;l=Ee(B({},c),{res:{backend:f.backend,wsEndpoint:f.wsEndpoint,apiEndpoint:f.apiEndpoint,token:f.token,refreshToken:g}})}if(o())return;this.pendingPortableRestore=B({envelope:l,epoch:i,raw:a.raw},s?{resume:!0}:{});let d=this.buildAutoLoginOptions();s&&delete d.forceReset,yield this.initializeClient(B({},l.user),d,new Date().getTime(),!0,"internal-autoLogin")}catch(a){this.loggingService.catch("Error in autoLoginPortableSession: ",a)}finally{this.pendingPortableRestore=null}})}getPortableBackend(){return this.portableBackend$.value}getFirebaseConfig$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getFirebaseConfig","color: green;"),this.firebaseConfig$.asObservable()}getFirebaseConfig(){return this.loggingService.log("%c[WB] Calling FUNCTION: getFirebaseConfig","color: green;"),this.firebaseConfig$.value}setAdvancedQueries(r){this.loggingService.log("%c[WB] Calling FUNCTION: setAdvancedQueries","color: green;");try{r&&typeof r=="object"&&localStorage.setItem(F.LOCAL_STORAGE.VELT_ADVANCED_QUERIES,JSON.stringify(r)),this.advancedQueries$.next(r)}catch(i){this.loggingService.catch("Error in setAdvancedQueries: ",i)}}getAdvancedQueries$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAdvancedQueries$","color: green;"),this.advancedQueries$.asObservable()}getAdvancedQueries(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAdvancedQueries","color: green;"),this.advancedQueries$.value}getAdvancedQueriesEnabled(r){try{return!this.configService.getConfig()?.advancedQueriesDisabled&&(r||!!this.getAdvancedQueries()?.advancedQueriesEnabled)}catch(i){return this.loggingService.catch("Error in getAdvancedQueriesEnabled: ",i),!1}}signOutPreviousUser(){return this.signOutPreviousUser$.asObservable()}getUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUser","color: green;"),this.afAuth?.currentUser||this.portableAuthUser$.value?this.user$.value:null}getProvidedOrCurrentUserId(){try{return this.providedUser?.userId??this.user$.value?.userId??void 0}catch(r){this.loggingService.catch("Error in getProvidedOrCurrentUserId: ",r);return}}scheduleLoggedInUserResolveRetry(r,i){return y(this,null,function*(){try{if(!r||this.loggedInUserResolveRetryInFlightUserId===r)return;this.loggedInUserResolveRetryInFlightUserId=r;let o=this.loggedInUserResolveRetryDelaysMs;for(let s=0;s<o.length;s++){if(yield new Promise(l=>setTimeout(l,o[s])),(this.providedUser?.userId??this.user$.value?.userId)!==r)return;let a=yield this.usersService?.resolveUsers({userIds:[r],organizationId:i,skipUserCheck:!0,forceResolve:!0,moduleName:IT.IDENTIFY});if((this.providedUser?.userId??this.user$.value?.userId)!==r)return;let c=a?.[r];if(c&&this.applyLateResolvedLoggedInUser(r,c))return}this.loggingService.catch(`User resolver did not return the logged-in user after ${o.length} retry attempts \u2014 comments created by this author will have no resolved profile until the resolver returns them`,{userId:r,organizationId:i,attempts:o.length})}catch(o){this.loggingService.catch("Error in scheduleLoggedInUserResolveRetry: ",o)}finally{this.loggedInUserResolveRetryInFlightUserId===r&&(this.loggedInUserResolveRetryInFlightUserId=null)}})}applyLateResolvedLoggedInUser(r,i){try{let o=this.user$.value;if(!o||o.userId!==r)return!1;if(!this.afAuth?.currentUser)return!0;let s=Yne(o,i);return this.setUserToStorage(s),this.user$.next(s),!0}catch(o){return this.loggingService.catch("Error in applyLateResolvedLoggedInUser: ",o),!1}}combinedAuthBearer$(){let r=!1;return Ka([hd(this.afAuth).pipe(Qa(VN)),this.portableAuthUser$]).pipe(mn(([i,o])=>(o!==null&&(r=!0),!!(i!==VN||o!==null||r))),De(([i,o])=>(i===VN?null:i)??o))}getUser$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUser$","color: green;"),this.combinedAuthBearer$().pipe(Mr(r=>r?this.user$.asObservable():lt(null)),yo(cp))}getAuthUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAuthUser","color: green;"),this.afAuth?.currentUser}getAuthState$(){return this.combinedAuthBearer$()}getIdTokenResultForUser(r,i){return Np(r,i)}getUserOptions(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOptions","color: green;"),this.userOptions$.value}getUserOptions$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOptions$","color: green;"),this.userOptions$.asObservable()}updateUser(r){this.loggingService.log("%c[WB] Calling FUNCTION: updateUser","color: green;");try{let i=this.user$.value;if(r.userId&&r.userId!==i?.userId||r?.groupId&&r?.groupId!==i?.groupId||r?.organizationId&&r?.organizationId!==i?.organizationId)this.providedUser=r,this.initializeClient(r,this.userOptions$?.value||{},new Date().getTime(),void 0,"internal-updateUser");else if(this.providedUser=B(B({},this.providedUser),r),i){let o=B(B({},i),r);this.updateUserInternally(o)}}catch(i){this.loggingService.catch("Error in updateUser: ",i)}}signInWithCustomToken(r,i,o="manual"){this.loggingService.log("%c[WB] Calling FUNCTION: signInWithCustomToken","color: green;");try{return IG(this.afAuth,i).then(s=>(this.analyticsService.trackEvent(St.Events.Core.SDK_USER_AUTH_SUCCESS,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,authType:o,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r)}),s)).catch(s=>(this.analyticsService.trackEvent(St.Events.Core.SDK_USER_AUTH_FAILED,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,authType:o,forceReset:this.userOptions$.value?.forceReset,message:s.message,user:this.getUserForTelemetry(r)}),s))}catch(s){return this.loggingService.catch("Error in signInWithCustomToken: ",s),Promise.reject(s)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache","color: green;");try{this.activityService?.resetActivityFeatureConfig()}catch(r){this.loggingService.catch("Error in clearCache: ",r)}}resetServicesCache(){this.loggingService.log("%c[WB] Calling FUNCTION: resetServicesCache in AuthService","color: green;");try{this.crdtService?.flushAllEditorActivities(),this.clearCache(),this.commonDbService?.unsubscribeFromObservables(),this.activityService?.destroy(),this.docService?.clearCacheOnUserCascade(),this.contactService?.clearCache(),this.iamService?.clearCache(),this.areaService?.clearCache(),this.commentService?.clearCache(),this.reactionService?.clearCache(),this.serviceBook.get(hT)?.clearCache(),this.viewsService?.clearCache()}catch(r){this.loggingService.catch("Error in resetServicesCache: ",r)}}initializeSignedInUser(r,i,o){this.loggingService.log("%c[WB] Calling FUNCTION: initializeSignedInUser","color: green;");try{let s=new zi;s.userSnippylyId=r.uid,s.type="signedIn",o&&(s=B(B({},s),o)),this.setUserToStorage(s),this.mergeUserWithProvidedUserData(s,i)}catch(s){this.loggingService.catch("Error in initializeSignedInUser: ",s)}}mergeUserWithProvidedUserData(r,i){return y(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: mergeUserWithProvidedUserData","color: green;");try{r.userId=this.providedUser?.userId||r.userId;let o=null;if(this.usersService?.externalUserDataProviderAvailable()){let s=nd(),a=IT.IDENTIFY,c=this.providedUser?.clientOrganizationId||r.clientOrganizationId;this.coreActionsService.triggerAction(Wi.USER_RESOLVER,{event:St.Events.Resolver.USER_RESOLUTION_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:s,methodName:nR.MERGE_USER_WITH_PROVIDED_USER_DATA,moduleName:a,source:"internal",payload:{userIds:[r.userId],organizationId:c}});let l=yield this.usersService.resolveUsers({userIds:[r.userId],organizationId:c,skipUserCheck:!0,uniqueId:s,moduleName:a});l&&l[r.userId]?o=JSON.parse(JSON.stringify(l[r.userId]||{})):this.scheduleLoggedInUserResolveRetry(r.userId,c),r=B(B({},r),o||{})}r.name=o?o?.name:this.providedUser?.name||r.name,r.clientUserName=o?o?.clientUserName:this.providedUser?.clientUserName||r.clientUserName,r.photoUrl=o?o?.photoUrl:this.providedUser?.photoUrl||r.photoUrl,r?.photoUrl===void 0&&(r.photoUrl=null),r.email=o?o?.email:this.providedUser?.email||r.email,r.color=o?.color||this.providedUser?.color||this.getUserAvatarColor(r.userId),r.textColor=o?.textColor||this.providedUser?.textColor||this.getUserTextColor(r.userId),r.initial=o?.initial||this.providedUser?.initial||r.initial||r.name?.charAt(0).toUpperCase()||r.email?.charAt(0).toUpperCase(),r.contacts=this.providedUser?.contacts||r.contacts,r.plan=this.providedUser?.plan||r.plan,r.groupId=this.providedUser?.groupId||r.groupId,r.clientGroupId=this.providedUser?.clientGroupId||r.clientGroupId,r.clientOrganizationId=this.providedUser?.clientOrganizationId||r.clientOrganizationId,r.organizationId=this.providedUser?.organizationId||r.organizationId,r.isAdmin=this.providedUser?.isAdmin,r.isReadOnly=this.providedUser?.isReadOnly,r.isAnonymous=this.providedUser?.isAnonymous,r.isGuest=this.providedUser?.isGuest,this.updateUserInternally(r)}catch(o){this.loggingService.catch("Error in mergeUserWithProvidedUserData: ",o)}})}updateUserInternally(r){return y(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserInternally","color: green;");try{let i=Object.assign({},r);delete i.contacts,this.analyticsService.identifyUser(r.userSnippylyId,i,{forceReset:this.userOptions$.value?.forceReset}),this.getPlanDetailsCalled||this.getPlanDetailsFromDb();let o=pd(this.functions,od({url:this.endpointsService.getCloudFunctionUrl("sdkProxy"),apiProxyDomain:this.configService?.getApiProxyDomain()})),s=zV({methodName:"updateUserInternally",data:{type:"getProjectConfig"},getSdkProxy:o,userId:r?.userId??""}),a=Promise.resolve();if(this.userPermissionService?.isPermissionProviderAvailable()&&r.clientOrganizationId){let d=[{userId:r.userId,resource:{id:r.clientOrganizationId,type:HU.ORGANIZATION,source:vT.IDENTIFY,organizationId:r.clientOrganizationId}}],h=nd();this.coreActionsService.triggerAction(Wi.PERMISSION_PROVIDER,{event:St.Events.PermissionProvider.RESOURCE_ACCESS_REQUEST_FORMED,methodName:vT.IDENTIFY,uniqueId:h,timestamp:new Date().getTime(),source:"internal",payload:{requests:d}}),a=this.userPermissionService?.onResourceAccessRequired({requests:d,uniqueId:h,userId:r.userId,methodName:vT.IDENTIFY,fromCache:!1})??Promise.resolve()}let[c,l]=yield Promise.allSettled([s,a]);if(c.status==="fulfilled"){this.setIsPrivateCommentsEnabled(!!c.value?.data?.isPrivateCommentsEnabled);let d=c.value?.data?.activityConfig??{immutable:!1,isEnabled:!1};this.cachedActivityConfig=d,this.activityService?.setActivityFeatureConfig(d)}else this.loggingService.warn("Failed to fetch project config:",c.reason);this.afAuth.currentUser?(this.user$.next(r),this.updateUserToFirebase(r)):this.portableAuthUser$.value&&this.user$.next(r)}catch(i){this.loggingService.catch("Error in updateUserInternally: ",i)}})}updateUserToFirebase(r){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserToFirebase","color: green;");try{let i=JSON.parse(JSON.stringify(r)),o=Ee(B({},i),{lastUpdated:new Date})}catch(i){this.loggingService.catch("Error in updateUserToFirebase: ",i)}}getPlanDetailsFromDb(){return y(this,null,function*(){try{this.getPlanDetailsCalled=!0;let i=yield pd(this.functions,od({url:this.endpointsService.getCloudFunctionUrl("getPlanDetails"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:1200*1e3})({apiKey:this.configService.getApiKey(),sdkVersion:xc(),sdkType:this.configService.getSdkType()});return i?.data?.isPlanExpired&&(this.analyticsService.trackEvent(St.Events.Core.SDK_PLAN_EXPIRED),this.configService.getSF()||console.warn("Velt SDK plan has expired.")),this.planDetails$.next(i?.data||{planInfo:null,isPlanExpired:!1}),i}catch(r){return this.loggingService.catch("Error in getPlanDetailsFromDb: ",r),this.planDetails$.next({planInfo:null,isPlanExpired:!1}),Promise.resolve(null)}})}isPlanExpired$(){return this.planDetails$.pipe(mn(r=>!!r),De(r=>!!r?.isPlanExpired))}isPlanExpired(){return this.planDetails$.getValue()?.isPlanExpired}addPreSignOutFuction(r,i){try{this.preSignOutFunctions.set(r,i)}catch(o){this.loggingService.catch("Error in addPreSignOutFuction: ",o)}}setUserOrganization(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserOrganization","color: green;");let i=JSON.parse(JSON.stringify(this.userOrganization$.value||{}));this.getUser()?.organizationId===r?.organizationId?(i.metadata=r,this.userOrganization$.next(i)):this.userOrganization$.next(null)}catch(i){this.loggingService.catch("Error in setUserOrganization: ",i)}}setOrganizationUserGroups(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserOrganizationGroups","color: green;");let i=JSON.parse(JSON.stringify(this.userOrganization$.value||{}));this.getUser()?.organizationId===i?.metadata?.organizationId&&(i.groups=r,this.userOrganization$.next(i))}catch(i){this.loggingService.catch("Error in setUserOrganizationGroups: ",i)}}getUserOrganization$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOrganization$","color: green;"),this.getUser$().pipe(Mr(r=>r?this.userOrganization$.asObservable().pipe(De(i=>i?.metadata?.organizationId===r.organizationId?i:null)):lt(null)))}signOutUser(r="internal"){return y(this,null,function*(){try{this.userPermissionService?.invalidateAllPermissionsState(),this.portableSessionEpoch++,this.portableSignOutOwnsEpochBump=!0,this.pendingPortableRestore=null,this.portableResumeUserId=null,this.portableSessionIdentity=null,(this.portableAutoLoginCalled||this.configService?.getEnablePortableBackend()===!0)&&(this.clearPersistedPortableSession(),this.recordPortableSignOut(),this.clearPortableTokenRefresh()),r==="external"&&(this.onRetrySubscription?.unsubscribe(),this.authProviderListenerGeneration++),this.userPermissionService?.revokeAccessOnUserLogout(),this.analyticsService.trackEvent(St.Events.Core.SDK_USER_SIGN_OUT,{apiKey:this.apiKey,clientUserId:this.user$?.value?.userId,snippylyUserId:this.user$?.value?.userSnippylyId,message:r==="external"?"User Sign out":"System Sign out",user:this.user$?.value?this.getUserForTelemetry(this.user$?.value):null,forceReset:this.userOptions$.value?.forceReset,source:r});let i=yield hd(this.afAuth).pipe(En(1)).toPromise().catch(o=>null);if(i){this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState();for(let[o,s]of this.preSignOutFunctions)try{yield s(i)}catch(a){this.loggingService.catch(`Error in signOutUser ${o} function: `,a)}return this.user$.next(null),yield VV(1e3),vG(this.afAuth).catch(o=>{this.loggingService.catch("Error in signOutUser:",o)})}else return(this.portableAuthUser$.value||this.portableBackend$.value)&&(this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState()),Promise.resolve()}catch(i){this.loggingService.catch("Error in signOutUser: ",i)}finally{this.portableSignOutOwnsEpochBump=!1}})}isFeatureAllowed(r){return bV(this.config,this.user$.value,r)}getUserWithoutContacts(r){try{if(r){let i=JSON.parse(JSON.stringify(r));return delete i.contacts,i}else return null}catch(i){return this.loggingService.catch("Error in getUserWithoutContacts: ",i),null}}getUserForTelemetry(r){try{let i=this.getUserWithoutContacts(r);return i?this.usersService?.userResolverConfigured?.()?IR(i):i:null}catch(i){return this.loggingService.catch("Error in getUserForTelemetry: ",i),null}}getUserForClient(r){try{return _R(r)}catch(i){return this.loggingService.catch("Error in getUserForClient: ",i),null}}getUserAvatarColor(r){try{return r?this.avatarService.generateUserColor(Mc(r)):"#625DF5"}catch{return"#625DF5"}}getUserTextColor(r){try{return"#FFFFFF"}catch{return"#FFFFFF"}}setOptionalPropertiesToUsers(r){try{r.forEach(i=>{try{i?.color||(i.color=this.getUserAvatarColor(i?.userId)),i?.textColor||(i.textColor=this.getUserTextColor(i?.userId)),!i?.initial&&(i?.name||i?.email)&&(i.initial=i.name?.charAt(0).toUpperCase()||i.email?.charAt(0).toUpperCase())}catch{}})}catch{}}};e.PORTABLE_REFRESH_WARN_AFTER_FAILURES=3,e.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS=["visibilitychange","resume"],e.PORTABLE_NO_CREDENTIAL_ENVELOPE={error:"No renewal credential.",code:"no_renewal_credential",message:"the session has no renewal credential for the configured gateway",source:"identify"},e.\u0275fac=function(i){return new(i||e)($(Hc),$(Ji),$(t2),$(n2),$(C2),$(Ho),$(zs),$(bt),$(mT))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var N2="@firebase/database",w2="1.0.20";var Ww="";function Xne(t){Ww=t}var qN=class{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,n){n==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),xt(n))}get(e){let n=this.domStorage_.getItem(this.prefixedName_(e));return n==null?null:ad(n)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}};var KN=class{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,n){n==null?delete this.cache_[e]:this.cache_[e]=n}get(e){return Vr(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}};var aj=function(t){try{if(typeof window<"u"&&typeof window[t]<"u"){let e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new qN(e)}}catch{}return new KN},Jc=aj("localStorage"),YN=aj("sessionStorage");var Id=new Br("@firebase/database"),cj=(function(){let t=1;return function(){return t++}})(),lj=function(t){let e=pB(t),n=new PT;n.update(e);let r=n.digest();return cd.encodeByteArray(r)},ng=function(...t){let e="";for(let n=0;n<t.length;n++){let r=t[n];Array.isArray(r)||r&&typeof r=="object"&&typeof r.length=="number"?e+=ng.apply(null,r):typeof r=="object"?e+=xt(r):e+=r,e+=" "}return e},Zc=null,b2=!0,Qne=function(t,e){q(!e||t===!0||t===!1,"Can't turn on custom loggers persistently."),t===!0?(Id.logLevel=Re.VERBOSE,Zc=Id.log.bind(Id),e&&YN.set("logging_enabled",!0)):typeof t=="function"?Zc=t:(Zc=null,YN.remove("logging_enabled"))},un=function(...t){if(b2===!0&&(b2=!1,Zc===null&&YN.get("logging_enabled")===!0&&Qne(!0)),Zc){let e=ng.apply(null,t);Zc(e)}},rg=function(t){return function(...e){un(t,...e)}},XN=function(...t){let e="FIREBASE INTERNAL ERROR: "+ng(...t);Id.error(e)},Wo=function(...t){let e=`FIREBASE FATAL ERROR: ${ng(...t)}`;throw Id.error(e),new Error(e)},xn=function(...t){let e="FIREBASE WARNING: "+ng(...t);Id.warn(e)},Jne=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&xn("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},By=function(t){return typeof t=="number"&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},Zne=function(t){if(Ki()||document.readyState==="complete")t();else{let e=!1,n=function(){if(!document.body){setTimeout(n,Math.floor(10));return}e||(e=!0,t())};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&n()}),window.attachEvent("onload",n))}},tl="[MIN_NAME]",Zs="[MAX_NAME]",al=function(t,e){if(t===e)return 0;if(t===tl||e===Zs)return-1;if(e===tl||t===Zs)return 1;{let n=O2(t),r=O2(e);return n!==null?r!==null?n-r===0?t.length-e.length:n-r:-1:r!==null?1:t<e?-1:1}},ere=function(t,e){return t===e?0:t<e?-1:1},xp=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+xt(e))},zw=function(t){if(typeof t!="object"||t===null)return xt(t);let e=[];for(let r in t)e.push(r);e.sort();let n="{";for(let r=0;r<e.length;r++)r!==0&&(n+=","),n+=xt(e[r]),n+=":",n+=zw(t[e[r]]);return n+="}",n},uj=function(t,e){let n=t.length;if(n<=e)return[t];let r=[];for(let i=0;i<n;i+=e)i+e>n?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r};function dn(t,e){for(let n in t)t.hasOwnProperty(n)&&e(n,t[n])}var dj=function(t){q(!By(t),"Invalid JSON number");let e=11,n=52,r=(1<<e-1)-1,i,o,s,a,c;t===0?(o=0,s=0,i=1/t===-1/0?1:0):(i=t<0,t=Math.abs(t),t>=Math.pow(2,1-r)?(a=Math.min(Math.floor(Math.log(t)/Math.LN2),r),o=a+r,s=Math.round(t*Math.pow(2,n-a)-Math.pow(2,n))):(o=0,s=Math.round(t/Math.pow(2,1-r-n))));let l=[];for(c=n;c;c-=1)l.push(s%2?1:0),s=Math.floor(s/2);for(c=e;c;c-=1)l.push(o%2?1:0),o=Math.floor(o/2);l.push(i?1:0),l.reverse();let d=l.join(""),h="";for(c=0;c<64;c+=8){let f=parseInt(d.substr(c,8),2).toString(16);f.length===1&&(f="0"+f),h=h+f}return h.toLowerCase()},tre=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},nre=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function rre(t,e){let n="Unknown Error";t==="too_big"?n="The data requested exceeds the maximum size that can be accessed with a single request.":t==="permission_denied"?n="Client doesn't have permission to access the desired data.":t==="unavailable"&&(n="The service is unavailable");let r=new Error(t+" at "+e._path.toString()+": "+n);return r.code=t.toUpperCase(),r}var ire=new RegExp("^-?(0*)\\d{1,10}$"),ore=-2147483648,sre=2147483647,O2=function(t){if(ire.test(t)){let e=Number(t);if(e>=ore&&e<=sre)return e}return null},bd=function(t){try{t()}catch(e){setTimeout(()=>{let n=e.stack||"";throw xn("Exception was thrown by user callback.",n),e},Math.floor(0))}},are=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Vp=function(t,e){let n=setTimeout(t,e);return typeof n=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(n):typeof n=="object"&&n.unref&&n.unref(),n};var QN=class{constructor(e,n){this.appCheckProvider=n,this.appName=e.name,Zn(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=n?.getImmediate({optional:!0}),this.appCheck||n?.get().then(r=>this.appCheck=r)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((n,r)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){var n;(n=this.appCheckProvider)===null||n===void 0||n.get().then(r=>r.addTokenListener(e))}notifyForInvalidToken(){xn(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}};var JN=class{constructor(e,n,r){this.appName_=e,this.firebaseOptions_=n,this.authProvider_=r,this.auth_=null,this.auth_=r.getImmediate({optional:!0}),this.auth_||r.onInit(i=>this.auth_=i)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(n=>n&&n.code==="auth/token-not-initialized"?(un("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(n)):new Promise((n,r)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(n=>n.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(n=>n.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',xn(e)}},Bp=(()=>{class t{constructor(n){this.accessToken=n}getToken(n){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(n){n(this.accessToken)}removeTokenChangeListener(n){}notifyForInvalidToken(){}}t.OWNER="owner";return t})(),gy="5",hj="v",fj="s",pj="r",gj="f",mj=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Ej="ls",_j="p",ZN="ac",Tj="websocket",yj="long_polling";var my=class{constructor(e,n,r,i,o=!1,s="",a=!1,c=!1,l=null){this.secure=n,this.namespace=r,this.webSocketOnly=i,this.nodeAdmin=o,this.persistenceKey=s,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=c,this.emulatorOptions=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Jc.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Jc.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){let e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${n}`}};function cre(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function Ij(t,e,n){q(typeof e=="string","typeof type must == string"),q(typeof n=="object","typeof params must == object");let r;if(e===Tj)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===yj)r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);cre(t)&&(n.ns=t.namespace);let i=[];return dn(n,(o,s)=>{i.push(o+"="+s)}),r+i.join("&")}var ew=class{constructor(){this.counters_={}}incrementCounter(e,n=1){Vr(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=n}get(){return tB(this.counters_)}};var BN={},GN={};function qw(t){let e=t.toString();return BN[e]||(BN[e]=new ew),BN[e]}function lre(t,e){let n=t.toString();return GN[n]||(GN[n]=e()),GN[n]}var tw=class{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,n){this.closeAfterResponse=e,this.onClose=n,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,n){for(this.pendingResponses[e]=n;this.pendingResponses[this.currentResponseNum];){let r=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let i=0;i<r.length;++i)r[i]&&bd(()=>{this.onMessage_(r[i])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}};var M2="start",ure="close",dre="pLPCommand",hre="pRTLPCB",vj="id",Sj="pw",Aj="ser",fre="cb",pre="seg",gre="ts",mre="d",Ere="dframe",Cj=1870,Dj=30,_re=Cj-Dj,Tre=25e3,yre=3e4,Ey=class t{constructor(e,n,r,i,o,s,a){this.connId=e,this.repoInfo=n,this.applicationId=r,this.appCheckToken=i,this.authToken=o,this.transportSessionId=s,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=rg(e),this.stats_=qw(n),this.urlFn=c=>(this.appCheckToken&&(c[ZN]=this.appCheckToken),Ij(n,yj,c))}open(e,n){this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new tw(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(yre)),Zne(()=>{if(this.isClosed_)return;this.scriptTagHolder=new nw((...o)=>{let[s,a,c,l,d]=o;if(this.incrementIncomingBytes_(o),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,s===M2)this.id=a,this.password=c;else if(s===ure)a?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(a,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+s)},(...o)=>{let[s,a]=o;this.incrementIncomingBytes_(o),this.myPacketOrderer.handleResponse(s,a)},()=>{this.onClosed_()},this.urlFn);let r={};r[M2]="t",r[Aj]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(r[fre]=this.scriptTagHolder.uniqueCallbackIdentifier),r[hj]=gy,this.transportSessionId&&(r[fj]=this.transportSessionId),this.lastSessionId&&(r[Ej]=this.lastSessionId),this.applicationId&&(r[_j]=this.applicationId),this.appCheckToken&&(r[ZN]=this.appCheckToken),typeof location<"u"&&location.hostname&&mj.test(location.hostname)&&(r[pj]=gj);let i=this.urlFn(r);this.log_("Connecting via long-poll to "+i),this.scriptTagHolder.addTag(i,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){t.forceAllow_=!0}static forceDisallow(){t.forceDisallow_=!0}static isAvailable(){return Ki()?!1:t.forceAllow_?!0:!t.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!tre()&&!nre()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){let n=xt(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);let r=RR(n),i=uj(r,_re);for(let o=0;o<i.length;o++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[o]),this.curSegmentNum++}addDisconnectPingFrame(e,n){if(Ki())return;this.myDisconnFrame=document.createElement("iframe");let r={};r[Ere]="t",r[vj]=e,r[Sj]=n,this.myDisconnFrame.src=this.urlFn(r),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){let n=xt(e).length;this.bytesReceived+=n,this.stats_.incrementCounter("bytes_received",n)}},nw=class t{constructor(e,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0,Ki())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=cj(),window[dre+this.uniqueCallbackIdentifier]=e,window[hre+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createIFrame_();let o="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(o='<script>document.domain="'+document.domain+'";<\/script>');let s="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(a){un("frame writing exception"),a.stack&&un(a.stack),un(a)}}}static createIFrame_(){let e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||un("No IE domain setting required")}catch{let r=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+r+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));let e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;let e={};e[vj]=this.myID,e[Sj]=this.myPW,e[Aj]=this.currentSerial;let n=this.urlFn(e),r="",i=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+Dj+r.length<=Cj;){let s=this.pendingSegs.shift();r=r+"&"+pre+i+"="+s.seg+"&"+gre+i+"="+s.ts+"&"+mre+i+"="+s.d,i++}return n=n+r,this.addLongPollTag_(n,this.currentSerial),!0}else return!1}enqueueSegment(e,n,r){this.pendingSegs.push({seg:e,ts:n,d:r}),this.alive&&this.newRequest_()}addLongPollTag_(e,n){this.outstandingRequests.add(n);let r=()=>{this.outstandingRequests.delete(n),this.newRequest_()},i=setTimeout(r,Math.floor(Tre)),o=()=>{clearTimeout(i),r()};this.addTag(e,o)}addTag(e,n){Ki()?this.doNodeLongPoll(e,n):setTimeout(()=>{try{if(!this.sendNewPolls)return;let r=this.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){let i=r.readyState;(!i||i==="loaded"||i==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),n())},r.onerror=()=>{un("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))}};var Ire=16384,vre=45e3,_y=null;typeof MozWebSocket<"u"?_y=MozWebSocket:typeof WebSocket<"u"&&(_y=WebSocket);var Td=(()=>{class t{constructor(n,r,i,o,s,a,c){this.connId=n,this.applicationId=i,this.appCheckToken=o,this.authToken=s,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=rg(this.connId),this.stats_=qw(r),this.connURL=t.connectionURL_(r,a,c,o,i),this.nodeAdmin=r.nodeAdmin}static connectionURL_(n,r,i,o,s){let a={};return a[hj]=gy,!Ki()&&typeof location<"u"&&location.hostname&&mj.test(location.hostname)&&(a[pj]=gj),r&&(a[fj]=r),i&&(a[Ej]=i),o&&(a[ZN]=o),s&&(a[_j]=s),Ij(n,Tj,a)}open(n,r){this.onDisconnect=r,this.onMessage=n,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Jc.set("previous_websocket_failure",!0);try{let i;if(Ki()){let o=this.nodeAdmin?"AdminNode":"Node";i={headers:{"User-Agent":`Firebase/${gy}/${Ww}/${process.platform}/${o}`,"X-Firebase-GMPID":this.applicationId||""}},this.authToken&&(i.headers.Authorization=`Bearer ${this.authToken}`),this.appCheckToken&&(i.headers["X-Firebase-AppCheck"]=this.appCheckToken);let s=process.env,a=this.connURL.indexOf("wss://")===0?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;a&&(i.proxy={origin:a})}this.mySock=new _y(this.connURL,[],i)}catch(i){this.log_("Error instantiating WebSocket.");let o=i.message||i.data;o&&this.log_(o),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=i=>{this.handleIncomingFrame(i)},this.mySock.onerror=i=>{this.log_("WebSocket error. Closing connection.");let o=i.message||i.data;o&&this.log_(o),this.onClosed_()}}start(){}static forceDisallow(){t.forceDisallow_=!0}static isAvailable(){let n=!1;if(typeof navigator<"u"&&navigator.userAgent){let r=/Android ([0-9]{0,}\.[0-9]{0,})/,i=navigator.userAgent.match(r);i&&i.length>1&&parseFloat(i[1])<4.4&&(n=!0)}return!n&&_y!==null&&!t.forceDisallow_}static previouslyFailed(){return Jc.isInMemoryStorage||Jc.get("previous_websocket_failure")===!0}markConnectionHealthy(){Jc.remove("previous_websocket_failure")}appendFrame_(n){if(this.frames.push(n),this.frames.length===this.totalFrames){let r=this.frames.join("");this.frames=null;let i=ad(r);this.onMessage(i)}}handleNewFrameCount_(n){this.totalFrames=n,this.frames=[]}extractFrameCount_(n){if(q(this.frames===null,"We already have a frame buffer"),n.length<=6){let r=Number(n);if(!isNaN(r))return this.handleNewFrameCount_(r),null}return this.handleNewFrameCount_(1),n}handleIncomingFrame(n){if(this.mySock===null)return;let r=n.data;if(this.bytesReceived+=r.length,this.stats_.incrementCounter("bytes_received",r.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(r);else{let i=this.extractFrameCount_(r);i!==null&&this.appendFrame_(i)}}send(n){this.resetKeepAlive();let r=xt(n);this.bytesSent+=r.length,this.stats_.incrementCounter("bytes_sent",r.length);let i=uj(r,Ire);i.length>1&&this.sendString_(String(i.length));for(let o=0;o<i.length;o++)this.sendString_(i[o])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(vre))}sendString_(n){try{this.mySock.send(n)}catch(r){this.log_("Exception thrown from WebSocket.send():",r.message||r.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4;return t})(),Rj=(()=>{class t{static get ALL_TRANSPORTS(){return[Ey,Td]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(n){this.initTransports_(n)}initTransports_(n){let r=Td&&Td.isAvailable(),i=r&&!Td.previouslyFailed();if(n.webSocketOnly&&(r||xn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[Td];else{let o=this.transports_=[];for(let s of t.ALL_TRANSPORTS)s&&s.isAvailable()&&o.push(s);t.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}t.globalTransportInitialized_=!1;return t})(),Sre=6e4,Are=5e3,Cre=10*1024,Dre=100*1024,jN="t",L2="d",Rre="s",P2="r",Nre="e",x2="o",k2="a",F2="n",U2="p",wre="h",rw=class{constructor(e,n,r,i,o,s,a,c,l,d){this.id=e,this.repoInfo_=n,this.applicationId_=r,this.appCheckToken_=i,this.authToken_=o,this.onMessage_=s,this.onReady_=a,this.onDisconnect_=c,this.onKill_=l,this.lastSessionId=d,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=rg("c:"+this.id+":"),this.transportManager_=new Rj(n),this.log_("Connection created"),this.start_()}start_(){let e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(n,r)},Math.floor(0));let i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=Vp(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>Dre?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>Cre?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(i)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return n=>{e===this.conn_?this.onConnectionLost_(n):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return n=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(n):e===this.secondaryConn_?this.onSecondaryMessageReceived_(n):this.log_("message on old connection"))}}sendRequest(e){let n={t:"d",d:e};this.sendData_(n)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(jN in e){let n=e[jN];n===k2?this.upgradeIfSecondaryHealthy_():n===P2?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===x2&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){let n=xp("t",e),r=xp("d",e);if(n==="c")this.onSecondaryControl_(r);else if(n==="d")this.pendingDataMessages.push(r);else throw new Error("Unknown protocol layer: "+n)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:U2,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:k2,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:F2,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){let n=xp("t",e),r=xp("d",e);n==="c"?this.onControl_(r):n==="d"&&this.onDataMessage_(r)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){let n=xp(jN,e);if(L2 in e){let r=e[L2];if(n===wre){let i=Object.assign({},r);this.repoInfo_.isUsingEmulator&&(i.h=this.repoInfo_.host),this.onHandshake_(i)}else if(n===F2){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let i=0;i<this.pendingDataMessages.length;++i)this.onDataMessage_(this.pendingDataMessages[i]);this.pendingDataMessages=[],this.tryCleanupConnection()}else n===Rre?this.onConnectionShutdown_(r):n===P2?this.onReset_(r):n===Nre?XN("Server Error: "+r):n===x2?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):XN("Unknown control packet command: "+n)}}onHandshake_(e){let n=e.ts,r=e.v,i=e.h;this.sessionId=e.s,this.repoInfo_.host=i,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,n),gy!==r&&xn("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){let e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),Vp(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(Sre))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,n){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(n,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Vp(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(Are))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:U2,d:{}}}))}onSecondaryConnectionLost_(){let e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Jc.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}};var Ty=class{put(e,n,r,i){}merge(e,n,r,i){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,n,r){}onDisconnectMerge(e,n,r){}onDisconnectCancel(e,n){}reportStats(e){}};var yy=class{constructor(e){this.allowedEvents_=e,this.listeners_={},q(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...n){if(Array.isArray(this.listeners_[e])){let r=[...this.listeners_[e]];for(let i=0;i<r.length;i++)r[i].callback.apply(r[i].context,n)}}on(e,n,r){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:n,context:r});let i=this.getInitialEvent(e);i&&n.apply(r,i)}off(e,n,r){this.validateEventType_(e);let i=this.listeners_[e]||[];for(let o=0;o<i.length;o++)if(i[o].callback===n&&(!r||r===i[o].context)){i.splice(o,1);return}}validateEventType_(e){q(this.allowedEvents_.find(n=>n===e),"Unknown event: "+e)}};var Iy=class t extends yy{static getInstance(){return new t}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!hp()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return q(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}};var V2=32,B2=768,Be=class{constructor(e,n){if(n===void 0){this.pieces_=e.split("/");let r=0;for(let i=0;i<this.pieces_.length;i++)this.pieces_[i].length>0&&(this.pieces_[r]=this.pieces_[i],r++);this.pieces_.length=r,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}toString(){let e="";for(let n=this.pieceNum_;n<this.pieces_.length;n++)this.pieces_[n]!==""&&(e+="/"+this.pieces_[n]);return e||"/"}};function Ve(){return new Be("")}function Ne(t){return t.pieceNum_>=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function ea(t){return t.pieces_.length-t.pieceNum_}function at(t){let e=t.pieceNum_;return e<t.pieces_.length&&e++,new Be(t.pieces_,e)}function Kw(t){return t.pieceNum_<t.pieces_.length?t.pieces_[t.pieces_.length-1]:null}function bre(t){let e="";for(let n=t.pieceNum_;n<t.pieces_.length;n++)t.pieces_[n]!==""&&(e+="/"+encodeURIComponent(String(t.pieces_[n])));return e||"/"}function $p(t,e=0){return t.pieces_.slice(t.pieceNum_+e)}function Nj(t){if(t.pieceNum_>=t.pieces_.length)return null;let e=[];for(let n=t.pieceNum_;n<t.pieces_.length-1;n++)e.push(t.pieces_[n]);return new Be(e,0)}function Ct(t,e){let n=[];for(let r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);if(e instanceof Be)for(let r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{let r=e.split("/");for(let i=0;i<r.length;i++)r[i].length>0&&n.push(r[i])}return new Be(n,0)}function we(t){return t.pieceNum_>=t.pieces_.length}function zn(t,e){let n=Ne(t),r=Ne(e);if(n===null)return e;if(n===r)return zn(at(t),at(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function Ore(t,e){let n=$p(t,0),r=$p(e,0);for(let i=0;i<n.length&&i<r.length;i++){let o=al(n[i],r[i]);if(o!==0)return o}return n.length===r.length?0:n.length<r.length?-1:1}function Yw(t,e){if(ea(t)!==ea(e))return!1;for(let n=t.pieceNum_,r=e.pieceNum_;n<=t.pieces_.length;n++,r++)if(t.pieces_[n]!==e.pieces_[r])return!1;return!0}function jr(t,e){let n=t.pieceNum_,r=e.pieceNum_;if(ea(t)>ea(e))return!1;for(;n<t.pieces_.length;){if(t.pieces_[n]!==e.pieces_[r])return!1;++n,++r}return!0}var iw=class{constructor(e,n){this.errorPrefix_=n,this.parts_=$p(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let r=0;r<this.parts_.length;r++)this.byteLength_+=mp(this.parts_[r]);wj(this)}};function Mre(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=mp(e),wj(t)}function Lre(t){let e=t.parts_.pop();t.byteLength_-=mp(e),t.parts_.length>0&&(t.byteLength_-=1)}function wj(t){if(t.byteLength_>B2)throw new Error(t.errorPrefix_+"has a key path longer than "+B2+" bytes ("+t.byteLength_+").");if(t.parts_.length>V2)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+V2+") or object contains a cycle "+Qc(t))}function Qc(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}var ow=class t extends yy{static getInstance(){return new t}constructor(){super(["visible"]);let e,n;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(n="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(n="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(n="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(n="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,n&&document.addEventListener(n,()=>{let r=!document[e];r!==this.visible_&&(this.visible_=r,this.trigger("visible",r))},!1)}getInitialEvent(e){return q(e==="visible","Unknown event type: "+e),[this.visible_]}};var kp=1e3,Pre=300*1e3,G2=30*1e3,xre=1.3,kre=3e4,Fre="server_kill",j2=3,Xw=(()=>{class t extends Ty{constructor(n,r,i,o,s,a,c,l){if(super(),this.repoInfo_=n,this.applicationId_=r,this.onDataUpdate_=i,this.onConnectStatus_=o,this.onServerInfoUpdate_=s,this.authTokenProvider_=a,this.appCheckTokenProvider_=c,this.authOverride_=l,this.id=t.nextPersistentConnectionId_++,this.log_=rg("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=kp,this.maxReconnectDelay_=Pre,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,l&&!Ki())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");ow.getInstance().on("visible",this.onVisible_,this),n.host.indexOf("fblocal")===-1&&Iy.getInstance().on("online",this.onOnline_,this)}sendRequest(n,r,i){let o=++this.requestNumber_,s={r:o,a:n,b:r};this.log_(xt(s)),q(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(s),i&&(this.requestCBHash_[o]=i)}get(n){this.initConnection_();let r=new cn,o={action:"g",request:{p:n._path.toString(),q:n._queryObject},onComplete:a=>{let c=a.d;a.s==="ok"?r.resolve(c):r.reject(c)}};this.outstandingGets_.push(o),this.outstandingGetCount_++;let s=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(s),r.promise}listen(n,r,i,o){this.initConnection_();let s=n._queryIdentifier,a=n._path.toString();this.log_("Listen called for "+a+" "+s),this.listens.has(a)||this.listens.set(a,new Map),q(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"listen() called for non-default but complete query"),q(!this.listens.get(a).has(s),"listen() called twice for same path/queryId.");let c={onComplete:o,hashFn:r,query:n,tag:i};this.listens.get(a).set(s,c),this.connected_&&this.sendListen_(c)}sendGet_(n){let r=this.outstandingGets_[n];this.sendRequest("g",r.request,i=>{delete this.outstandingGets_[n],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),r.onComplete&&r.onComplete(i)})}sendListen_(n){let r=n.query,i=r._path.toString(),o=r._queryIdentifier;this.log_("Listen on "+i+" for "+o);let s={p:i},a="q";n.tag&&(s.q=r._queryObject,s.t=n.tag),s.h=n.hashFn(),this.sendRequest(a,s,c=>{let l=c.d,d=c.s;t.warnOnListenWarnings_(l,r),(this.listens.get(i)&&this.listens.get(i).get(o))===n&&(this.log_("listen response",c),d!=="ok"&&this.removeListen_(i,o),n.onComplete&&n.onComplete(d,l))})}static warnOnListenWarnings_(n,r){if(n&&typeof n=="object"&&Vr(n,"w")){let i=Fs(n,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){let o='".indexOn": "'+r._queryParams.getIndex().toString()+'"',s=r._path.toString();xn(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${o} at ${s} to your security rules for better performance.`)}}}refreshAuthToken(n){this.authToken_=n,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(n)}reduceReconnectDelayIfAdminCredential_(n){(n&&n.length===40||hB(n))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=G2)}refreshAppCheckToken(n){this.appCheckToken_=n,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){let n=this.authToken_,r=dB(n)?"auth":"gauth",i={cred:n};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(r,i,o=>{let s=o.s,a=o.d||"error";this.authToken_===n&&(s==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(s,a))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},n=>{let r=n.s,i=n.d||"error";r==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(r,i)})}unlisten(n,r){let i=n._path.toString(),o=n._queryIdentifier;this.log_("Unlisten called for "+i+" "+o),q(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(i,o)&&this.connected_&&this.sendUnlisten_(i,o,n._queryObject,r)}sendUnlisten_(n,r,i,o){this.log_("Unlisten on "+n+" for "+r);let s={p:n},a="n";o&&(s.q=i,s.t=o),this.sendRequest(a,s)}onDisconnectPut(n,r,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",n,r,i):this.onDisconnectRequestQueue_.push({pathString:n,action:"o",data:r,onComplete:i})}onDisconnectMerge(n,r,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",n,r,i):this.onDisconnectRequestQueue_.push({pathString:n,action:"om",data:r,onComplete:i})}onDisconnectCancel(n,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",n,null,r):this.onDisconnectRequestQueue_.push({pathString:n,action:"oc",data:null,onComplete:r})}sendOnDisconnect_(n,r,i,o){let s={p:r,d:i};this.log_("onDisconnect "+n,s),this.sendRequest(n,s,a=>{o&&setTimeout(()=>{o(a.s,a.d)},Math.floor(0))})}put(n,r,i,o){this.putInternal("p",n,r,i,o)}merge(n,r,i,o){this.putInternal("m",n,r,i,o)}putInternal(n,r,i,o,s){this.initConnection_();let a={p:r,d:i};s!==void 0&&(a.h=s),this.outstandingPuts_.push({action:n,request:a,onComplete:o}),this.outstandingPutCount_++;let c=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(c):this.log_("Buffering put: "+r)}sendPut_(n){let r=this.outstandingPuts_[n].action,i=this.outstandingPuts_[n].request,o=this.outstandingPuts_[n].onComplete;this.outstandingPuts_[n].queued=this.connected_,this.sendRequest(r,i,s=>{this.log_(r+" response",s),delete this.outstandingPuts_[n],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),o&&o(s.s,s.d)})}reportStats(n){if(this.connected_){let r={c:n};this.log_("reportStats",r),this.sendRequest("s",r,i=>{if(i.s!=="ok"){let s=i.d;this.log_("reportStats","Error sending stats: "+s)}})}}onDataMessage_(n){if("r"in n){this.log_("from server: "+xt(n));let r=n.r,i=this.requestCBHash_[r];i&&(delete this.requestCBHash_[r],i(n.b))}else{if("error"in n)throw"A server-side error has occurred: "+n.error;"a"in n&&this.onDataPush_(n.a,n.b)}}onDataPush_(n,r){this.log_("handleServerMessage",n,r),n==="d"?this.onDataUpdate_(r.p,r.d,!1,r.t):n==="m"?this.onDataUpdate_(r.p,r.d,!0,r.t):n==="c"?this.onListenRevoked_(r.p,r.q):n==="ac"?this.onAuthRevoked_(r.s,r.d):n==="apc"?this.onAppCheckRevoked_(r.s,r.d):n==="sd"?this.onSecurityDebugPacket_(r):XN("Unrecognized action received from server: "+xt(n)+`
|
|
150
|
+
`+ht),dt&&(ht=ka(ht)),R&&is?ts(ht):ht},e.setConfig=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pa(W),zl=!0,ba=Je,ql=rt},e.clearConfig=function(){po=null,zl=!1,ba=null,ql=null,R=O,N=""},e.isValidAttribute=function(W,T,w){po||Pa({});let G=$e(W),ee=$e(T);return Ua(G,ee,w)},e.addHook=function(W,T){typeof T=="function"&&nr(He,W)&&Op(He[W],T)},e.removeHook=function(W,T){if(nr(He,W)){if(T!==void 0){let w=Tne(He[W],T);return w===-1?void 0:yne(He[W],w,1)[0]}return o2(He[W])}},e.removeHooks=function(W){nr(He,W)&&(He[W]=[])},e.removeAllHooks=function(){He=E2()},e}var fy=I2();var Wne=/^\/\/\*\[@id='([^']+)'\]/;function UN(t){try{if(typeof t!="string")return null;let e=Wne.exec(t);if(!e)return null;let n=e[1],r=t.slice(e[0].length);if(!r)return{rootId:n,segments:[]};if(!r.startsWith("/"))return null;let i=[],o="",s=0,a=null;for(let c=1;c<r.length;c++){let l=r[c];if(a){l===a&&(a=null),o+=l;continue}if(l==="'"||l==='"')a=l;else if(l==="[")s++;else if(l==="]")s--;else if(l==="/"&&s===0){if(!o)return null;i.push(o),o="";continue}o+=l}return!o||a||s!==0?null:(i.push(o),{rootId:n,segments:i})}catch{return null}}var zne=[/:r[0-9a-z]+:/i,/_r_[0-9a-z]+_/i,/«r[0-9a-z]+»/i,/^radix-/i];function S2(t){try{return t?zne.some(e=>e.test(t)):!1}catch{return!1}}function Uke(t){if(Array.isArray(t))return v2(t);if(!t||typeof t!="object"||!("documentIds"in t))return{documentIds:null};let e=t.documentIds;return Array.isArray(e)?v2(e):{documentIds:[],problem:"not-an-array"}}function v2(t){let e=t.filter(n=>typeof n=="string"||typeof n=="number"&&Number.isFinite(n)).map(n=>String(n)).filter(n=>n.length>0);return B({documentIds:Array.from(new Set(e)).sort()},e.length<t.length?{problem:"dropped-entries"}:{})}function Vke(t,e){return t===null||e===null?t===e:t.length===e.length&&t.every((n,r)=>n===e[r])}var A2={ADD_TAGS:["velt-skeleton-loader"],ADD_ATTR:["border-radius","target"]},C2=(()=>{let e=class e{constructor(r,i,o,s){this.analyticsService=r,this.rendererFactory2=i,this.loggingService=o,this.sanitizer=s,this.smoothScrollShieldHandler=null,this.smoothScrollShieldLoadListener=null,this.isVideoEditorHandlingDelete=!1,this.pageScrollHeight=0,this.enableRectSelectionSubject$=new ie(!1),this.enableRectSelection$=this.enableRectSelectionSubject$.asObservable(),this.scrollableElementsIds$=new ie([]),this.mousedown=!1,this.windowMouseDown$=new Rt,this.windowPointerMove$=new ie(null),this.windowPointerUp$=new ie(null),this.documentSelectionChange$=new ie(null),this.windowClick$=new ie(null),this.windowScroll$=new ie(null),this.windowResize$=new ie(null),this.windowKeyupBackspace$=new ie(null),this.windowKeyupDelete$=new ie(null),this.windowKeyupEsc$=new ie(null),this.windowPopState$=new ie(null),this.documentClick$=new ie(null),this.documentClickSubject$=new Rt,this.documentFocus$=new ie(null),this.windowKeydownShift$=new ie(null),this.windowKeyupShift$=new ie(null),this.mutation$=new ie(null),this.childListMutation$=new ie(null),this.networkStatus$=new ie(!1),this.xpathCache=new Map,this.xpathCacheId=new Map,this.selectedAnnotationsMap$=new ie({}),this.selectedAnnotationsLocationMap$=new ie({}),this.selectedAnnotationsContextIdMap$=new ie({}),this.recordingInProgress$=new ie({}),this.deleteAnnotations$=new ie([]),this.pinHighlighterClass$=new ie(null),this.dialogOpenedInSidebar$=new ie(!1),this.textHighlighterClass$=new ie(null),this.commentPinHighlighter$=new ie(!1),this.deviceInfo$=new ie(new Ur),this.customCss$=new ie(null),this.mutationObserver=null,this.animationFilterEnabled=!1,this.animationLibraryDetected=null,this.staticAnimationCache=new WeakMap,this.ANIMATION_LIBRARY_SELECTOR=["[data-gsap]",".gsap-marker-start",".gsap-marker-end","[data-gsap-id]",".swiper-slide",".swiper-wrapper",".swiper-pagination",".swiper-pagination-bullet","[data-aos]"].join(", "),this.previousMousePosition={pageX:0,pageY:0,clientX:0,clientY:0},this.currentMousePosition={pageX:0,pageY:0,clientX:0,clientY:0,element:{xpath:"",topPercentage:0,leftPercentage:0}},this.nodeMap={},this.unlistenElementScroll={},this.tabId=null,this.dynamicIdPatterns=[/^yui_[a-z0-9_]+$/i],this.excludeClassList=["show-pin-cursor"],this.filterSnippylyNodes=a=>{try{let c=[];return a.forEach(l=>{if(!qi(l))if(l instanceof HTMLElement){if(l.className.includes("cdk-overlay-container")||l.className.includes("cdk-overlay-connected-position-bounding-box"))return;if(l.className.includes("cdk-overlay")){let d=!1;l.childNodes.forEach(h=>{qi(h)&&(d=!0)}),d||c.push(l)}else c.push(l)}else c.push(l)}),c}catch(c){return this.loggingService.catch("Error in DomService filterSnippylyNodes: ",c),[]}},this.loggingService.log("%c[WB] Creating CLASS: DomService","color: blue;");try{this.analyticsService.setDomService(this),this.renderer=this.rendererFactory2.createRenderer(null,null);let a=this.calculateScreenSize();this.currentScreenSize$=new ie(a),this.currentMousePosition$=new ie(this.currentMousePosition),this.detectNetworkStatusChange(),this.getScrollableElementsIds$().pipe(Ya(),eE(([c,l])=>{try{let d=l.filter(f=>!c.includes(f)),h=c.filter(f=>!l.includes(f));h.length&&h.map(g=>document.getElementById(g)).filter(g=>g).forEach(g=>{this.unlistenElementScroll&&this.unlistenElementScroll[g.id]&&this.unlistenElementScroll[g.id]()}),d.length&&d.map(g=>document.getElementById(g)).filter(g=>g).forEach(g=>{this.unlistenElementScroll[g.id]=this.renderer.listen(g,"scroll",E=>{let I=this.calculateScreenSize();this.currentScreenSize$.next(I)})})}catch(d){this.loggingService.catch("Error in DomService getScrollableElementsIds subscription: ",d)}})).subscribe(()=>{},c=>{this.loggingService.catch("Error in DomService getScrollableElementsIds subscription: ",c)}),this.getSelectedAnnotationsMap$().subscribe(c=>{Object.keys(c||{})?.length?jV("snippylyUserScalableNo","viewport","width=device-width, user-scalable=no"):HV("snippylyUserScalableNo")},c=>{this.loggingService.catch("Error in DomService getSelectedAnnotationsMap$ subscription: ",c)})}catch(a){this.loggingService.catch("Error in DomService constructor: ",a)}}setDocService(r){try{this.docService=r,this.subscribeToDomEvents()}catch(i){this.loggingService.catch("Error in DomService setDocService: ",i)}}setDynamicIdPatterns(r){try{let i=r.map(o=>typeof o=="string"?new RegExp(o):o).filter(Boolean);i.length&&(this.dynamicIdPatterns=i)}catch(i){this.loggingService.catch("Error in DomService setDynamicIdPatterns: ",i)}}isLikelyDynamicId(r){try{return r?this.dynamicIdPatterns.some(i=>i.test(r)):!1}catch{return!1}}isGeneratedId(r){return this.isLikelyDynamicId(r)||S2(r)}getStableAttributes(r){try{let i={};if(!r.getAttributeNames)return i;let o=new Set(["id","class","style"]);return r.getAttributeNames().forEach(a=>{if(o.has(a)||a.includes("snippyly")||a.includes("velt"))return;let c=r.getAttribute(a);c&&c.length<=256&&(i[a]=c)}),i}catch{return{}}}buildStableElementSelector(r,i){try{if(Object.keys(i).length===0)return;let s=[r.tagName?.toLowerCase()],a=["data-","aria-","role","name","title","type"];return Object.keys(i).sort((l,d)=>{let h=a.findIndex(g=>l.startsWith(g)),f=a.findIndex(g=>d.startsWith(g));return(h===-1?99:h)-(f===-1?99:f)}).slice(0,4).forEach(l=>{let d=CSS.escape(i[l]);s.push(`[${l}="${d}"]`)}),s.join("")}catch{return}}getVisibleText(r,i=400){try{let o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null),s="",a,c=0;for(;(a=o.nextNode())&&s.length<i;){let l=(a.textContent||"").replace(/\s+/g," ").trim();if(l&&(s+=(s?" ":"")+l),c++,c>100)break}return s.slice(0,i)}catch{return""}}hashText(r){try{return DV(r)}catch{return}}generateRobustXPath(r,i){try{let o=i?.maxDepth||10,s=i?.useAbsolutePath||!1,a=[],c=r,l=0;for(;c&&c!==document.documentElement&&l<o;){let g=this.buildRobustXPathSegment(c);if(g&&(a.unshift(g),this.isStrongAnchorSegment(g)))break;c=c.parentElement,l++}if(a.length===0)return;let h=(s?"/":"//")+a.join("/");return a.some(g=>g.includes("[@")||g.includes("[contains(@class"))?h:void 0}catch{return}}buildRobustXPathSegment(r){try{let i=r.tagName.toLowerCase(),o=r.id;if(o&&!this.isLikelyDynamicId(o)&&document.querySelectorAll(`[id="${CSS.escape(o)}"]`).length===1)return`*[@id=${this.escapeXPathValue(o)}]`;let s=["data-region","data-instanceid","data-action","data-key","data-block","data-activityid"];for(let g of s){let E=r.getAttribute(g);if(E)return`${i}[@${g}=${this.escapeXPathValue(E)}]`}let a=Array.from(r.attributes).filter(g=>g.name.startsWith("data-")&&!g.name.includes("snippyly")&&!g.name.includes("velt")&&g.value.length<100).sort((g,E)=>g.value.length-E.value.length);if(a.length>0){let g=a[0];return`${i}[@${g.name}=${this.escapeXPathValue(g.value)}]`}let c=r.getAttribute("role");if(c)return`${i}[@role=${this.escapeXPathValue(c)}]`;let l=r.getAttribute("aria-label");if(l&&l.length<50)return`${i}[@aria-label=${this.escapeXPathValue(l)}]`;let d=r.getAttribute("name");if(d)return`${i}[@name=${this.escapeXPathValue(d)}]`;let h=r.getAttribute("type");if(h)return`${i}[@type=${this.escapeXPathValue(h)}]`;let f=Array.from(r.classList||[]).filter(g=>g.length>0&&g.length<40&&!g.includes("yui")&&!g.includes("velt")&&!g.includes("snippyly")&&!this.excludeClassList.includes(g)).slice(0,2);if(f.length>0){let g=f.map(E=>`contains(@class, ${this.escapeXPathValue(E)})`).join(" and ");return`${i}[${g}]`}if(r.parentElement){let g=Array.from(r.parentElement.children).filter(E=>E.tagName===r.tagName);if(g.length>1){let E=g.indexOf(r)+1;return`${i}[${E}]`}}return i}catch{return}}isStrongAnchorSegment(r){try{return!!(r.includes("[@id=")||["main","navigation","banner","contentinfo","complementary","search"].some(s=>r.includes(`[@role='${s}']`))||["data-region","data-instanceid","data-activityid"].some(s=>r.includes(`[@${s}=`)))}catch{return!1}}escapeXPathValue(r,i=!0){try{return r.includes("'")?r.includes('"')?`concat(${r.split("'").map(a=>`'${a}'`).join(`,"'",`)})`:i?`"${r}"`:r:i?`'${r}'`:r}catch{try{return`concat(${r.split("'").map(c=>`'${c}'`).join(`,"'",`)})`}catch{return i?`'${r}'`:r}}}getElementFromRobustXPath(r){try{return document.evaluate(r,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch{return null}}getAllElementsFromRobustXPath(r){try{let i=document.evaluate(r,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),o=[];for(let s=0;s<i.snapshotLength;s++){let a=i.snapshotItem(s);a instanceof Element&&o.push(a)}return o}catch{return[]}}generateAnchorRecord(r,i){try{let o=this.generateAnchorRecordForElement(r,i),s=null;if(r.parentElement&&r.parentElement instanceof HTMLElement&&rd(r.parentElement)&&r.parentElement!==document.body&&(s=r.parentElement),o&&s){let a=this.generateAnchorRecordForElement(s,i);a&&(o.parent=a)}return o}catch(o){return this.loggingService.catch("Error in DomService generateAnchorRecord: ",o),null}}generateAnchorRecordForElement(r,i){try{if(!r)return null;let o=r,s=o.tagName?.toUpperCase();if(!s)return null;let a=o.id&&!this.isLikelyDynamicId(o.id)?o.id:void 0,c=this.getStableAttributes(o),l=this.buildStableElementSelector(o,c),d=this.getVisibleText(o),h=this.hashText(d||""),f=this.generateRobustXPath(o),g=this.getXPath(o,!1,!1,void 0,{ignoreGeneratedIds:i?.ignoreGeneratedIds}),E=this.getXPath(o,!0),I=this.getXPath(o,!0,!0);return{version:"1.0",id:a,tagName:s,elementSelector:l,robustXPath:f||void 0,xPath:g||void 0,fXPath:E||void 0,cfXPath:I||void 0,contentHash:h?{value:h,algorithm:"md5",source:"textContent"}:void 0,createdAt:Date.now()}}catch(o){return this.loggingService.catch("Error in DomService generateAnchorRecordForElement: ",o),null}}resolveAnchorRecord(r){try{let i=[],o=null,s=(h,f,g=0)=>{let E=[],I=g;if(E.push({method:f,score:g}),r.tagName&&h.tagName?.toUpperCase()===r.tagName&&(I+=10,E.push({method:"tagName-match",score:10})),r.contentHash?.value){let S=this.getVisibleText(h);this.hashText(S)===r.contentHash.value&&(I+=30,E.push({method:"contentHash-match",score:30}))}i.push({el:h,score:I,by:f,scoreBreakdown:E})};if(r.id){let h=document.querySelectorAll(`#${CSS.escape(r.id)}`);if(h.length===1)return{element:h[0],matchedBy:"id",score:90};h.length>1&&h.forEach(f=>s(f,"id-duplicate",70))}if(r.elementSelector){let h=document.querySelectorAll(r.elementSelector);if(h.length===1)return{element:h[0],matchedBy:"element-selector",score:80};h.forEach(f=>s(f,"element-selector-duplicate",60))}r.robustXPath&&this.getAllElementsFromRobustXPath(r.robustXPath).slice(0,20).forEach(E=>s(E,"robustXPath",50)),r?.parent&&(o=this.resolveAnchorRecord(r.parent),o.element&&o.element.querySelectorAll(r.tagName?.toLowerCase()||"*").forEach(f=>s(f,"parent+tag",40)));let a=(h,f,g)=>{if(!h)return;let E=this.getElementFromXPath(h);E&&s(E,f||"xpath",g||30)};if(a(r.xPath,"xPath",30),a(r.cfXPath,"cfXPath",30),a(r.fXPath,"fXPath",30),r.contentHash?.value&&i.length===0){let f=g=>{let E=0;for(let I=0;I<g.length&&E<400;I++){let S=g[I];if(E++,!this.isElementVisible(S))continue;let L=this.getVisibleText(S),V=this.hashText(L);V&&V===r.contentHash?.value&&s(S,"contentHash",15)}};if(o?.element&&o?.element instanceof Element){let g=o?.element?.querySelectorAll("*");f(g)}}if(!i.length)return{element:null};i.sort((h,f)=>f.score-h.score);let c=i[0].score,l=i.filter(h=>h.score===c);if(l.length>1){let h=[{path:r.xPath,label:"xPath"},{path:r.cfXPath,label:"cfXPath"},{path:r.fXPath,label:"fXPath"}];for(let f of h)if(f.path){let g=this.getElementFromXPath(f.path);if(g){let E=l.find(I=>I.el===g);if(E)return{element:E.el,matchedBy:`${E.by}+position`,score:E.score,scoreBreakdown:E.scoreBreakdown}}}}let d=i[0];return{element:d.el,matchedBy:d.by,score:d.score,scoreBreakdown:d.scoreBreakdown}}catch(i){return this.loggingService.catch("Error in DomService resolveAnchorRecord: ",i),{element:null}}}subscribeToDomEvents(){try{this.docService?.getDocumentPaths$().pipe(De(r=>{r?(this.onWindowResize(),this.onWindowScroll(),this.onPointerDown(),this.onWindowClick(),this.onWindowKeyupBackspace(),this.onWindowKeyupDelete(),this.onWindowKeyupEsc(),this.onWindowPopState(),this.onWindowKeydownShift(),this.onWindowKeyupShift(),this.addPointerMoveListener(),this.addPointerUpListener(),this.addSelectionChangeListener(),this.onDocumentFocus(),this.setupSmoothScrollShield()):(this.unsubscribeFromWindowResize(),this.unsubscribeFromWindowScroll(),this.unsubscribeFromPointerDown(),this.unsubscribeFromWindowClick(),this.unsubscribeFromWindowKeyupBackspace(),this.unsubscribeFromWindowKeyupDelete(),this.unsubscribeFromWindowKeyupEsc(),this.unsubscribeFromWindowPopState(),this.unsubscribeFromWindowKeydownShift(),this.unsubscribeFromWindowKeyupShift(),this.unsubscribeFromPointerMoveListener(),this.unsubscribeFromPointerUpListener(),this.unsubscribeFromSelectionChangeListener(),this.unsubscribeFromDocumentFocus(),this.unsetMutationObserver(),this.teardownSmoothScrollShield())})).subscribe(),this.onDocumentClick()}catch(r){this.loggingService.catch("Error in DomService subscribeToDomEvents: ",r)}}setScrollableElementsIds(r){try{r&&r.length&&this.scrollableElementsIds$.next(Array.from(new Set(r)))}catch(i){this.loggingService.catch("Error in DomService setScrollableElementsIds: ",i)}}getScrollableElementsIds$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getScrollableElementsIds$","color: green;"),this.scrollableElementsIds$.asObservable()}removeScrollableElementsIds(){this.scrollableElementsIds$.next([])}setMutationObserver(r){try{this.mutationObserver||(this.loggingService.log("%c[WB] Calling DomService FUNCTION: setMutationObserver","color: green;"),this.loggingService.log("%c[WB] setMutationObserver from: "+r,"color: green;"),this.animationFilterEnabled=this.detectAnimationLibraries(),this.loggingService.log("%c[WB] Animation filter:","color: green;",this.animationFilterEnabled?"ENABLED (library detected)":"DISABLED (no library)"),this.mutationObserver=new MutationObserver(i=>{try{if(i?.find(s=>s?.attributeName===F.VELT_IGNORE_CHANGE_DETECTION))return;let o=i.filter(s=>s.type==="childList").filter(s=>{let a=s.target;return s.removedNodes.forEach(c=>{let l=c;if(typeof l.getAttribute=="function"){let d=l.getAttribute(F.ATTRIBUTES.VELT_ELEMENT_CACHE_ID);if(d!==null&&d!==""){let h=this.xpathCacheId.get(d);h!==void 0&&(this.xpathCacheId.delete(d),this.xpathCache.delete(h))}}}),qi(a)?!1:!!(this.filterSnippylyNodes(s.addedNodes).length||this.filterSnippylyNodes(s.removedNodes).length)});this.animationFilterEnabled?this.childListMutation$.next(o.filter(s=>!this.isAnimatingElement(s.target))):this.childListMutation$.next(o),o.push(...i.filter(s=>s.type==="attributes").filter(s=>!qi(s.target)).filter(s=>this.filterSnippylyNodes([s.target]).length).filter(s=>{if(s){let a=s.target;return a?.classList?.contains("snippyly-sidebar-panel")?!1:a?!a.getAttribute(F.VELT_IGNORE_CHANGE_DETECTION):!0}return!0})),o=o.filter(s=>{let a=!0;return Object.keys(F.INGNORE_MUTATION_OBSERVER_CHANGE_TAGS).forEach(c=>{s.target?.closest(c)&&(a=!1)}),a}),o=o.filter(s=>s.target&&rd(s.target)),this.animationFilterEnabled&&(o=o.filter(s=>!this.isAnimatingElement(s.target))),o.length&&this.mutation$.next(o)}catch(o){this.loggingService.catch("Error in DomService change detection: ",o)}}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0}))}catch(i){this.loggingService.catch("Error in DomService change detection: ",i)}}detectAnimationLibraries(){try{if(this.animationLibraryDetected!==null)return this.animationLibraryDetected;let r=window;return r.gsap||r.TweenMax||r.TweenLite||r.TimelineMax||r.TimelineLite?(this.loggingService.log("%c[WB] Detected animation library: GSAP","color: green;"),this.animationLibraryDetected=!0,!0):r.Swiper?(this.loggingService.log("%c[WB] Detected animation library: Swiper","color: green;"),this.animationLibraryDetected=!0,!0):r.AOS?(this.loggingService.log("%c[WB] Detected animation library: AOS","color: green;"),this.animationLibraryDetected=!0,!0):r.anime?(this.loggingService.log("%c[WB] Detected animation library: Anime.js","color: green;"),this.animationLibraryDetected=!0,!0):r.lottie||r.Lottie||r.bodymovin?(this.loggingService.log("%c[WB] Detected animation library: Lottie","color: green;"),this.animationLibraryDetected=!0,!0):document.querySelector("[data-framer-component-type]")?(this.loggingService.log("%c[WB] Detected animation library: Framer Motion","color: green;"),this.animationLibraryDetected=!0,!0):document.querySelector(this.ANIMATION_LIBRARY_SELECTOR)?(this.loggingService.log("%c[WB] Detected animation library: DOM markers","color: green;"),this.animationLibraryDetected=!0,!0):(this.loggingService.log("%c[WB] No animation library detected","color: green;"),this.animationLibraryDetected=!1,!1)}catch{return this.animationLibraryDetected=!1,!1}}isAnimatingElement(r){try{if(!r||typeof r.closest!="function")return!1;let i=window;if(i.gsap&&typeof i.gsap.isTweening=="function"){if(i.gsap.isTweening(r))return!0;if(typeof i.gsap.getTweensOf=="function")try{if(i.gsap.getTweensOf(r).length>0)return!0}catch{}}else if(i.TweenMax&&typeof i.TweenMax.isTweening=="function"){if(i.TweenMax.isTweening(r))return!0;if(typeof i.TweenMax.getTweensOf=="function")try{if(i.TweenMax.getTweensOf(r).length>0)return!0}catch{}}let o=r.style?.cssText||"";if(o){let l=o.includes("transform")||o.includes("translate3d")||o.includes("translate(")||o.includes("scale3d")||o.includes("rotate"),d=o.includes("will-change")&&o.includes("transform"),h=o.includes("transform-style")&&o.includes("preserve-3d");if(l&&(d||h))return!0}if(r.style&&(r.style.animation!==""&&r.style.animation!=="none"||r.style.transition!==""&&r.style.transition!=="none")||r.classList?.contains("animate")||r.classList?.contains("animating")||r.classList?.contains("animated")||r.classList?.contains("animation"))return!0;let s=this.staticAnimationCache.get(r);if(s!==void 0)return s;let a=!1,c=r.className||"";return typeof c=="string"&&(c.includes("slider")&&(c.includes("bullet")||c.includes("pagination"))&&(a=!0),c.includes("swiper-pagination")&&(a=!0)),!a&&(r.hasAttribute("data-aos")||r.hasAttribute("data-motion"))&&(a=!0),!a&&r.closest(this.ANIMATION_LIBRARY_SELECTOR)&&(a=!0),this.staticAnimationCache.set(r,a),a}catch{return!1}}unsetMutationObserver(){try{this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null,this.staticAnimationCache=new WeakMap,this.animationLibraryDetected=null,this.animationFilterEnabled=!1)}catch(r){this.loggingService.catch("Error in DomService unsetMutationObserver: ",r)}}detectNetworkStatusChange(){this.loggingService.log("%c[WB] Calling FUNCTION: detectNetworkStatusChange","color: green;");try{gs(wi(window,"offline").pipe(De(()=>!1)),wi(window,"online").pipe(De(()=>!0)),new fe(r=>{r.next(navigator.onLine),r.complete()})).subscribe(r=>{this.networkStatus$.next(r)})}catch(r){this.loggingService.catch("Error in DomService detectNetworkStatusChange: ",r)}}onWindowResize(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowResize","color: green;");try{this.unsubscribeFromWindowResize(),this.unlistenWindowResize=this.renderer.listen("window","resize",r=>{this.windowResize$.next(r);let i=this.calculateScreenSize();this.deviceInfo$.next(new Ur),this.currentScreenSize$.next(i)})}catch(r){this.loggingService.catch("Error in DomService onWindowResize: ",r)}}unsubscribeFromWindowResize(){try{this.unlistenWindowResize&&typeof this.unlistenWindowResize=="function"&&(this.unlistenWindowResize(),this.unlistenWindowResize=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowResize: ",r)}}onWindowScroll(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowScroll","color: green;");try{this.unsubscribeFromWindowScroll(),this.unlistenWindowScroll=this.renderer.listen("window","scroll",r=>{this.windowScroll$.next(r);let i=this.calculateScreenSize();this.currentScreenSize$.next(i)})}catch(r){this.loggingService.catch("Error in DomService onWindowScroll: ",r)}}unsubscribeFromWindowScroll(){try{this.unlistenWindowScroll&&typeof this.unlistenWindowScroll=="function"&&(this.unlistenWindowScroll(),this.unlistenWindowScroll=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowScroll: ",r)}}setupSmoothScrollShield(){this.loggingService.log("%c[WB] Calling FUNCTION: setupSmoothScrollShield","color: green;");try{if(typeof window>"u"||typeof document>"u"||this.smoothScrollShieldHandler)return;if(this.isSmoothScrollLibPresent()){this.attachSmoothScrollShield();return}if(document.readyState!=="complete"&&!this.smoothScrollShieldLoadListener){let r=()=>{this.smoothScrollShieldLoadListener=null;try{if(this.smoothScrollShieldHandler)return;this.isSmoothScrollLibPresent()&&this.attachSmoothScrollShield()}catch(i){this.loggingService.catch("Error in DomService smooth-scroll shield load re-check: ",i)}};window.addEventListener("load",r,{once:!0}),this.smoothScrollShieldLoadListener=()=>window.removeEventListener("load",r)}}catch(r){this.loggingService.catch("Error in DomService setupSmoothScrollShield: ",r)}}isSmoothScrollLibPresent(){try{if(typeof window>"u"||typeof document>"u")return!1;if(window.ET_SmoothScroll)return!0;let i=document.body;return!!(i&&i.classList&&i.classList.contains("et_smooth_scroll"))}catch(r){return this.loggingService.catch("Error in DomService isSmoothScrollLibPresent: ",r),!1}}attachSmoothScrollShield(){if(this.smoothScrollShieldHandler)return;let r=/^(VELT-|SUPERFLOW-|SNIPPYLY-)/,i=s=>{try{let a=typeof s.composedPath=="function"?s.composedPath():[];for(let c=0;c<a.length;c++){let l=a[c];if(!(!l||l.nodeType!==1)&&l.tagName&&r.test(l.tagName)){s.stopImmediatePropagation();return}}}catch(a){this.loggingService.catch("Error in DomService smoothScrollShield handler: ",a)}};this.smoothScrollShieldHandler=i;let o={capture:!0,passive:!0};window.addEventListener("wheel",i,o),window.addEventListener("mousewheel",i,o),window.addEventListener("touchmove",i,o),this.unlistenWindowWheelShield=()=>window.removeEventListener("wheel",i,o),this.unlistenWindowMouseWheelShield=()=>window.removeEventListener("mousewheel",i,o),this.unlistenWindowTouchMoveShield=()=>window.removeEventListener("touchmove",i,o)}teardownSmoothScrollShield(){this.loggingService.log("%c[WB] Calling FUNCTION: teardownSmoothScrollShield","color: green;");try{try{this.smoothScrollShieldLoadListener&&typeof this.smoothScrollShieldLoadListener=="function"&&(this.smoothScrollShieldLoadListener(),this.smoothScrollShieldLoadListener=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (load): ",r)}try{this.unlistenWindowWheelShield&&typeof this.unlistenWindowWheelShield=="function"&&(this.unlistenWindowWheelShield(),this.unlistenWindowWheelShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (wheel): ",r)}try{this.unlistenWindowMouseWheelShield&&typeof this.unlistenWindowMouseWheelShield=="function"&&(this.unlistenWindowMouseWheelShield(),this.unlistenWindowMouseWheelShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (mousewheel): ",r)}try{this.unlistenWindowTouchMoveShield&&typeof this.unlistenWindowTouchMoveShield=="function"&&(this.unlistenWindowTouchMoveShield(),this.unlistenWindowTouchMoveShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (touchmove): ",r)}this.smoothScrollShieldHandler=null}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield: ",r)}}onPointerDown(){this.loggingService.log("%c[WB] Calling FUNCTION: onPointerDown","color: green;");try{this.unsubscribeFromPointerDown(),this.unlistenPointerDown=this.renderer.listen("window","pointerdown",r=>{this.mousedown=!0,this.windowMouseDown$.next(r),this.setPointerPosition(r)})}catch(r){this.loggingService.catch("Error in DomService onPointerDown: ",r)}}unsubscribeFromPointerDown(){try{this.unlistenPointerDown&&typeof this.unlistenPointerDown=="function"&&(this.unlistenPointerDown(),this.unlistenPointerDown=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerDown: ",r)}}onWindowClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupBackspace","color: green;");try{this.unsubscribeFromWindowClick(),this.unlistenWindowClick=this.renderer.listen("window","click",r=>{this.windowClick$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowClick: ",r)}}unsubscribeFromWindowClick(){try{this.unlistenWindowClick&&typeof this.unlistenWindowClick=="function"&&(this.unlistenWindowClick(),this.unlistenWindowClick=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowClick: ",r)}}onWindowKeyupBackspace(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupBackspace","color: green;");try{this.unsubscribeFromWindowKeyupBackspace(),this.unlistenWindowKeyupBackspace=this.renderer.listen("window","keyup.backspace",r=>{this.isVideoEditorHandlingDelete||this.windowKeyupBackspace$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupBackspace: ",r)}}unsubscribeFromWindowKeyupBackspace(){try{this.unlistenWindowKeyupBackspace&&typeof this.unlistenWindowKeyupBackspace=="function"&&(this.unlistenWindowKeyupBackspace(),this.unlistenWindowKeyupBackspace=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupBackspace: ",r)}}onWindowKeyupDelete(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupDelete","color: green;");try{this.unsubscribeFromWindowKeyupDelete(),this.unlistenWindowKeyupDelete=this.renderer.listen("window","keyup.delete",r=>{this.isVideoEditorHandlingDelete||this.windowKeyupDelete$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupDelete: ",r)}}unsubscribeFromWindowKeyupDelete(){try{this.unlistenWindowKeyupDelete&&typeof this.unlistenWindowKeyupDelete=="function"&&(this.unlistenWindowKeyupDelete(),this.unlistenWindowKeyupDelete=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupDelete: ",r)}}onWindowKeyupEsc(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupEsc","color: green;");try{this.unsubscribeFromWindowKeyupEsc(),this.unlistenWindowKeyupEsc=this.renderer.listen("window","keyup.esc",r=>{this.windowKeyupEsc$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupEsc: ",r)}}unsubscribeFromWindowKeyupEsc(){try{this.unlistenWindowKeyupEsc&&typeof this.unlistenWindowKeyupEsc=="function"&&(this.unlistenWindowKeyupEsc(),this.unlistenWindowKeyupEsc=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupEsc: ",r)}}onWindowPopState(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowPopState","color: green;");try{this.unsubscribeFromWindowPopState(),this.unlistenWindowPopState=this.renderer.listen("window","popstate",r=>{this.windowPopState$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowPopState: ",r)}}unsubscribeFromWindowPopState(){try{this.unlistenWindowPopState&&typeof this.unlistenWindowPopState=="function"&&(this.unlistenWindowPopState(),this.unlistenWindowPopState=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowPopState: ",r)}}onDocumentClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onDocumentClick","color: green;");try{this.unsubscribeFromDocumentClick(),this.documentClickListener=r=>{r?.target?.tagName?.toLowerCase()!==F.TAGS.SUPERFLOW_TOOLBAR&&(this.documentClick$.next(r),this.documentClickSubject$.next(r))},document.addEventListener("click",this.documentClickListener,!0)}catch(r){this.loggingService.catch("Error in DomService onDocumentClick: ",r)}}unsubscribeFromDocumentClick(){try{this.documentClickListener&&typeof this.documentClickListener=="function"&&(document.removeEventListener("click",this.documentClickListener,!0),this.documentClickListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromDocumentClick: ",r)}}onDocumentFocus(){this.loggingService.log("%c[WB] Calling FUNCTION: onDocumentFocus","color: green;");try{this.unsubscribeFromDocumentFocus(),this.documentFocusListener=r=>{this.documentFocus$.next(r)},document.addEventListener("focus",this.documentFocusListener,!0)}catch(r){this.loggingService.catch("Error in DomService onDocumentFocus: ",r)}}unsubscribeFromDocumentFocus(){try{this.documentFocusListener&&typeof this.documentFocusListener=="function"&&(document.removeEventListener("focus",this.documentFocusListener,!0),this.documentFocusListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromDocumentFocus: ",r)}}onWindowKeydownShift(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeydownShift","color: green;");try{this.unsubscribeFromWindowKeydownShift(),this.unlistenWindowKeydownShift=this.renderer.listen("window","keydown.shift",r=>{this.windowKeydownShift$.next(r),this.windowKeyupShift$.next(null)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeydownShift: ",r)}}unsubscribeFromWindowKeydownShift(){try{this.unlistenWindowKeydownShift&&typeof this.unlistenWindowKeydownShift=="function"&&(this.unlistenWindowKeydownShift(),this.unlistenWindowKeydownShift=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeydownShift: ",r)}}onWindowKeyupShift(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupShift","color: green;");try{this.unsubscribeFromWindowKeyupShift(),this.unlistenWindowKeyupShift=this.renderer.listen("window","keyup.shift",r=>{this.windowKeyupShift$.next(r),this.windowKeydownShift$.next(null)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupShift: ",r)}}unsubscribeFromWindowKeyupShift(){try{this.unlistenWindowKeyupShift&&typeof this.unlistenWindowKeyupShift=="function"&&(this.unlistenWindowKeyupShift(),this.unlistenWindowKeyupShift=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupShift: ",r)}}onWindowKeydown$(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeydown$","color: green;");try{return wi(window,"keydown")}catch(r){return this.loggingService.catch("Error in DomService onWindowKeydown$: ",r),Wa}}addPointerMoveListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerMoveListener","color: green;");try{this.unsubscribeFromPointerMoveListener(),this.unlistenPointerMoveListener=this.renderer.listen("document","pointermove",r=>{this.windowPointerMove$.next(r),this.mouseMoveEvent=r})}catch(r){this.loggingService.catch("Error in DomService addPointerMoveListener: ",r)}}unsubscribeFromPointerMoveListener(){try{this.unlistenPointerMoveListener&&typeof this.unlistenPointerMoveListener=="function"&&(this.unlistenPointerMoveListener(),this.unlistenPointerMoveListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerMoveListener: ",r)}}addPointerUpListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerUpListener","color: green;");try{this.unsubscribeFromPointerUpListener(),this.unlistenPointerUpListener=this.renderer.listen("document","pointerup",r=>{this.windowPointerUp$.next(r)})}catch(r){this.loggingService.catch("Error in DomService addPointerUpListener: ",r)}}unsubscribeFromPointerUpListener(){try{this.unlistenPointerUpListener&&typeof this.unlistenPointerUpListener=="function"&&(this.unlistenPointerUpListener(),this.unlistenPointerUpListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerUpListener: ",r)}}addSelectionChangeListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerUpListener","color: green;");try{this.unsubscribeFromSelectionChangeListener(),this.unlistenSelectionChangeListener=this.renderer.listen("document","selectionchange",r=>{this.documentSelectionChange$.next(r)})}catch(r){this.loggingService.catch("Error in DomService addPointerUpListener: ",r)}}unsubscribeFromSelectionChangeListener(){try{this.unlistenSelectionChangeListener&&typeof this.unlistenSelectionChangeListener=="function"&&(this.unlistenSelectionChangeListener(),this.unlistenSelectionChangeListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromSelectionChangeListener: ",r)}}updateCurrentMousePosition(r){try{if(this.currentMousePosition.pageX=r.pageX,this.currentMousePosition.pageY=r.pageY,this.currentMousePosition.clientX=r.clientX,this.currentMousePosition.clientY=r.clientY,r.target){let i=this.getXPath(r.target),o=r.target;if(i?.includes("name()='svg'")){let h=this.getXPath(i);h&&(o=h.iterateNext()||r.target)}let s=o.getBoundingClientRect(),a=r.clientX-s.x,c=r.clientY-s.y,l=a*100/(s.width||1),d=c*100/(s.height||1);this.currentMousePosition.element={xpath:i,topPercentage:d,leftPercentage:l}}else this.currentMousePosition.element=null;this.currentMousePosition$.next(this.currentMousePosition)}catch(i){this.loggingService.catch("Error in DomService updateCurrentMousePosition: ",i)}}getTargetElementForCursorPosition(r,i=!0,o=!1,s=!0,a,c=!0,l,d){try{let h=r,f=h?.touches?.length?h.touches[0]?.clientX:h?.clientX,g=h?.touches?.length?h.touches[0]?.clientY:h?.clientY;l&&(f=l.clientX,g=l.clientY);let E=this.getBackgroundElement(f,g,i,o);if(E&&a&&typeof a=="function"&&(E=a(E)),E){let I=this.getXPath(E,!1,!1,void 0,d),S=this.getXPath(E,!0),L=E.getBoundingClientRect(),V=f-L.x,K=g-L.y,oe=V*100/(L.width||1),ge=K*100/(L.height||1),te={xpath:I,fXpath:S,leftPercentage:oe,topPercentage:ge};if(s){let C=this.getXPath(E,!0,!0);te.cfXpath=C}if(c){let C=this.generateAnchorRecord(E,d);C&&(te.anchor=C)}return te}else return null}catch(h){return this.loggingService.catch("Error in DomService getTargetElementForCommentPinAnnotation: ",h),null}}getBackgroundElement(r,i,o=!0,s=!1){try{let a=document.elementsFromPoint(r,i),c=[];a.forEach(d=>{qi(d)?c=[]:rd(d)&&c.push(d)}),s&&(c=c.filter(d=>this.isElementVisibleOnScreen(d)));let l=0;return o||c?.forEach((d,h)=>{d.tagName.toLowerCase()==="svg"&&(l=h)}),c[l]}catch(a){return this.loggingService.catch("Error in DomService getBackgroundElement: ",a),null}}getBackgroundVeltElement(r,i){try{let o=document.elementsFromPoint(r,i),s=[];return o.forEach(a=>{qi(a)&&rd(a)&&s.push(a)}),s[0]}catch(o){return this.loggingService.catch("Error in DomService getBackgroundSnippylyElement: ",o),null}}setPointerPosition(r){this.loggingService.log("%c[WB] Calling FUNCTION: setPointerPosition","color: green;");try{this.previousMousePosition.pageX=r.pageX,this.previousMousePosition.pageY=r.pageY,this.currentMousePosition.pageX=r.pageX,this.currentMousePosition.pageY=r.pageY}catch(i){this.loggingService.catch("Error in DomService setPointerPosition: ",i)}}getCurrentWindowSize$(r){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentWindowSize","color: green;"),this.currentScreenSize$.asObservable()}getCurrentMousePosition$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentMousePosition","color: green;"),this.currentMousePosition$.asObservable()}getCurrentWindowSizeValue(){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentWindowSizeValue","color: green;"),this.currentScreenSize$.value}getTopLeftPosition(){this.loggingService.log("%c[WB] Calling FUNCTION: getTopLeftPosition","color: green;");try{let r=document?.body?.getBoundingClientRect()||document?.documentElement?.getBoundingClientRect(),i=this.currentMousePosition?.pageX||r.x+200,o=Math.min(i,r.width/2),s=Math.abs(r.y),a=r.y-20;return s>50&&(a=Math.abs(r.y)+180),this.loggingService.log(r),this.loggingService.log(o),this.loggingService.log(a),{topPositionX:o,topPositionY:a}}catch(r){return this.loggingService.catch("Error in DomService getTopLeftPosition: ",r),{topPositionX:0,topPositionY:0}}}toggleSelection(){this.enableRectSelectionSubject$.next(!this.enableRectSelectionSubject$.value)}enableSelection(){this.enableRectSelectionSubject$.next(!0)}disableSelection(){this.enableRectSelectionSubject$.next(!1)}setPinHighlighterClass(r){this.pinHighlighterClass$.next(r)}setTextHighlighterClass(r){this.textHighlighterClass$.next(r)}getTextHighlighterClass(){return this.textHighlighterClass$.asObservable()}enableCommentPinHighlighter(){this.commentPinHighlighter$.next(!0)}disableCommentPinHighlighter(){this.commentPinHighlighter$.next(!1)}getCommentPinHighlighter$(){return this.commentPinHighlighter$.asObservable()}getCommentPinHighlighter(){return this.commentPinHighlighter$?.value}highlightElement(r,i,o){if(r&&!Oc(r)){if(!o&&this.getCommentPinHighlighter()&&(this.pinHighlighterClass$.value?this.addClassToElement(r,this.pinHighlighterClass$.value):this.addClassToElement(r,F.SNIPPYLY_HIGHLIGHT)),i&&!r.hasAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)){let s=r.style.getPropertyValue("cursor"),a=r.style.getPropertyPriority("cursor"),c=s?{defaultCursorValue:s,defaultCursorPriority:a}:"";r.setAttribute(F.ATTRIBUTES.DEFAULT_CURSOR,c?JSON.stringify(c):""),r.style.setProperty("cursor",i,"important")}r.setAttribute(F.SNIPPYLY_HIGHLIGHT,"true"),r.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true")}}removeHighlightFromElement(r){if(r&&(this.pinHighlighterClass$.value&&this.removeClassFromElement(r,this.pinHighlighterClass$.value),this.removeClassFromElement(r,F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.VELT_IGNORE_CHANGE_DETECTION),r.hasAttribute(F.ATTRIBUTES.DEFAULT_CURSOR))){try{if(r.style.removeProperty("cursor"),r.getAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)){let i=JSON.parse(r.getAttribute(F.ATTRIBUTES.DEFAULT_CURSOR));r.style.setProperty("cursor",i.defaultCursorValue,i.defaultCursorPriority)}}catch{}r.removeAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)}}highlightUserElement(r,i,o,s=!1){try{r&&(this.addClassToElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT),s&&this.addClassToElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT),r.setAttribute(F.SNIPPYLY_HIGHLIGHT,"true"),r.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true"),i&&!r.style.getPropertyValue(F.VELT_SELECTION_COLOR)&&r.style.setProperty(F.VELT_SELECTION_COLOR,i),o&&r.setAttribute(F.SNIPPYLY_HIGHLIGHT_USER_NAME,o))}catch(a){this.loggingService.catch("Error in DomService highlightUserElement: ",a)}}removeHighlightUserFromElement(r){try{r&&(this.removeClassFromElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT),this.removeClassFromElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.VELT_IGNORE_CHANGE_DETECTION),r.removeAttribute(F.VELT_SELECTION_COLOR),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT_USER_NAME),r.style.removeProperty(F.VELT_SELECTION_COLOR))}catch(i){this.loggingService.catch("Error in DomService removeHighlightUserFromElement: ",i)}}previewHighlightElement(r){r&&r.setAttribute(F.SNIPPYLY_HIGHLIGHT_PREVIEW,"true")}removePreviewHighlightFromElement(r){r&&r.removeAttribute(F.SNIPPYLY_HIGHLIGHT_PREVIEW)}getXPath(r,i=!1,o=!1,s,a){try{let c=this.calculateXPath(r,i,o,s,a);if(c&&typeof c=="string"&&c.includes("/svg")){let l=c.split("/"),d=!1;l.forEach((h,f)=>{h.includes("svg")&&(d=!0),d&&(l[f]="svg:"+h)}),c=l.join("/")}return c}catch(c){this.loggingService.catch("Error in DomService getXPath:",c)}}namespaceResolver(r){return r==="svg"?"http://www.w3.org/2000/svg":null}calculateXPath(r,i,o,s,a){try{if(r){if(typeof r=="string")return document.evaluate(r,s||document,this.namespaceResolver,XPathResult.ANY_TYPE,null);if(!r||r.nodeType!=1)return"";if(r.id&&document.querySelectorAll(`[id='${r.id}']`)?.length===1&&!i&&!(a?.ignoreGeneratedIds&&this.isGeneratedId(r.id)))return"//*[@id='"+r.id+"']";if(o&&r.className&&r.className.split){let l=r.className?.split(" ")?.filter(d=>!d?.includes("snippyly")&&!d?.includes("velt")&&!["show-pin-cursor"].includes(d))[0];if(l){let d=this.calculateXPath(r.parentNode,i,o,s,a)+"/"+r.tagName.toLowerCase(),h=Array.from(r.parentNode?.children||[]).filter(f=>f.nodeType===1&&f.tagName===r.tagName?f.className?.split(" ")?.filter(E=>E?.includes("snippyly")||E?.includes("velt")||["show-pin-cursor"].includes(E))[0]===l:!1);if(h.length>1){let f=h.indexOf(r)+1;d+=`[contains(concat(' ', normalize-space(@class), ' '), ' ${l} ')][${f}]`}else d+=`[contains(concat(' ', normalize-space(@class), ' '), ' ${l} ')]`;return d}}let c=[].filter.call(r.parentNode?.children?r.parentNode?.children:[],function(l){return l.tagName==r.tagName});return this.calculateXPath(r.parentNode,i,o,void 0,a)+"/"+r.tagName.toLowerCase()+(c.length>1?"["+([].indexOf.call(c,r)+1)+"]":"")}}catch(c){this.loggingService.catch("Error in DomService calculateXPath:",c)}}getElementFromXPath(r,i=document){try{if(this.xpathCache.has(r)){let s=this.xpathCache.get(r);if(s!==void 0&&document.contains(s))return s;this.xpathCache.delete(r)}let o=this.getXPath(r,!1,!1,i);if(o){let s=o?.iterateNext();if(s!==null&&typeof s.setAttribute=="function"&&!Oc(s)){let a=nd();s.setAttribute(F.ATTRIBUTES.VELT_ELEMENT_CACHE_ID,a),this.xpathCacheId.set(a,r)}return this.xpathCache.set(r,s),s}return null}catch(o){return this.loggingService.catch("Error in DomService getElementFromXPath:",o),null}}getElementFromTargetElement(r){try{let i=null;if(r?.anchor){let o=this.resolveAnchorRecord(r.anchor);o?.element&&(i=o.element)}else r?.xpath?i=this.getElementFromXPath(r.xpath):r?.cfXpath?i=this.getElementFromXPath(r.cfXpath):r?.fXpath&&(i=this.getElementFromXPath(r.fXpath));return i}catch(i){return this.loggingService.catch("Error in DomService getElementFromTargetElement:",i),null}}resolveIdScopedTarget(r){try{let i=r?.anchor?.xPath||r?.xpath,o=UN(i);if(!i||!o||this.isGeneratedId(o.rootId))return{applicable:!1,element:null};let s=this.getUniqueElementById(o.rootId);if(!s||!this.isElementVisible(s)||!rd(s))return{applicable:!0,element:null};let a=d=>!!d&&s.contains(d)&&this.isElementVisible(d),c=this.getElementFromXPath(i);if(a(c))return{applicable:!0,element:c,matchedBy:"exact"};let l=r?.anchor?.robustXPath;if(l&&UN(l)?.rootId===o.rootId){let d=this.getElementFromRobustXPath(l);if(a(d))return{applicable:!0,element:d,matchedBy:"robust"}}return{applicable:!0,element:s,matchedBy:"root"}}catch(i){return this.loggingService.catch("Error in DomService resolveIdScopedTarget: ",i),{applicable:!1,element:null}}}getUniqueElementById(r){try{let i=document.querySelectorAll(`[id="${CSS.escape(r)}"]`);return i.length===1?i[0]:null}catch{return null}}getElementFromTargetTextRange(r){try{let i=null;if(r?.commonAncestorContainerAnchor){let o=this.resolveAnchorRecord(r.commonAncestorContainerAnchor);o?.element&&(i=o.element)}else r?.commonAncestorContainer&&(i=this.getElementFromXPath(r.commonAncestorContainer));return i}catch(i){return this.loggingService.catch("Error in DomService getElementFromTargetTextRange:",i),null}}calculateScreenSize(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowResize","color: green;");try{let r=[document?.body?.clientHeight||0,document?.documentElement?.clientHeight||0,window?.innerHeight||0],i=[document?.body?.clientWidth||0,document?.documentElement?.clientWidth||0,window?.innerWidth||0];this.calculatePageScrollHeight(),this.loggingService.log(this.pageScrollHeight),this.loggingService.log(this.nodeMap),this.highestNode=this.nodeMap[this.pageScrollHeight];let o=new rp;return o.screenWidth=Math.max(...i),o.screenHeight=Math.max(...r),o.screenScrollHeight=this.pageScrollHeight,o}catch(r){return this.loggingService.catch("Error in DomService calculateScreenSize:",r),new rp}}calculatePageScrollHeight(){this.loggingService.log("%c[WB] Calling FUNCTION: calculatePageScrollHeight","color: green;");try{this.pageScrollHeight=0,this.findLongestNode(document?.documentElement?.childNodes)}catch(r){this.loggingService.catch("Error in DomService calculatePageScrollHeight: ",r)}}removeSnippylyContent(r){this.loggingService.log("%c[WB] Calling FUNCTION: removeSnippylyContent","color: green;");try{let o=new DOMParser().parseFromString(r,"text/html");o.querySelectorAll("[data-snippyly-cache-id]").forEach(f=>{f.removeAttribute("data-snippyly-cache-id")}),o.querySelectorAll("[data-velt-cache-id]").forEach(f=>{f.removeAttribute("data-velt-cache-id")}),o.querySelectorAll(".comment-text-highlight").forEach(f=>{f?.parentNode?.insertBefore(document.createTextNode(f?.textContent),f),f.remove()});let l=document.createNodeIterator(o,NodeFilter.SHOW_COMMENT),d;for(;d=l.nextNode();)d?.remove();return this.mergeAdjacentTextNodes(o.body),this.sanitizeHtml(o.body.innerHTML)}catch(i){return this.loggingService.catch("Error in DomService removeSnippylyContent: ",i),r}}mergeAdjacentTextNodes(r){try{let i=r.firstChild;for(;i;){if(i.nodeType===Node.TEXT_NODE){let o=i.nextSibling;for(;o&&o.nodeType===Node.TEXT_NODE;)i.textContent+=o.textContent,o.remove(),o=i.nextSibling}i=i.nextSibling}}catch(i){this.loggingService.catch("Error in DomService mergeAdjacentTextNodes: ",i)}}findLongestNode(r){try{for(let i=r.length-1;i>=0;i--){if(r[i]?.scrollHeight&&r[i]?.clientHeight){let o=Math.max(r[i]?.scrollHeight,r[i]?.clientHeight);this.pageScrollHeight=Math.max(o,this.pageScrollHeight),this.nodeMap[o]=r[i]}r[i]?.childNodes?.length&&this.findLongestNode(r[i]?.childNodes)}}catch(i){this.loggingService.catch("Error in DomService findLongestNode: ",i)}}resetSelectedAnnotationsMap(r=!0,i){try{let o=Array.from(document.querySelectorAll(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`)),s=this.getDraftCommentAnnotationDialogs()||[];o.push(...s),o=Array.from(new Set(o));let a=o.map(h=>h.classList.contains("velt-annotation-draft-checked")?(h.classList.remove("velt-annotation-draft-checked"),null):(this.removeClassFromElement(h,"velt-comment-dialog-shake"),setTimeout(()=>{this.addClassToElement(h,"velt-comment-dialog-shake"),h.getAttribute(F.ATTRIBUTES.VELT_ANNOTATION_EDIT_COMMENT)||h.classList.contains("velt-annotation-draft-checked")||this.addClassToElement(h,"velt-annotation-draft-checked")},100),h.getAttribute(F.ATTRIBUTES.VELT_ANNOTATION_DRAFT))).filter(h=>h),c=Object.keys(this.getRecordingInProgress()||{});a=[...a,...c];let l=this.selectedAnnotationsMap$.value;if(r&&this.selectedAnnotationsMap$.value&&Object.keys(this.selectedAnnotationsMap$.value).length){let h=[];Object.keys(l).forEach(f=>{if(l[f]?.type==="tag"){let g=l[f];g?.to?.length||a.includes(f)||h.push(g)}else l[f]?.comments?.length||a.includes(f)||h.push(l[f])}),this.deleteAnnotations$.next(h),this.deleteAnnotations$.next([])}let d={};Object.keys(l).forEach(h=>{a.includes(h)&&(d[h]=l[h]),i&&(i==="comment"?["comment","videoPin"].includes(l[h]?.type)||(d[h]=l[h]):l[h]?.type!==i&&(d[h]=l[h]))}),Object.keys(d).forEach(h=>{let f=d[h]?.multiThreadAnnotationId;f&&!d[f]&&(d[f]={annotationId:f,type:"multiThread"})}),JSON.stringify(this.selectedAnnotationsMap$.value)!==JSON.stringify(d)&&this.selectedAnnotationsMap$.next(d),this.setDialogOpenedInSidebar(!1)}catch(o){this.loggingService.catch("Error in DomService resetSelectedAnnotationsMap: ",o)}}setRecordingInProgress(r,i){try{if(i)this.recordingInProgress$.next(Ee(B({},this.recordingInProgress$.value),{[r]:i}));else{let o=this.recordingInProgress$.value;delete o[r],this.recordingInProgress$.next(o)}}catch(o){this.loggingService.catch("Error in DomService setRecordingInProgress: ",o)}}resetRecordingInProgress(){try{this.recordingInProgress$.next({})}catch(r){this.loggingService.catch("Error in DomService resetRecordingInProgress: ",r)}}getRecordingInProgress(){try{return this.recordingInProgress$.value}catch(r){return this.loggingService.catch("Error in DomService getRecordingInProgress: ",r),{}}}getDraftCommentAnnotationDialogs(){try{let r=[],i=Array.from(document.querySelectorAll(`${F.TAGS.SNIPPYLY_COMMENT_DIALOG}`)),o=Array.from(document.querySelectorAll(`${F.TAGS.VELT_COMMENT_DIALOG}`));return[...i,...o].forEach(a=>{if(a?.shadowRoot){let c=a.shadowRoot.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);c&&r.push(c)}else{let c=a.querySelector(`${F.TAGS.VELT_SHADOW_DOM_INTERNAL}`);if(c?.shadowRoot){let l=c.shadowRoot?.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);l&&r.push(l)}else{let l=a.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);l&&r.push(l)}}}),r}catch(r){return this.loggingService.catch("Error in DomService getDraftCommentAnnotationDialogs: ",r),[]}}getSelectedAnnotationsMap(r){try{let i=this.selectedAnnotationsMap$.value;if(r){let o={};return Object.keys(i).forEach(s=>{r==="comment"?["comment","videoPin"].includes(i[s].type)&&(o[s]=i[s]):i[s].type===r&&(o[s]=i[s])}),o}else return i}catch(i){return this.loggingService.catch("Error in DomService getSelectedAnnotationsMap: ",i),{}}}getSelectedAnnotationsMap$(r){return this.selectedAnnotationsMap$.asObservable().pipe(De(i=>{if(r){let o={};return Object.keys(i).forEach(s=>{i[s].type===r&&(o[s]=i[s])}),o}else return i}))}getSelectedComments$(){return this.selectedAnnotationsMap$.asObservable().pipe(De(r=>Object.values(r)))}getSelectedAnnotationsLocationMap(){try{return this.selectedAnnotationsLocationMap$.value}catch(r){return this.loggingService.catch("Error in DomService getSelectedAnnotationsLocationMap: ",r),{}}}getSelectedAnnotationsLocationMap$(){return this.selectedAnnotationsLocationMap$.asObservable()}getSelectedAnnotationsContextIdMap(){try{return this.selectedAnnotationsContextIdMap$.value}catch(r){return this.loggingService.catch("Error in DomService getSelectedAnnotationsContextIdMap: ",r),{}}}getSelectedAnnotationsContextIdMap$(){return this.selectedAnnotationsContextIdMap$.asObservable()}toggleAnnotationSelection(r,i,o,s=!1,a,c){try{o==="sidebarShowReplies"?this.setDialogOpenedInSidebar(!0):this.setDialogOpenedInSidebar(!1);let l=JSON.parse(JSON.stringify(this.selectedAnnotationsMap$.value||{})),d=JSON.parse(JSON.stringify(this.selectedAnnotationsLocationMap$.value||{})),h=JSON.parse(JSON.stringify(this.selectedAnnotationsContextIdMap$.value||{}));l[r.annotationId]&&!s?delete l[r.annotationId]:((!this.windowKeydownShift$.value||s)&&(l={}),l[r.annotationId]=r,d[r.annotationId]=i,c&&(h[r.annotationId]=c),a=r?.multiThreadAnnotationId||a,a&&(l[a]={annotationId:a,type:"multiThread"},d[a]=i,c&&(h[a]=c))),this.selectedAnnotationsMap$.next(l),Object.keys(d).forEach(f=>{l[f]||delete d[f]}),this.selectedAnnotationsLocationMap$.next(d),Object.keys(h).forEach(f=>{l[f]||delete h[f]}),this.selectedAnnotationsContextIdMap$.next(h)}catch(l){this.loggingService.catch("Error in DomService toggleAnnotationSelection: ",l)}}setSelectedAnnotationLocation(r,i){try{let o=JSON.parse(JSON.stringify(this.getSelectedAnnotationsLocationMap()||{}));o?.[r]!==i&&(o[r]=i,this.selectedAnnotationsLocationMap$.next(o))}catch(o){this.loggingService.catch("Error in DomService setSelectedAnnotationLocation: ",o)}}updateSelectedAnnotationInMap(r){try{let i=this.selectedAnnotationsMap$.value;r.forEach(o=>{i[o.annotationId]&&(i[o.annotationId]=o)}),this.selectedAnnotationsMap$.next(i)}catch(i){this.loggingService.catch("Error in DomService updateSelectedAnnotationInMap: ",i)}}getDeleteCommmentAnnotations$(){try{return this.deleteAnnotations$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getDeleteCommmentAnnotations$: ",r),lt([])}}getHighestNode(){return this.loggingService.log("%c[WB] Calling FUNCTION: getHighestNode","color: green;"),this.highestNode}onWindowMouseDown$(){return this.windowMouseDown$.asObservable()}onWindowPointerMove$(){return this.windowPointerMove$.asObservable()}onWindowPointerMove(){return this.windowPointerMove$.value}onWindowPointerUp$(){return this.windowPointerUp$.asObservable()}onSelectionChange$(){return this.documentSelectionChange$.asObservable()}onWindowClick$(){return this.windowClick$.asObservable()}onWindowScroll$(){return this.windowScroll$.asObservable()}onWindowResize$(){return this.windowResize$.asObservable()}onWindowKeyupBackspace$(){return this.windowKeyupBackspace$.asObservable()}onWindowKeyupDelete$(){return this.windowKeyupDelete$.asObservable()}onWindowKeyupEsc$(){return this.windowKeyupEsc$.asObservable()}onWindowPopState$(){return this.windowPopState$.asObservable()}onDocumentClick$(){return this.documentClick$.asObservable()}getLastDocumentClick(){return this.documentClick$.value}onDocumentClickSubject$(){return this.documentClickSubject$.asObservable()}onDocumentFocus$(){return this.documentFocus$.asObservable()}onDomChange$(r){try{return this.mutationObserver||this.setMutationObserver(r),this.mutation$.asObservable()}catch(i){return this.loggingService.catch("Error in DomService onDomChange$: ",i),lt([])}}getChildListMutation$(){return this.childListMutation$.asObservable()}onNetworkStatusChange$(){return this.networkStatus$.asObservable()}getNetworkStatus(){return this.networkStatus$.value}getElementOffset(r,i){try{let o={offsetTop:0,offsetLeft:0},s=r;if(s===i){let a=window.getComputedStyle(r);a.position==="static"&&a.transformStyle!="preserve-3d"&&a.transform=="none"&&(o.offsetLeft=r?.offsetLeft||0,o.offsetTop=r?.offsetTop||0)}if(s!==i)if(r?.closest("svg"))for(;s&&s!==i;){let c=window.getComputedStyle(s);if(s.tagName.toLowerCase()==="svg"||s instanceof SVGElement){let l=s.parentElement;if(l){let d=l.getBoundingClientRect(),h=s.getBoundingClientRect();o.offsetLeft+=h.left-d.left,o.offsetTop+=h.top-d.top}}else c.position==="static"?c.transformStyle!="preserve-3d"&&c.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0):(o.offsetLeft+=s.offsetLeft,o.offsetTop+=s.offsetTop);if(s=s.parentElement,r instanceof SVGElement&&s===i){let l=window.getComputedStyle(s);l.position==="static"&&l.transformStyle!="preserve-3d"&&l.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0)}}else{let c=window.getComputedStyle(s);c.position==="static"?c.transformStyle!="preserve-3d"&&c.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0):(o.offsetLeft+=s.offsetLeft,o.offsetTop+=s.offsetTop)}return o}catch(o){return this.loggingService.catch("Error in DomService getElementOffset: ",o),{offsetTop:0,offsetLeft:0}}}isElementVisible(r){try{if(typeof r?.getBoundingClientRect=="function"){let{width:i,height:o,top:s,bottom:a}=r?.getBoundingClientRect();return i>0||o>0||s<window.innerHeight&&a>0}else return!1}catch(i){return this.loggingService.catch("Error in DomService isElementVisible: ",i),!1}}isElementVisibleOnScreen(r){try{if(r){if(!(r instanceof Element))return!1;let i=r,o=window.getComputedStyle(i);return!(o.display==="none"||o.visibility==="hidden"||parseFloat(o.opacity)===0)}return!1}catch(i){return this.loggingService.catch("Error in DomService isElementVisibleOnScreen: ",i),!1}}getClickAndDragPointsObservable(){return new fe(r=>{let i=wi(document,"mousedown").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),o=wi(document,"mousemove").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),s=wi(document,"mouseup").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),c=i.pipe(Mr(l=>o.pipe(Ya(),De(([d,h])=>({startPoint:l,prevPoint:d,curPoint:h})),ps(s)))).subscribe(r);return()=>c.unsubscribe()})}drawRectangle(r,i){let o=document.querySelector(".rectangle");o||(o=document.createElement("div"),this.addClassToElement(o,"rectangle"),o.setAttribute(F.ATTRIBUTES.VELT_COMMENT_DISABLED,"true"),o.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true"),document.body.appendChild(o));let s=Math.abs(i.x-r.x),a=Math.abs(i.y-r.y),c=Math.min(r.x,i.x),l=Math.min(r.y,i.y);return o.style.width=`${s}px`,o.style.height=`${a}px`,o.style.left=`${c}px`,o.style.top=`${l}px`,o.style.position="absolute",o.style.border="2px dashed #f00",o.style.pointerEvents="none",o.style.zIndex="2147483577",o}getRange(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: getRange","color: green;"),window.getSelection()?.toString()){let r=window.getSelection();if(r?.rangeCount)return r.getRangeAt(0)}return null}catch(r){return this.loggingService.catch("Error in DomService getRange: ",r),null}}clearTextSelection(){try{this.loggingService.log("%c[WB] Calling FUNCTION: clearTextSelection","color: green;"),window.getSelection&&(window.getSelection()?.empty?window.getSelection()?.empty():window.getSelection()?.removeAllRanges&&window.getSelection()?.removeAllRanges())}catch(r){this.loggingService.catch("Error in DomService clearTextSelection: ",r)}}getTargetTextRangeFromSelectionRange(r){try{let i={},o=r.commonAncestorContainer;o?.nodeType===Node.TEXT_NODE&&(o=o.parentElement);let s=document.body;if(o){let c=this.getTextXPath(o);this.isXpathWithId(c)&&(s=o)}let a=this.getAdditionalLocationContainer(o);if(a&&(s=a),i.commonAncestorContainer=this.getTextXPath(s),i.commonAncestorContainer){let c=this.getElementFromXPath(i.commonAncestorContainer);if(c){i.commonAncestorContainerFXpath=this.getXPath(c,!0),i.commonAncestorContainerCFXpath=this.getXPath(c,!0,!0);let l=this.generateAnchorRecord(c);l&&(i.commonAncestorContainerAnchor=l)}}return i.text=r.toString(),i.occurrence=gR(s,0,r.startContainer,r.startOffset,r.toString())+1,i}catch(i){this.loggingService.catch("Error in DomService getTargetTextRangeFromSelectionRange: ",i);return}}getTextXPath(r){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: getTextXPath","color: green;"),r.nodeType===Node.TEXT_NODE){let i=1,o=r.previousSibling;for(;o;)o.nodeType===Node.TEXT_NODE&&i++,o=o.previousSibling;return this.getXPath(r.parentElement)}else return this.getXPath(r)}catch(i){this.loggingService.catch("Error in DomService getTextXPath: ",i);return}}getHostElement(r){try{if(F.NON_NESTABLE_ELEMENTS[r?.tagName?.toLowerCase()]){let o=r?.closest("picture");return o?o?.parentElement:r.parentElement}let i=r.closest("svg");return i?i?.parentElement:r}catch(i){return this.loggingService.catch("Error in DomService getHostElement: ",i),r}}isElementInsideAdditionalLocationContainer(r){try{return!!r?.closest(`[${F.ATTRIBUTES.VELT_LOCATION}], [${F.ATTRIBUTES.VELT_LOCATION_ID}]`)}catch(i){return this.loggingService.catch("Error in DomService isElementInsideAdditionalLocationContainer: ",i),!1}}getAdditionalLocationContainer(r){try{return r?.closest(`[${F.ATTRIBUTES.VELT_LOCATION}], [${F.ATTRIBUTES.VELT_LOCATION_ID}]`)||null}catch(i){return this.loggingService.catch("Error in DomService getAdditionalLocationContainer: ",i),null}}isXpathWithId(r){try{return typeof r=="string"?!!r?.includes("[@id="):!1}catch(i){return this.loggingService.catch("Error in DomService isXpathWithId: ",i),!1}}getListedElements({elementIds:r,elementClassNames:i,elementQuerySelectors:o}){try{let s=[];if(r?.length)for(let a=0;a<r.length;a++){let c=document.getElementById(r[a]);c&&s.push(c)}if(i?.length)for(let a=0;a<i.length;a++){let c=document.getElementsByClassName(i[a]);for(let l=0;l<c.length;l++){let d=c[l];d&&d instanceof HTMLElement&&s.push(d)}}if(o?.length)for(let a=0;a<o.length;a++){let c=document.querySelectorAll(o[a]);for(let l=0;l<c.length;l++){let d=c[l];d&&d instanceof HTMLElement&&s.push(d)}}return s}catch(s){return this.loggingService.catch("Error in DomService getListedElements: ",s),[]}}isElementInsideListedElementIds(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.getElementById(i[o]);if(s&&s.contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementIds: ",o),!1}}isElementInsideListedElementClassNames(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.getElementsByClassName(i[o]);for(let a=0;a<s.length;a++)if(s[a].contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementClassNames: ",o),!1}}isElementInsideListedElementQuerySelectors(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.querySelectorAll(i[o]);for(let a=0;a<s.length;a++)if(s[a].contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementQuerySelectors: ",o),!1}}addClassToElement(r,i){try{this.loggingService.log("%c[WB] Calling FUNCTION: addClassToElement","color: green;"),r&&(r.classList?.contains(i)||r.classList?.add(i))}catch(o){this.loggingService.catch("Error in DomService addClassToElement: ",o)}}removeClassFromElement(r,i){try{this.loggingService.log("%c[WB] Calling FUNCTION: removeClassFromElement","color: green;"),r&&r.classList?.contains(i)&&r.classList?.remove(i)}catch(o){this.loggingService.catch("Error in DomService removeClassFromElement: ",o)}}isElementInsideParentWithAttribute(r,i,o){try{let s=r;for(;s&&s!==document.body;){if(s?.getAttribute&&s?.getAttribute(i)===o)return!0;s=s.parentElement}return!1}catch(s){return this.loggingService.catch("Error in DomService isElementInsideParentWithAttribute: ",s),!1}}setVideoEditorHandlingDelete(r){try{this.isVideoEditorHandlingDelete=r}catch(i){this.loggingService.catch("Error in DomService setVideoEditorHandlingDelete: ",i)}}isVideoEditorHandlingDeleteKey(){try{return this.isVideoEditorHandlingDelete}catch(r){return this.loggingService.catch("Error in DomService isVideoEditorHandlingDeleteKey: ",r),!1}}setCustomCss(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomCss","color: green;"),this.customCss$.next(r)}catch(i){this.loggingService.catch("Error in DomService setCustomCss: ",i)}}getCustomCss$(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getCustomCss$","color: green;"),this.customCss$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getCustomCss$: ",r),lt(null)}}injectCustomCss(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: injectCustomCss","color: green;");let i=this.customCss$.value;if(i){let o=r?.shadowRoot?.querySelector(`[${F.VELT_CUSTOM_CSS}]`);if(o&&o.remove(),i?.type==="link"){let s=document.createElement("link");s.href=i?.value,s.rel="stylesheet",s.setAttribute(F.VELT_CUSTOM_CSS,"true"),r?.shadowRoot?.appendChild(s)}else{let s=document.createElement("style");s.innerHTML=this.sanitizeHtml(i?.value),s.setAttribute(F.VELT_CUSTOM_CSS,"true"),r?.shadowRoot?.appendChild(s)}}}catch(i){this.loggingService.catch("Error in DomService injectCustomCss: ",i)}}subscribeInjectCustomCss(r){try{return this.customCss$.subscribe(()=>{this.injectCustomCss(r?.nativeElement)})}catch(i){return this.loggingService.catch("Error in DomService subscribeInjectCustomCss: ",i),new gt}}trimCommentHtml(r){try{let i=document.createElement("div");i.innerHTML=r,this.removeEmptyElements(i);let o=i.innerHTML;return o=o.replace(e.MULTIPLE_NBSP_REGEX," ").replace(e.TRIM_NBSP_REGEX,"").trim(),o}catch(i){return this.loggingService.catch("Error in DomService trimCommentHtml: ",i),r}}removeEmptyElements(r){try{let s=function(a){return o.test(a.innerHTML)};var i=s;let o=/^\s*(<br\s*\/?>)?\s*$/;for(;r.firstChild&&s(r.firstChild);)r.removeChild(r.firstChild);for(;r.lastChild&&s(r.lastChild);)r.removeChild(r.lastChild)}catch(o){this.loggingService.catch("Error in DomService removeEmptyElements: ",o)}}normalizeWhitespace(r){try{r.childNodes.forEach(i=>{i.nodeType===Node.TEXT_NODE?i.nodeValue=i.nodeValue?.replace(/\s+/g," ").trim()??"":i.nodeType===Node.ELEMENT_NODE&&this.normalizeWhitespace(i)})}catch(i){this.loggingService.catch("Error in DomService normalizeWhitespace: ",i)}}sanitizeHtml(r){try{return this.loggingService.log("%c[WB] Calling FUNCTION: sanitizeHtml","color: green;"),fy.sanitize(r,A2)}catch(i){return this.loggingService.catch("Error in DomService sanitizeHtml: ",i),""}}sanitizeHtmlForPaste(r){try{let i=this.convertStylesToTags(r);return fy.sanitize(i,{ALLOWED_TAGS:["b","strong","i","em","u","a","br"],ALLOWED_ATTR:["href","target","rel"]})}catch(i){return this.loggingService.catch("Error in DomService sanitizeHtmlForPaste: ",i),""}}convertStylesToTags(r){try{let i=document.createElement("div");return i.innerHTML=r,this.convertBlockElementsToBr(i),this.processNodeStyles(i),i.innerHTML}catch(i){return this.loggingService.catch("Error in DomService convertStylesToTags: ",i),r}}convertBlockElementsToBr(r){try{let i=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE","SECTION","ARTICLE","HEADER","FOOTER"],o;for(;(o=r.querySelector(i.join(",")))!==null;){let s=o.parentNode;if(!s)break;for(;o.firstChild;)s.insertBefore(o.firstChild,o);o.nextSibling&&s.insertBefore(document.createElement("br"),o),s.removeChild(o)}}catch(i){this.loggingService.catch("Error in DomService convertBlockElementsToBr: ",i)}}processNodeStyles(r){try{let i=Array.from(r.childNodes);for(let o of i)if(o.nodeType===Node.ELEMENT_NODE){this.processNodeStyles(o);let s=o,a=s.style,c=o,l=a?.fontWeight;if(l==="bold"||l==="700"||l==="800"||l==="900"){let d=s.tagName?.toLowerCase();if(d!=="b"&&d!=="strong"){let h=document.createElement("b");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}if(a?.fontStyle==="italic"){let d=s.tagName?.toLowerCase();if(d!=="i"&&d!=="em"){let h=document.createElement("i");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}if((a?.textDecorationLine?.includes("underline")||a?.textDecoration?.includes("underline"))&&s.tagName?.toLowerCase()!=="u"){let h=document.createElement("u");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}}catch(i){this.loggingService.catch("Error in DomService processNodeStyles: ",i)}}sanitizeSvg(r){try{return fy.sanitize(r,A2)}catch(i){return this.loggingService.catch("Error in DomService sanitizeSvg: ",i),r}}setDeviceInfo(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDeviceInfo","color: green;");let r=new Ur;this.deviceInfo$.next(r)}catch(r){this.loggingService.catch("Error in DomService setDeviceInfo: ",r)}}getDeviceInfo$(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getDeviceInfo$","color: green;"),this.deviceInfo$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getDeviceInfo$: ",r),lt(new Ur)}}getTabId(){try{let r=sessionStorage.getItem(F.SESSION_STORAGE.VELT_TAB_ID);!r&&this.tabId&&(r=this.tabId,sessionStorage.setItem(F.SESSION_STORAGE.VELT_TAB_ID,r)),!this.tabId&&r&&(this.tabId=r);let i=this.getTabIdFromWindowName();return(!r||r!==i)&&(r=nd(),this.tabId=r,sessionStorage.setItem(F.SESSION_STORAGE.VELT_TAB_ID,r),this.setTabIdToWindowName(r)),r}catch(r){return this.loggingService.catch("Error in DomService getTabId: ",r),null}}getTabIdFromWindowName(){try{return window.name}catch(r){return this.loggingService.catch("Error in DomService getTabIdFromWindowName: ",r),null}}setTabIdToWindowName(r){try{window.name=r}catch(i){this.loggingService.catch("Error in DomService setTabIdToWindowName: ",i)}}getDeviceInfo(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getDeviceInfo","color: green;"),this.deviceInfo$.value}catch(r){return this.loggingService.catch("Error in DomService getDeviceInfo: ",r),new Ur}}isMobileDevice(){try{return new Ur().getDeviceType()===Er.MOBILE}catch(r){return this.loggingService.catch("Error in DomService isMobileDevice: ",r),!1}}isTabletDevice(){try{return new Ur().getDeviceType()===Er.TABLET}catch(r){return this.loggingService.catch("Error in DomService isTabletDevice: ",r),!1}}isDesktopDevice(){try{return new Ur().getDeviceType()===Er.DESKTOP}catch(r){return this.loggingService.catch("Error in DomService isDesktopDevice: ",r),!1}}deepCloneElement(r){try{var i=document.createElement(r?.tagName);return Array.from(r.attributes).forEach(o=>{i.setAttribute(o.nodeName,o.nodeValue)}),r.childNodes.forEach(o=>{o.nodeType===Node.ELEMENT_NODE?i.appendChild(this.deepCloneElement(o)):o.nodeType===Node.TEXT_NODE&&i.appendChild(document.createTextNode(o.nodeValue))}),i}catch(o){return this.loggingService.catch("Error in DomService deepCloneElement: ",o),r}}setRandomNumberToElementRecursive(r){try{if(!r)return;let i=Math.random().toString(36).substring(7);r&&r.setAttribute&&typeof r.setAttribute=="function"&&(r.getAttribute("velt-wireframe-id")||r.setAttribute("velt-wireframe-id",i)),Array.from(r.children).forEach(s=>{this.setRandomNumberToElementRecursive(s)})}catch(i){this.loggingService.catch("Error in DomService setRandomNumberToElementRecursive: ",i)}}setDialogOpenedInSidebar(r){this.dialogOpenedInSidebar$.next(r)}getDialogOpenedInSidebar(){return this.dialogOpenedInSidebar$.asObservable()}removeWireframeSuffixFromTags(r){if(!r)return;Array.from(r.children).forEach(o=>{if(this.removeWireframeSuffixFromTags(o),o.tagName.toLowerCase().endsWith("-wireframe")){let s=o.tagName.toLowerCase().replace("-wireframe",""),a=document.createElement(s);for(Array.from(o.attributes).forEach(c=>{a.setAttribute(c.name,c.value)});o.firstChild;)a.appendChild(o.firstChild);o.parentNode.replaceChild(a,o)}})}isMonitorDevice(){try{return new Ur().getDeviceType()===Er.MONITOR}catch(r){return this.loggingService.catch("Error in DomService isMonitorDevice: ",r),!1}}isElementOriginallyStatic(r){try{return window.getComputedStyle(r).position==="static"||r.hasAttribute(F.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_AREA_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_RECORDER_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_ARROW_PIN_HOST_STATIC)}catch(i){return this.loggingService.catch("Error in DomService isElementOriginallyStatic: ",i),!1}}};e.MULTIPLE_NBSP_REGEX=/(?: \s*){2,}/g,e.TRIM_NBSP_REGEX=/^(?: \s*)+|(?: \s*)+$/g,e.\u0275fac=function(i){return new(i||e)($(zs),$(bo),$(bt),$(XD))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function Xc(t){let e=t?.refreshToken;return typeof e=="string"&&e.length>0?e:void 0}var VN=Symbol("velt-auth-state-pending");function Yne(t,e){let n=B(B({},t),e||{});return n.userId=t.userId,n.userSnippylyId=t.userSnippylyId,n.type=t.type,n.organizationId=t.organizationId,n.clientOrganizationId=t.clientOrganizationId,n.groupId=t.groupId,n.clientGroupId=t.clientGroupId,n.contacts=t.contacts,n.plan=t.plan,n.isAdmin=t.isAdmin,n.isReadOnly=t.isReadOnly,n.isAnonymous=t.isAnonymous,n.isGuest=t.isGuest,n.color=e?.color||t.color,n.textColor=e?.textColor||t.textColor,n.initial=e?.initial||n.name?.charAt(0).toUpperCase()||n.email?.charAt(0).toUpperCase()||t.initial,n?.photoUrl===void 0&&(n.photoUrl=null),n}function D2(t,e){if(!e.length)return!0;if(t.length!==e.length)return!1;let n=new Set(t);return e.every(r=>n.has(r))}var Ed=(()=>{let e=class e{constructor(r,i,o,s,a,c,l,d,h){this.afAuth=r,this.configService=i,this.avatarService=o,this.coreActionsService=s,this.domService=a,this.functions=c,this.analyticsService=l,this.loggingService=d,this.serviceBook=h,this.endpointsService=Y(ly),this.portableBackend$=new ie(null),this.portableAuthUser$=new ie(null),this.user$=new ie(null),this.userOptions$=new ie(null),this.userContacts$=new ie(null),this.userOrganization$=new ie(null),this.isPrivateCommentsEnabled$=new ie(!1),this.providedUser=new zi,this.portableRefreshTimer=null,this.portableToken=null,this.portableRefreshInFlightEpoch=null,this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0,this.portableRefreshWarnedEpoch=null,this.portableVisibilityHandler=null,this.loggedInUserResolveRetryDelaysMs=[2e3,8e3,3e4],this.loggedInUserResolveRetryInFlightUserId=null,this.firebaseConfig$=new ie(null),this.advancedQueries$=new ie(null),this.planDetails$=new ie(null),this.signOutPreviousUser$=new ie(null),this.preSignOutFunctions=new Map,this.autoLoginCalled=!1,this.portableAutoLoginCalled=!1,this.portableAutoLoginInFlight=Promise.resolve(),this.portableSessionEpoch=0,this.portableLocalSessionEnds=0,this.portableSignOutOwnsEpochBump=!1,this.pendingPortableRestore=null,this.portableResumeUserId=null,this.portableStorageHandler=null,this.portableSessionIdentity=null,this.reportedPortableRefreshCodes=new Set,this.autoLoginRequired=!0,this.config=null,this.getPlanDetailsCalled=!1,this.forceReLoggedIn=!1,this.lastLoggedInUserData=null,this.sessionReLoginCount=0,this.SESSION_RE_LOGIN_COUNT_LIMIT=10,this.sessionReLoginSubscription=null,this.onRetrySubscription=null,this.authProviderListenerGeneration=0,this.TOKEN_EXPIRED_ERROR_COUNT_LIMIT=3,this.tokenExpiredErrorCount=0,this.cachedActivityConfig=null,this.viewsService=null,this.crdtService=null,this.portableSavedSessionRaw=null,this.portableRenewalStopped=null,this.portableSessionStartedAt=0,this.portablePersistInFlight=Promise.resolve(),this.loggingService.log("%c[WB] Creating CLASS: AuthService","color: blue;"),this.serviceBook.observe(fT).subscribe(f=>{this.commentService=f??void 0}),this.serviceBook.observe(pT).subscribe(f=>{this.reactionService=f??void 0}),this.serviceBook.observe(gT).subscribe(f=>{this.areaService=f??void 0}),this.serviceBook.observe(TU).subscribe(f=>{this.activityService=f??void 0,f&&this.cachedActivityConfig&&f.setActivityFeatureConfig(this.cachedActivityConfig)}),this.serviceBook.observe(yU).subscribe(f=>{this.viewsService=f??null}),this.serviceBook.observe(IU).subscribe(f=>{this.crdtService=f??null});try{try{let f=this.configService.getAuthProxyHost();if(f){let g=this.afAuth?.config;g&&(g.apiHost=f,g.tokenApiHost=f)}}catch{}this.analyticsService.setAuthService(this),this.configService.getConfig$().subscribe(f=>{this.config=f}),this.forceReLoggedIn=localStorage.getItem(F.LOCAL_STORAGE.VELT_USER_FORCE_RE_LOGGED_IN)==="true",this.sessionReLoginSubscription=hd(this.afAuth).pipe(Qa(this.afAuth.currentUser),Ya(),Mr(([f,g])=>this.domService.onNetworkStatusChange$().pipe(mn(E=>E),En(1),De(()=>({previousUser:f,currentUser:g}))))).subscribe(E=>y(this,[E],function*({previousUser:f,currentUser:g}){if(!g&&f){let I=f?.stsTokenManager?.expirationTime,S=new Date().getTime(),L=I-S;S>I&&(this.analyticsService.trackEvent(St.Events.Core.SDK_SESSION_TOKEN_EXPIRED,{apiKey:this.apiKey,user:this.getUserForTelemetry(this.user$.value??void 0),lastLoggedInUserData:this.lastLoggedInUserData?{user:this.getUserForTelemetry(this.lastLoggedInUserData.user),autoLogin:this.lastLoggedInUserData.autoLogin,hasAuthToken:!!this.lastLoggedInUserData.userOptions?.authToken}:null,timeLeft:L,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.user$.value?.userSnippylyId),this.user$.value&&f?.uid===this.user$.value?.userSnippylyId&&this.lastLoggedInUserData?.user?.userSnippylyId===this.user$.value?.userSnippylyId&&(this.sessionReLoginCount>this.SESSION_RE_LOGIN_COUNT_LIMIT?(this.analyticsService.trackEvent(St.Events.Core.SDK_SESSION_RE_LOGIN_COUNT_EXCEEDED,{apiKey:this.apiKey,clientUserId:this.lastLoggedInUserData.user.userId,snippylyUserId:this.lastLoggedInUserData.user.userSnippylyId,timeLeft:L,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.user$.value?.userSnippylyId),this.sessionReLoginSubscription?.unsubscribe()):(this.sessionReLoginCount++,this.analyticsService.trackEvent(St.Events.Core.SDK_SESSION_RE_LOGIN_TRIGGERED,{apiKey:this.apiKey,clientUserId:this.lastLoggedInUserData.user.userId,snippylyUserId:this.lastLoggedInUserData.user.userSnippylyId,user:this.getUserForTelemetry(this.lastLoggedInUserData.user),timeLeft:L,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.lastLoggedInUserData.user.userSnippylyId),this.lastLoggedInUserData.user=yield this.updateUserWithColorAndTextColor(this.lastLoggedInUserData.user),this.initializeClient(this.lastLoggedInUserData.user,this.lastLoggedInUserData.userOptions,this.lastLoggedInUserData.initializeClientToken,this.lastLoggedInUserData.autoLogin,"internal-sessionReLogin"))))}}),f=>{this.loggingService.catch("Error in AuthService sessionReLoginSubscription: ",f)}),this.getUser$().pipe(yo(cp)).subscribe(f=>{let g=_R(f);this.coreActionsService.triggerAction(Wi.USER_UPDATE,g),this.coreActionsService.triggerAction(Wi.INIT_UPDATE,{event:Wi.USER_UPDATE,payload:{user:g}})})}catch(f){this.loggingService.catch("Error in AuthService constructor: ",f)}}setApiKey(r,i){this.loggingService.log("%c[WB] Calling FUNCTION: setApiKey","color: green;",r);try{if(this.apiKey){this.loggingService.log("API key is already set");return}this.apiKey=r,this.configService.setApiKey(this.apiKey),i||(i=new yT),this.configService.initConfig(i);let o=this.configService.getProxyConfig();if(o?.authHost)try{let s=this.afAuth?.config;s&&(s.apiHost=o.authHost,s.tokenApiHost=o.authHost)}catch(s){this.loggingService.catch("Error setting auth proxy config: ",s)}else try{let s=this.afAuth?.config;s&&s.apiHost!=="identitytoolkit.googleapis.com"&&(s.apiHost="identitytoolkit.googleapis.com",s.tokenApiHost="securetoken.googleapis.com")}catch(s){this.loggingService.catch("Error resetting auth proxy config: ",s)}i.debugMode?sessionStorage.setItem("debugMode","true"):sessionStorage.removeItem("debugMode"),this.autoLoginCalled||hd(this.afAuth).pipe(En(1)).subscribe(s=>y(this,null,function*(){if(this.autoLoginCalled=!0,s){let a=yield Np(s,!0).catch(c=>null);if(a){let{user:c}=a?.claims;this.autoLoginRequired&&(c=yield this.updateUserWithColorAndTextColor(c),this.initializeClient(c,this.buildAutoLoginOptions(),new Date().getTime(),!0,"internal-autoLogin"))}}})),!this.portableAutoLoginCalled&&this.configService.getEnablePortableBackend()===!0&&(this.portableAutoLoginCalled=!0,this.portableAutoLoginInFlight=this.autoLoginPortableSession())}catch(o){this.loggingService.catch("Error in setApiKey: ",o)}}setUsersService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUsersService","color: green;"),this.usersService=r}catch(i){this.loggingService.catch("Error in setUsersService: ",i)}}setUserPermissionService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserPermissionService","color: green;"),this.userPermissionService=r}catch(i){this.loggingService.catch("Error in setUserPermissionService: ",i)}}setDocService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDocService","color: green;"),this.docService=r}catch(i){this.loggingService.catch("Error in setDocService: ",i)}}setContactService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setContactService","color: green;"),this.contactService=r}catch(i){this.loggingService.catch("Error in setContactService: ",i)}}setIamService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setIamService","color: green;"),this.iamService=r}catch(i){this.loggingService.catch("Error in setIamService: ",i)}}setCommentService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentService","color: green;"),this.commentService=r}catch(i){this.loggingService.catch("Error in setCommentService: ",i)}}setCommonDbService(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommonDbService","color: green;"),this.commonDbService=r}catch(i){this.loggingService.catch("Error in setCommonDbService: ",i)}}validateOrganizationId(r){if(this.isVersionGreaterThanOrEqualTo4()&&!r?.organizationId)if(this.analyticsService.trackEvent(St.Events.Core.SDK_VALIDATE_CLIENT_FAILED,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,message:"Organization Id is not set",forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r)},!0,r.userSnippylyId),this.configService.getSF())this.loggingService.catch("OrganizationId is not set in Identify method",void 0,void 0,!0);else throw new Error("OrganizationId is not set in Identify method")}setVeltAuthProvider(r){return y(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: setVeltAuthProvider","color: green;");try{this.onRetrySubscription?.unsubscribe(),this.authProviderListenerGeneration++;let i=null;if(!r.user)return null;r.generateToken&&typeof r.generateToken=="function"&&(i=yield r.generateToken());let o=yield ER(()=>window.Velt.identify(r.user,B(B({},r.options||{}),i&&{authToken:i}),{fromProvider:!0}).catch(s=>(r.onError&&typeof r.onError=="function"&&r.onError(s),Promise.reject(s))),r.retryConfig||{retryCount:0,retryDelay:0});return o&&r.generateToken&&typeof r.generateToken=="function"&&(this.onRetrySubscription=this.coreActionsService.onAction(Wi.ERROR).pipe(mn(s=>s.code==="token_expired"),En(10)).subscribe(s=>y(this,null,function*(){if(s.code==="token_expired"){let a=this.authProviderListenerGeneration,c=()=>a===this.authProviderListenerGeneration,l=this.docService?.getDocumentIds()?.map(I=>({id:I.clientDocumentId}))??[],d=this.docService?.getOptionsFromDocumentPaths()??void 0,h=[],f=this.docService?.getLocation();f&&h.push(f.location);let g=this.docService?.getLocations();if(g&&Object.values(g).forEach(I=>{h.push(I.location)}),(yield ER(()=>y(this,null,function*(){try{let I=yield r.generateToken?.();return c()&&I?window.Velt.identify(r.user,B(B({},r.options||{}),I&&{authToken:I}),{fromProvider:!0}):!0}catch{return!1}}),r.retryConfig||{retryCount:0,retryDelay:0}))&&c()){let I=this.docService?.getDocumentIds()?.map(V=>V.clientDocumentId)??[];D2(l.map(V=>V.id),I)&&(yield this.docService?.setDocuments({documents:l,options:d,source:"internal"}));let S=[],L=this.docService?.getLocation();L?.location?.id&&S.push(L.location.id),Object.values(this.docService?.getLocations()??{}).forEach(V=>{V?.location?.id&&S.push(V.location.id)}),D2(h.map(V=>V?.id).filter(Boolean),S)&&(yield this.docService?.setLocations({locations:h,source:"internal",options:{appendLocation:!f}}))}}}))),o}catch(i){return this.loggingService.catch("Error in setVeltAuthProvider: ",i),null}})}setUserToStorage(r){return y(this,null,function*(){try{if(r){let i=yield wT(r,r?.userId??"");localStorage.setItem(F.LOCAL_STORAGE.VELT_IDENTIFY_USER,i)}}catch(i){this.loggingService.catch("Error in setUserToStorage: ",i)}})}getUserFromStorage(r){return y(this,null,function*(){try{let i=localStorage.getItem(F.LOCAL_STORAGE.VELT_IDENTIFY_USER);return i?yield sp(i,r?.userId??""):null}catch(i){return this.loggingService.catch("Error in getUserFromStorage: ",i),null}})}setIsPrivateCommentsEnabled(r){try{this.isPrivateCommentsEnabled$.next(r)}catch(i){this.loggingService.catch("Error in setIsPrivateCommentsEnabled: ",i)}}getIsPrivateCommentsEnabled(){return this.isPrivateCommentsEnabled$.value}getIsPrivateCommentsEnabled$(){return this.isPrivateCommentsEnabled$.asObservable()}updateUserWithColorAndTextColor(r){return y(this,null,function*(){try{let i=JSON.parse(JSON.stringify(r??{})),o=yield this.getUserFromStorage(i);return!o||Object.keys(o).length===0?(delete i?.color,delete i?.textColor,i):(o?.color&&(i.color=o?.color),o?.textColor&&(i.textColor=o?.textColor),i)}catch(i){return this.loggingService.catch("Error in updateUserWithColorAndTextColor: ",i),r}})}updateUserIfRequired(r){return y(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserIfRequired","color: green;");try{let i=yield this.getUserFromStorage(r),o={};r.color&&r.color!==i?.color&&(o.color=r.color),r.textColor&&r.textColor!==i?.textColor&&(o.textColor=r.textColor),Object.keys(o).length>0&&r.clientOrganizationId&&this.docService?.addUserInfoToOrganization({organizationId:r.clientOrganizationId,user:Ee(B({},o),{userId:r.userId})})}catch(i){this.loggingService.catch("Error in updateUserIfRequired: ",i)}})}initializeClient(r,i,o,s,a){return y(this,null,function*(){try{if(this.autoLoginRequired=!1,this.portableResumeUserId=null,this.userOptions$.next(i),this.initializeClientToken)this.pendingUserLogin=r,this.pendingUserLoginSource=a;else{r.userSnippylyId=PV(this.configService.getApiKey(),r.userId),this.pendingUserLogin=void 0,this.pendingUserLoginSource=void 0,this.initializeClientToken=o;let c=this.portableSessionEpoch,l=this.portableLocalSessionEnds,d=yield hd(this.afAuth).pipe(En(1)).toPromise().catch(E=>null),h=!0;this.providedUser=JSON.parse(JSON.stringify(r));let f=!d&&s?this.takePendingPortableRestore(r,i):null,g=f?.envelope??null;if(g){if(this.loggingService.log("%c[WB] Calling FUNCTION: restorePortableSession","color: green;"),this.validateOrganizationId(r),!(yield this.applyIdentifyResponse(r,g.res,s)))return;h=!1,this.trackAutoAuthSuccess(r,a)}else if(!d&&s&&a==="internal-autoLogin"&&this.configService?.getEnablePortableBackend()===!0)return f?.resume?(Wn("session.resume-skipped",f.overtaken?"overtaken":"not restorable"),this.loggingService.log("Velt [portable backend]: not following the session another page saved; waiting for identify().")):f?.overtaken?(Wn("session.restore-discarded"),this.loggingService.log("Velt [portable backend]: discarding a reload restore that a sign-out or a new identify overtook."),this.clearPersistedPortableSessionIfUnchanged(f.raw)):(this.loggingService.log("Velt [portable backend]: nothing restorable on reload; waiting for identify()."),this.clearPersistedPortableSession()),this.initializeClientToken=0,this.checkForPendingLogin(),null;if(d){let E=yield Np(d,!0).catch(V=>null);if(!E)return;let{user:I,firebaseConfig:S,advancedQueries:L}=E.claims;d?.uid!==r?.userSnippylyId||r?.groupId!==I?.groupId||r?.organizationId!==I?.organizationId||i?.forceReset||!s&&r?.organizationId&&!this.forceReLoggedIn||this.forceReLoginRequiredForAdvancedQueries(r)||this.forceReLoginRequiredForRegion(r,S)||this.forceReLoginRequiredForCommentViews(r)?(localStorage.setItem(F.LOCAL_STORAGE.VELT_USER_FORCE_RE_LOGGED_IN,"true"),localStorage.setItem(F.LOCAL_STORAGE.VELT_COMMENT_VIEWS_MIGRATED,"true"),this.forceReLoggedIn=!0,yield this.signOutUser("internal"),c=this.portableSessionEpoch,l=this.portableLocalSessionEnds):(this.loggingService.log("%c[WB] Calling FUNCTION: reinitializeCurrentUser","color: green;"),this.loggingService.log("Keeping user"),yield this.updateUserIfRequired(r),this.validateOrganizationId(r),this.setFirebaseConfig(S),this.setAdvancedQueries(L),I&&(this.providedUser.isAdmin=!!I.isAdmin),this.initializeSignedInUser(d,s,r),h=!1,this.trackAutoAuthSuccess(r,a))}else if(h&&c===this.portableSessionEpoch&&this.isPortableIdentityChange(r,i)){let E=this.signOutUser("internal");c=this.portableSessionEpoch,l=this.portableLocalSessionEnds,yield E}if(h){this.analyticsService.trackEvent(St.Events.Core.SDK_VALIDATE_CLIENT_TRIGGERED,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r),source:a},!0,r.userSnippylyId,r.userId);let E=yield this.requestIdentify(r,i?.authToken);if(E.error){if(this.analyticsService.trackEvent(St.Events.Core.SDK_VALIDATE_CLIENT_FAILED,Ee(B({apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,message:E.error,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r)},E),{source:a}),!0,r.userSnippylyId,r.userId),E.error&&typeof E.error=="string")if(this.isTokenExpiredIdentifyError(E))this.emitIdentifyTokenExpiredError(E,r,a);else{let S=E;this.coreActionsService.triggerAction(Wi.ERROR,S)}throw E}else this.tokenExpiredErrorCount=0;if(this.shouldHandlePortableBackend(E)&&this.isPortableIdentifyOvertaken(c,l,s))return this.loggingService.log("Velt [portable backend]: discarding an identify response that a sign-out overtook."),this.initializeClientToken=0,this.checkForPendingLogin(),null;if(this.shouldHandlePortableBackend(E)&&c!==this.portableSessionEpoch&&(this.autoLoginRequired=!1,this.portableResumeUserId=null),this.analyticsService.trackEvent(St.Events.Core.SDK_VALIDATE_CLIENT_SUCCESS,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r),source:a},!0,r.userSnippylyId,r.userId),this.validateOrganizationId(r),!(yield this.applyIdentifyResponse(r,E,s)))return}this.initializeClientToken=0,this.lastLoggedInUserData={user:r,userOptions:i,initializeClientToken:o,autoLogin:s},this.checkForPendingLogin()}return r}catch(c){return this.initializeClientToken=0,this.checkForPendingLogin(),this.loggingService.catch("Error in initializeClient: ",c),i?.throwError?Promise.reject(c):Promise.resolve(null)}})}isPortableIdentifyOvertaken(r,i,o){let s=this.portableSessionEpoch-r;return o?s!==0:s!==this.portableLocalSessionEnds-i}isPortableIdentityChange(r,i){try{if(!this.portableAuthUser$.value)return!1;let o=this.portableSessionIdentity?.user??this.user$.value;return o?o.userSnippylyId!==r?.userSnippylyId||r?.groupId!==o.groupId||r?.organizationId!==o.organizationId||!!i?.forceReset:!1}catch(o){return this.loggingService.catch("Error in isPortableIdentityChange: ",o),!1}}isVersionGreaterThanOrEqualTo4(){try{let r=xc();return(r?parseInt(r.split(".")?.[0]||"0"):0)>=4}catch(r){return this.loggingService.catch("Error in isVersionGreaterThanOrEqualTo4: ",r),!1}}isVersion4Point5(){try{let r=xc();if(r){let i=r.split("."),o=parseInt(i[0]||"0"),s=parseInt(i[1]||"0"),a=parseInt(i[2]||"0");if(o>=4&&s>=5)return o===4&&s===5&&a===0?!r.toLowerCase().includes("beta"):!0}return!1}catch(r){return this.loggingService.catch("Error in isVersion4Point5: ",r),!1}}forceReLoginRequiredForAdvancedQueries(r){try{let i=this.isVersionGreaterThanOrEqualTo4(),o=!1;try{let s=localStorage.getItem(F.LOCAL_STORAGE.VELT_ADVANCED_QUERIES);s&&(o=JSON.parse(s)?.advancedQueriesEnabled)}catch(s){this.loggingService.catch("Error in forceReLoginRequiredForAdvancedQueries: ",s)}return!!(i&&r.organizationId&&!o)}catch(i){return this.loggingService.catch("Error in forceReLoginRequiredForAdvancedQueries: ",i),!1}}forceReLoginRequiredForCommentViews(r){try{let i=this.isVersion4Point5(),o=!1;try{let s=localStorage.getItem(F.LOCAL_STORAGE.VELT_COMMENT_VIEWS_MIGRATED);s&&(o=JSON.parse(s))}catch(s){this.loggingService.catch("Error in forceReLoginRequiredForCommentViews: ",s)}return!!(i&&r.organizationId&&!o)}catch(i){return this.loggingService.catch("Error in forceReLoginRequiredForCommentViews: ",i),!1}}forceReLoginRequiredForRegion(r,i){try{return!!(this.isVersionGreaterThanOrEqualTo4()&&r.organizationId&&!i?.region)}catch(o){return this.loggingService.catch("Error in forceReLoginRequiredForRegion: ",o),!1}}checkForPendingLogin(){this.pendingUserLogin&&this.initializeClient(this.pendingUserLogin,this.userOptions$?.value||{},new Date().getTime(),void 0,this.pendingUserLoginSource)}setFirebaseConfig(r){this.loggingService.log("%c[WB] Calling FUNCTION: setFirebaseConfig","color: green;");try{this.firebaseConfig$.value||this.firebaseConfig$.next({firebaseOptions:B(B({},this.endpointsService.getFirebaseConfig()),r)})}catch(i){this.loggingService.catch("Error in setFirebaseConfig: ",i)}}requestIdentify(r,i){return y(this,null,function*(){let o=xc();this.usersService?.userResolverConfigured?.()&&(r=IR(r));let s=this.endpointsService.getPortableIdentifyUrl();return s?FG({url:s,apiKey:this.apiKey,user:r,version:o,authToken:i}):(yield pd(this.functions,od({url:this.endpointsService.getCloudFunctionUrl("validateClient"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:1200*1e3})({apiKey:this.apiKey,user:r,version:o,authToken:i}))?.data})}requestPortableRefresh(r){return y(this,null,function*(){let i=this.endpointsService.getPortableIdentifyUrl();if(!i||Pc(i)){let o="the portable identify URL is not configured; the renewal credential was not sent";return{error:o,code:"network_error",message:o,source:"identify"}}return BG({url:VG(i,"refresh"),apiKey:this.apiKey,refreshToken:r,timeoutMs:xG()})})}reportPortableRefreshMisconfigured(r){try{let i=String(r?.code??"unknown");if(this.reportedPortableRefreshCodes.has(i))return;if(this.reportedPortableRefreshCodes.add(i),i===e.PORTABLE_NO_CREDENTIAL_ENVELOPE.code){console.error("Velt [portable backend]: this session has no renewal credential for the configured gateway (the identify answer carried no refreshToken, or selfHosted.portableBackendUrl changed after sign-in), so it cannot be renewed: it is signed out and the app must identify() again. Every identify answer from portable-v0.1.6 or later carries one.");return}let o=r?.message?` (${r.message})`:"";console.error(i==="invalid-argument"?`Velt [portable backend]: the gateway rejected the session renewal as malformed: invalid-argument${o}. The SDK and gateway versions disagree on /identify/refresh; renewal is stopped for this session.`:`Velt [portable backend]: the gateway refused the session renewal: ${i}${o}. A deployment setting is wrong (the allowed origins, or the identify configuration for this API key). Renewal is stopped for this session; after the setting is fixed, a reload renews from the saved session.`)}catch{}}emitIdentifyTokenExpiredError(r,i,o){if(this.tokenExpiredErrorCount++,this.tokenExpiredErrorCount<=this.TOKEN_EXPIRED_ERROR_COUNT_LIMIT){let s={code:"token_expired",message:"Token expired",error:r?.error,source:r?.source};this.coreActionsService.triggerAction(Wi.ERROR,s)}else{let s={code:"too_many_retries",message:"Token expired. Too many retries.",error:r?.error,source:r?.source};this.coreActionsService.triggerAction(Wi.ERROR,s),this.analyticsService.trackEvent(St.Events.Core.SDK_JWT_EXPIRED_RETRY_EXCEEDED,{apiKey:this.apiKey,clientUserId:i.userId,snippylyUserId:i.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,source:o},!0,i.userSnippylyId,i.userId)}}isTokenExpiredIdentifyError(r){try{return r?.code==="token_expired"||!!r?.error?.toLowerCase?.()?.includes("token expired")}catch{return!1}}shouldHandlePortableBackend(r){try{return this.configService?.getEnablePortableBackend()===!0&&XG(r)}catch(i){return this.loggingService.catch("Error in shouldHandlePortableBackend: ",i),!1}}applyIdentifyResponse(r,i,o){return y(this,null,function*(){if(this.shouldHandlePortableBackend(i)){this.portableSessionEpoch++;let s=this.portableSessionEpoch,a=Xc(i),c=a?this.endpointsService.getPortableIdentifyUrl()??void 0:void 0;if(this.portableSessionIdentity=B({user:r,epoch:s},a?{refreshToken:a,refreshTokenIssuer:c}:{}),this.portableSessionStartedAt=Date.now(),this.handlePortableBackendResponse(i),yield this.applyPortableProjectConfig(i),s!==this.portableSessionEpoch)return Wn("session.adopt-discarded"),this.loggingService.log("Velt [portable backend]: discarding a portable sign-in that a sign-out or a new identify overtook."),!0;this.initializePortableSignedInUser(r,i)}else if(i.firebaseConfig){this.clearPortableBackendState(),this.setFirebaseConfig(i.firebaseConfig),yield this.signInWithCustomToken(r,i.token),this.loggingService.log("new signed in user",this.afAuth.currentUser);let s=yield Np(this.afAuth.currentUser,!0).catch(l=>null);if(!s)return!1;let{user:a,advancedQueries:c}=s.claims;this.setAdvancedQueries(c),this.providedUser.isAdmin=!!a?.isAdmin,this.initializeSignedInUser(this.afAuth.currentUser,o,r)}return!0})}applyPortableProjectConfig(r){return y(this,null,function*(){try{let i=yield KG({apiEndpoint:r?.apiEndpoint,token:r?.token});if(!i)return;this.setIsPrivateCommentsEnabled(i.isPrivateCommentsEnabled);let o=i.activityConfig??{immutable:!1,isEnabled:!1};this.cachedActivityConfig=o,this.activityService?.setActivityFeatureConfig(o)}catch(i){this.loggingService.catch("Error in applyPortableProjectConfig: ",i)}})}handlePortableBackendResponse(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: handlePortableBackendResponse","color: green;"),this.portableBackend$.next({backend:r?.backend,wsEndpoint:r?.wsEndpoint,apiEndpoint:r?.apiEndpoint}),QG({backend:r?.backend,token:r?.token??null,wsEndpoint:r?.wsEndpoint,apiEndpoint:r?.apiEndpoint}),this.schedulePortableTokenRefresh(r?.token??null)}catch(i){this.loggingService.catch("Error in handlePortableBackendResponse: ",i)}}schedulePortableTokenRefresh(r){try{if(this.clearPortableTokenRefresh(),this.portableToken=r,!r)return;this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0;let i=$G(wp(r),Date.now());if(i!==null?this.armPortableRefreshTimer(i,"expiry"):this.loggingService.log("Velt [portable backend]: no proactive token refresh scheduled (token expiry unreadable or already past)."),typeof document<"u"&&typeof document.addEventListener=="function"){this.portableVisibilityHandler=o=>{try{let s=wN(this.portableToken,Date.now());if(Wn(`page.${o?.type??"lifecycle"}`,`visibility=${typeof document<"u"?document.visibilityState:"?"} credentialExpired=${s}`),o?.type==="pageshow"&&o.persisted===!1)return;s?this.refreshPortableToken("focus"):this.checkPortableSessionAgainstStorage(`page.${o?.type??"lifecycle"}`),ZG()}catch{}};for(let o of e.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS)document.addEventListener(o,this.portableVisibilityHandler);typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("pageshow",this.portableVisibilityHandler)}this.armPortableStorageListener()}catch(i){this.loggingService.catch("Error scheduling portable token refresh: ",i)}}readStoredPortableSessionRaw(){try{return localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{return}}readPortableSavedSession(r){return y(this,null,function*(){try{let i;try{i=localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{return{verdict:"persist"}}if(!i){let a=this.readPortableSignOutAt();return{verdict:a!==null&&a>=this.portableSessionStartedAt?"stop":"persist"}}if(i===this.portableSavedSessionRaw)return{verdict:"persist"};let o=null;try{o=yield sp(i,this.apiKey??"")}catch{o=null}return o?.v!==1||o?.apiKey!==this.apiKey||!o?.user?.userId?{verdict:"renew-only"}:o.user.userId!==r?{verdict:"stop"}:{verdict:"persist",sharedRefreshToken:(o?.portableBackendUrl??null)===(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)?Xc(o?.res):void 0}}catch(i){return this.loggingService.catch("Error in AuthService readPortableSavedSession: ",i),{verdict:"persist"}}})}recordPortableSignOut(){try{if(!this.apiKey)return;let r={};try{let i=JSON.parse(localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)??"{}");i&&typeof i=="object"&&!Array.isArray(i)&&(r=i)}catch{r={}}r[this.apiKey]=Date.now(),localStorage.setItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT,JSON.stringify(r))}catch{}}armPortableRefreshTimer(r,i){this.cancelPortableRefreshTimer(),this.portableRefreshTimer=setTimeout(()=>this.refreshPortableToken(i),r)}cancelPortableRefreshTimer(){this.portableRefreshTimer&&(clearTimeout(this.portableRefreshTimer),this.portableRefreshTimer=null)}readPortableSignOutAt(){try{let r=JSON.parse(localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)??"null"),i=r&&this.apiKey?r[this.apiKey]:void 0;return typeof i=="number"&&Number.isFinite(i)?i:null}catch{return null}}clearPortableTokenRefresh(){try{if(this.cancelPortableRefreshTimer(),this.portableVisibilityHandler&&typeof document<"u")for(let r of e.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS)document.removeEventListener(r,this.portableVisibilityHandler);this.portableVisibilityHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("pageshow",this.portableVisibilityHandler),this.portableVisibilityHandler=null,this.portableStorageHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("storage",this.portableStorageHandler),this.portableStorageHandler=null}catch{}}refreshPortableToken(r){return y(this,null,function*(){let i=this.portableSessionEpoch;if(this.portableRefreshInFlightEpoch!==i){this.portableRefreshInFlightEpoch=i;try{let o=this.portableSessionIdentity,s=o?.user;if(!o||o.epoch!==i||!s?.userId||!this.portableBackend$.value)return;if(this.portableRenewalStopped?.epoch===i){Wn("credential.refresh-skipped",`${this.portableRenewalStopped.reason}; waiting for identify()`);return}let a=yield this.readPortableSavedSession(s.userId);if(i!==this.portableSessionEpoch)return;if(a.verdict==="stop"){this.endPortableSessionFromAnotherPage(s,`refresh:${r}`);return}let c=a.sharedRefreshToken,l=this.endpointsService.getPortableIdentifyUrl()??void 0;c&&l&&this.portableSessionIdentity&&c!==this.portableSessionIdentity.refreshToken&&(Wn("credential.shared-adopted"),this.portableSessionIdentity=Ee(B({},this.portableSessionIdentity),{refreshToken:c,refreshTokenIssuer:l}));let d=this.portableSessionIdentity??o,h=d.refreshToken&&d.refreshTokenIssuer===l?d.refreshToken:void 0;if(!h){this.reportPortableRefreshMisconfigured(e.PORTABLE_NO_CREDENTIAL_ENVELOPE),this.endPortableSessionForDeadCredential(s,e.PORTABLE_NO_CREDENTIAL_ENVELOPE,r);return}this.loggingService.log(`Velt [portable backend]: refreshing the gateway credential (${r}).`),Wn("credential.refresh-requested",`reason=${r} via=refresh`);let f=yield this.requestPortableRefresh(h);if(i!==this.portableSessionEpoch){Wn("credential.refresh-discarded",`reason=${r}`),this.loggingService.log("Velt [portable backend]: discarding a credential refresh that a sign-out or a new identify overtook.");return}if(!this.shouldHandlePortableBackend(f)||!f?.token){if(f?.code===RN){this.endPortableSessionForDeadCredential(s,f,r);return}if(NN.has(f?.code)){Wn("credential.refresh-misconfigured",`code=${f?.code}`),this.portableRenewalStopped={epoch:i,reason:`renewal refused: ${f?.code}`},this.cancelPortableRefreshTimer(),this.reportPortableRefreshMisconfigured(f);return}this.portableRefreshFailures++,this.portableRefreshFailures>=e.PORTABLE_REFRESH_WARN_AFTER_FAILURES&&this.reportPortableRefreshFailing(f,i);let S=Date.now();wN(this.portableToken,S)&&this.portableRefreshFailuresPastExpiry++,this.armPortableRefreshTimer(WG(wp(this.portableToken),S,this.portableRefreshFailuresPastExpiry),r);return}let g=this.readStoredPortableSessionRaw(),E=yield this.readPortableSavedSession(s.userId);if(i!==this.portableSessionEpoch){Wn("credential.refresh-discarded",`reason=${r}`);return}if(E.verdict==="stop"){this.endPortableSessionFromAnotherPage(s,`refresh-answered:${r}`);return}Wn("credential.refreshed"),this.handlePortableBackendResponse(f);let I=Xc(f)??h;this.portableSessionIdentity?.epoch===i&&(this.portableSessionIdentity=Ee(B({},this.portableSessionIdentity),{refreshToken:I,refreshTokenIssuer:l})),E.verdict==="persist"&&this.persistPortableSession(s,Ee(B({},f),{refreshToken:I}),{expectStoredRaw:g})}catch(o){this.loggingService.catch("Error refreshing portable token: ",o)}finally{this.portableRefreshInFlightEpoch===i&&(this.portableRefreshInFlightEpoch=null)}}})}reportPortableRefreshFailing(r,i){try{if(this.portableRefreshWarnedEpoch===i)return;this.portableRefreshWarnedEpoch=i,console.warn(`Velt [portable backend]: could not renew the gateway credential (${this.portableRefreshFailures} attempts in a row${r?.code?`, last: ${r.code}`:""}). The SDK keeps retrying \u2014 every 30 s while the current token is valid; once it has expired, after 30 s, doubling up to every 16 minutes, and each time the page becomes active again \u2014 and the realtime session is unavailable from the moment the token expires until a renewal succeeds. Check that the gateway's /identify/refresh endpoint is reachable and the API key is enabled.`)}catch{}}endPortableSessionForDeadCredential(r,i,o){Wn("credential.refresh-credential-invalid",`reason=${o}`),this.portableSavedSessionRaw&&this.clearPersistedPortableSessionIfUnchanged(this.portableSavedSessionRaw),this.endPortableSessionLocally(r),this.emitIdentifyTokenExpiredError(i,r,"internal-portableRefresh")}endPortableSessionFromAnotherPage(r,i){Wn("session.ended-elsewhere",i),this.loggingService.log("Velt [portable backend]: another page signed out or signed in another user; this page's session ends too."),this.endPortableSessionLocally(r)}checkPortableSessionAgainstStorage(r){return y(this,null,function*(){try{let i=this.portableSessionEpoch,o=this.portableSessionIdentity;if(!o||o.epoch!==i||!o.user?.userId)return;let{verdict:s}=yield this.readPortableSavedSession(o.user.userId);s==="stop"&&i===this.portableSessionEpoch&&this.endPortableSessionFromAnotherPage(o.user,r)}catch(i){this.loggingService.catch("Error checking the portable session against storage: ",i)}})}armPortableStorageListener(){try{if(this.portableStorageHandler||typeof window>"u"||typeof window.addEventListener!="function")return;this.portableStorageHandler=r=>{try{let i=r?.key;if(i!==null&&i!==F.LOCAL_STORAGE.VELT_PORTABLE_SESSION&&i!==F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)return;this.portableSessionIdentity?this.checkPortableSessionAgainstStorage("storage"):this.portableResumeUserId&&this.resumePortableSessionFromAnotherPage()}catch{}},window.addEventListener("storage",this.portableStorageHandler)}catch(r){this.loggingService.catch("Error arming the portable storage listener: ",r)}}resumePortableSessionFromAnotherPage(){let r=this.portableResumeUserId;!r||this.portableSessionIdentity||this.initializeClientToken||!this.autoLoginRequired||this.configService?.getEnablePortableBackend()!==!0||(this.portableAutoLoginInFlight=this.portableAutoLoginInFlight.then(()=>this.autoLoginPortableSession({onlyUserId:r})).catch(()=>{}))}initializePortableSignedInUser(r,i){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: initializePortableSignedInUser","color: green;"),!i?.token){this.portableAuthUser$.value&&(this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState());return}let o=new zi;o.type="signedIn",o=B(B({},o),r),o.color=o.color||this.getUserAvatarColor(o.userId),o.textColor=o.textColor||this.getUserTextColor(o.userId),o.initial=o.initial||o.name?.charAt(0).toUpperCase()||o.email?.charAt(0).toUpperCase(),this.setUserToStorage(o),this.persistPortableSession(o,i);let s=Object.assign({},o);delete s.contacts,this.analyticsService.identifyUser(o.userSnippylyId,s,{forceReset:this.userOptions$.value?.forceReset}),this.user$.next(o),this.portableAuthUser$.next({uid:o.userSnippylyId})}catch(o){this.loggingService.catch("Error in initializePortableSignedInUser: ",o)}}clearPortableBackendState(){try{this.portableSignOutOwnsEpochBump||this.portableSessionEpoch++,this.releasePortableSession({clearStorage:!0})}catch(r){this.loggingService.catch("Error clearing portable backend state: ",r)}}releasePortableSession(r){this.pendingPortableRestore=null,this.portableSessionIdentity=null,r.clearStorage&&(this.portableAutoLoginCalled||this.configService?.getEnablePortableBackend()===!0)&&this.clearPersistedPortableSession(),!(!this.portableBackend$.value&&!this.portableAuthUser$.value)&&(this.clearPortableTokenRefresh(),this.portableToken=null,this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0,this.portableBackend$.next(null),this.portableAuthUser$.next(null),this.user$.next(null),JG())}endPortableSessionLocally(r){try{this.userPermissionService?.invalidateAllPermissionsState(),this.portableSessionEpoch++,this.portableLocalSessionEnds++,this.resetServicesCache(),this.user$.next(null),this.releasePortableSession({clearStorage:!1}),this.autoLoginRequired=!0,this.portableResumeUserId=r?.userId??null,this.armPortableStorageListener()}catch(i){this.loggingService.catch("Error ending the portable session: ",i)}}trackAutoAuthSuccess(r,i){this.analyticsService.trackEvent(St.Events.Core.SDK_USER_AUTH_SUCCESS,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,authType:"auto",forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r),source:i})}buildAutoLoginOptions(){return this.userOptions$?.value?Ee(B({},this.userOptions$.value),{replaceContacts:!1,replaceGroupContacts:!1,replacePrivateContacts:!1}):{}}persistPortableSession(r,i,o){let s=this.portableSessionEpoch;return this.portablePersistInFlight=this.portablePersistInFlight.then(()=>this.writePortableSessionEnvelope(r,i,s,o?.expectStoredRaw)).catch(()=>{}),this.portablePersistInFlight}writePortableSessionEnvelope(r,i,o,s){return y(this,null,function*(){try{if(!i?.token||!r?.userId||!this.apiKey)return;let a=this.user$.value;if(a?.userSnippylyId&&r.userSnippylyId&&a.userSnippylyId!==r.userSnippylyId)return;let c=this.getUserWithoutContacts(r);if(!c)return;let l={v:1,apiKey:this.apiKey,portableBackendUrl:this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null,user:c,res:B({backend:i.backend,wsEndpoint:i.wsEndpoint,apiEndpoint:i.apiEndpoint,token:i.token},Xc(i)?{refreshToken:Xc(i)}:{})},d=yield wT(l,this.apiKey);if(o!==this.portableSessionEpoch){this.loggingService.log("Velt [portable backend]: dropping a session envelope write that a sign-out or a new identify overtook.");return}if(s!==void 0&&localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)!==s){this.loggingService.log("Velt [portable backend]: not re-persisting a refreshed credential \u2014 another page changed the saved session meanwhile.");return}let h=this.readPortableSignOutAt();if(h!==null&&h>this.portableSessionStartedAt){this.loggingService.log("Velt [portable backend]: not persisting the session \u2014 another page signed out after it began.");return}typeof d=="string"&&!d.startsWith("{")&&d!==JSON.stringify(l)&&(localStorage.setItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION,d),this.portableSavedSessionRaw=d)}catch(a){this.loggingService.catch("Error in writePortableSessionEnvelope: ",a)}})}readPersistedPortableSession(){return y(this,null,function*(){try{let r=localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION);if(!r)return null;let i=yield sp(r,this.apiKey??"");return i?i.v!==1||i.apiKey!==this.apiKey||!i.user?.userId||!i.res?.token?(this.clearPersistedPortableSession(),null):(this.portableSavedSessionRaw=r,{envelope:i,raw:r}):null}catch(r){return this.loggingService.catch("Error in readPersistedPortableSession: ",r),null}})}clearPersistedPortableSession(){this.portableSavedSessionRaw=null;try{localStorage.removeItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{}}clearPersistedPortableSessionIfUnchanged(r){try{r&&localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)===r&&this.clearPersistedPortableSession()}catch{}}isPortableTokenNearExpiry(r){let i=wp(r);return i===null||i-Date.now()<=3e4}isPortableRestoreConfigured(){try{let r=this.endpointsService?.getPortableIdentifyUrl?.();return this.configService?.getEnablePortableBackend()===!0&&!!r&&!Pc(r)}catch{return!1}}isRestorablePortableSession(r,i,o){try{if(!this.isPortableRestoreConfigured()||o?.forceReset||r.portableBackendUrl!==(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)||!zc(r.res?.apiEndpoint)||r.user?.userSnippylyId!==i?.userSnippylyId)return!1;let s=this.user$.value;return s?.userSnippylyId&&s.userSnippylyId!==r.user.userSnippylyId||this.isPortableTokenNearExpiry(r.res.token)?!1:this.shouldHandlePortableBackend(r.res)}catch(s){return this.loggingService.catch("Error in isRestorablePortableSession: ",s),!1}}takePendingPortableRestore(r,i){let o=this.pendingPortableRestore;if(this.pendingPortableRestore=null,!o)return null;let s=o.resume===!0;return o.epoch!==this.portableSessionEpoch?{envelope:null,overtaken:!0,raw:o.raw,resume:s}:{envelope:this.isRestorablePortableSession(o.envelope,r,i)?o.envelope:null,overtaken:!1,raw:o.raw,resume:s}}autoLoginPortableSession(r){return y(this,null,function*(){let i=this.portableSessionEpoch,o=()=>i!==this.portableSessionEpoch||!this.autoLoginRequired,s=!!r?.onlyUserId;try{let a=yield this.readPersistedPortableSession(),c=a?.envelope;if(!a||!c||o()||s&&c.user?.userId!==r?.onlyUserId)return;if(!this.isPortableRestoreConfigured()){s||this.clearPersistedPortableSession();return}if(c.portableBackendUrl!==(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)){s||(this.loggingService.log("Velt [portable backend]: the persisted session belongs to a different gateway; dropped."),this.clearPersistedPortableSession());return}let l=c;if(this.isPortableTokenNearExpiry(c.res.token)){let h=Xc(c.res);if(!h){this.loggingService.log("Velt [portable backend]: the persisted session has no renewal credential; waiting for identify()."),this.clearPersistedPortableSessionIfUnchanged(a.raw);return}Wn("credential.restore-renew","via=refresh");let f=yield this.requestPortableRefresh(h);if(o())return;if(!this.shouldHandlePortableBackend(f)||!f?.token){if(f?.code==="network_error"){this.loggingService.log("Velt [portable backend]: could not reach the gateway to renew the persisted session; keeping it for the next attempt.");return}if(NN.has(f?.code)&&this.reportPortableRefreshMisconfigured(f),f?.code!==RN){this.loggingService.log(`Velt [portable backend]: the persisted session's renewal was refused for now (${f?.code??"no code"}); keeping it for the next attempt.`);return}this.loggingService.log("Velt [portable backend]: the persisted session could not be renewed on reload; waiting for identify()."),this.clearPersistedPortableSessionIfUnchanged(a.raw);return}let g=Xc(f)??h;l=Ee(B({},c),{res:{backend:f.backend,wsEndpoint:f.wsEndpoint,apiEndpoint:f.apiEndpoint,token:f.token,refreshToken:g}})}if(o())return;this.pendingPortableRestore=B({envelope:l,epoch:i,raw:a.raw},s?{resume:!0}:{});let d=this.buildAutoLoginOptions();s&&delete d.forceReset,yield this.initializeClient(B({},l.user),d,new Date().getTime(),!0,"internal-autoLogin")}catch(a){this.loggingService.catch("Error in autoLoginPortableSession: ",a)}finally{this.pendingPortableRestore=null}})}getPortableBackend(){return this.portableBackend$.value}getFirebaseConfig$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getFirebaseConfig","color: green;"),this.firebaseConfig$.asObservable()}getFirebaseConfig(){return this.loggingService.log("%c[WB] Calling FUNCTION: getFirebaseConfig","color: green;"),this.firebaseConfig$.value}setAdvancedQueries(r){this.loggingService.log("%c[WB] Calling FUNCTION: setAdvancedQueries","color: green;");try{r&&typeof r=="object"&&localStorage.setItem(F.LOCAL_STORAGE.VELT_ADVANCED_QUERIES,JSON.stringify(r)),this.advancedQueries$.next(r)}catch(i){this.loggingService.catch("Error in setAdvancedQueries: ",i)}}getAdvancedQueries$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAdvancedQueries$","color: green;"),this.advancedQueries$.asObservable()}getAdvancedQueries(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAdvancedQueries","color: green;"),this.advancedQueries$.value}getAdvancedQueriesEnabled(r){try{return!this.configService.getConfig()?.advancedQueriesDisabled&&(r||!!this.getAdvancedQueries()?.advancedQueriesEnabled)}catch(i){return this.loggingService.catch("Error in getAdvancedQueriesEnabled: ",i),!1}}signOutPreviousUser(){return this.signOutPreviousUser$.asObservable()}getUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUser","color: green;"),this.afAuth?.currentUser||this.portableAuthUser$.value?this.user$.value:null}getProvidedOrCurrentUserId(){try{return this.providedUser?.userId??this.user$.value?.userId??void 0}catch(r){this.loggingService.catch("Error in getProvidedOrCurrentUserId: ",r);return}}scheduleLoggedInUserResolveRetry(r,i){return y(this,null,function*(){try{if(!r||this.loggedInUserResolveRetryInFlightUserId===r)return;this.loggedInUserResolveRetryInFlightUserId=r;let o=this.loggedInUserResolveRetryDelaysMs;for(let s=0;s<o.length;s++){if(yield new Promise(l=>setTimeout(l,o[s])),(this.providedUser?.userId??this.user$.value?.userId)!==r)return;let a=yield this.usersService?.resolveUsers({userIds:[r],organizationId:i,skipUserCheck:!0,forceResolve:!0,moduleName:IT.IDENTIFY});if((this.providedUser?.userId??this.user$.value?.userId)!==r)return;let c=a?.[r];if(c&&this.applyLateResolvedLoggedInUser(r,c))return}this.loggingService.catch(`User resolver did not return the logged-in user after ${o.length} retry attempts \u2014 comments created by this author will have no resolved profile until the resolver returns them`,{userId:r,organizationId:i,attempts:o.length})}catch(o){this.loggingService.catch("Error in scheduleLoggedInUserResolveRetry: ",o)}finally{this.loggedInUserResolveRetryInFlightUserId===r&&(this.loggedInUserResolveRetryInFlightUserId=null)}})}applyLateResolvedLoggedInUser(r,i){try{let o=this.user$.value;if(!o||o.userId!==r)return!1;if(!this.afAuth?.currentUser)return!0;let s=Yne(o,i);return this.setUserToStorage(s),this.user$.next(s),!0}catch(o){return this.loggingService.catch("Error in applyLateResolvedLoggedInUser: ",o),!1}}combinedAuthBearer$(){let r=!1;return Ka([hd(this.afAuth).pipe(Qa(VN)),this.portableAuthUser$]).pipe(mn(([i,o])=>(o!==null&&(r=!0),!!(i!==VN||o!==null||r))),De(([i,o])=>(i===VN?null:i)??o))}getUser$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUser$","color: green;"),this.combinedAuthBearer$().pipe(Mr(r=>r?this.user$.asObservable():lt(null)),yo(cp))}getAuthUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAuthUser","color: green;"),this.afAuth?.currentUser}getAuthState$(){return this.combinedAuthBearer$()}getIdTokenResultForUser(r,i){return Np(r,i)}getUserOptions(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOptions","color: green;"),this.userOptions$.value}getUserOptions$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOptions$","color: green;"),this.userOptions$.asObservable()}updateUser(r){this.loggingService.log("%c[WB] Calling FUNCTION: updateUser","color: green;");try{let i=this.user$.value;if(r.userId&&r.userId!==i?.userId||r?.groupId&&r?.groupId!==i?.groupId||r?.organizationId&&r?.organizationId!==i?.organizationId)this.providedUser=r,this.initializeClient(r,this.userOptions$?.value||{},new Date().getTime(),void 0,"internal-updateUser");else if(this.providedUser=B(B({},this.providedUser),r),i){let o=B(B({},i),r);this.updateUserInternally(o)}}catch(i){this.loggingService.catch("Error in updateUser: ",i)}}signInWithCustomToken(r,i,o="manual"){this.loggingService.log("%c[WB] Calling FUNCTION: signInWithCustomToken","color: green;");try{return IG(this.afAuth,i).then(s=>(this.analyticsService.trackEvent(St.Events.Core.SDK_USER_AUTH_SUCCESS,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,authType:o,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r)}),s)).catch(s=>(this.analyticsService.trackEvent(St.Events.Core.SDK_USER_AUTH_FAILED,{apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,authType:o,forceReset:this.userOptions$.value?.forceReset,message:s.message,user:this.getUserForTelemetry(r)}),s))}catch(s){return this.loggingService.catch("Error in signInWithCustomToken: ",s),Promise.reject(s)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache","color: green;");try{this.activityService?.resetActivityFeatureConfig()}catch(r){this.loggingService.catch("Error in clearCache: ",r)}}resetServicesCache(){this.loggingService.log("%c[WB] Calling FUNCTION: resetServicesCache in AuthService","color: green;");try{this.crdtService?.flushAllEditorActivities(),this.clearCache(),this.commonDbService?.unsubscribeFromObservables(),this.activityService?.destroy(),this.docService?.clearCacheOnUserCascade(),this.contactService?.clearCache(),this.iamService?.clearCache(),this.areaService?.clearCache(),this.commentService?.clearCache(),this.reactionService?.clearCache(),this.serviceBook.get(hT)?.clearCache(),this.viewsService?.clearCache()}catch(r){this.loggingService.catch("Error in resetServicesCache: ",r)}}initializeSignedInUser(r,i,o){this.loggingService.log("%c[WB] Calling FUNCTION: initializeSignedInUser","color: green;");try{let s=new zi;s.userSnippylyId=r.uid,s.type="signedIn",o&&(s=B(B({},s),o)),this.setUserToStorage(s),this.mergeUserWithProvidedUserData(s,i)}catch(s){this.loggingService.catch("Error in initializeSignedInUser: ",s)}}mergeUserWithProvidedUserData(r,i){return y(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: mergeUserWithProvidedUserData","color: green;");try{r.userId=this.providedUser?.userId||r.userId;let o=null;if(this.usersService?.externalUserDataProviderAvailable()){let s=nd(),a=IT.IDENTIFY,c=this.providedUser?.clientOrganizationId||r.clientOrganizationId;this.coreActionsService.triggerAction(Wi.USER_RESOLVER,{event:St.Events.Resolver.USER_RESOLUTION_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:s,methodName:nR.MERGE_USER_WITH_PROVIDED_USER_DATA,moduleName:a,source:"internal",payload:{userIds:[r.userId],organizationId:c}});let l=yield this.usersService.resolveUsers({userIds:[r.userId],organizationId:c,skipUserCheck:!0,uniqueId:s,moduleName:a});l&&l[r.userId]?o=JSON.parse(JSON.stringify(l[r.userId]||{})):this.scheduleLoggedInUserResolveRetry(r.userId,c),r=B(B({},r),o||{})}r.name=o?o?.name:this.providedUser?.name||r.name,r.clientUserName=o?o?.clientUserName:this.providedUser?.clientUserName||r.clientUserName,r.photoUrl=o?o?.photoUrl:this.providedUser?.photoUrl||r.photoUrl,r?.photoUrl===void 0&&(r.photoUrl=null),r.email=o?o?.email:this.providedUser?.email||r.email,r.color=o?.color||this.providedUser?.color||this.getUserAvatarColor(r.userId),r.textColor=o?.textColor||this.providedUser?.textColor||this.getUserTextColor(r.userId),r.initial=o?.initial||this.providedUser?.initial||r.initial||r.name?.charAt(0).toUpperCase()||r.email?.charAt(0).toUpperCase(),r.contacts=this.providedUser?.contacts||r.contacts,r.plan=this.providedUser?.plan||r.plan,r.groupId=this.providedUser?.groupId||r.groupId,r.clientGroupId=this.providedUser?.clientGroupId||r.clientGroupId,r.clientOrganizationId=this.providedUser?.clientOrganizationId||r.clientOrganizationId,r.organizationId=this.providedUser?.organizationId||r.organizationId,r.isAdmin=this.providedUser?.isAdmin,r.isReadOnly=this.providedUser?.isReadOnly,r.isAnonymous=this.providedUser?.isAnonymous,r.isGuest=this.providedUser?.isGuest,this.updateUserInternally(r)}catch(o){this.loggingService.catch("Error in mergeUserWithProvidedUserData: ",o)}})}updateUserInternally(r){return y(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserInternally","color: green;");try{let i=Object.assign({},r);delete i.contacts,this.analyticsService.identifyUser(r.userSnippylyId,i,{forceReset:this.userOptions$.value?.forceReset}),this.getPlanDetailsCalled||this.getPlanDetailsFromDb();let o=pd(this.functions,od({url:this.endpointsService.getCloudFunctionUrl("sdkProxy"),apiProxyDomain:this.configService?.getApiProxyDomain()})),s=zV({methodName:"updateUserInternally",data:{type:"getProjectConfig"},getSdkProxy:o,userId:r?.userId??""}),a=Promise.resolve();if(this.userPermissionService?.isPermissionProviderAvailable()&&r.clientOrganizationId){let d=[{userId:r.userId,resource:{id:r.clientOrganizationId,type:HU.ORGANIZATION,source:vT.IDENTIFY,organizationId:r.clientOrganizationId}}],h=nd();this.coreActionsService.triggerAction(Wi.PERMISSION_PROVIDER,{event:St.Events.PermissionProvider.RESOURCE_ACCESS_REQUEST_FORMED,methodName:vT.IDENTIFY,uniqueId:h,timestamp:new Date().getTime(),source:"internal",payload:{requests:d}}),a=this.userPermissionService?.onResourceAccessRequired({requests:d,uniqueId:h,userId:r.userId,methodName:vT.IDENTIFY,fromCache:!1})??Promise.resolve()}let[c,l]=yield Promise.allSettled([s,a]);if(c.status==="fulfilled"){this.setIsPrivateCommentsEnabled(!!c.value?.data?.isPrivateCommentsEnabled);let d=c.value?.data?.activityConfig??{immutable:!1,isEnabled:!1};this.cachedActivityConfig=d,this.activityService?.setActivityFeatureConfig(d)}else this.loggingService.warn("Failed to fetch project config:",c.reason);this.afAuth.currentUser?(this.user$.next(r),this.updateUserToFirebase(r)):this.portableAuthUser$.value&&this.user$.next(r)}catch(i){this.loggingService.catch("Error in updateUserInternally: ",i)}})}updateUserToFirebase(r){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserToFirebase","color: green;");try{let i=JSON.parse(JSON.stringify(r)),o=Ee(B({},i),{lastUpdated:new Date})}catch(i){this.loggingService.catch("Error in updateUserToFirebase: ",i)}}getPlanDetailsFromDb(){return y(this,null,function*(){try{this.getPlanDetailsCalled=!0;let i=yield pd(this.functions,od({url:this.endpointsService.getCloudFunctionUrl("getPlanDetails"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:1200*1e3})({apiKey:this.configService.getApiKey(),sdkVersion:xc(),sdkType:this.configService.getSdkType()});return i?.data?.isPlanExpired&&(this.analyticsService.trackEvent(St.Events.Core.SDK_PLAN_EXPIRED),this.configService.getSF()||console.warn("Velt SDK plan has expired.")),this.planDetails$.next(i?.data||{planInfo:null,isPlanExpired:!1}),i}catch(r){return this.loggingService.catch("Error in getPlanDetailsFromDb: ",r),this.planDetails$.next({planInfo:null,isPlanExpired:!1}),Promise.resolve(null)}})}isPlanExpired$(){return this.planDetails$.pipe(mn(r=>!!r),De(r=>!!r?.isPlanExpired))}isPlanExpired(){return this.planDetails$.getValue()?.isPlanExpired}addPreSignOutFuction(r,i){try{this.preSignOutFunctions.set(r,i)}catch(o){this.loggingService.catch("Error in addPreSignOutFuction: ",o)}}setUserOrganization(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserOrganization","color: green;");let i=JSON.parse(JSON.stringify(this.userOrganization$.value||{}));this.getUser()?.organizationId===r?.organizationId?(i.metadata=r,this.userOrganization$.next(i)):this.userOrganization$.next(null)}catch(i){this.loggingService.catch("Error in setUserOrganization: ",i)}}setOrganizationUserGroups(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserOrganizationGroups","color: green;");let i=JSON.parse(JSON.stringify(this.userOrganization$.value||{}));this.getUser()?.organizationId===i?.metadata?.organizationId&&(i.groups=r,this.userOrganization$.next(i))}catch(i){this.loggingService.catch("Error in setUserOrganizationGroups: ",i)}}getUserOrganization$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOrganization$","color: green;"),this.getUser$().pipe(Mr(r=>r?this.userOrganization$.asObservable().pipe(De(i=>i?.metadata?.organizationId===r.organizationId?i:null)):lt(null)))}signOutUser(r="internal"){return y(this,null,function*(){try{this.userPermissionService?.invalidateAllPermissionsState(),this.portableSessionEpoch++,this.portableSignOutOwnsEpochBump=!0,this.pendingPortableRestore=null,this.portableResumeUserId=null,this.portableSessionIdentity=null,(this.portableAutoLoginCalled||this.configService?.getEnablePortableBackend()===!0)&&(this.clearPersistedPortableSession(),this.recordPortableSignOut(),this.clearPortableTokenRefresh()),r==="external"&&(this.onRetrySubscription?.unsubscribe(),this.authProviderListenerGeneration++),this.userPermissionService?.revokeAccessOnUserLogout(),this.analyticsService.trackEvent(St.Events.Core.SDK_USER_SIGN_OUT,{apiKey:this.apiKey,clientUserId:this.user$?.value?.userId,snippylyUserId:this.user$?.value?.userSnippylyId,message:r==="external"?"User Sign out":"System Sign out",user:this.user$?.value?this.getUserForTelemetry(this.user$?.value):null,forceReset:this.userOptions$.value?.forceReset,source:r});let i=yield hd(this.afAuth).pipe(En(1)).toPromise().catch(o=>null);if(i){this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState();for(let[o,s]of this.preSignOutFunctions)try{yield s(i)}catch(a){this.loggingService.catch(`Error in signOutUser ${o} function: `,a)}return this.user$.next(null),yield VV(1e3),vG(this.afAuth).catch(o=>{this.loggingService.catch("Error in signOutUser:",o)})}else return(this.portableAuthUser$.value||this.portableBackend$.value)&&(this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState()),Promise.resolve()}catch(i){this.loggingService.catch("Error in signOutUser: ",i)}finally{this.portableSignOutOwnsEpochBump=!1}})}isFeatureAllowed(r){return bV(this.config,this.user$.value,r)}getUserWithoutContacts(r){try{if(r){let i=JSON.parse(JSON.stringify(r));return delete i.contacts,i}else return null}catch(i){return this.loggingService.catch("Error in getUserWithoutContacts: ",i),null}}getUserForTelemetry(r){try{let i=this.getUserWithoutContacts(r);return i?this.usersService?.userResolverConfigured?.()?IR(i):i:null}catch(i){return this.loggingService.catch("Error in getUserForTelemetry: ",i),null}}getUserForClient(r){try{return _R(r)}catch(i){return this.loggingService.catch("Error in getUserForClient: ",i),null}}getUserAvatarColor(r){try{return r?this.avatarService.generateUserColor(Mc(r)):"#625DF5"}catch{return"#625DF5"}}getUserTextColor(r){try{return"#FFFFFF"}catch{return"#FFFFFF"}}setOptionalPropertiesToUsers(r){try{r.forEach(i=>{try{i?.color||(i.color=this.getUserAvatarColor(i?.userId)),i?.textColor||(i.textColor=this.getUserTextColor(i?.userId)),!i?.initial&&(i?.name||i?.email)&&(i.initial=i.name?.charAt(0).toUpperCase()||i.email?.charAt(0).toUpperCase())}catch{}})}catch{}}};e.PORTABLE_REFRESH_WARN_AFTER_FAILURES=3,e.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS=["visibilitychange","resume"],e.PORTABLE_NO_CREDENTIAL_ENVELOPE={error:"No renewal credential.",code:"no_renewal_credential",message:"the session has no renewal credential for the configured gateway",source:"identify"},e.\u0275fac=function(i){return new(i||e)($(Hc),$(Ji),$(t2),$(n2),$(C2),$(Ho),$(zs),$(bt),$(mT))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var N2="@firebase/database",w2="1.0.20";var Ww="";function Xne(t){Ww=t}var qN=class{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,n){n==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),xt(n))}get(e){let n=this.domStorage_.getItem(this.prefixedName_(e));return n==null?null:ad(n)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}};var KN=class{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,n){n==null?delete this.cache_[e]:this.cache_[e]=n}get(e){return Vr(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}};var aj=function(t){try{if(typeof window<"u"&&typeof window[t]<"u"){let e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new qN(e)}}catch{}return new KN},Jc=aj("localStorage"),YN=aj("sessionStorage");var Id=new Br("@firebase/database"),cj=(function(){let t=1;return function(){return t++}})(),lj=function(t){let e=pB(t),n=new PT;n.update(e);let r=n.digest();return cd.encodeByteArray(r)},ng=function(...t){let e="";for(let n=0;n<t.length;n++){let r=t[n];Array.isArray(r)||r&&typeof r=="object"&&typeof r.length=="number"?e+=ng.apply(null,r):typeof r=="object"?e+=xt(r):e+=r,e+=" "}return e},Zc=null,b2=!0,Qne=function(t,e){q(!e||t===!0||t===!1,"Can't turn on custom loggers persistently."),t===!0?(Id.logLevel=Re.VERBOSE,Zc=Id.log.bind(Id),e&&YN.set("logging_enabled",!0)):typeof t=="function"?Zc=t:(Zc=null,YN.remove("logging_enabled"))},un=function(...t){if(b2===!0&&(b2=!1,Zc===null&&YN.get("logging_enabled")===!0&&Qne(!0)),Zc){let e=ng.apply(null,t);Zc(e)}},rg=function(t){return function(...e){un(t,...e)}},XN=function(...t){let e="FIREBASE INTERNAL ERROR: "+ng(...t);Id.error(e)},Wo=function(...t){let e=`FIREBASE FATAL ERROR: ${ng(...t)}`;throw Id.error(e),new Error(e)},xn=function(...t){let e="FIREBASE WARNING: "+ng(...t);Id.warn(e)},Jne=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&xn("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},By=function(t){return typeof t=="number"&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},Zne=function(t){if(Ki()||document.readyState==="complete")t();else{let e=!1,n=function(){if(!document.body){setTimeout(n,Math.floor(10));return}e||(e=!0,t())};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&n()}),window.attachEvent("onload",n))}},tl="[MIN_NAME]",Zs="[MAX_NAME]",al=function(t,e){if(t===e)return 0;if(t===tl||e===Zs)return-1;if(e===tl||t===Zs)return 1;{let n=O2(t),r=O2(e);return n!==null?r!==null?n-r===0?t.length-e.length:n-r:-1:r!==null?1:t<e?-1:1}},ere=function(t,e){return t===e?0:t<e?-1:1},xp=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+xt(e))},zw=function(t){if(typeof t!="object"||t===null)return xt(t);let e=[];for(let r in t)e.push(r);e.sort();let n="{";for(let r=0;r<e.length;r++)r!==0&&(n+=","),n+=xt(e[r]),n+=":",n+=zw(t[e[r]]);return n+="}",n},uj=function(t,e){let n=t.length;if(n<=e)return[t];let r=[];for(let i=0;i<n;i+=e)i+e>n?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r};function dn(t,e){for(let n in t)t.hasOwnProperty(n)&&e(n,t[n])}var dj=function(t){q(!By(t),"Invalid JSON number");let e=11,n=52,r=(1<<e-1)-1,i,o,s,a,c;t===0?(o=0,s=0,i=1/t===-1/0?1:0):(i=t<0,t=Math.abs(t),t>=Math.pow(2,1-r)?(a=Math.min(Math.floor(Math.log(t)/Math.LN2),r),o=a+r,s=Math.round(t*Math.pow(2,n-a)-Math.pow(2,n))):(o=0,s=Math.round(t/Math.pow(2,1-r-n))));let l=[];for(c=n;c;c-=1)l.push(s%2?1:0),s=Math.floor(s/2);for(c=e;c;c-=1)l.push(o%2?1:0),o=Math.floor(o/2);l.push(i?1:0),l.reverse();let d=l.join(""),h="";for(c=0;c<64;c+=8){let f=parseInt(d.substr(c,8),2).toString(16);f.length===1&&(f="0"+f),h=h+f}return h.toLowerCase()},tre=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},nre=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function rre(t,e){let n="Unknown Error";t==="too_big"?n="The data requested exceeds the maximum size that can be accessed with a single request.":t==="permission_denied"?n="Client doesn't have permission to access the desired data.":t==="unavailable"&&(n="The service is unavailable");let r=new Error(t+" at "+e._path.toString()+": "+n);return r.code=t.toUpperCase(),r}var ire=new RegExp("^-?(0*)\\d{1,10}$"),ore=-2147483648,sre=2147483647,O2=function(t){if(ire.test(t)){let e=Number(t);if(e>=ore&&e<=sre)return e}return null},bd=function(t){try{t()}catch(e){setTimeout(()=>{let n=e.stack||"";throw xn("Exception was thrown by user callback.",n),e},Math.floor(0))}},are=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Vp=function(t,e){let n=setTimeout(t,e);return typeof n=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(n):typeof n=="object"&&n.unref&&n.unref(),n};var QN=class{constructor(e,n){this.appCheckProvider=n,this.appName=e.name,Zn(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=n?.getImmediate({optional:!0}),this.appCheck||n?.get().then(r=>this.appCheck=r)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((n,r)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){var n;(n=this.appCheckProvider)===null||n===void 0||n.get().then(r=>r.addTokenListener(e))}notifyForInvalidToken(){xn(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}};var JN=class{constructor(e,n,r){this.appName_=e,this.firebaseOptions_=n,this.authProvider_=r,this.auth_=null,this.auth_=r.getImmediate({optional:!0}),this.auth_||r.onInit(i=>this.auth_=i)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(n=>n&&n.code==="auth/token-not-initialized"?(un("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(n)):new Promise((n,r)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(n=>n.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(n=>n.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',xn(e)}},Bp=(()=>{class t{constructor(n){this.accessToken=n}getToken(n){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(n){n(this.accessToken)}removeTokenChangeListener(n){}notifyForInvalidToken(){}}t.OWNER="owner";return t})(),gy="5",hj="v",fj="s",pj="r",gj="f",mj=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Ej="ls",_j="p",ZN="ac",Tj="websocket",yj="long_polling";var my=class{constructor(e,n,r,i,o=!1,s="",a=!1,c=!1,l=null){this.secure=n,this.namespace=r,this.webSocketOnly=i,this.nodeAdmin=o,this.persistenceKey=s,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=c,this.emulatorOptions=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Jc.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Jc.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){let e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${n}`}};function cre(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function Ij(t,e,n){q(typeof e=="string","typeof type must == string"),q(typeof n=="object","typeof params must == object");let r;if(e===Tj)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===yj)r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);cre(t)&&(n.ns=t.namespace);let i=[];return dn(n,(o,s)=>{i.push(o+"="+s)}),r+i.join("&")}var ew=class{constructor(){this.counters_={}}incrementCounter(e,n=1){Vr(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=n}get(){return tB(this.counters_)}};var BN={},GN={};function qw(t){let e=t.toString();return BN[e]||(BN[e]=new ew),BN[e]}function lre(t,e){let n=t.toString();return GN[n]||(GN[n]=e()),GN[n]}var tw=class{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,n){this.closeAfterResponse=e,this.onClose=n,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,n){for(this.pendingResponses[e]=n;this.pendingResponses[this.currentResponseNum];){let r=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let i=0;i<r.length;++i)r[i]&&bd(()=>{this.onMessage_(r[i])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}};var M2="start",ure="close",dre="pLPCommand",hre="pRTLPCB",vj="id",Sj="pw",Aj="ser",fre="cb",pre="seg",gre="ts",mre="d",Ere="dframe",Cj=1870,Dj=30,_re=Cj-Dj,Tre=25e3,yre=3e4,Ey=class t{constructor(e,n,r,i,o,s,a){this.connId=e,this.repoInfo=n,this.applicationId=r,this.appCheckToken=i,this.authToken=o,this.transportSessionId=s,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=rg(e),this.stats_=qw(n),this.urlFn=c=>(this.appCheckToken&&(c[ZN]=this.appCheckToken),Ij(n,yj,c))}open(e,n){this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new tw(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(yre)),Zne(()=>{if(this.isClosed_)return;this.scriptTagHolder=new nw((...o)=>{let[s,a,c,l,d]=o;if(this.incrementIncomingBytes_(o),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,s===M2)this.id=a,this.password=c;else if(s===ure)a?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(a,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+s)},(...o)=>{let[s,a]=o;this.incrementIncomingBytes_(o),this.myPacketOrderer.handleResponse(s,a)},()=>{this.onClosed_()},this.urlFn);let r={};r[M2]="t",r[Aj]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(r[fre]=this.scriptTagHolder.uniqueCallbackIdentifier),r[hj]=gy,this.transportSessionId&&(r[fj]=this.transportSessionId),this.lastSessionId&&(r[Ej]=this.lastSessionId),this.applicationId&&(r[_j]=this.applicationId),this.appCheckToken&&(r[ZN]=this.appCheckToken),typeof location<"u"&&location.hostname&&mj.test(location.hostname)&&(r[pj]=gj);let i=this.urlFn(r);this.log_("Connecting via long-poll to "+i),this.scriptTagHolder.addTag(i,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){t.forceAllow_=!0}static forceDisallow(){t.forceDisallow_=!0}static isAvailable(){return Ki()?!1:t.forceAllow_?!0:!t.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!tre()&&!nre()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){let n=xt(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);let r=RR(n),i=uj(r,_re);for(let o=0;o<i.length;o++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[o]),this.curSegmentNum++}addDisconnectPingFrame(e,n){if(Ki())return;this.myDisconnFrame=document.createElement("iframe");let r={};r[Ere]="t",r[vj]=e,r[Sj]=n,this.myDisconnFrame.src=this.urlFn(r),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){let n=xt(e).length;this.bytesReceived+=n,this.stats_.incrementCounter("bytes_received",n)}},nw=class t{constructor(e,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0,Ki())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=cj(),window[dre+this.uniqueCallbackIdentifier]=e,window[hre+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createIFrame_();let o="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(o='<script>document.domain="'+document.domain+'";<\/script>');let s="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(a){un("frame writing exception"),a.stack&&un(a.stack),un(a)}}}static createIFrame_(){let e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||un("No IE domain setting required")}catch{let r=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+r+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));let e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;let e={};e[vj]=this.myID,e[Sj]=this.myPW,e[Aj]=this.currentSerial;let n=this.urlFn(e),r="",i=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+Dj+r.length<=Cj;){let s=this.pendingSegs.shift();r=r+"&"+pre+i+"="+s.seg+"&"+gre+i+"="+s.ts+"&"+mre+i+"="+s.d,i++}return n=n+r,this.addLongPollTag_(n,this.currentSerial),!0}else return!1}enqueueSegment(e,n,r){this.pendingSegs.push({seg:e,ts:n,d:r}),this.alive&&this.newRequest_()}addLongPollTag_(e,n){this.outstandingRequests.add(n);let r=()=>{this.outstandingRequests.delete(n),this.newRequest_()},i=setTimeout(r,Math.floor(Tre)),o=()=>{clearTimeout(i),r()};this.addTag(e,o)}addTag(e,n){Ki()?this.doNodeLongPoll(e,n):setTimeout(()=>{try{if(!this.sendNewPolls)return;let r=this.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){let i=r.readyState;(!i||i==="loaded"||i==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),n())},r.onerror=()=>{un("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))}};var Ire=16384,vre=45e3,_y=null;typeof MozWebSocket<"u"?_y=MozWebSocket:typeof WebSocket<"u"&&(_y=WebSocket);var Td=(()=>{class t{constructor(n,r,i,o,s,a,c){this.connId=n,this.applicationId=i,this.appCheckToken=o,this.authToken=s,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=rg(this.connId),this.stats_=qw(r),this.connURL=t.connectionURL_(r,a,c,o,i),this.nodeAdmin=r.nodeAdmin}static connectionURL_(n,r,i,o,s){let a={};return a[hj]=gy,!Ki()&&typeof location<"u"&&location.hostname&&mj.test(location.hostname)&&(a[pj]=gj),r&&(a[fj]=r),i&&(a[Ej]=i),o&&(a[ZN]=o),s&&(a[_j]=s),Ij(n,Tj,a)}open(n,r){this.onDisconnect=r,this.onMessage=n,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Jc.set("previous_websocket_failure",!0);try{let i;if(Ki()){let o=this.nodeAdmin?"AdminNode":"Node";i={headers:{"User-Agent":`Firebase/${gy}/${Ww}/${process.platform}/${o}`,"X-Firebase-GMPID":this.applicationId||""}},this.authToken&&(i.headers.Authorization=`Bearer ${this.authToken}`),this.appCheckToken&&(i.headers["X-Firebase-AppCheck"]=this.appCheckToken);let s=process.env,a=this.connURL.indexOf("wss://")===0?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;a&&(i.proxy={origin:a})}this.mySock=new _y(this.connURL,[],i)}catch(i){this.log_("Error instantiating WebSocket.");let o=i.message||i.data;o&&this.log_(o),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=i=>{this.handleIncomingFrame(i)},this.mySock.onerror=i=>{this.log_("WebSocket error. Closing connection.");let o=i.message||i.data;o&&this.log_(o),this.onClosed_()}}start(){}static forceDisallow(){t.forceDisallow_=!0}static isAvailable(){let n=!1;if(typeof navigator<"u"&&navigator.userAgent){let r=/Android ([0-9]{0,}\.[0-9]{0,})/,i=navigator.userAgent.match(r);i&&i.length>1&&parseFloat(i[1])<4.4&&(n=!0)}return!n&&_y!==null&&!t.forceDisallow_}static previouslyFailed(){return Jc.isInMemoryStorage||Jc.get("previous_websocket_failure")===!0}markConnectionHealthy(){Jc.remove("previous_websocket_failure")}appendFrame_(n){if(this.frames.push(n),this.frames.length===this.totalFrames){let r=this.frames.join("");this.frames=null;let i=ad(r);this.onMessage(i)}}handleNewFrameCount_(n){this.totalFrames=n,this.frames=[]}extractFrameCount_(n){if(q(this.frames===null,"We already have a frame buffer"),n.length<=6){let r=Number(n);if(!isNaN(r))return this.handleNewFrameCount_(r),null}return this.handleNewFrameCount_(1),n}handleIncomingFrame(n){if(this.mySock===null)return;let r=n.data;if(this.bytesReceived+=r.length,this.stats_.incrementCounter("bytes_received",r.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(r);else{let i=this.extractFrameCount_(r);i!==null&&this.appendFrame_(i)}}send(n){this.resetKeepAlive();let r=xt(n);this.bytesSent+=r.length,this.stats_.incrementCounter("bytes_sent",r.length);let i=uj(r,Ire);i.length>1&&this.sendString_(String(i.length));for(let o=0;o<i.length;o++)this.sendString_(i[o])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(vre))}sendString_(n){try{this.mySock.send(n)}catch(r){this.log_("Exception thrown from WebSocket.send():",r.message||r.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4;return t})(),Rj=(()=>{class t{static get ALL_TRANSPORTS(){return[Ey,Td]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(n){this.initTransports_(n)}initTransports_(n){let r=Td&&Td.isAvailable(),i=r&&!Td.previouslyFailed();if(n.webSocketOnly&&(r||xn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[Td];else{let o=this.transports_=[];for(let s of t.ALL_TRANSPORTS)s&&s.isAvailable()&&o.push(s);t.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}t.globalTransportInitialized_=!1;return t})(),Sre=6e4,Are=5e3,Cre=10*1024,Dre=100*1024,jN="t",L2="d",Rre="s",P2="r",Nre="e",x2="o",k2="a",F2="n",U2="p",wre="h",rw=class{constructor(e,n,r,i,o,s,a,c,l,d){this.id=e,this.repoInfo_=n,this.applicationId_=r,this.appCheckToken_=i,this.authToken_=o,this.onMessage_=s,this.onReady_=a,this.onDisconnect_=c,this.onKill_=l,this.lastSessionId=d,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=rg("c:"+this.id+":"),this.transportManager_=new Rj(n),this.log_("Connection created"),this.start_()}start_(){let e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(n,r)},Math.floor(0));let i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=Vp(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>Dre?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>Cre?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(i)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return n=>{e===this.conn_?this.onConnectionLost_(n):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return n=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(n):e===this.secondaryConn_?this.onSecondaryMessageReceived_(n):this.log_("message on old connection"))}}sendRequest(e){let n={t:"d",d:e};this.sendData_(n)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(jN in e){let n=e[jN];n===k2?this.upgradeIfSecondaryHealthy_():n===P2?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===x2&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){let n=xp("t",e),r=xp("d",e);if(n==="c")this.onSecondaryControl_(r);else if(n==="d")this.pendingDataMessages.push(r);else throw new Error("Unknown protocol layer: "+n)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:U2,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:k2,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:F2,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){let n=xp("t",e),r=xp("d",e);n==="c"?this.onControl_(r):n==="d"&&this.onDataMessage_(r)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){let n=xp(jN,e);if(L2 in e){let r=e[L2];if(n===wre){let i=Object.assign({},r);this.repoInfo_.isUsingEmulator&&(i.h=this.repoInfo_.host),this.onHandshake_(i)}else if(n===F2){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let i=0;i<this.pendingDataMessages.length;++i)this.onDataMessage_(this.pendingDataMessages[i]);this.pendingDataMessages=[],this.tryCleanupConnection()}else n===Rre?this.onConnectionShutdown_(r):n===P2?this.onReset_(r):n===Nre?XN("Server Error: "+r):n===x2?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):XN("Unknown control packet command: "+n)}}onHandshake_(e){let n=e.ts,r=e.v,i=e.h;this.sessionId=e.s,this.repoInfo_.host=i,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,n),gy!==r&&xn("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){let e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),Vp(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(Sre))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,n){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(n,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Vp(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(Are))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:U2,d:{}}}))}onSecondaryConnectionLost_(){let e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Jc.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}};var Ty=class{put(e,n,r,i){}merge(e,n,r,i){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,n,r){}onDisconnectMerge(e,n,r){}onDisconnectCancel(e,n){}reportStats(e){}};var yy=class{constructor(e){this.allowedEvents_=e,this.listeners_={},q(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...n){if(Array.isArray(this.listeners_[e])){let r=[...this.listeners_[e]];for(let i=0;i<r.length;i++)r[i].callback.apply(r[i].context,n)}}on(e,n,r){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:n,context:r});let i=this.getInitialEvent(e);i&&n.apply(r,i)}off(e,n,r){this.validateEventType_(e);let i=this.listeners_[e]||[];for(let o=0;o<i.length;o++)if(i[o].callback===n&&(!r||r===i[o].context)){i.splice(o,1);return}}validateEventType_(e){q(this.allowedEvents_.find(n=>n===e),"Unknown event: "+e)}};var Iy=class t extends yy{static getInstance(){return new t}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!hp()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return q(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}};var V2=32,B2=768,Be=class{constructor(e,n){if(n===void 0){this.pieces_=e.split("/");let r=0;for(let i=0;i<this.pieces_.length;i++)this.pieces_[i].length>0&&(this.pieces_[r]=this.pieces_[i],r++);this.pieces_.length=r,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}toString(){let e="";for(let n=this.pieceNum_;n<this.pieces_.length;n++)this.pieces_[n]!==""&&(e+="/"+this.pieces_[n]);return e||"/"}};function Ve(){return new Be("")}function Ne(t){return t.pieceNum_>=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function ea(t){return t.pieces_.length-t.pieceNum_}function at(t){let e=t.pieceNum_;return e<t.pieces_.length&&e++,new Be(t.pieces_,e)}function Kw(t){return t.pieceNum_<t.pieces_.length?t.pieces_[t.pieces_.length-1]:null}function bre(t){let e="";for(let n=t.pieceNum_;n<t.pieces_.length;n++)t.pieces_[n]!==""&&(e+="/"+encodeURIComponent(String(t.pieces_[n])));return e||"/"}function $p(t,e=0){return t.pieces_.slice(t.pieceNum_+e)}function Nj(t){if(t.pieceNum_>=t.pieces_.length)return null;let e=[];for(let n=t.pieceNum_;n<t.pieces_.length-1;n++)e.push(t.pieces_[n]);return new Be(e,0)}function Ct(t,e){let n=[];for(let r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);if(e instanceof Be)for(let r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{let r=e.split("/");for(let i=0;i<r.length;i++)r[i].length>0&&n.push(r[i])}return new Be(n,0)}function we(t){return t.pieceNum_>=t.pieces_.length}function zn(t,e){let n=Ne(t),r=Ne(e);if(n===null)return e;if(n===r)return zn(at(t),at(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function Ore(t,e){let n=$p(t,0),r=$p(e,0);for(let i=0;i<n.length&&i<r.length;i++){let o=al(n[i],r[i]);if(o!==0)return o}return n.length===r.length?0:n.length<r.length?-1:1}function Yw(t,e){if(ea(t)!==ea(e))return!1;for(let n=t.pieceNum_,r=e.pieceNum_;n<=t.pieces_.length;n++,r++)if(t.pieces_[n]!==e.pieces_[r])return!1;return!0}function jr(t,e){let n=t.pieceNum_,r=e.pieceNum_;if(ea(t)>ea(e))return!1;for(;n<t.pieces_.length;){if(t.pieces_[n]!==e.pieces_[r])return!1;++n,++r}return!0}var iw=class{constructor(e,n){this.errorPrefix_=n,this.parts_=$p(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let r=0;r<this.parts_.length;r++)this.byteLength_+=mp(this.parts_[r]);wj(this)}};function Mre(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=mp(e),wj(t)}function Lre(t){let e=t.parts_.pop();t.byteLength_-=mp(e),t.parts_.length>0&&(t.byteLength_-=1)}function wj(t){if(t.byteLength_>B2)throw new Error(t.errorPrefix_+"has a key path longer than "+B2+" bytes ("+t.byteLength_+").");if(t.parts_.length>V2)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+V2+") or object contains a cycle "+Qc(t))}function Qc(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}var ow=class t extends yy{static getInstance(){return new t}constructor(){super(["visible"]);let e,n;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(n="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(n="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(n="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(n="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,n&&document.addEventListener(n,()=>{let r=!document[e];r!==this.visible_&&(this.visible_=r,this.trigger("visible",r))},!1)}getInitialEvent(e){return q(e==="visible","Unknown event type: "+e),[this.visible_]}};var kp=1e3,Pre=300*1e3,G2=30*1e3,xre=1.3,kre=3e4,Fre="server_kill",j2=3,Xw=(()=>{class t extends Ty{constructor(n,r,i,o,s,a,c,l){if(super(),this.repoInfo_=n,this.applicationId_=r,this.onDataUpdate_=i,this.onConnectStatus_=o,this.onServerInfoUpdate_=s,this.authTokenProvider_=a,this.appCheckTokenProvider_=c,this.authOverride_=l,this.id=t.nextPersistentConnectionId_++,this.log_=rg("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=kp,this.maxReconnectDelay_=Pre,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,l&&!Ki())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");ow.getInstance().on("visible",this.onVisible_,this),n.host.indexOf("fblocal")===-1&&Iy.getInstance().on("online",this.onOnline_,this)}sendRequest(n,r,i){let o=++this.requestNumber_,s={r:o,a:n,b:r};this.log_(xt(s)),q(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(s),i&&(this.requestCBHash_[o]=i)}get(n){this.initConnection_();let r=new cn,o={action:"g",request:{p:n._path.toString(),q:n._queryObject},onComplete:a=>{let c=a.d;a.s==="ok"?r.resolve(c):r.reject(c)}};this.outstandingGets_.push(o),this.outstandingGetCount_++;let s=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(s),r.promise}listen(n,r,i,o){this.initConnection_();let s=n._queryIdentifier,a=n._path.toString();this.log_("Listen called for "+a+" "+s),this.listens.has(a)||this.listens.set(a,new Map),q(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"listen() called for non-default but complete query"),q(!this.listens.get(a).has(s),"listen() called twice for same path/queryId.");let c={onComplete:o,hashFn:r,query:n,tag:i};this.listens.get(a).set(s,c),this.connected_&&this.sendListen_(c)}sendGet_(n){let r=this.outstandingGets_[n];this.sendRequest("g",r.request,i=>{delete this.outstandingGets_[n],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),r.onComplete&&r.onComplete(i)})}sendListen_(n){let r=n.query,i=r._path.toString(),o=r._queryIdentifier;this.log_("Listen on "+i+" for "+o);let s={p:i},a="q";n.tag&&(s.q=r._queryObject,s.t=n.tag),s.h=n.hashFn(),this.sendRequest(a,s,c=>{let l=c.d,d=c.s;t.warnOnListenWarnings_(l,r),(this.listens.get(i)&&this.listens.get(i).get(o))===n&&(this.log_("listen response",c),d!=="ok"&&this.removeListen_(i,o),n.onComplete&&n.onComplete(d,l))})}static warnOnListenWarnings_(n,r){if(n&&typeof n=="object"&&Vr(n,"w")){let i=Fs(n,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){let o='".indexOn": "'+r._queryParams.getIndex().toString()+'"',s=r._path.toString();xn(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${o} at ${s} to your security rules for better performance.`)}}}refreshAuthToken(n){this.authToken_=n,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(n)}reduceReconnectDelayIfAdminCredential_(n){(n&&n.length===40||hB(n))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=G2)}refreshAppCheckToken(n){this.appCheckToken_=n,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){let n=this.authToken_,r=dB(n)?"auth":"gauth",i={cred:n};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(r,i,o=>{let s=o.s,a=o.d||"error";this.authToken_===n&&(s==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(s,a))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},n=>{let r=n.s,i=n.d||"error";r==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(r,i)})}unlisten(n,r){let i=n._path.toString(),o=n._queryIdentifier;this.log_("Unlisten called for "+i+" "+o),q(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(i,o)&&this.connected_&&this.sendUnlisten_(i,o,n._queryObject,r)}sendUnlisten_(n,r,i,o){this.log_("Unlisten on "+n+" for "+r);let s={p:n},a="n";o&&(s.q=i,s.t=o),this.sendRequest(a,s)}onDisconnectPut(n,r,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",n,r,i):this.onDisconnectRequestQueue_.push({pathString:n,action:"o",data:r,onComplete:i})}onDisconnectMerge(n,r,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",n,r,i):this.onDisconnectRequestQueue_.push({pathString:n,action:"om",data:r,onComplete:i})}onDisconnectCancel(n,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",n,null,r):this.onDisconnectRequestQueue_.push({pathString:n,action:"oc",data:null,onComplete:r})}sendOnDisconnect_(n,r,i,o){let s={p:r,d:i};this.log_("onDisconnect "+n,s),this.sendRequest(n,s,a=>{o&&setTimeout(()=>{o(a.s,a.d)},Math.floor(0))})}put(n,r,i,o){this.putInternal("p",n,r,i,o)}merge(n,r,i,o){this.putInternal("m",n,r,i,o)}putInternal(n,r,i,o,s){this.initConnection_();let a={p:r,d:i};s!==void 0&&(a.h=s),this.outstandingPuts_.push({action:n,request:a,onComplete:o}),this.outstandingPutCount_++;let c=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(c):this.log_("Buffering put: "+r)}sendPut_(n){let r=this.outstandingPuts_[n].action,i=this.outstandingPuts_[n].request,o=this.outstandingPuts_[n].onComplete;this.outstandingPuts_[n].queued=this.connected_,this.sendRequest(r,i,s=>{this.log_(r+" response",s),delete this.outstandingPuts_[n],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),o&&o(s.s,s.d)})}reportStats(n){if(this.connected_){let r={c:n};this.log_("reportStats",r),this.sendRequest("s",r,i=>{if(i.s!=="ok"){let s=i.d;this.log_("reportStats","Error sending stats: "+s)}})}}onDataMessage_(n){if("r"in n){this.log_("from server: "+xt(n));let r=n.r,i=this.requestCBHash_[r];i&&(delete this.requestCBHash_[r],i(n.b))}else{if("error"in n)throw"A server-side error has occurred: "+n.error;"a"in n&&this.onDataPush_(n.a,n.b)}}onDataPush_(n,r){this.log_("handleServerMessage",n,r),n==="d"?this.onDataUpdate_(r.p,r.d,!1,r.t):n==="m"?this.onDataUpdate_(r.p,r.d,!0,r.t):n==="c"?this.onListenRevoked_(r.p,r.q):n==="ac"?this.onAuthRevoked_(r.s,r.d):n==="apc"?this.onAppCheckRevoked_(r.s,r.d):n==="sd"?this.onSecurityDebugPacket_(r):XN("Unrecognized action received from server: "+xt(n)+`
|
|
151
151
|
Are you using the latest client?`)}onReady_(n,r){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(n),this.lastSessionId=r,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(n){q(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(n))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(n){n&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=kp,this.realtime_||this.scheduleConnect_(0)),this.visible_=n}onOnline_(n){n?(this.log_("Browser went online."),this.reconnectDelay_=kp,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>kre&&(this.reconnectDelay_=kp),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());let n=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_),r=Math.max(0,this.reconnectDelay_-n);r=Math.random()*r,this.log_("Trying to reconnect in "+r+"ms"),this.scheduleConnect_(r),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*xre)}this.onConnectStatus_(!1)}establishConnection_(){return y(this,null,function*(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;let n=this.onDataMessage_.bind(this),r=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),o=this.id+":"+t.nextConnectionId_++,s=this.lastSessionId,a=!1,c=null,l=function(){c?c.close():(a=!0,i())},d=function(f){q(c,"sendRequest call when we're not connected not allowed."),c.sendRequest(f)};this.realtime_={close:l,sendRequest:d};let h=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{let[f,g]=yield Promise.all([this.authTokenProvider_.getToken(h),this.appCheckTokenProvider_.getToken(h)]);a?un("getToken() completed but was canceled"):(un("getToken() completed. Creating connection."),this.authToken_=f&&f.accessToken,this.appCheckToken_=g&&g.token,c=new rw(o,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,n,r,i,E=>{xn(E+" ("+this.repoInfo_.toString()+")"),this.interrupt(Fre)},s))}catch(f){this.log_("Failed to get token: "+f),a||(this.repoInfo_.nodeAdmin&&xn(f),l())}}})}interrupt(n){un("Interrupting connection for reason: "+n),this.interruptReasons_[n]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(n){un("Resuming connection for reason: "+n),delete this.interruptReasons_[n],fp(this.interruptReasons_)&&(this.reconnectDelay_=kp,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(n){let r=n-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:r})}cancelSentTransactions_(){for(let n=0;n<this.outstandingPuts_.length;n++){let r=this.outstandingPuts_[n];r&&"h"in r.request&&r.queued&&(r.onComplete&&r.onComplete("disconnect"),delete this.outstandingPuts_[n],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(n,r){let i;r?i=r.map(s=>zw(s)).join("$"):i="default";let o=this.removeListen_(n,i);o&&o.onComplete&&o.onComplete("permission_denied")}removeListen_(n,r){let i=new Be(n).toString(),o;if(this.listens.has(i)){let s=this.listens.get(i);o=s.get(r),s.delete(r),s.size===0&&this.listens.delete(i)}else o=void 0;return o}onAuthRevoked_(n,r){un("Auth token revoked: "+n+"/"+r),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(n==="invalid_token"||n==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=j2&&(this.reconnectDelay_=G2,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(n,r){un("App check token revoked: "+n+"/"+r),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(n==="invalid_token"||n==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=j2&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(n){this.securityDebugCallback_?this.securityDebugCallback_(n):"msg"in n&&console.log("FIREBASE: "+n.msg.replace(`
|
|
152
152
|
`,`
|
|
153
|
-
FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(let n of this.listens.values())for(let r of n.values())this.sendListen_(r);for(let n=0;n<this.outstandingPuts_.length;n++)this.outstandingPuts_[n]&&this.sendPut_(n);for(;this.onDisconnectRequestQueue_.length;){let n=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(n.action,n.pathString,n.data,n.onComplete)}for(let n=0;n<this.outstandingGets_.length;n++)this.outstandingGets_[n]&&this.sendGet_(n)}sendConnectStats_(){let n={},r="js";Ki()&&(this.repoInfo_.nodeAdmin?r="admin_node":r="node"),n["sdk."+r+"."+Ww.replace(/\./g,"-")]=1,hp()?n["framework.cordova"]=1:UT()&&(n["framework.reactnative"]=1),this.reportStats(n)}shouldReconnect_(){let n=Iy.getInstance().currentlyOnline();return fp(this.interruptReasons_)&&n}}t.nextPersistentConnectionId_=0,t.nextConnectionId_=0;return t})(),Oe=class t{constructor(e,n){this.name=e,this.node=n}static Wrap(e,n){return new t(e,n)}};var vd=class{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,n){let r=new Oe(tl,e),i=new Oe(tl,n);return this.compare(r,i)!==0}minPost(){return Oe.MIN}};var py,vy=class extends vd{static get __EMPTY_NODE(){return py}static set __EMPTY_NODE(e){py=e}compare(e,n){return al(e.name,n.name)}isDefinedOn(e){throw kc("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,n){return!1}minPost(){return Oe.MIN}maxPost(){return new Oe(Zs,py)}makePost(e,n){return q(typeof e=="string","KeyIndex indexValue must always be a string."),new Oe(e,py)}toString(){return".key"}},el=new vy;var yd=class{constructor(e,n,r,i,o=null){this.isReverse_=i,this.resultGenerator_=o,this.nodeStack_=[];let s=1;for(;!e.isEmpty();)if(e=e,s=n?r(e.key,n):1,i&&(s*=-1),s<0)this.isReverse_?e=e.left:e=e.right;else if(s===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),n;if(this.resultGenerator_?n=this.resultGenerator_(e.key,e.value):n={key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return n}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}},ui=(()=>{class t{constructor(n,r,i,o,s){this.key=n,this.value=r,this.color=i??t.RED,this.left=o??Hr.EMPTY_NODE,this.right=s??Hr.EMPTY_NODE}copy(n,r,i,o,s){return new t(n??this.key,r??this.value,i??this.color,o??this.left,s??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(n){return this.left.inorderTraversal(n)||!!n(this.key,this.value)||this.right.inorderTraversal(n)}reverseTraversal(n){return this.right.reverseTraversal(n)||n(this.key,this.value)||this.left.reverseTraversal(n)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(n,r,i){let o=this,s=i(n,o.key);return s<0?o=o.copy(null,null,null,o.left.insert(n,r,i),null):s===0?o=o.copy(null,r,null,null,null):o=o.copy(null,null,null,null,o.right.insert(n,r,i)),o.fixUp_()}removeMin_(){if(this.left.isEmpty())return Hr.EMPTY_NODE;let n=this;return!n.left.isRed_()&&!n.left.left.isRed_()&&(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.removeMin_(),null),n.fixUp_()}remove(n,r){let i,o;if(i=this,r(n,i.key)<0)!i.left.isEmpty()&&!i.left.isRed_()&&!i.left.left.isRed_()&&(i=i.moveRedLeft_()),i=i.copy(null,null,null,i.left.remove(n,r),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),!i.right.isEmpty()&&!i.right.isRed_()&&!i.right.left.isRed_()&&(i=i.moveRedRight_()),r(n,i.key)===0){if(i.right.isEmpty())return Hr.EMPTY_NODE;o=i.right.min_(),i=i.copy(o.key,o.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(n,r))}return i.fixUp_()}isRed_(){return this.color}fixUp_(){let n=this;return n.right.isRed_()&&!n.left.isRed_()&&(n=n.rotateLeft_()),n.left.isRed_()&&n.left.left.isRed_()&&(n=n.rotateRight_()),n.left.isRed_()&&n.right.isRed_()&&(n=n.colorFlip_()),n}moveRedLeft_(){let n=this.colorFlip_();return n.right.left.isRed_()&&(n=n.copy(null,null,null,null,n.right.rotateRight_()),n=n.rotateLeft_(),n=n.colorFlip_()),n}moveRedRight_(){let n=this.colorFlip_();return n.left.left.isRed_()&&(n=n.rotateRight_(),n=n.colorFlip_()),n}rotateLeft_(){let n=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,n,null)}rotateRight_(){let n=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,n)}colorFlip_(){let n=this.left.copy(null,null,!this.left.color,null,null),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,r)}checkMaxDepth_(){let n=this.check_();return Math.pow(2,n)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");let n=this.left.check_();if(n!==this.right.check_())throw new Error("Black depths differ");return n+(this.isRed_()?0:1)}}return t.RED=!0,t.BLACK=!1,t})(),sw=class{copy(e,n,r,i,o){return this}insert(e,n,r){return new ui(e,n,null)}remove(e,n){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}},Hr=class t{constructor(e,n=t.EMPTY_NODE){this.comparator_=e,this.root_=n}insert(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,ui.BLACK,null,null))}remove(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,ui.BLACK,null,null))}get(e){let n,r=this.root_;for(;!r.isEmpty();){if(n=this.comparator_(e,r.key),n===0)return r.value;n<0?r=r.left:n>0&&(r=r.right)}return null}getPredecessorKey(e){let n,r=this.root_,i=null;for(;!r.isEmpty();)if(n=this.comparator_(e,r.key),n===0){if(r.left.isEmpty())return i?i.key:null;for(r=r.left;!r.right.isEmpty();)r=r.right;return r.key}else n<0?r=r.left:n>0&&(i=r,r=r.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new yd(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,n){return new yd(this.root_,e,this.comparator_,!1,n)}getReverseIteratorFrom(e,n){return new yd(this.root_,e,this.comparator_,!0,n)}getReverseIterator(e){return new yd(this.root_,null,this.comparator_,!0,e)}};Hr.EMPTY_NODE=new sw;function Ure(t,e){return al(t.name,e.name)}function Qw(t,e){return al(t,e)}var aw;function Vre(t){aw=t}var bj=function(t){return typeof t=="number"?"number:"+dj(t):"string:"+t},Oj=function(t){if(t.isLeafNode()){let e=t.val();q(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Vr(e,".sv"),"Priority must be a string or number.")}else q(t===aw||t.isEmpty(),"priority of unexpected type.");q(t===aw||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};var H2,Sd=(()=>{class t{static set __childrenNodeConstructor(n){H2=n}static get __childrenNodeConstructor(){return H2}constructor(n,r=t.__childrenNodeConstructor.EMPTY_NODE){this.value_=n,this.priorityNode_=r,this.lazyHash_=null,q(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),Oj(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(n){return new t(this.value_,n)}getImmediateChild(n){return n===".priority"?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE}getChild(n){return we(n)?this:Ne(n)===".priority"?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(n,r){return null}updateImmediateChild(n,r){return n===".priority"?this.updatePriority(r):r.isEmpty()&&n!==".priority"?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(n,r).updatePriority(this.priorityNode_)}updateChild(n,r){let i=Ne(n);return i===null?r:r.isEmpty()&&i!==".priority"?this:(q(i!==".priority"||ea(n)===1,".priority must be the last token in a path"),this.updateImmediateChild(i,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(at(n),r)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(n,r){return!1}val(n){return n&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let n="";this.priorityNode_.isEmpty()||(n+="priority:"+bj(this.priorityNode_.val())+":");let r=typeof this.value_;n+=r+":",r==="number"?n+=dj(this.value_):n+=this.value_,this.lazyHash_=lj(n)}return this.lazyHash_}getValue(){return this.value_}compareTo(n){return n===t.__childrenNodeConstructor.EMPTY_NODE?1:n instanceof t.__childrenNodeConstructor?-1:(q(n.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(n))}compareToLeafNode_(n){let r=typeof n.value_,i=typeof this.value_,o=t.VALUE_TYPE_ORDER.indexOf(r),s=t.VALUE_TYPE_ORDER.indexOf(i);return q(o>=0,"Unknown leaf type: "+r),q(s>=0,"Unknown leaf type: "+i),o===s?i==="object"?0:this.value_<n.value_?-1:this.value_===n.value_?0:1:s-o}withIndex(){return this}isIndexed(){return!0}equals(n){if(n===this)return!0;if(n.isLeafNode()){let r=n;return this.value_===r.value_&&this.priorityNode_.equals(r.priorityNode_)}else return!1}}t.VALUE_TYPE_ORDER=["object","boolean","number","string"];return t})(),Mj,Lj;function Bre(t){Mj=t}function Gre(t){Lj=t}var cw=class extends vd{compare(e,n){let r=e.node.getPriority(),i=n.node.getPriority(),o=r.compareTo(i);return o===0?al(e.name,n.name):o}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,n){return!e.getPriority().equals(n.getPriority())}minPost(){return Oe.MIN}maxPost(){return new Oe(Zs,new Sd("[PRIORITY-POST]",Lj))}makePost(e,n){let r=Mj(e);return new Oe(n,new Sd("[PRIORITY-POST]",r))}toString(){return".priority"}},ft=new cw;var jre=Math.log(2),lw=class{constructor(e){let n=o=>parseInt(Math.log(o)/jre,10),r=o=>parseInt(Array(o+1).join("1"),2);this.count=n(e+1),this.current_=this.count-1;let i=r(this.count);this.bits_=e+1&i}nextBitIsOne(){let e=!(this.bits_&1<<this.current_);return this.current_--,e}},Sy=function(t,e,n,r){t.sort(e);let i=function(c,l){let d=l-c,h,f;if(d===0)return null;if(d===1)return h=t[c],f=n?n(h):h,new ui(f,h.node,ui.BLACK,null,null);{let g=parseInt(d/2,10)+c,E=i(c,g),I=i(g+1,l);return h=t[g],f=n?n(h):h,new ui(f,h.node,ui.BLACK,E,I)}},o=function(c){let l=null,d=null,h=t.length,f=function(E,I){let S=h-E,L=h;h-=E;let V=i(S+1,L),K=t[S],oe=n?n(K):K;g(new ui(oe,K.node,I,null,V))},g=function(E){l?(l.left=E,l=E):(d=E,l=E)};for(let E=0;E<c.count;++E){let I=c.nextBitIsOne(),S=Math.pow(2,c.count-(E+1));I?f(S,ui.BLACK):(f(S,ui.BLACK),f(S,ui.RED))}return d},s=new lw(t.length),a=o(s);return new Hr(r||e,a)};var HN,_d={},Ad=class t{static get Default(){return q(_d&&ft,"ChildrenNode.ts has not been loaded"),HN=HN||new t({".priority":_d},{".priority":ft}),HN}constructor(e,n){this.indexes_=e,this.indexSet_=n}get(e){let n=Fs(this.indexes_,e);if(!n)throw new Error("No index defined for "+e);return n instanceof Hr?n:null}hasIndex(e){return Vr(this.indexSet_,e.toString())}addIndex(e,n){q(e!==el,"KeyIndex always exists and isn't meant to be added to the IndexMap.");let r=[],i=!1,o=n.getIterator(Oe.Wrap),s=o.getNext();for(;s;)i=i||e.isDefinedOn(s.node),r.push(s),s=o.getNext();let a;i?a=Sy(r,e.getCompare()):a=_d;let c=e.toString(),l=Object.assign({},this.indexSet_);l[c]=e;let d=Object.assign({},this.indexes_);return d[c]=a,new t(d,l)}addToIndexes(e,n){let r=pp(this.indexes_,(i,o)=>{let s=Fs(this.indexSet_,o);if(q(s,"Missing index implementation for "+o),i===_d)if(s.isDefinedOn(e.node)){let a=[],c=n.getIterator(Oe.Wrap),l=c.getNext();for(;l;)l.name!==e.name&&a.push(l),l=c.getNext();return a.push(e),Sy(a,s.getCompare())}else return _d;else{let a=n.get(e.name),c=i;return a&&(c=c.remove(new Oe(e.name,a))),c.insert(e,e.node)}});return new t(r,this.indexSet_)}removeFromIndexes(e,n){let r=pp(this.indexes_,i=>{if(i===_d)return i;{let o=n.get(e.name);return o?i.remove(new Oe(e.name,o)):i}});return new t(r,this.indexSet_)}};var Fp,ve=(()=>{class t{static get EMPTY_NODE(){return Fp||(Fp=new t(new Hr(Qw),null,Ad.Default))}constructor(n,r,i){this.children_=n,this.priorityNode_=r,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&Oj(this.priorityNode_),this.children_.isEmpty()&&q(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Fp}updatePriority(n){return this.children_.isEmpty()?this:new t(this.children_,n,this.indexMap_)}getImmediateChild(n){if(n===".priority")return this.getPriority();{let r=this.children_.get(n);return r===null?Fp:r}}getChild(n){let r=Ne(n);return r===null?this:this.getImmediateChild(r).getChild(at(n))}hasChild(n){return this.children_.get(n)!==null}updateImmediateChild(n,r){if(q(r,"We should always be passing snapshot nodes"),n===".priority")return this.updatePriority(r);{let i=new Oe(n,r),o,s;r.isEmpty()?(o=this.children_.remove(n),s=this.indexMap_.removeFromIndexes(i,this.children_)):(o=this.children_.insert(n,r),s=this.indexMap_.addToIndexes(i,this.children_));let a=o.isEmpty()?Fp:this.priorityNode_;return new t(o,a,s)}}updateChild(n,r){let i=Ne(n);if(i===null)return r;{q(Ne(n)!==".priority"||ea(n)===1,".priority must be the last token in a path");let o=this.getImmediateChild(i).updateChild(at(n),r);return this.updateImmediateChild(i,o)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(n){if(this.isEmpty())return null;let r={},i=0,o=0,s=!0;if(this.forEachChild(ft,(a,c)=>{r[a]=c.val(n),i++,s&&t.INTEGER_REGEXP_.test(a)?o=Math.max(o,Number(a)):s=!1}),!n&&s&&o<2*i){let a=[];for(let c in r)a[c]=r[c];return a}else return n&&!this.getPriority().isEmpty()&&(r[".priority"]=this.getPriority().val()),r}hash(){if(this.lazyHash_===null){let n="";this.getPriority().isEmpty()||(n+="priority:"+bj(this.getPriority().val())+":"),this.forEachChild(ft,(r,i)=>{let o=i.hash();o!==""&&(n+=":"+r+":"+o)}),this.lazyHash_=n===""?"":lj(n)}return this.lazyHash_}getPredecessorChildName(n,r,i){let o=this.resolveIndex_(i);if(o){let s=o.getPredecessorKey(new Oe(n,r));return s?s.name:null}else return this.children_.getPredecessorKey(n)}getFirstChildName(n){let r=this.resolveIndex_(n);if(r){let i=r.minKey();return i&&i.name}else return this.children_.minKey()}getFirstChild(n){let r=this.getFirstChildName(n);return r?new Oe(r,this.children_.get(r)):null}getLastChildName(n){let r=this.resolveIndex_(n);if(r){let i=r.maxKey();return i&&i.name}else return this.children_.maxKey()}getLastChild(n){let r=this.getLastChildName(n);return r?new Oe(r,this.children_.get(r)):null}forEachChild(n,r){let i=this.resolveIndex_(n);return i?i.inorderTraversal(o=>r(o.name,o.node)):this.children_.inorderTraversal(r)}getIterator(n){return this.getIteratorFrom(n.minPost(),n)}getIteratorFrom(n,r){let i=this.resolveIndex_(r);if(i)return i.getIteratorFrom(n,o=>o);{let o=this.children_.getIteratorFrom(n.name,Oe.Wrap),s=o.peek();for(;s!=null&&r.compare(s,n)<0;)o.getNext(),s=o.peek();return o}}getReverseIterator(n){return this.getReverseIteratorFrom(n.maxPost(),n)}getReverseIteratorFrom(n,r){let i=this.resolveIndex_(r);if(i)return i.getReverseIteratorFrom(n,o=>o);{let o=this.children_.getReverseIteratorFrom(n.name,Oe.Wrap),s=o.peek();for(;s!=null&&r.compare(s,n)>0;)o.getNext(),s=o.peek();return o}}compareTo(n){return this.isEmpty()?n.isEmpty()?0:-1:n.isLeafNode()||n.isEmpty()?1:n===ig?-1:0}withIndex(n){if(n===el||this.indexMap_.hasIndex(n))return this;{let r=this.indexMap_.addIndex(n,this.children_);return new t(this.children_,this.priorityNode_,r)}}isIndexed(n){return n===el||this.indexMap_.hasIndex(n)}equals(n){if(n===this)return!0;if(n.isLeafNode())return!1;{let r=n;if(this.getPriority().equals(r.getPriority()))if(this.children_.count()===r.children_.count()){let i=this.getIterator(ft),o=r.getIterator(ft),s=i.getNext(),a=o.getNext();for(;s&&a;){if(s.name!==a.name||!s.node.equals(a.node))return!1;s=i.getNext(),a=o.getNext()}return s===null&&a===null}else return!1;else return!1}}resolveIndex_(n){return n===el?null:this.indexMap_.get(n.toString())}}return t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t})(),uw=class extends ve{constructor(){super(new Hr(Qw),ve.EMPTY_NODE,Ad.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return ve.EMPTY_NODE}isEmpty(){return!1}},ig=new uw;Object.defineProperties(Oe,{MIN:{value:new Oe(tl,ve.EMPTY_NODE)},MAX:{value:new Oe(Zs,ig)}});vy.__EMPTY_NODE=ve.EMPTY_NODE;Sd.__childrenNodeConstructor=ve;Vre(ig);Gre(ig);var Hre=!0;function At(t,e=null){if(t===null)return ve.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),q(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){let n=t;return new Sd(n,At(e))}if(!(t instanceof Array)&&Hre){let n=[],r=!1;if(dn(t,(s,a)=>{if(s.substring(0,1)!=="."){let c=At(a);c.isEmpty()||(r=r||!c.getPriority().isEmpty(),n.push(new Oe(s,c)))}}),n.length===0)return ve.EMPTY_NODE;let o=Sy(n,Ure,s=>s.name,Qw);if(r){let s=Sy(n,ft.getCompare());return new ve(o,At(e),new Ad({".priority":s},{".priority":ft}))}else return new ve(o,At(e),Ad.Default)}else{let n=ve.EMPTY_NODE;return dn(t,(r,i)=>{if(Vr(t,r)&&r.substring(0,1)!=="."){let o=At(i);(o.isLeafNode()||!o.isEmpty())&&(n=n.updateImmediateChild(r,o))}}),n.updatePriority(At(e))}}Bre(At);var Wp=class extends vd{constructor(e){super(),this.indexPath_=e,q(!we(e)&&Ne(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,n){let r=this.extractChild(e.node),i=this.extractChild(n.node),o=r.compareTo(i);return o===0?al(e.name,n.name):o}makePost(e,n){let r=At(e),i=ve.EMPTY_NODE.updateChild(this.indexPath_,r);return new Oe(n,i)}maxPost(){let e=ve.EMPTY_NODE.updateChild(this.indexPath_,ig);return new Oe(Zs,e)}toString(){return $p(this.indexPath_,0).join("/")}};var dw=class extends vd{compare(e,n){let r=e.node.compareTo(n.node);return r===0?al(e.name,n.name):r}isDefinedOn(e){return!0}indexedValueChanged(e,n){return!e.equals(n)}minPost(){return Oe.MIN}maxPost(){return Oe.MAX}makePost(e,n){let r=At(e);return new Oe(n,r)}toString(){return".value"}},Pj=new dw;function xj(t){return{type:"value",snapshotNode:t}}function Cd(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function zp(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function qp(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}function $re(t,e){return{type:"child_moved",snapshotNode:e,childName:t}}var Kp=class{constructor(e){this.index_=e}updateChild(e,n,r,i,o,s){q(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");let a=e.getImmediateChild(n);return a.getChild(i).equals(r.getChild(i))&&a.isEmpty()===r.isEmpty()||(s!=null&&(r.isEmpty()?e.hasChild(n)?s.trackChildChange(zp(n,a)):q(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?s.trackChildChange(Cd(n,r)):s.trackChildChange(qp(n,r,a))),e.isLeafNode()&&r.isEmpty())?e:e.updateImmediateChild(n,r).withIndex(this.index_)}updateFullNode(e,n,r){return r!=null&&(e.isLeafNode()||e.forEachChild(ft,(i,o)=>{n.hasChild(i)||r.trackChildChange(zp(i,o))}),n.isLeafNode()||n.forEachChild(ft,(i,o)=>{if(e.hasChild(i)){let s=e.getImmediateChild(i);s.equals(o)||r.trackChildChange(qp(i,o,s))}else r.trackChildChange(Cd(i,o))})),n.withIndex(this.index_)}updatePriority(e,n){return e.isEmpty()?ve.EMPTY_NODE:e.updatePriority(n)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}};var Ay=class t{constructor(e){this.indexedFilter_=new Kp(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){let n=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,r=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return n&&r}updateChild(e,n,r,i,o,s){return this.matches(new Oe(n,r))||(r=ve.EMPTY_NODE),this.indexedFilter_.updateChild(e,n,r,i,o,s)}updateFullNode(e,n,r){n.isLeafNode()&&(n=ve.EMPTY_NODE);let i=n.withIndex(this.index_);i=i.updatePriority(ve.EMPTY_NODE);let o=this;return n.forEachChild(ft,(s,a)=>{o.matches(new Oe(s,a))||(i=i.updateImmediateChild(s,ve.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,i,r)}updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){let n=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),n)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){let n=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),n)}else return e.getIndex().maxPost()}};var hw=class{constructor(e){this.withinDirectionalStart=n=>this.reverse_?this.withinEndPost(n):this.withinStartPost(n),this.withinDirectionalEnd=n=>this.reverse_?this.withinStartPost(n):this.withinEndPost(n),this.withinStartPost=n=>{let r=this.index_.compare(this.rangedFilter_.getStartPost(),n);return this.startIsInclusive_?r<=0:r<0},this.withinEndPost=n=>{let r=this.index_.compare(n,this.rangedFilter_.getEndPost());return this.endIsInclusive_?r<=0:r<0},this.rangedFilter_=new Ay(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,n,r,i,o,s){return this.rangedFilter_.matches(new Oe(n,r))||(r=ve.EMPTY_NODE),e.getImmediateChild(n).equals(r)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,n,r,i,o,s):this.fullLimitUpdateChild_(e,n,r,o,s)}updateFullNode(e,n,r){let i;if(n.isLeafNode()||n.isEmpty())i=ve.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<n.numChildren()&&n.isIndexed(this.index_)){i=ve.EMPTY_NODE.withIndex(this.index_);let o;this.reverse_?o=n.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):o=n.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let s=0;for(;o.hasNext()&&s<this.limit_;){let a=o.getNext();if(this.withinDirectionalStart(a))if(this.withinDirectionalEnd(a))i=i.updateImmediateChild(a.name,a.node),s++;else break;else continue}}else{i=n.withIndex(this.index_),i=i.updatePriority(ve.EMPTY_NODE);let o;this.reverse_?o=i.getReverseIterator(this.index_):o=i.getIterator(this.index_);let s=0;for(;o.hasNext();){let a=o.getNext();s<this.limit_&&this.withinDirectionalStart(a)&&this.withinDirectionalEnd(a)?s++:i=i.updateImmediateChild(a.name,ve.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,i,r)}updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,n,r,i,o){let s;if(this.reverse_){let h=this.index_.getCompare();s=(f,g)=>h(g,f)}else s=this.index_.getCompare();let a=e;q(a.numChildren()===this.limit_,"");let c=new Oe(n,r),l=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),d=this.rangedFilter_.matches(c);if(a.hasChild(n)){let h=a.getImmediateChild(n),f=i.getChildAfterChild(this.index_,l,this.reverse_);for(;f!=null&&(f.name===n||a.hasChild(f.name));)f=i.getChildAfterChild(this.index_,f,this.reverse_);let g=f==null?1:s(f,c);if(d&&!r.isEmpty()&&g>=0)return o?.trackChildChange(qp(n,r,h)),a.updateImmediateChild(n,r);{o?.trackChildChange(zp(n,h));let I=a.updateImmediateChild(n,ve.EMPTY_NODE);return f!=null&&this.rangedFilter_.matches(f)?(o?.trackChildChange(Cd(f.name,f.node)),I.updateImmediateChild(f.name,f.node)):I}}else return r.isEmpty()?e:d&&s(l,c)>=0?(o!=null&&(o.trackChildChange(zp(l.name,l.node)),o.trackChildChange(Cd(n,r))),a.updateImmediateChild(n,r).updateImmediateChild(l.name,ve.EMPTY_NODE)):e}};var fw=class t{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=ft}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return q(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return q(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:tl}hasEnd(){return this.endSet_}getIndexEndValue(){return q(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return q(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:Zs}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return q(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===ft}copy(){let e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}};function Wre(t){return t.loadsAllData()?new Kp(t.getIndex()):t.hasLimit()?new hw(t):new Ay(t)}function zre(t,e){let n=t.copy();return n.limitSet_=!0,n.limit_=e,n.viewFrom_="r",n}function qre(t,e,n){let r=t.copy();return r.startSet_=!0,e===void 0&&(e=null),r.indexStartValue_=e,n!=null?(r.startNameSet_=!0,r.indexStartName_=n):(r.startNameSet_=!1,r.indexStartName_=""),r}function Kre(t,e,n){let r=t.copy();return r.endSet_=!0,e===void 0&&(e=null),r.indexEndValue_=e,n!==void 0?(r.endNameSet_=!0,r.indexEndName_=n):(r.endNameSet_=!1,r.indexEndName_=""),r}function Yre(t,e){let n=t.copy();return n.index_=e,n}function $2(t){let e={};if(t.isDefault())return e;let n;if(t.index_===ft?n="$priority":t.index_===Pj?n="$value":t.index_===el?n="$key":(q(t.index_ instanceof Wp,"Unrecognized index type!"),n=t.index_.toString()),e.orderBy=xt(n),t.startSet_){let r=t.startAfterSet_?"startAfter":"startAt";e[r]=xt(t.indexStartValue_),t.startNameSet_&&(e[r]+=","+xt(t.indexStartName_))}if(t.endSet_){let r=t.endBeforeSet_?"endBefore":"endAt";e[r]=xt(t.indexEndValue_),t.endNameSet_&&(e[r]+=","+xt(t.indexEndName_))}return t.limitSet_&&(t.isViewFromLeft()?e.limitToFirst=t.limit_:e.limitToLast=t.limit_),e}function W2(t){let e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_),e.sin=!t.startAfterSet_),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_),e.ein=!t.endBeforeSet_),t.limitSet_){e.l=t.limit_;let n=t.viewFrom_;n===""&&(t.isViewFromLeft()?n="l":n="r"),e.vf=n}return t.index_!==ft&&(e.i=t.index_.toString()),e}var pw=class t extends Ty{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,n){return n!==void 0?"tag$"+n:(q(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,n,r,i){super(),this.repoInfo_=e,this.onDataUpdate_=n,this.authTokenProvider_=r,this.appCheckTokenProvider_=i,this.log_=rg("p:rest:"),this.listens_={}}listen(e,n,r,i){let o=e._path.toString();this.log_("Listen called for "+o+" "+e._queryIdentifier);let s=t.getListenId_(e,r),a={};this.listens_[s]=a;let c=$2(e._queryParams);this.restRequest_(o+".json",c,(l,d)=>{let h=d;if(l===404&&(h=null,l=null),l===null&&this.onDataUpdate_(o,h,!1,r),Fs(this.listens_,s)===a){let f;l?l===401?f="permission_denied":f="rest_error:"+l:f="ok",i(f,null)}})}unlisten(e,n){let r=t.getListenId_(e,n);delete this.listens_[r]}get(e){let n=$2(e._queryParams),r=e._path.toString(),i=new cn;return this.restRequest_(r+".json",n,(o,s)=>{let a=s;o===404&&(a=null,o=null),o===null?(this.onDataUpdate_(r,a,!1,null),i.resolve(a)):i.reject(new Error(a))}),i.promise}refreshAuthToken(e){}restRequest_(e,n={},r){return n.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([i,o])=>{i&&i.accessToken&&(n.auth=i.accessToken),o&&o.token&&(n.ac=o.token);let s=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+gp(n);this.log_("Sending REST request for "+s);let a=new XMLHttpRequest;a.onreadystatechange=()=>{if(r&&a.readyState===4){this.log_("REST Response for "+s+" received. status:",a.status,"response:",a.responseText);let c=null;if(a.status>=200&&a.status<300){try{c=ad(a.responseText)}catch{xn("Failed to parse JSON response for "+s+": "+a.responseText)}r(null,c)}else a.status!==401&&a.status!==404&&xn("Got unsuccessful REST response for "+s+" Status: "+a.status),r(a.status);r=null}},a.open("GET",s,!0),a.send()})}};var gw=class{constructor(){this.rootNode_=ve.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,n){this.rootNode_=this.rootNode_.updateChild(e,n)}};function Cy(){return{value:null,children:new Map}}function Od(t,e,n){if(we(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{let r=Ne(e);t.children.has(r)||t.children.set(r,Cy());let i=t.children.get(r);e=at(e),Od(i,e,n)}}function mw(t,e){if(we(e))return t.value=null,t.children.clear(),!0;if(t.value!==null){if(t.value.isLeafNode())return!1;{let n=t.value;return t.value=null,n.forEachChild(ft,(r,i)=>{Od(t,new Be(r),i)}),mw(t,e)}}else if(t.children.size>0){let n=Ne(e);return e=at(e),t.children.has(n)&&mw(t.children.get(n),e)&&t.children.delete(n),t.children.size===0}else return!0}function Ew(t,e,n){t.value!==null?n(e,t.value):Xre(t,(r,i)=>{let o=new Be(e.toString()+"/"+r);Ew(i,o,n)})}function Xre(t,e){t.children.forEach((n,r)=>{e(r,n)})}var _w=class{constructor(e){this.collection_=e,this.last_=null}get(){let e=this.collection_.get(),n=Object.assign({},e);return this.last_&&dn(this.last_,(r,i)=>{n[r]=n[r]-i}),this.last_=e,n}};var z2=10*1e3,Qre=30*1e3,Jre=300*1e3,Tw=class{constructor(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new _w(e);let r=z2+(Qre-z2)*Math.random();Vp(this.reportStats_.bind(this),Math.floor(r))}reportStats_(){let e=this.statsListener_.get(),n={},r=!1;dn(e,(i,o)=>{o>0&&Vr(this.statsToReport_,i)&&(n[i]=o,r=!0)}),r&&this.server_.reportStats(n),Vp(this.reportStats_.bind(this),Math.floor(Math.random()*2*Jre))}};var Zi=(function(t){return t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE",t})(Zi||{});function Jw(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function Zw(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function eb(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}var yw=class t{constructor(e,n,r){this.path=e,this.affectedTree=n,this.revert=r,this.type=Zi.ACK_USER_WRITE,this.source=Jw()}operationForChild(e){if(we(this.path)){if(this.affectedTree.value!=null)return q(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{let n=this.affectedTree.subtree(new Be(e));return new t(Ve(),n,this.revert)}}else return q(Ne(this.path)===e,"operationForChild called for unrelated child."),new t(at(this.path),this.affectedTree,this.revert)}};var Dy=class t{constructor(e,n){this.source=e,this.path=n,this.type=Zi.LISTEN_COMPLETE}operationForChild(e){return we(this.path)?new t(this.source,Ve()):new t(this.source,at(this.path))}};var Dd=class t{constructor(e,n,r){this.source=e,this.path=n,this.snap=r,this.type=Zi.OVERWRITE}operationForChild(e){return we(this.path)?new t(this.source,Ve(),this.snap.getImmediateChild(e)):new t(this.source,at(this.path),this.snap)}};var Yp=class t{constructor(e,n,r){this.source=e,this.path=n,this.children=r,this.type=Zi.MERGE}operationForChild(e){if(we(this.path)){let n=this.children.subtree(new Be(e));return n.isEmpty()?null:n.value?new Dd(this.source,Ve(),n.value):new t(this.source,Ve(),n)}else return q(Ne(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,at(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}};var eo=class{constructor(e,n,r){this.node_=e,this.fullyInitialized_=n,this.filtered_=r}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(we(e))return this.isFullyInitialized()&&!this.filtered_;let n=Ne(e);return this.isCompleteForChild(n)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}};var Iw=class{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}};function Zre(t,e,n,r){let i=[],o=[];return e.forEach(s=>{s.type==="child_changed"&&t.index_.indexedValueChanged(s.oldSnap,s.snapshotNode)&&o.push($re(s.childName,s.snapshotNode))}),Up(t,i,"child_removed",e,r,n),Up(t,i,"child_added",e,r,n),Up(t,i,"child_moved",o,r,n),Up(t,i,"child_changed",e,r,n),Up(t,i,"value",e,r,n),i}function Up(t,e,n,r,i,o){let s=r.filter(a=>a.type===n);s.sort((a,c)=>tie(t,a,c)),s.forEach(a=>{let c=eie(t,a,o);i.forEach(l=>{l.respondsTo(a.type)&&e.push(l.createEvent(c,t.query_))})})}function eie(t,e,n){return e.type==="value"||e.type==="child_removed"||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}function tie(t,e,n){if(e.childName==null||n.childName==null)throw kc("Should only compare child_ events.");let r=new Oe(e.childName,e.snapshotNode),i=new Oe(n.childName,n.snapshotNode);return t.index_.compare(r,i)}function Gy(t,e){return{eventCache:t,serverCache:e}}function Gp(t,e,n,r){return Gy(new eo(e,n,r),t.serverCache)}function kj(t,e,n,r){return Gy(t.eventCache,new eo(e,n,r))}function Ry(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function nl(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}var $N,nie=()=>($N||($N=new Hr(ere)),$N),qn=class t{static fromObject(e){let n=new t(null);return dn(e,(r,i)=>{n=n.set(new Be(r),i)}),n}constructor(e,n=nie()){this.value=e,this.children=n}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,n){if(this.value!=null&&n(this.value))return{path:Ve(),value:this.value};if(we(e))return null;{let r=Ne(e),i=this.children.get(r);if(i!==null){let o=i.findRootMostMatchingPathAndValue(at(e),n);return o!=null?{path:Ct(new Be(r),o.path),value:o.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(we(e))return this;{let n=Ne(e),r=this.children.get(n);return r!==null?r.subtree(at(e)):new t(null)}}set(e,n){if(we(e))return new t(n,this.children);{let r=Ne(e),o=(this.children.get(r)||new t(null)).set(at(e),n),s=this.children.insert(r,o);return new t(this.value,s)}}remove(e){if(we(e))return this.children.isEmpty()?new t(null):new t(null,this.children);{let n=Ne(e),r=this.children.get(n);if(r){let i=r.remove(at(e)),o;return i.isEmpty()?o=this.children.remove(n):o=this.children.insert(n,i),this.value===null&&o.isEmpty()?new t(null):new t(this.value,o)}else return this}}get(e){if(we(e))return this.value;{let n=Ne(e),r=this.children.get(n);return r?r.get(at(e)):null}}setTree(e,n){if(we(e))return n;{let r=Ne(e),o=(this.children.get(r)||new t(null)).setTree(at(e),n),s;return o.isEmpty()?s=this.children.remove(r):s=this.children.insert(r,o),new t(this.value,s)}}fold(e){return this.fold_(Ve(),e)}fold_(e,n){let r={};return this.children.inorderTraversal((i,o)=>{r[i]=o.fold_(Ct(e,i),n)}),n(e,this.value,r)}findOnPath(e,n){return this.findOnPath_(e,Ve(),n)}findOnPath_(e,n,r){let i=this.value?r(n,this.value):!1;if(i)return i;if(we(e))return null;{let o=Ne(e),s=this.children.get(o);return s?s.findOnPath_(at(e),Ct(n,o),r):null}}foreachOnPath(e,n){return this.foreachOnPath_(e,Ve(),n)}foreachOnPath_(e,n,r){if(we(e))return this;{this.value&&r(n,this.value);let i=Ne(e),o=this.children.get(i);return o?o.foreachOnPath_(at(e),Ct(n,i),r):new t(null)}}foreach(e){this.foreach_(Ve(),e)}foreach_(e,n){this.children.inorderTraversal((r,i)=>{i.foreach_(Ct(e,r),n)}),this.value&&n(e,this.value)}foreachChild(e){this.children.inorderTraversal((n,r)=>{r.value&&e(n,r.value)})}};var di=class t{constructor(e){this.writeTree_=e}static empty(){return new t(new qn(null))}};function jp(t,e,n){if(we(e))return new di(new qn(n));{let r=t.writeTree_.findRootMostValueAndPath(e);if(r!=null){let i=r.path,o=r.value,s=zn(i,e);return o=o.updateChild(s,n),new di(t.writeTree_.set(i,o))}else{let i=new qn(n),o=t.writeTree_.setTree(e,i);return new di(o)}}}function vw(t,e,n){let r=t;return dn(n,(i,o)=>{r=jp(r,Ct(e,i),o)}),r}function q2(t,e){if(we(e))return di.empty();{let n=t.writeTree_.setTree(e,new qn(null));return new di(n)}}function Sw(t,e){return cl(t,e)!=null}function cl(t,e){let n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(zn(n.path,e)):null}function K2(t){let e=[],n=t.writeTree_.value;return n!=null?n.isLeafNode()||n.forEachChild(ft,(r,i)=>{e.push(new Oe(r,i))}):t.writeTree_.children.inorderTraversal((r,i)=>{i.value!=null&&e.push(new Oe(r,i.value))}),e}function Qs(t,e){if(we(e))return t;{let n=cl(t,e);return n!=null?new di(new qn(n)):new di(t.writeTree_.subtree(e))}}function Aw(t){return t.writeTree_.isEmpty()}function Rd(t,e){return Fj(Ve(),t.writeTree_,e)}function Fj(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);{let r=null;return e.children.inorderTraversal((i,o)=>{i===".priority"?(q(o.value!==null,"Priority writes must always be leaf nodes"),r=o.value):n=Fj(Ct(t,i),o,n)}),!n.getChild(t).isEmpty()&&r!==null&&(n=n.updateChild(Ct(t,".priority"),r)),n}}function jy(t,e){return Gj(e,t)}function rie(t,e,n,r,i){q(r>t.lastWriteId,"Stacking an older write on top of newer ones"),i===void 0&&(i=!0),t.allWrites.push({path:e,snap:n,writeId:r,visible:i}),i&&(t.visibleWrites=jp(t.visibleWrites,e,n)),t.lastWriteId=r}function iie(t,e,n,r){q(r>t.lastWriteId,"Stacking an older merge on top of newer ones"),t.allWrites.push({path:e,children:n,writeId:r,visible:!0}),t.visibleWrites=vw(t.visibleWrites,e,n),t.lastWriteId=r}function oie(t,e){for(let n=0;n<t.allWrites.length;n++){let r=t.allWrites[n];if(r.writeId===e)return r}return null}function sie(t,e){let n=t.allWrites.findIndex(a=>a.writeId===e);q(n>=0,"removeWrite called with nonexistent writeId.");let r=t.allWrites[n];t.allWrites.splice(n,1);let i=r.visible,o=!1,s=t.allWrites.length-1;for(;i&&s>=0;){let a=t.allWrites[s];a.visible&&(s>=n&&aie(a,r.path)?i=!1:jr(r.path,a.path)&&(o=!0)),s--}if(i){if(o)return cie(t),!0;if(r.snap)t.visibleWrites=q2(t.visibleWrites,r.path);else{let a=r.children;dn(a,c=>{t.visibleWrites=q2(t.visibleWrites,Ct(r.path,c))})}return!0}else return!1}function aie(t,e){if(t.snap)return jr(t.path,e);for(let n in t.children)if(t.children.hasOwnProperty(n)&&jr(Ct(t.path,n),e))return!0;return!1}function cie(t){t.visibleWrites=Uj(t.allWrites,lie,Ve()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function lie(t){return t.visible}function Uj(t,e,n){let r=di.empty();for(let i=0;i<t.length;++i){let o=t[i];if(e(o)){let s=o.path,a;if(o.snap)jr(n,s)?(a=zn(n,s),r=jp(r,a,o.snap)):jr(s,n)&&(a=zn(s,n),r=jp(r,Ve(),o.snap.getChild(a)));else if(o.children){if(jr(n,s))a=zn(n,s),r=vw(r,a,o.children);else if(jr(s,n))if(a=zn(s,n),we(a))r=vw(r,Ve(),o.children);else{let c=Fs(o.children,Ne(a));if(c){let l=c.getChild(at(a));r=jp(r,Ve(),l)}}}else throw kc("WriteRecord should have .snap or .children")}}return r}function Vj(t,e,n,r,i){if(!r&&!i){let o=cl(t.visibleWrites,e);if(o!=null)return o;{let s=Qs(t.visibleWrites,e);if(Aw(s))return n;if(n==null&&!Sw(s,Ve()))return null;{let a=n||ve.EMPTY_NODE;return Rd(s,a)}}}else{let o=Qs(t.visibleWrites,e);if(!i&&Aw(o))return n;if(!i&&n==null&&!Sw(o,Ve()))return null;{let s=function(l){return(l.visible||i)&&(!r||!~r.indexOf(l.writeId))&&(jr(l.path,e)||jr(e,l.path))},a=Uj(t.allWrites,s,e),c=n||ve.EMPTY_NODE;return Rd(a,c)}}}function uie(t,e,n){let r=ve.EMPTY_NODE,i=cl(t.visibleWrites,e);if(i)return i.isLeafNode()||i.forEachChild(ft,(o,s)=>{r=r.updateImmediateChild(o,s)}),r;if(n){let o=Qs(t.visibleWrites,e);return n.forEachChild(ft,(s,a)=>{let c=Rd(Qs(o,new Be(s)),a);r=r.updateImmediateChild(s,c)}),K2(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}else{let o=Qs(t.visibleWrites,e);return K2(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}}function die(t,e,n,r,i){q(r||i,"Either existingEventSnap or existingServerSnap must exist");let o=Ct(e,n);if(Sw(t.visibleWrites,o))return null;{let s=Qs(t.visibleWrites,o);return Aw(s)?i.getChild(n):Rd(s,i.getChild(n))}}function hie(t,e,n,r){let i=Ct(e,n),o=cl(t.visibleWrites,i);if(o!=null)return o;if(r.isCompleteForChild(n)){let s=Qs(t.visibleWrites,i);return Rd(s,r.getNode().getImmediateChild(n))}else return null}function fie(t,e){return cl(t.visibleWrites,e)}function pie(t,e,n,r,i,o,s){let a,c=Qs(t.visibleWrites,e),l=cl(c,Ve());if(l!=null)a=l;else if(n!=null)a=Rd(c,n);else return[];if(a=a.withIndex(s),!a.isEmpty()&&!a.isLeafNode()){let d=[],h=s.getCompare(),f=o?a.getReverseIteratorFrom(r,s):a.getIteratorFrom(r,s),g=f.getNext();for(;g&&d.length<i;)h(g,r)!==0&&d.push(g),g=f.getNext();return d}else return[]}function gie(){return{visibleWrites:di.empty(),allWrites:[],lastWriteId:-1}}function Ny(t,e,n,r){return Vj(t.writeTree,t.treePath,e,n,r)}function tb(t,e){return uie(t.writeTree,t.treePath,e)}function Y2(t,e,n,r){return die(t.writeTree,t.treePath,e,n,r)}function wy(t,e){return fie(t.writeTree,Ct(t.treePath,e))}function mie(t,e,n,r,i,o){return pie(t.writeTree,t.treePath,e,n,r,i,o)}function nb(t,e,n){return hie(t.writeTree,t.treePath,e,n)}function Bj(t,e){return Gj(Ct(t.treePath,e),t.writeTree)}function Gj(t,e){return{treePath:t,writeTree:e}}var Cw=class{constructor(){this.changeMap=new Map}trackChildChange(e){let n=e.type,r=e.childName;q(n==="child_added"||n==="child_changed"||n==="child_removed","Only child changes supported for tracking"),q(r!==".priority","Only non-priority child changes can be tracked.");let i=this.changeMap.get(r);if(i){let o=i.type;if(n==="child_added"&&o==="child_removed")this.changeMap.set(r,qp(r,e.snapshotNode,i.snapshotNode));else if(n==="child_removed"&&o==="child_added")this.changeMap.delete(r);else if(n==="child_removed"&&o==="child_changed")this.changeMap.set(r,zp(r,i.oldSnap));else if(n==="child_changed"&&o==="child_added")this.changeMap.set(r,Cd(r,e.snapshotNode));else if(n==="child_changed"&&o==="child_changed")this.changeMap.set(r,qp(r,e.snapshotNode,i.oldSnap));else throw kc("Illegal combination of changes: "+e+" occurred after "+i)}else this.changeMap.set(r,e)}getChanges(){return Array.from(this.changeMap.values())}};var Dw=class{getCompleteChild(e){return null}getChildAfterChild(e,n,r){return null}},jj=new Dw,Xp=class{constructor(e,n,r=null){this.writes_=e,this.viewCache_=n,this.optCompleteServerCache_=r}getCompleteChild(e){let n=this.viewCache_.eventCache;if(n.isCompleteForChild(e))return n.getNode().getImmediateChild(e);{let r=this.optCompleteServerCache_!=null?new eo(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return nb(this.writes_,e,r)}}getChildAfterChild(e,n,r){let i=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:nl(this.viewCache_),o=mie(this.writes_,i,n,1,r,e);return o.length===0?null:o[0]}};function Eie(t){return{filter:t}}function _ie(t,e){q(e.eventCache.getNode().isIndexed(t.filter.getIndex()),"Event snap not indexed"),q(e.serverCache.getNode().isIndexed(t.filter.getIndex()),"Server snap not indexed")}function Tie(t,e,n,r,i){let o=new Cw,s,a;if(n.type===Zi.OVERWRITE){let l=n;l.source.fromUser?s=Rw(t,e,l.path,l.snap,r,i,o):(q(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered()&&!we(l.path),s=by(t,e,l.path,l.snap,r,i,a,o))}else if(n.type===Zi.MERGE){let l=n;l.source.fromUser?s=Iie(t,e,l.path,l.children,r,i,o):(q(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered(),s=Nw(t,e,l.path,l.children,r,i,a,o))}else if(n.type===Zi.ACK_USER_WRITE){let l=n;l.revert?s=Aie(t,e,l.path,r,i,o):s=vie(t,e,l.path,l.affectedTree,r,i,o)}else if(n.type===Zi.LISTEN_COMPLETE)s=Sie(t,e,n.path,r,o);else throw kc("Unknown operation type: "+n.type);let c=o.getChanges();return yie(e,s,c),{viewCache:s,changes:c}}function yie(t,e,n){let r=e.eventCache;if(r.isFullyInitialized()){let i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=Ry(t);(n.length>0||!t.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(xj(Ry(e)))}}function Hj(t,e,n,r,i,o){let s=e.eventCache;if(wy(r,n)!=null)return e;{let a,c;if(we(n))if(q(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){let l=nl(e),d=l instanceof ve?l:ve.EMPTY_NODE,h=tb(r,d);a=t.filter.updateFullNode(e.eventCache.getNode(),h,o)}else{let l=Ny(r,nl(e));a=t.filter.updateFullNode(e.eventCache.getNode(),l,o)}else{let l=Ne(n);if(l===".priority"){q(ea(n)===1,"Can't have a priority with additional path components");let d=s.getNode();c=e.serverCache.getNode();let h=Y2(r,n,d,c);h!=null?a=t.filter.updatePriority(d,h):a=s.getNode()}else{let d=at(n),h;if(s.isCompleteForChild(l)){c=e.serverCache.getNode();let f=Y2(r,n,s.getNode(),c);f!=null?h=s.getNode().getImmediateChild(l).updateChild(d,f):h=s.getNode().getImmediateChild(l)}else h=nb(r,l,e.serverCache);h!=null?a=t.filter.updateChild(s.getNode(),l,h,d,i,o):a=s.getNode()}}return Gp(e,a,s.isFullyInitialized()||we(n),t.filter.filtersNodes())}}function by(t,e,n,r,i,o,s,a){let c=e.serverCache,l,d=s?t.filter:t.filter.getIndexedFilter();if(we(n))l=d.updateFullNode(c.getNode(),r,null);else if(d.filtersNodes()&&!c.isFiltered()){let g=c.getNode().updateChild(n,r);l=d.updateFullNode(c.getNode(),g,null)}else{let g=Ne(n);if(!c.isCompleteForPath(n)&&ea(n)>1)return e;let E=at(n),S=c.getNode().getImmediateChild(g).updateChild(E,r);g===".priority"?l=d.updatePriority(c.getNode(),S):l=d.updateChild(c.getNode(),g,S,E,jj,null)}let h=kj(e,l,c.isFullyInitialized()||we(n),d.filtersNodes()),f=new Xp(i,h,o);return Hj(t,h,n,i,f,a)}function Rw(t,e,n,r,i,o,s){let a=e.eventCache,c,l,d=new Xp(i,e,o);if(we(n))l=t.filter.updateFullNode(e.eventCache.getNode(),r,s),c=Gp(e,l,!0,t.filter.filtersNodes());else{let h=Ne(n);if(h===".priority")l=t.filter.updatePriority(e.eventCache.getNode(),r),c=Gp(e,l,a.isFullyInitialized(),a.isFiltered());else{let f=at(n),g=a.getNode().getImmediateChild(h),E;if(we(f))E=r;else{let I=d.getCompleteChild(h);I!=null?Kw(f)===".priority"&&I.getChild(Nj(f)).isEmpty()?E=I:E=I.updateChild(f,r):E=ve.EMPTY_NODE}if(g.equals(E))c=e;else{let I=t.filter.updateChild(a.getNode(),h,E,f,d,s);c=Gp(e,I,a.isFullyInitialized(),t.filter.filtersNodes())}}}return c}function X2(t,e){return t.eventCache.isCompleteForChild(e)}function Iie(t,e,n,r,i,o,s){let a=e;return r.foreach((c,l)=>{let d=Ct(n,c);X2(e,Ne(d))&&(a=Rw(t,a,d,l,i,o,s))}),r.foreach((c,l)=>{let d=Ct(n,c);X2(e,Ne(d))||(a=Rw(t,a,d,l,i,o,s))}),a}function Q2(t,e,n){return n.foreach((r,i)=>{e=e.updateChild(r,i)}),e}function Nw(t,e,n,r,i,o,s,a){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let c=e,l;we(n)?l=r:l=new qn(null).setTree(n,r);let d=e.serverCache.getNode();return l.children.inorderTraversal((h,f)=>{if(d.hasChild(h)){let g=e.serverCache.getNode().getImmediateChild(h),E=Q2(t,g,f);c=by(t,c,new Be(h),E,i,o,s,a)}}),l.children.inorderTraversal((h,f)=>{let g=!e.serverCache.isCompleteForChild(h)&&f.value===null;if(!d.hasChild(h)&&!g){let E=e.serverCache.getNode().getImmediateChild(h),I=Q2(t,E,f);c=by(t,c,new Be(h),I,i,o,s,a)}}),c}function vie(t,e,n,r,i,o,s){if(wy(i,n)!=null)return e;let a=e.serverCache.isFiltered(),c=e.serverCache;if(r.value!=null){if(we(n)&&c.isFullyInitialized()||c.isCompleteForPath(n))return by(t,e,n,c.getNode().getChild(n),i,o,a,s);if(we(n)){let l=new qn(null);return c.getNode().forEachChild(el,(d,h)=>{l=l.set(new Be(d),h)}),Nw(t,e,n,l,i,o,a,s)}else return e}else{let l=new qn(null);return r.foreach((d,h)=>{let f=Ct(n,d);c.isCompleteForPath(f)&&(l=l.set(d,c.getNode().getChild(f)))}),Nw(t,e,n,l,i,o,a,s)}}function Sie(t,e,n,r,i){let o=e.serverCache,s=kj(e,o.getNode(),o.isFullyInitialized()||we(n),o.isFiltered());return Hj(t,s,n,r,jj,i)}function Aie(t,e,n,r,i,o){let s;if(wy(r,n)!=null)return e;{let a=new Xp(r,e,i),c=e.eventCache.getNode(),l;if(we(n)||Ne(n)===".priority"){let d;if(e.serverCache.isFullyInitialized())d=Ny(r,nl(e));else{let h=e.serverCache.getNode();q(h instanceof ve,"serverChildren would be complete if leaf node"),d=tb(r,h)}d=d,l=t.filter.updateFullNode(c,d,o)}else{let d=Ne(n),h=nb(r,d,e.serverCache);h==null&&e.serverCache.isCompleteForChild(d)&&(h=c.getImmediateChild(d)),h!=null?l=t.filter.updateChild(c,d,h,at(n),a,o):e.eventCache.getNode().hasChild(d)?l=t.filter.updateChild(c,d,ve.EMPTY_NODE,at(n),a,o):l=c,l.isEmpty()&&e.serverCache.isFullyInitialized()&&(s=Ny(r,nl(e)),s.isLeafNode()&&(l=t.filter.updateFullNode(l,s,o)))}return s=e.serverCache.isFullyInitialized()||wy(r,Ve())!=null,Gp(e,l,s,t.filter.filtersNodes())}}var ww=class{constructor(e,n){this.query_=e,this.eventRegistrations_=[];let r=this.query_._queryParams,i=new Kp(r.getIndex()),o=Wre(r);this.processor_=Eie(o);let s=n.serverCache,a=n.eventCache,c=i.updateFullNode(ve.EMPTY_NODE,s.getNode(),null),l=o.updateFullNode(ve.EMPTY_NODE,a.getNode(),null),d=new eo(c,s.isFullyInitialized(),i.filtersNodes()),h=new eo(l,a.isFullyInitialized(),o.filtersNodes());this.viewCache_=Gy(h,d),this.eventGenerator_=new Iw(this.query_)}get query(){return this.query_}};function Cie(t){return t.viewCache_.serverCache.getNode()}function Die(t){return Ry(t.viewCache_)}function Rie(t,e){let n=nl(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!we(e)&&!n.getImmediateChild(Ne(e)).isEmpty())?n.getChild(e):null}function J2(t){return t.eventRegistrations_.length===0}function Nie(t,e){t.eventRegistrations_.push(e)}function Z2(t,e,n){let r=[];if(n){q(e==null,"A cancel should cancel all event registrations.");let i=t.query._path;t.eventRegistrations_.forEach(o=>{let s=o.createCancelEvent(n,i);s&&r.push(s)})}if(e){let i=[];for(let o=0;o<t.eventRegistrations_.length;++o){let s=t.eventRegistrations_[o];if(!s.matches(e))i.push(s);else if(e.hasAnyCallback()){i=i.concat(t.eventRegistrations_.slice(o+1));break}}t.eventRegistrations_=i}else t.eventRegistrations_=[];return r}function ej(t,e,n,r){e.type===Zi.MERGE&&e.source.queryId!==null&&(q(nl(t.viewCache_),"We should always have a full cache before handling merges"),q(Ry(t.viewCache_),"Missing event cache, even though we have a server cache"));let i=t.viewCache_,o=Tie(t.processor_,i,e,n,r);return _ie(t.processor_,o.viewCache),q(o.viewCache.serverCache.isFullyInitialized()||!i.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=o.viewCache,$j(t,o.changes,o.viewCache.eventCache.getNode(),null)}function wie(t,e){let n=t.viewCache_.eventCache,r=[];return n.getNode().isLeafNode()||n.getNode().forEachChild(ft,(o,s)=>{r.push(Cd(o,s))}),n.isFullyInitialized()&&r.push(xj(n.getNode())),$j(t,r,n.getNode(),e)}function $j(t,e,n,r){let i=r?[r]:t.eventRegistrations_;return Zre(t.eventGenerator_,e,n,i)}var Oy,My=class{constructor(){this.views=new Map}};function bie(t){q(!Oy,"__referenceConstructor has already been defined"),Oy=t}function Oie(){return q(Oy,"Reference.ts has not been loaded"),Oy}function Mie(t){return t.views.size===0}function rb(t,e,n,r){let i=e.source.queryId;if(i!==null){let o=t.views.get(i);return q(o!=null,"SyncTree gave us an op for an invalid query."),ej(o,e,n,r)}else{let o=[];for(let s of t.views.values())o=o.concat(ej(s,e,n,r));return o}}function Wj(t,e,n,r,i){let o=e._queryIdentifier,s=t.views.get(o);if(!s){let a=Ny(n,i?r:null),c=!1;a?c=!0:r instanceof ve?(a=tb(n,r),c=!1):(a=ve.EMPTY_NODE,c=!1);let l=Gy(new eo(a,c,!1),new eo(r,i,!1));return new ww(e,l)}return s}function Lie(t,e,n,r,i,o){let s=Wj(t,e,r,i,o);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,s),Nie(s,n),wie(s,n)}function Pie(t,e,n,r){let i=e._queryIdentifier,o=[],s=[],a=ta(t);if(i==="default")for(let[c,l]of t.views.entries())s=s.concat(Z2(l,n,r)),J2(l)&&(t.views.delete(c),l.query._queryParams.loadsAllData()||o.push(l.query));else{let c=t.views.get(i);c&&(s=s.concat(Z2(c,n,r)),J2(c)&&(t.views.delete(i),c.query._queryParams.loadsAllData()||o.push(c.query)))}return a&&!ta(t)&&o.push(new(Oie())(e._repo,e._path)),{removed:o,events:s}}function zj(t){let e=[];for(let n of t.views.values())n.query._queryParams.loadsAllData()||e.push(n);return e}function Js(t,e){let n=null;for(let r of t.views.values())n=n||Rie(r,e);return n}function qj(t,e){if(e._queryParams.loadsAllData())return Hy(t);{let r=e._queryIdentifier;return t.views.get(r)}}function Kj(t,e){return qj(t,e)!=null}function ta(t){return Hy(t)!=null}function Hy(t){for(let e of t.views.values())if(e.query._queryParams.loadsAllData())return e;return null}var Ly;function xie(t){q(!Ly,"__referenceConstructor has already been defined"),Ly=t}function kie(){return q(Ly,"Reference.ts has not been loaded"),Ly}var Fie=1,Py=class{constructor(e){this.listenProvider_=e,this.syncPointTree_=new qn(null),this.pendingWriteTree_=gie(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}};function ib(t,e,n,r,i){return rie(t.pendingWriteTree_,e,n,r,i),i?Md(t,new Dd(Jw(),e,n)):[]}function Uie(t,e,n,r){iie(t.pendingWriteTree_,e,n,r);let i=qn.fromObject(n);return Md(t,new Yp(Jw(),e,i))}function Ys(t,e,n=!1){let r=oie(t.pendingWriteTree_,e);if(sie(t.pendingWriteTree_,e)){let o=new qn(null);return r.snap!=null?o=o.set(Ve(),!0):dn(r.children,s=>{o=o.set(new Be(s),!0)}),Md(t,new yw(r.path,o,n))}else return[]}function og(t,e,n){return Md(t,new Dd(Zw(),e,n))}function Vie(t,e,n){let r=qn.fromObject(n);return Md(t,new Yp(Zw(),e,r))}function Bie(t,e){return Md(t,new Dy(Zw(),e))}function Gie(t,e,n){let r=ob(t,n);if(r){let i=sb(r),o=i.path,s=i.queryId,a=zn(o,e),c=new Dy(eb(s),a);return ab(t,o,c)}else return[]}function xy(t,e,n,r,i=!1){let o=e._path,s=t.syncPointTree_.get(o),a=[];if(s&&(e._queryIdentifier==="default"||Kj(s,e))){let c=Pie(s,e,n,r);Mie(s)&&(t.syncPointTree_=t.syncPointTree_.remove(o));let l=c.removed;if(a=c.events,!i){let d=l.findIndex(f=>f._queryParams.loadsAllData())!==-1,h=t.syncPointTree_.findOnPath(o,(f,g)=>ta(g));if(d&&!h){let f=t.syncPointTree_.subtree(o);if(!f.isEmpty()){let g=$ie(f);for(let E=0;E<g.length;++E){let I=g[E],S=I.query,L=Jj(t,I);t.listenProvider_.startListening(Hp(S),Qp(t,S),L.hashFn,L.onComplete)}}}!h&&l.length>0&&!r&&(d?t.listenProvider_.stopListening(Hp(e),null):l.forEach(f=>{let g=t.queryToTagMap.get(Wy(f));t.listenProvider_.stopListening(Hp(f),g)}))}Wie(t,l)}return a}function Yj(t,e,n,r){let i=ob(t,r);if(i!=null){let o=sb(i),s=o.path,a=o.queryId,c=zn(s,e),l=new Dd(eb(a),c,n);return ab(t,s,l)}else return[]}function jie(t,e,n,r){let i=ob(t,r);if(i){let o=sb(i),s=o.path,a=o.queryId,c=zn(s,e),l=qn.fromObject(n),d=new Yp(eb(a),c,l);return ab(t,s,d)}else return[]}function bw(t,e,n,r=!1){let i=e._path,o=null,s=!1;t.syncPointTree_.foreachOnPath(i,(f,g)=>{let E=zn(f,i);o=o||Js(g,E),s=s||ta(g)});let a=t.syncPointTree_.get(i);a?(s=s||ta(a),o=o||Js(a,Ve())):(a=new My,t.syncPointTree_=t.syncPointTree_.set(i,a));let c;o!=null?c=!0:(c=!1,o=ve.EMPTY_NODE,t.syncPointTree_.subtree(i).foreachChild((g,E)=>{let I=Js(E,Ve());I&&(o=o.updateImmediateChild(g,I))}));let l=Kj(a,e);if(!l&&!e._queryParams.loadsAllData()){let f=Wy(e);q(!t.queryToTagMap.has(f),"View does not exist, but we have a tag");let g=zie();t.queryToTagMap.set(f,g),t.tagToQueryMap.set(g,f)}let d=jy(t.pendingWriteTree_,i),h=Lie(a,e,n,d,o,c);if(!l&&!s&&!r){let f=qj(a,e);h=h.concat(qie(t,e,f))}return h}function $y(t,e,n){let i=t.pendingWriteTree_,o=t.syncPointTree_.findOnPath(e,(s,a)=>{let c=zn(s,e),l=Js(a,c);if(l)return l});return Vj(i,e,o,n,!0)}function Hie(t,e){let n=e._path,r=null;t.syncPointTree_.foreachOnPath(n,(l,d)=>{let h=zn(l,n);r=r||Js(d,h)});let i=t.syncPointTree_.get(n);i?r=r||Js(i,Ve()):(i=new My,t.syncPointTree_=t.syncPointTree_.set(n,i));let o=r!=null,s=o?new eo(r,!0,!1):null,a=jy(t.pendingWriteTree_,e._path),c=Wj(i,e,a,o?s.getNode():ve.EMPTY_NODE,o);return Die(c)}function Md(t,e){return Xj(e,t.syncPointTree_,null,jy(t.pendingWriteTree_,Ve()))}function Xj(t,e,n,r){if(we(t.path))return Qj(t,e,n,r);{let i=e.get(Ve());n==null&&i!=null&&(n=Js(i,Ve()));let o=[],s=Ne(t.path),a=t.operationForChild(s),c=e.children.get(s);if(c&&a){let l=n?n.getImmediateChild(s):null,d=Bj(r,s);o=o.concat(Xj(a,c,l,d))}return i&&(o=o.concat(rb(i,t,r,n))),o}}function Qj(t,e,n,r){let i=e.get(Ve());n==null&&i!=null&&(n=Js(i,Ve()));let o=[];return e.children.inorderTraversal((s,a)=>{let c=n?n.getImmediateChild(s):null,l=Bj(r,s),d=t.operationForChild(s);d&&(o=o.concat(Qj(d,a,c,l)))}),i&&(o=o.concat(rb(i,t,r,n))),o}function Jj(t,e){let n=e.query,r=Qp(t,n);return{hashFn:()=>(Cie(e)||ve.EMPTY_NODE).hash(),onComplete:i=>{if(i==="ok")return r?Gie(t,n._path,r):Bie(t,n._path);{let o=rre(i,n);return xy(t,n,null,o)}}}}function Qp(t,e){let n=Wy(e);return t.queryToTagMap.get(n)}function Wy(t){return t._path.toString()+"$"+t._queryIdentifier}function ob(t,e){return t.tagToQueryMap.get(e)}function sb(t){let e=t.indexOf("$");return q(e!==-1&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new Be(t.substr(0,e))}}function ab(t,e,n){let r=t.syncPointTree_.get(e);q(r,"Missing sync point for query tag that we're tracking");let i=jy(t.pendingWriteTree_,e);return rb(r,n,i,null)}function $ie(t){return t.fold((e,n,r)=>{if(n&&ta(n))return[Hy(n)];{let i=[];return n&&(i=zj(n)),dn(r,(o,s)=>{i=i.concat(s)}),i}})}function Hp(t){return t._queryParams.loadsAllData()&&!t._queryParams.isDefault()?new(kie())(t._repo,t._path):t}function Wie(t,e){for(let n=0;n<e.length;++n){let r=e[n];if(!r._queryParams.loadsAllData()){let i=Wy(r),o=t.queryToTagMap.get(i);t.queryToTagMap.delete(i),t.tagToQueryMap.delete(o)}}}function zie(){return Fie++}function qie(t,e,n){let r=e._path,i=Qp(t,e),o=Jj(t,n),s=t.listenProvider_.startListening(Hp(e),i,o.hashFn,o.onComplete),a=t.syncPointTree_.subtree(r);if(i)q(!ta(a.value),"If we're adding a query, it shouldn't be shadowed");else{let c=a.fold((l,d,h)=>{if(!we(l)&&d&&ta(d))return[Hy(d).query];{let f=[];return d&&(f=f.concat(zj(d).map(g=>g.query))),dn(h,(g,E)=>{f=f.concat(E)}),f}});for(let l=0;l<c.length;++l){let d=c[l];t.listenProvider_.stopListening(Hp(d),Qp(t,d))}}return s}var Ow=class t{constructor(e){this.node_=e}getImmediateChild(e){let n=this.node_.getImmediateChild(e);return new t(n)}node(){return this.node_}},Mw=class t{constructor(e,n){this.syncTree_=e,this.path_=n}getImmediateChild(e){let n=Ct(this.path_,e);return new t(this.syncTree_,n)}node(){return $y(this.syncTree_,this.path_)}},Kie=function(t){return t=t||{},t.timestamp=t.timestamp||new Date().getTime(),t},tj=function(t,e,n){if(!t||typeof t!="object")return t;if(q(".sv"in t,"Unexpected leaf node or priority contents"),typeof t[".sv"]=="string")return Yie(t[".sv"],e,n);if(typeof t[".sv"]=="object")return Xie(t[".sv"],e);q(!1,"Unexpected server value: "+JSON.stringify(t,null,2))},Yie=function(t,e,n){if(t==="timestamp")return n.timestamp;q(!1,"Unexpected server value: "+t)},Xie=function(t,e,n){t.hasOwnProperty("increment")||q(!1,"Unexpected server value: "+JSON.stringify(t,null,2));let r=t.increment;typeof r!="number"&&q(!1,"Unexpected increment value: "+r);let i=e.node();if(q(i!==null&&typeof i<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;let s=i.getValue();return typeof s!="number"?r:s+r},Zj=function(t,e,n,r){return lb(e,new Mw(n,t),r)},cb=function(t,e,n){return lb(t,new Ow(e),n)};function lb(t,e,n){let r=t.getPriority().val(),i=tj(r,e.getImmediateChild(".priority"),n),o;if(t.isLeafNode()){let s=t,a=tj(s.getValue(),e,n);return a!==s.getValue()||i!==s.getPriority().val()?new Sd(a,At(i)):t}else{let s=t;return o=s,i!==s.getPriority().val()&&(o=o.updatePriority(new Sd(i))),s.forEachChild(ft,(a,c)=>{let l=lb(c,e.getImmediateChild(a),n);l!==c&&(o=o.updateImmediateChild(a,l))}),o}}var Jp=class{constructor(e="",n=null,r={children:{},childCount:0}){this.name=e,this.parent=n,this.node=r}};function zy(t,e){let n=e instanceof Be?e:new Be(e),r=t,i=Ne(n);for(;i!==null;){let o=Fs(r.node.children,i)||{children:{},childCount:0};r=new Jp(i,r,o),n=at(n),i=Ne(n)}return r}function ll(t){return t.node.value}function ub(t,e){t.node.value=e,Lw(t)}function eH(t){return t.node.childCount>0}function Qie(t){return ll(t)===void 0&&!eH(t)}function qy(t,e){dn(t.node.children,(n,r)=>{e(new Jp(n,t,r))})}function tH(t,e,n,r){n&&!r&&e(t),qy(t,i=>{tH(i,e,!0,r)}),n&&r&&e(t)}function Jie(t,e,n){let r=n?t:t.parent;for(;r!==null;){if(e(r))return!0;r=r.parent}return!1}function sg(t){return new Be(t.parent===null?t.name:sg(t.parent)+"/"+t.name)}function Lw(t){t.parent!==null&&Zie(t.parent,t.name,t)}function Zie(t,e,n){let r=Qie(n),i=Vr(t.node.children,e);r&&i?(delete t.node.children[e],t.node.childCount--,Lw(t)):!r&&!i&&(t.node.children[e]=n.node,t.node.childCount++,Lw(t))}var eoe=/[\[\].#$\/\u0000-\u001F\u007F]/,toe=/[\[\].#$\u0000-\u001F\u007F]/,WN=10*1024*1024,Ky=function(t){return typeof t=="string"&&t.length!==0&&!eoe.test(t)},nH=function(t){return typeof t=="string"&&t.length!==0&&!toe.test(t)},noe=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),nH(t)},Zp=function(t){return t===null||typeof t=="string"||typeof t=="number"&&!By(t)||t&&typeof t=="object"&&Vr(t,".sv")},rl=function(t,e,n,r){r&&e===void 0||ag(Us(t,"value"),e,n)},ag=function(t,e,n){let r=n instanceof Be?new iw(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+Qc(r));if(typeof e=="function")throw new Error(t+"contains a function "+Qc(r)+" with contents = "+e.toString());if(By(e))throw new Error(t+"contains "+e.toString()+" "+Qc(r));if(typeof e=="string"&&e.length>WN/3&&mp(e)>WN)throw new Error(t+"contains a string greater than "+WN+" utf8 bytes "+Qc(r)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let i=!1,o=!1;if(dn(e,(s,a)=>{if(s===".value")i=!0;else if(s!==".priority"&&s!==".sv"&&(o=!0,!Ky(s)))throw new Error(t+" contains an invalid key ("+s+") "+Qc(r)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);Mre(r,s),ag(t,a,r),Lre(r)}),i&&o)throw new Error(t+' contains ".value" child '+Qc(r)+" in addition to actual children.")}},roe=function(t,e){let n,r;for(n=0;n<e.length;n++){r=e[n];let o=$p(r);for(let s=0;s<o.length;s++)if(!(o[s]===".priority"&&s===o.length-1)){if(!Ky(o[s]))throw new Error(t+"contains an invalid key ("+o[s]+") in path "+r.toString()+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`)}}e.sort(Ore);let i=null;for(n=0;n<e.length;n++){if(r=e[n],i!==null&&jr(i,r))throw new Error(t+"contains a path "+i.toString()+" that is ancestor of another path "+r.toString());i=r}},rH=function(t,e,n,r){if(r&&e===void 0)return;let i=Us(t,"values");if(!(e&&typeof e=="object")||Array.isArray(e))throw new Error(i+" must be an object containing the children to replace.");let o=[];dn(e,(s,a)=>{let c=new Be(s);if(ag(i,a,Ct(n,c)),Kw(c)===".priority"&&!Zp(a))throw new Error(i+"contains an invalid value for '"+c.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");o.push(c)}),roe(i,o)},ioe=function(t,e,n){if(!(n&&e===void 0)){if(By(e))throw new Error(Us(t,"priority")+"is "+e.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!Zp(e))throw new Error(Us(t,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},iH=function(t,e,n,r){if(!(r&&n===void 0)&&!Ky(n))throw new Error(Us(t,e)+'was an invalid key = "'+n+`". Firebase keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]").`)},db=function(t,e,n,r){if(!(r&&n===void 0)&&!nH(n))throw new Error(Us(t,e)+'was an invalid path = "'+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},ooe=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),db(t,e,n,r)},Xs=function(t,e){if(Ne(e)===".info")throw new Error(t+" failed = Can't modify data under /.info/")},soe=function(t,e){let n=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!Ky(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||n.length!==0&&!noe(n))throw new Error(Us(t,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};var Pw=class{constructor(){this.eventLists_=[],this.recursionDepth_=0}};function Yy(t,e){let n=null;for(let r=0;r<e.length;r++){let i=e[r],o=i.getPath();n!==null&&!Yw(o,n.path)&&(t.eventLists_.push(n),n=null),n===null&&(n={events:[],path:o}),n.events.push(i)}n&&t.eventLists_.push(n)}function oH(t,e,n){Yy(t,n),sH(t,r=>Yw(r,e))}function vr(t,e,n){Yy(t,n),sH(t,r=>jr(r,e)||jr(e,r))}function sH(t,e){t.recursionDepth_++;let n=!0;for(let r=0;r<t.eventLists_.length;r++){let i=t.eventLists_[r];if(i){let o=i.path;e(o)?(aoe(t.eventLists_[r]),t.eventLists_[r]=null):n=!1}}n&&(t.eventLists_=[]),t.recursionDepth_--}function aoe(t){for(let e=0;e<t.events.length;e++){let n=t.events[e];if(n!==null){t.events[e]=null;let r=n.getEventRunner();Zc&&un("event: "+n.toString()),bd(r)}}}var coe="repo_interrupt",loe=25,xw=class{constructor(e,n,r,i){this.repoInfo_=e,this.forceRestClient_=n,this.authTokenProvider_=r,this.appCheckProvider_=i,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Pw,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Cy(),this.transactionQueueTree_=new Jp,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}};function uoe(t,e,n){if(t.stats_=qw(t.repoInfo_),t.forceRestClient_||are())t.server_=new pw(t.repoInfo_,(r,i,o,s)=>{nj(t,r,i,o,s)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>rj(t,!0),0);else{if(typeof n<"u"&&n!==null){if(typeof n!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{xt(n)}catch(r){throw new Error("Invalid authOverride provided: "+r)}}t.persistentConnection_=new Xw(t.repoInfo_,e,(r,i,o,s)=>{nj(t,r,i,o,s)},r=>{rj(t,r)},r=>{doe(t,r)},t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener(r=>{t.server_.refreshAuthToken(r)}),t.appCheckProvider_.addTokenChangeListener(r=>{t.server_.refreshAppCheckToken(r.token)}),t.statsReporter_=lre(t.repoInfo_,()=>new Tw(t.stats_,t.server_)),t.infoData_=new gw,t.infoSyncTree_=new Py({startListening:(r,i,o,s)=>{let a=[],c=t.infoData_.getNode(r._path);return c.isEmpty()||(a=og(t.infoSyncTree_,r._path,c),setTimeout(()=>{s("ok")},0)),a},stopListening:()=>{}}),hb(t,"connected",!1),t.serverSyncTree_=new Py({startListening:(r,i,o,s)=>(t.server_.listen(r,o,i,(a,c)=>{let l=s(a,c);vr(t.eventQueue_,r._path,l)}),[]),stopListening:(r,i)=>{t.server_.unlisten(r,i)}})}function aH(t){let n=t.infoData_.getNode(new Be(".info/serverTimeOffset")).val()||0;return new Date().getTime()+n}function cg(t){return Kie({timestamp:aH(t)})}function nj(t,e,n,r,i){t.dataUpdateCount++;let o=new Be(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let s=[];if(i)if(r){let c=pp(n,l=>At(l));s=jie(t.serverSyncTree_,o,c,i)}else{let c=At(n);s=Yj(t.serverSyncTree_,o,c,i)}else if(r){let c=pp(n,l=>At(l));s=Vie(t.serverSyncTree_,o,c)}else{let c=At(n);s=og(t.serverSyncTree_,o,c)}let a=o;s.length>0&&(a=Nd(t,o)),vr(t.eventQueue_,a,s)}function rj(t,e){hb(t,"connected",e),e===!1&&goe(t)}function doe(t,e){dn(e,(n,r)=>{hb(t,n,r)})}function hb(t,e,n){let r=new Be("/.info/"+e),i=At(n);t.infoData_.updateSnapshot(r,i);let o=og(t.infoSyncTree_,r,i);vr(t.eventQueue_,r,o)}function Xy(t){return t.nextWriteId_++}function hoe(t,e,n){let r=Hie(t.serverSyncTree_,e);return r!=null?Promise.resolve(r):t.server_.get(e).then(i=>{let o=At(i).withIndex(e._queryParams.getIndex());bw(t.serverSyncTree_,e,n,!0);let s;if(e._queryParams.loadsAllData())s=og(t.serverSyncTree_,e._path,o);else{let a=Qp(t.serverSyncTree_,e);s=Yj(t.serverSyncTree_,e._path,o,a)}return vr(t.eventQueue_,e._path,s),xy(t.serverSyncTree_,e,n,null,!0),o},i=>(Ld(t,"get for query "+xt(e)+" failed: "+i),Promise.reject(new Error(i))))}function foe(t,e,n,r,i){Ld(t,"set",{path:e.toString(),value:n,priority:r});let o=cg(t),s=At(n,r),a=$y(t.serverSyncTree_,e),c=cb(s,a,o),l=Xy(t),d=ib(t.serverSyncTree_,e,c,l,!0);Yy(t.eventQueue_,d),t.server_.put(e.toString(),s.val(!0),(f,g)=>{let E=f==="ok";E||xn("set at "+e+" failed: "+f);let I=Ys(t.serverSyncTree_,l,!E);vr(t.eventQueue_,e,I),na(t,i,f,g)});let h=pb(t,e);Nd(t,h),vr(t.eventQueue_,h,[])}function poe(t,e,n,r){Ld(t,"update",{path:e.toString(),value:n});let i=!0,o=cg(t),s={};if(dn(n,(a,c)=>{i=!1,s[a]=Zj(Ct(e,a),At(c),t.serverSyncTree_,o)}),i)un("update() called with empty data. Don't do anything."),na(t,r,"ok",void 0);else{let a=Xy(t),c=Uie(t.serverSyncTree_,e,s,a);Yy(t.eventQueue_,c),t.server_.merge(e.toString(),n,(l,d)=>{let h=l==="ok";h||xn("update at "+e+" failed: "+l);let f=Ys(t.serverSyncTree_,a,!h),g=f.length>0?Nd(t,e):e;vr(t.eventQueue_,g,f),na(t,r,l,d)}),dn(n,l=>{let d=pb(t,Ct(e,l));Nd(t,d)}),vr(t.eventQueue_,e,[])}}function goe(t){Ld(t,"onDisconnectEvents");let e=cg(t),n=Cy();Ew(t.onDisconnect_,Ve(),(i,o)=>{let s=Zj(i,o,t.serverSyncTree_,e);Od(n,i,s)});let r=[];Ew(n,Ve(),(i,o)=>{r=r.concat(og(t.serverSyncTree_,i,o));let s=pb(t,i);Nd(t,s)}),t.onDisconnect_=Cy(),vr(t.eventQueue_,Ve(),r)}function moe(t,e,n){t.server_.onDisconnectCancel(e.toString(),(r,i)=>{r==="ok"&&mw(t.onDisconnect_,e),na(t,n,r,i)})}function ij(t,e,n,r){let i=At(n);t.server_.onDisconnectPut(e.toString(),i.val(!0),(o,s)=>{o==="ok"&&Od(t.onDisconnect_,e,i),na(t,r,o,s)})}function Eoe(t,e,n,r,i){let o=At(n,r);t.server_.onDisconnectPut(e.toString(),o.val(!0),(s,a)=>{s==="ok"&&Od(t.onDisconnect_,e,o),na(t,i,s,a)})}function _oe(t,e,n,r){if(fp(n)){un("onDisconnect().update() called with empty data. Don't do anything."),na(t,r,"ok",void 0);return}t.server_.onDisconnectMerge(e.toString(),n,(i,o)=>{i==="ok"&&dn(n,(s,a)=>{let c=At(a);Od(t.onDisconnect_,Ct(e,s),c)}),na(t,r,i,o)})}function Toe(t,e,n){let r;Ne(e._path)===".info"?r=bw(t.infoSyncTree_,e,n):r=bw(t.serverSyncTree_,e,n),oH(t.eventQueue_,e._path,r)}function kw(t,e,n){let r;Ne(e._path)===".info"?r=xy(t.infoSyncTree_,e,n):r=xy(t.serverSyncTree_,e,n),oH(t.eventQueue_,e._path,r)}function yoe(t){t.persistentConnection_&&t.persistentConnection_.interrupt(coe)}function Ld(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),un(n,...e)}function na(t,e,n,r){e&&bd(()=>{if(n==="ok")e(null);else{let i=(n||"error").toUpperCase(),o=i;r&&(o+=": "+r);let s=new Error(o);s.code=i,e(s)}})}function Ioe(t,e,n,r,i,o){Ld(t,"transaction on "+e);let s={path:e,update:n,onComplete:r,status:null,order:cj(),applyLocally:o,retryCount:0,unwatcher:i,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},a=fb(t,e,void 0);s.currentInputSnapshot=a;let c=s.update(a.val());if(c===void 0)s.unwatcher(),s.currentOutputSnapshotRaw=null,s.currentOutputSnapshotResolved=null,s.onComplete&&s.onComplete(null,!1,s.currentInputSnapshot);else{ag("transaction failed: Data returned ",c,s.path),s.status=0;let l=zy(t.transactionQueueTree_,e),d=ll(l)||[];d.push(s),ub(l,d);let h;typeof c=="object"&&c!==null&&Vr(c,".priority")?(h=Fs(c,".priority"),q(Zp(h),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):h=($y(t.serverSyncTree_,e)||ve.EMPTY_NODE).getPriority().val();let f=cg(t),g=At(c,h),E=cb(g,a,f);s.currentOutputSnapshotRaw=g,s.currentOutputSnapshotResolved=E,s.currentWriteId=Xy(t);let I=ib(t.serverSyncTree_,e,E,s.currentWriteId,s.applyLocally);vr(t.eventQueue_,e,I),Qy(t,t.transactionQueueTree_)}}function fb(t,e,n){return $y(t.serverSyncTree_,e,n)||ve.EMPTY_NODE}function Qy(t,e=t.transactionQueueTree_){if(e||Jy(t,e),ll(e)){let n=lH(t,e);q(n.length>0,"Sending zero length transaction queue"),n.every(i=>i.status===0)&&voe(t,sg(e),n)}else eH(e)&&qy(e,n=>{Qy(t,n)})}function voe(t,e,n){let r=n.map(l=>l.currentWriteId),i=fb(t,e,r),o=i,s=i.hash();for(let l=0;l<n.length;l++){let d=n[l];q(d.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),d.status=1,d.retryCount++;let h=zn(e,d.path);o=o.updateChild(h,d.currentOutputSnapshotRaw)}let a=o.val(!0),c=e;t.server_.put(c.toString(),a,l=>{Ld(t,"transaction put response",{path:c.toString(),status:l});let d=[];if(l==="ok"){let h=[];for(let f=0;f<n.length;f++)n[f].status=2,d=d.concat(Ys(t.serverSyncTree_,n[f].currentWriteId)),n[f].onComplete&&h.push(()=>n[f].onComplete(null,!0,n[f].currentOutputSnapshotResolved)),n[f].unwatcher();Jy(t,zy(t.transactionQueueTree_,e)),Qy(t,t.transactionQueueTree_),vr(t.eventQueue_,e,d);for(let f=0;f<h.length;f++)bd(h[f])}else{if(l==="datastale")for(let h=0;h<n.length;h++)n[h].status===3?n[h].status=4:n[h].status=0;else{xn("transaction at "+c.toString()+" failed: "+l);for(let h=0;h<n.length;h++)n[h].status=4,n[h].abortReason=l}Nd(t,e)}},s)}function Nd(t,e){let n=cH(t,e),r=sg(n),i=lH(t,n);return Soe(t,i,r),r}function Soe(t,e,n){if(e.length===0)return;let r=[],i=[],s=e.filter(a=>a.status===0).map(a=>a.currentWriteId);for(let a=0;a<e.length;a++){let c=e[a],l=zn(n,c.path),d=!1,h;if(q(l!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),c.status===4)d=!0,h=c.abortReason,i=i.concat(Ys(t.serverSyncTree_,c.currentWriteId,!0));else if(c.status===0)if(c.retryCount>=loe)d=!0,h="maxretry",i=i.concat(Ys(t.serverSyncTree_,c.currentWriteId,!0));else{let f=fb(t,c.path,s);c.currentInputSnapshot=f;let g=e[a].update(f.val());if(g!==void 0){ag("transaction failed: Data returned ",g,c.path);let E=At(g);typeof g=="object"&&g!=null&&Vr(g,".priority")||(E=E.updatePriority(f.getPriority()));let S=c.currentWriteId,L=cg(t),V=cb(E,f,L);c.currentOutputSnapshotRaw=E,c.currentOutputSnapshotResolved=V,c.currentWriteId=Xy(t),s.splice(s.indexOf(S),1),i=i.concat(ib(t.serverSyncTree_,c.path,V,c.currentWriteId,c.applyLocally)),i=i.concat(Ys(t.serverSyncTree_,S,!0))}else d=!0,h="nodata",i=i.concat(Ys(t.serverSyncTree_,c.currentWriteId,!0))}vr(t.eventQueue_,n,i),i=[],d&&(e[a].status=2,(function(f){setTimeout(f,Math.floor(0))})(e[a].unwatcher),e[a].onComplete&&(h==="nodata"?r.push(()=>e[a].onComplete(null,!1,e[a].currentInputSnapshot)):r.push(()=>e[a].onComplete(new Error(h),!1,null))))}Jy(t,t.transactionQueueTree_);for(let a=0;a<r.length;a++)bd(r[a]);Qy(t,t.transactionQueueTree_)}function cH(t,e){let n,r=t.transactionQueueTree_;for(n=Ne(e);n!==null&&ll(r)===void 0;)r=zy(r,n),e=at(e),n=Ne(e);return r}function lH(t,e){let n=[];return uH(t,e,n),n.sort((r,i)=>r.order-i.order),n}function uH(t,e,n){let r=ll(e);if(r)for(let i=0;i<r.length;i++)n.push(r[i]);qy(e,i=>{uH(t,i,n)})}function Jy(t,e){let n=ll(e);if(n){let r=0;for(let i=0;i<n.length;i++)n[i].status!==2&&(n[r]=n[i],r++);n.length=r,ub(e,n.length>0?n:void 0)}qy(e,r=>{Jy(t,r)})}function pb(t,e){let n=sg(cH(t,e)),r=zy(t.transactionQueueTree_,e);return Jie(r,i=>{zN(t,i)}),zN(t,r),tH(r,i=>{zN(t,i)}),n}function zN(t,e){let n=ll(e);if(n){let r=[],i=[],o=-1;for(let s=0;s<n.length;s++)n[s].status===3||(n[s].status===1?(q(o===s-1,"All SENT items should be at beginning of queue."),o=s,n[s].status=3,n[s].abortReason="set"):(q(n[s].status===0,"Unexpected transaction status in abort"),n[s].unwatcher(),i=i.concat(Ys(t.serverSyncTree_,n[s].currentWriteId,!0)),n[s].onComplete&&r.push(n[s].onComplete.bind(null,new Error("set"),!1,null))));o===-1?ub(e,void 0):n.length=o+1,vr(t.eventQueue_,sg(e),i);for(let s=0;s<r.length;s++)bd(r[s])}}function Aoe(t){let e="",n=t.split("/");for(let r=0;r<n.length;r++)if(n[r].length>0){let i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch{}e+="/"+i}return e}function Coe(t){let e={};t.charAt(0)==="?"&&(t=t.substring(1));for(let n of t.split("&")){if(n.length===0)continue;let r=n.split("=");r.length===2?e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):xn(`Invalid query segment '${n}' in query '${t}'`)}return e}var oj=function(t,e){let n=Doe(t),r=n.namespace;n.domain==="firebase.com"&&Wo(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!r||r==="undefined")&&n.domain!=="localhost"&&Wo("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||Jne();let i=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new my(n.host,n.secure,r,i,e,"",r!==n.subdomain),path:new Be(n.pathString)}},Doe=function(t){let e="",n="",r="",i="",o="",s=!0,a="https",c=443;if(typeof t=="string"){let l=t.indexOf("//");l>=0&&(a=t.substring(0,l-1),t=t.substring(l+2));let d=t.indexOf("/");d===-1&&(d=t.length);let h=t.indexOf("?");h===-1&&(h=t.length),e=t.substring(0,Math.min(d,h)),d<h&&(i=Aoe(t.substring(d,h)));let f=Coe(t.substring(Math.min(t.length,h)));l=e.indexOf(":"),l>=0?(s=a==="https"||a==="wss",c=parseInt(e.substring(l+1),10)):l=e.length;let g=e.slice(0,l);if(g.toLowerCase()==="localhost")n="localhost";else if(g.split(".").length<=2)n=g;else{let E=e.indexOf(".");r=e.substring(0,E).toLowerCase(),n=e.substring(E+1),o=r}"ns"in f&&(o=f.ns)}return{host:e,port:c,domain:n,subdomain:r,secure:s,scheme:a,pathString:i,namespace:o}};var sj="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",Roe=(function(){let t=0,e=[];return function(n){let r=n===t;t=n;let i,o=new Array(8);for(i=7;i>=0;i--)o[i]=sj.charAt(n%64),n=Math.floor(n/64);q(n===0,"Cannot push at time == 0");let s=o.join("");if(r){for(i=11;i>=0&&e[i]===63;i--)e[i]=0;e[i]++}else for(i=0;i<12;i++)e[i]=Math.floor(Math.random()*64);for(i=0;i<12;i++)s+=sj.charAt(e[i]);return q(s.length===20,"nextPushId: Length should be 20."),s}})();var ky=class{constructor(e,n,r,i){this.eventType=e,this.eventRegistration=n,this.snapshot=r,this.prevName=i}getPath(){let e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+xt(this.snapshot.exportVal())}},Fy=class{constructor(e,n,r){this.eventRegistration=e,this.error=n,this.path=r}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}};var eg=class{constructor(e,n){this.snapshotCallback=e,this.cancelCallback=n}onValue(e,n){this.snapshotCallback.call(null,e,n)}onCancel(e){return q(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}};var Fw=class{constructor(e,n){this._repo=e,this._path=n}cancel(){let e=new cn;return moe(this._repo,this._path,e.wrapCallback(()=>{})),e.promise}remove(){Xs("OnDisconnect.remove",this._path);let e=new cn;return ij(this._repo,this._path,null,e.wrapCallback(()=>{})),e.promise}set(e){Xs("OnDisconnect.set",this._path),rl("OnDisconnect.set",e,this._path,!1);let n=new cn;return ij(this._repo,this._path,e,n.wrapCallback(()=>{})),n.promise}setWithPriority(e,n){Xs("OnDisconnect.setWithPriority",this._path),rl("OnDisconnect.setWithPriority",e,this._path,!1),ioe("OnDisconnect.setWithPriority",n,!1);let r=new cn;return Eoe(this._repo,this._path,e,n,r.wrapCallback(()=>{})),r.promise}update(e){Xs("OnDisconnect.update",this._path),rH("OnDisconnect.update",e,this._path,!1);let n=new cn;return _oe(this._repo,this._path,e,n.wrapCallback(()=>{})),n.promise}};var il=class t{constructor(e,n,r,i){this._repo=e,this._path=n,this._queryParams=r,this._orderByCalled=i}get key(){return we(this._path)?null:Kw(this._path)}get ref(){return new hi(this._repo,this._path)}get _queryIdentifier(){let e=W2(this._queryParams),n=zw(e);return n==="{}"?"default":n}get _queryObject(){return W2(this._queryParams)}isEqual(e){if(e=Me(e),!(e instanceof t))return!1;let n=this._repo===e._repo,r=Yw(this._path,e._path),i=this._queryIdentifier===e._queryIdentifier;return n&&r&&i}toJSON(){return this.toString()}toString(){return this._repo.toString()+bre(this._path)}};function Noe(t,e){if(t._orderByCalled===!0)throw new Error(e+": You can't combine multiple orderBy calls.")}function gb(t){let e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===el){let r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!==tl)throw new Error(r);if(typeof e!="string")throw new Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!==Zs)throw new Error(r);if(typeof n!="string")throw new Error(i)}}else if(t.getIndex()===ft){if(e!=null&&!Zp(e)||n!=null&&!Zp(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(q(t.getIndex()instanceof Wp||t.getIndex()===Pj,"unknown index type."),e!=null&&typeof e=="object"||n!=null&&typeof n=="object")throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function dH(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}var hi=class t extends il{constructor(e,n){super(e,n,new fw,!1)}get parent(){let e=Nj(this._path);return e===null?null:new t(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}},wd=class t{constructor(e,n,r){this._node=e,this.ref=n,this._index=r}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){let n=new Be(e),r=ol(this.ref,e);return new t(this._node.getChild(n),r,ft)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(r,i)=>e(new t(i,ol(this.ref,r),ft)))}hasChild(e){let n=new Be(e);return!this._node.getChild(n).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}};function hH(t,e){return t=Me(t),t._checkNotDeleted("ref"),e!==void 0?ol(t._root,e):t._root}function ol(t,e){return t=Me(t),Ne(t._path)===null?ooe("child","path",e,!1):db("child","path",e,!1),new hi(t._repo,Ct(t._path,e))}function fH(t){return t=Me(t),new Fw(t._repo,t._path)}function pH(t,e){t=Me(t),Xs("push",t._path),rl("push",e,t._path,!0);let n=aH(t._repo),r=Roe(n),i=ol(t,r),o=ol(t,r),s;return e!=null?s=Zy(o,e).then(()=>o):s=Promise.resolve(o),i.then=s.then.bind(s),i.catch=s.then.bind(s,void 0),i}function gH(t){return Xs("remove",t._path),Zy(t,null)}function Zy(t,e){t=Me(t),Xs("set",t._path),rl("set",e,t._path,!1);let n=new cn;return foe(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}function mH(t,e){rH("update",e,t._path,!1);let n=new cn;return poe(t._repo,t._path,e,n.wrapCallback(()=>{})),n.promise}function eI(t){t=Me(t);let e=new eg(()=>{}),n=new tg(e);return hoe(t._repo,t,n).then(r=>new wd(r,new hi(t._repo,t._path),t._queryParams.getIndex()))}var tg=class t{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,n){let r=n._queryParams.getIndex();return new ky("value",this,new wd(e.snapshotNode,new hi(n._repo,n._path),r))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new Fy(this,e,n):null}matches(e){return e instanceof t?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}},Uy=class t{constructor(e,n){this.eventType=e,this.callbackContext=n}respondsTo(e){let n=e==="children_added"?"child_added":e;return n=n==="children_removed"?"child_removed":n,this.eventType===n}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new Fy(this,e,n):null}createEvent(e,n){q(e.childName!=null,"Child events should have a childName.");let r=ol(new hi(n._repo,n._path),e.childName),i=n._queryParams.getIndex();return new ky(e.type,this,new wd(e.snapshotNode,r,i),e.prevName)}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(e){return e instanceof t?this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)):!1}hasAnyCallback(){return!!this.callbackContext}};function lg(t,e,n,r,i){let o;if(typeof r=="object"&&(o=void 0,i=r),typeof r=="function"&&(o=r),i&&i.onlyOnce){let c=n,l=(d,h)=>{kw(t._repo,t,a),c(d,h)};l.userCallback=n.userCallback,l.context=n.context,n=l}let s=new eg(n,o||void 0),a=e==="value"?new tg(s):new Uy(e,s);return Toe(t._repo,t,a),()=>kw(t._repo,t,a)}function ug(t,e,n,r){return lg(t,"value",e,n,r)}function tI(t,e,n,r){return lg(t,"child_added",e,n,r)}function nI(t,e,n,r){return lg(t,"child_changed",e,n,r)}function mb(t,e,n,r){return lg(t,"child_moved",e,n,r)}function rI(t,e,n,r){return lg(t,"child_removed",e,n,r)}function iI(t,e,n){let r=null,i=n?new eg(n):null;e==="value"?r=new tg(i):e&&(r=new Uy(e,i)),kw(t._repo,t,r)}var sl=class{},Uw=class extends sl{constructor(e,n){super(),this._value=e,this._key=n,this.type="endAt"}_apply(e){rl("endAt",this._value,e._path,!0);let n=Kre(e._queryParams,this._value,this._key);if(dH(n),gb(n),e._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new il(e._repo,e._path,n,e._orderByCalled)}};var Vy=class extends sl{constructor(e,n){super(),this._value=e,this._key=n,this.type="startAt"}_apply(e){rl("startAt",this._value,e._path,!0);let n=qre(e._queryParams,this._value,this._key);if(dH(n),gb(n),e._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new il(e._repo,e._path,n,e._orderByCalled)}};function EH(t=null,e){return iH("startAt","key",e,!0),new Vy(t,e)}var Vw=class extends sl{constructor(e){super(),this._limit=e,this.type="limitToLast"}_apply(e){if(e._queryParams.hasLimit())throw new Error("limitToLast: Limit was already set (by another call to limitToFirst or limitToLast).");return new il(e._repo,e._path,zre(e._queryParams,this._limit),e._orderByCalled)}};function _H(t){if(typeof t!="number"||Math.floor(t)!==t||t<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new Vw(t)}var Bw=class extends sl{constructor(e){super(),this._path=e,this.type="orderByChild"}_apply(e){Noe(e,"orderByChild");let n=new Be(this._path);if(we(n))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");let r=new Wp(n),i=Yre(e._queryParams,r);return gb(i),new il(e._repo,e._path,i,!0)}};function TH(t){if(t==="$key")throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.');if(t==="$priority")throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.');if(t==="$value")throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.');return db("orderByChild","path",t,!1),new Bw(t)}var Gw=class extends sl{constructor(e,n){super(),this._value=e,this._key=n,this.type="equalTo"}_apply(e){if(rl("equalTo",this._value,e._path,!1),e._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(e._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new Uw(this._value,this._key)._apply(new Vy(this._value,this._key)._apply(e))}};function yH(t,e){return iH("equalTo","key",e,!0),new Gw(t,e)}function IH(t,...e){let n=Me(t);for(let r of e)n=r._apply(n);return n}bie(hi);xie(hi);var woe="FIREBASE_DATABASE_EMULATOR_HOST",jw={},boe=!1;function Ooe(t,e,n,r){let i=e.lastIndexOf(":"),o=e.substring(0,i),s=_r(o);t.repoInfo_=new my(e,s,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams,!0,n),r&&(t.authTokenProvider_=r)}function Moe(t,e,n,r,i){let o=r||t.options.databaseURL;o===void 0&&(t.options.projectId||Wo("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),un("Using default host for project ",t.options.projectId),o=`${t.options.projectId}-default-rtdb.firebaseio.com`);let s=oj(o,i),a=s.repoInfo,c,l;typeof process<"u"&&process.env&&(l=process.env[woe]),l?(c=!0,o=`http://${l}?ns=${a.namespace}`,s=oj(o,i),a=s.repoInfo):c=!s.repoInfo.secure;let d=i&&c?new Bp(Bp.OWNER):new JN(t.name,t.options,e);soe("Invalid Firebase Database URL",s),we(s.path)||Wo("Database URL must point to the root of a Firebase Database (not including a child path).");let h=Poe(a,t,d,new QN(t,n));return new Hw(h,t)}function Loe(t,e){let n=jw[e];(!n||n[t.key]!==t)&&Wo(`Database ${e}(${t.repoInfo_}) has already been deleted.`),yoe(t),delete n[t.key]}function Poe(t,e,n,r){let i=jw[e.name];i||(i={},jw[e.name]=i);let o=i[t.toURLString()];return o&&Wo("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),o=new xw(t,boe,n,r),i[t.toURLString()]=o,o}var Hw=class{constructor(e,n){this._repoInternal=e,this.app=n,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(uoe(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new hi(this._repo,Ve())),this._rootInternal}_delete(){return this._rootInternal!==null&&(Loe(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&Wo("Cannot call "+e+" on a deleted database.")}};function xoe(){Rj.IS_TRANSPORT_INITIALIZED&&xn("Transport has already been initialized. Please call this function before calling ref or setting up a listener")}function Eb(){xoe(),Td.forceDisallow(),Ey.forceAllow()}function Pd(t=er(),e){let n=Xi(t,"database").getImmediate({identifier:e});if(!n._instanceStarted){let r=ld("database");r&&vH(n,...r)}return n}function vH(t,e,n,r={}){t=Me(t),t._checkNotDeleted("useEmulator");let i=`${e}:${n}`,o=t._repoInternal;if(t._instanceStarted){if(i===t._repoInternal.repoInfo_.host&&oi(r,o.repoInfo_.emulatorOptions))return;Wo("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let s;if(o.repoInfo_.nodeAdmin)r.mockUserToken&&Wo('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),s=new Bp(Bp.OWNER);else if(r.mockUserToken){let a=typeof r.mockUserToken=="string"?r.mockUserToken:FT(r.mockUserToken,t.app.options.projectId);s=new Bp(a)}_r(e)&&(ks(e),Fc("Database",!0)),Ooe(o,i,r,s)}function koe(t){Xne(Bs),$n(new Xt("database",(e,{instanceIdentifier:n})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),o=e.getProvider("app-check-internal");return Moe(r,i,o,n)},"PUBLIC").setMultipleInstances(!0)),Ge(N2,w2,t),Ge(N2,w2,"esm2017")}var $w=class{constructor(e,n){this.committed=e,this.snapshot=n}toJSON(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}}};function SH(t,e,n){var r;if(t=Me(t),Xs("Reference.transaction",t._path),t.key===".length"||t.key===".keys")throw"Reference.transaction failed: "+t.key+" is a read-only object.";let i=(r=n?.applyLocally)!==null&&r!==void 0?r:!0,o=new cn,s=(c,l,d)=>{let h=null;c?o.reject(c):(h=new wd(d,new hi(t._repo,t._path),ft),o.resolve(new $w(l,h)))},a=ug(t,()=>{});return Ioe(t._repo,t._path,e,s,a,i),o.promise}Xw.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)};Xw.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};koe();var ul,hn=(function(t){return t.added="child_added",t.removed="child_removed",t.changed="child_changed",t.moved="child_moved",t.value="value",t})(hn||{}),Foe=Object.freeze((ul={},ul[hn.added]=tI,ul[hn.removed]=rI,ul[hn.changed]=nI,ul[hn.moved]=mb,ul[hn.value]=ug,ul));function sI(t,e){return new fe(function(n){var r=Foe[e](t,function(i,o){n.next({snapshot:i,prevKey:o,event:e})},n.error.bind(n));return{unsubscribe:function(){iI(t,e,r)}}}).pipe(cS(0))}var oI=function(){return oI=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},oI.apply(this,arguments)};function _b(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function AH(t){return(t==null||t.length===0)&&(t=[hn.added,hn.removed,hn.changed,hn.moved]),t}function CH(t,e){return e===void 0&&(e={}),sI(t,hn.value).pipe(De(function(n){return Tb(n,e)}))}function Tb(t,e){var n;e===void 0&&(e={});var r=t.snapshot.val();return!t.snapshot.exists()||typeof r!="object"?r:oI(oI({},r),e.keyField?(n={},n[e.keyField]=t.snapshot.key,n):null)}function DH(t,e){e===void 0&&(e={});var n=AH(e.events),r=n.map(function(i){return sI(t,i)});return gs.apply(void 0,r)}function Uoe(t){return cr(eI(t)).pipe(De(function(e){var n=hn.value;return{snapshot:e,prevKey:null,event:n}}))}function RH(t,e){e===void 0&&(e={});var n=AH(e.events);return Uoe(t).pipe(Mr(function(r){var i=[lt(r)];return n.forEach(function(o){i.push(sI(t,o))}),gs.apply(void 0,i).pipe(Zm(Boe,[]))}),yo())}function NH(t,e){return e===void 0&&(e={}),RH(t).pipe(De(function(n){return n.map(function(r){return Tb(r,e)})}))}function wH(t,e){for(var n=t.length,r=0;r<n;r++)if(t[r].snapshot.key===e)return r;return-1}function Voe(t,e){if(e==null)return 0;var n=wH(t,e);return n===-1?t.length:n+1}function Boe(t,e){var n=e.snapshot,r=e.prevKey,i=e.event,o=n.key,s=wH(t,o),a=Voe(t,r||void 0);switch(i){case hn.value:if(e.snapshot&&e.snapshot.exists()){var c=null;e.snapshot.forEach(function(h){var f={snapshot:h,event:hn.value,prevKey:c};return c=h.key,t=_b(_b([],t,!0),[f],!1),!1})}return t;case hn.added:if(s>-1){var l=t[s-1];(l&&l.snapshot.key||null)!==r&&(t=t.filter(function(h){return h.snapshot.key!==n.key}),t.splice(a,0,e))}else{if(r==null)return _b([e],t,!0);t=t.slice(),t.splice(a,0,e)}return t;case hn.removed:return t.filter(function(h){return h.snapshot.key!==n.key});case hn.changed:return t.map(function(h){return h.snapshot.key===o?e:h});case hn.moved:if(s>-1){var d=t.splice(s,1)[0];return t=t.slice(),t.splice(a,0,d),t}return t;default:return t}}var dg=class{constructor(e){return e}},bH="database",yb=class{constructor(){return Go(bH)}};var Ib=new z("angularfire2.database-instances");function Goe(t,e){let n=Gs(bH,t,e);return n&&new dg(n)}function joe(t){return(e,n)=>{let r=e.runOutsideAngular(()=>t(n));return new dg(r)}}var Hoe={provide:yb,deps:[[new zt,Ib]]},$oe={provide:dg,useFactory:Goe,deps:[[new zt,Ib],ci]};function tFe(t,...e){return Ge("angularfire",si.full,"rtdb"),Xn([$oe,Hoe,{provide:Ib,useFactory:joe(t),multi:!0,deps:[Ae,ze,ai,jo,[new zt,$c],[new zt,Hs],...e]}])}var OH=ue(NH,!0);var MH=ue(CH,!0),LH=ue(DH,!0);var nFe=ue(yH,!0,2);var hg=ue(eI,!0),rFe=ue(Pd,!0);var iFe=ue(_H,!0,2),PH=ue(iI,!0),xH=ue(tI,!0),kH=ue(nI,!0);var FH=ue(rI,!0),UH=ue(fH,!0),vb=ue(ug,!0),oFe=ue(TH,!0,2);var VH=ue(pH,!0,2),BH=ue(IH,!0,2),xd=ue(hH,!0,2);var GH=ue(gH,!0,2),jH=ue(SH,!0),HH=ue(Zy,!0,2);var sFe=ue(EH,!0,2),$H=ue(mH,!0,2);var WH=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},zH={};var zo,Sb;(function(){var t;function e(C,v){function A(){}A.prototype=v.prototype,C.D=v.prototype,C.prototype=new A,C.prototype.constructor=C,C.C=function(R,N,O){for(var D=Array(arguments.length-2),Vn=2;Vn<arguments.length;Vn++)D[Vn-2]=arguments[Vn];return v.prototype[N].apply(R,D)}}function n(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,n),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function i(C,v,A){A||(A=0);var R=Array(16);if(typeof v=="string")for(var N=0;16>N;++N)R[N]=v.charCodeAt(A++)|v.charCodeAt(A++)<<8|v.charCodeAt(A++)<<16|v.charCodeAt(A++)<<24;else for(N=0;16>N;++N)R[N]=v[A++]|v[A++]<<8|v[A++]<<16|v[A++]<<24;v=C.g[0],A=C.g[1],N=C.g[2];var O=C.g[3],D=v+(O^A&(N^O))+R[0]+3614090360&4294967295;v=A+(D<<7&4294967295|D>>>25),D=O+(N^v&(A^N))+R[1]+3905402710&4294967295,O=v+(D<<12&4294967295|D>>>20),D=N+(A^O&(v^A))+R[2]+606105819&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(v^N&(O^v))+R[3]+3250441966&4294967295,A=N+(D<<22&4294967295|D>>>10),D=v+(O^A&(N^O))+R[4]+4118548399&4294967295,v=A+(D<<7&4294967295|D>>>25),D=O+(N^v&(A^N))+R[5]+1200080426&4294967295,O=v+(D<<12&4294967295|D>>>20),D=N+(A^O&(v^A))+R[6]+2821735955&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(v^N&(O^v))+R[7]+4249261313&4294967295,A=N+(D<<22&4294967295|D>>>10),D=v+(O^A&(N^O))+R[8]+1770035416&4294967295,v=A+(D<<7&4294967295|D>>>25),D=O+(N^v&(A^N))+R[9]+2336552879&4294967295,O=v+(D<<12&4294967295|D>>>20),D=N+(A^O&(v^A))+R[10]+4294925233&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(v^N&(O^v))+R[11]+2304563134&4294967295,A=N+(D<<22&4294967295|D>>>10),D=v+(O^A&(N^O))+R[12]+1804603682&4294967295,v=A+(D<<7&4294967295|D>>>25),D=O+(N^v&(A^N))+R[13]+4254626195&4294967295,O=v+(D<<12&4294967295|D>>>20),D=N+(A^O&(v^A))+R[14]+2792965006&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(v^N&(O^v))+R[15]+1236535329&4294967295,A=N+(D<<22&4294967295|D>>>10),D=v+(N^O&(A^N))+R[1]+4129170786&4294967295,v=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(v^A))+R[6]+3225465664&4294967295,O=v+(D<<9&4294967295|D>>>23),D=N+(v^A&(O^v))+R[11]+643717713&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^v&(N^O))+R[0]+3921069994&4294967295,A=N+(D<<20&4294967295|D>>>12),D=v+(N^O&(A^N))+R[5]+3593408605&4294967295,v=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(v^A))+R[10]+38016083&4294967295,O=v+(D<<9&4294967295|D>>>23),D=N+(v^A&(O^v))+R[15]+3634488961&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^v&(N^O))+R[4]+3889429448&4294967295,A=N+(D<<20&4294967295|D>>>12),D=v+(N^O&(A^N))+R[9]+568446438&4294967295,v=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(v^A))+R[14]+3275163606&4294967295,O=v+(D<<9&4294967295|D>>>23),D=N+(v^A&(O^v))+R[3]+4107603335&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^v&(N^O))+R[8]+1163531501&4294967295,A=N+(D<<20&4294967295|D>>>12),D=v+(N^O&(A^N))+R[13]+2850285829&4294967295,v=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(v^A))+R[2]+4243563512&4294967295,O=v+(D<<9&4294967295|D>>>23),D=N+(v^A&(O^v))+R[7]+1735328473&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^v&(N^O))+R[12]+2368359562&4294967295,A=N+(D<<20&4294967295|D>>>12),D=v+(A^N^O)+R[5]+4294588738&4294967295,v=A+(D<<4&4294967295|D>>>28),D=O+(v^A^N)+R[8]+2272392833&4294967295,O=v+(D<<11&4294967295|D>>>21),D=N+(O^v^A)+R[11]+1839030562&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^v)+R[14]+4259657740&4294967295,A=N+(D<<23&4294967295|D>>>9),D=v+(A^N^O)+R[1]+2763975236&4294967295,v=A+(D<<4&4294967295|D>>>28),D=O+(v^A^N)+R[4]+1272893353&4294967295,O=v+(D<<11&4294967295|D>>>21),D=N+(O^v^A)+R[7]+4139469664&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^v)+R[10]+3200236656&4294967295,A=N+(D<<23&4294967295|D>>>9),D=v+(A^N^O)+R[13]+681279174&4294967295,v=A+(D<<4&4294967295|D>>>28),D=O+(v^A^N)+R[0]+3936430074&4294967295,O=v+(D<<11&4294967295|D>>>21),D=N+(O^v^A)+R[3]+3572445317&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^v)+R[6]+76029189&4294967295,A=N+(D<<23&4294967295|D>>>9),D=v+(A^N^O)+R[9]+3654602809&4294967295,v=A+(D<<4&4294967295|D>>>28),D=O+(v^A^N)+R[12]+3873151461&4294967295,O=v+(D<<11&4294967295|D>>>21),D=N+(O^v^A)+R[15]+530742520&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^v)+R[2]+3299628645&4294967295,A=N+(D<<23&4294967295|D>>>9),D=v+(N^(A|~O))+R[0]+4096336452&4294967295,v=A+(D<<6&4294967295|D>>>26),D=O+(A^(v|~N))+R[7]+1126891415&4294967295,O=v+(D<<10&4294967295|D>>>22),D=N+(v^(O|~A))+R[14]+2878612391&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~v))+R[5]+4237533241&4294967295,A=N+(D<<21&4294967295|D>>>11),D=v+(N^(A|~O))+R[12]+1700485571&4294967295,v=A+(D<<6&4294967295|D>>>26),D=O+(A^(v|~N))+R[3]+2399980690&4294967295,O=v+(D<<10&4294967295|D>>>22),D=N+(v^(O|~A))+R[10]+4293915773&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~v))+R[1]+2240044497&4294967295,A=N+(D<<21&4294967295|D>>>11),D=v+(N^(A|~O))+R[8]+1873313359&4294967295,v=A+(D<<6&4294967295|D>>>26),D=O+(A^(v|~N))+R[15]+4264355552&4294967295,O=v+(D<<10&4294967295|D>>>22),D=N+(v^(O|~A))+R[6]+2734768916&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~v))+R[13]+1309151649&4294967295,A=N+(D<<21&4294967295|D>>>11),D=v+(N^(A|~O))+R[4]+4149444226&4294967295,v=A+(D<<6&4294967295|D>>>26),D=O+(A^(v|~N))+R[11]+3174756917&4294967295,O=v+(D<<10&4294967295|D>>>22),D=N+(v^(O|~A))+R[2]+718787259&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~v))+R[9]+3951481745&4294967295,C.g[0]=C.g[0]+v&4294967295,C.g[1]=C.g[1]+(N+(D<<21&4294967295|D>>>11))&4294967295,C.g[2]=C.g[2]+N&4294967295,C.g[3]=C.g[3]+O&4294967295}r.prototype.u=function(C,v){v===void 0&&(v=C.length);for(var A=v-this.blockSize,R=this.B,N=this.h,O=0;O<v;){if(N==0)for(;O<=A;)i(this,C,O),O+=this.blockSize;if(typeof C=="string"){for(;O<v;)if(R[N++]=C.charCodeAt(O++),N==this.blockSize){i(this,R),N=0;break}}else for(;O<v;)if(R[N++]=C[O++],N==this.blockSize){i(this,R),N=0;break}}this.h=N,this.o+=v},r.prototype.v=function(){var C=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);C[0]=128;for(var v=1;v<C.length-8;++v)C[v]=0;var A=8*this.o;for(v=C.length-8;v<C.length;++v)C[v]=A&255,A/=256;for(this.u(C),C=Array(16),v=A=0;4>v;++v)for(var R=0;32>R;R+=8)C[A++]=this.g[v]>>>R&255;return C};function o(C,v){var A=a;return Object.prototype.hasOwnProperty.call(A,C)?A[C]:A[C]=v(C)}function s(C,v){this.h=v;for(var A=[],R=!0,N=C.length-1;0<=N;N--){var O=C[N]|0;R&&O==v||(A[N]=O,R=!1)}this.g=A}var a={};function c(C){return-128<=C&&128>C?o(C,function(v){return new s([v|0],0>v?-1:0)}):new s([C|0],0>C?-1:0)}function l(C){if(isNaN(C)||!isFinite(C))return h;if(0>C)return S(l(-C));for(var v=[],A=1,R=0;C>=A;R++)v[R]=C/A|0,A*=4294967296;return new s(v,0)}function d(C,v){if(C.length==0)throw Error("number format error: empty string");if(v=v||10,2>v||36<v)throw Error("radix out of range: "+v);if(C.charAt(0)=="-")return S(d(C.substring(1),v));if(0<=C.indexOf("-"))throw Error('number format error: interior "-" character');for(var A=l(Math.pow(v,8)),R=h,N=0;N<C.length;N+=8){var O=Math.min(8,C.length-N),D=parseInt(C.substring(N,N+O),v);8>O?(O=l(Math.pow(v,O)),R=R.j(O).add(l(D))):(R=R.j(A),R=R.add(l(D)))}return R}var h=c(0),f=c(1),g=c(16777216);t=s.prototype,t.m=function(){if(I(this))return-S(this).m();for(var C=0,v=1,A=0;A<this.g.length;A++){var R=this.i(A);C+=(0<=R?R:4294967296+R)*v,v*=4294967296}return C},t.toString=function(C){if(C=C||10,2>C||36<C)throw Error("radix out of range: "+C);if(E(this))return"0";if(I(this))return"-"+S(this).toString(C);for(var v=l(Math.pow(C,6)),A=this,R="";;){var N=oe(A,v).g;A=L(A,N.j(v));var O=((0<A.g.length?A.g[0]:A.h)>>>0).toString(C);if(A=N,E(A))return O+R;for(;6>O.length;)O="0"+O;R=O+R}},t.i=function(C){return 0>C?0:C<this.g.length?this.g[C]:this.h};function E(C){if(C.h!=0)return!1;for(var v=0;v<C.g.length;v++)if(C.g[v]!=0)return!1;return!0}function I(C){return C.h==-1}t.l=function(C){return C=L(this,C),I(C)?-1:E(C)?0:1};function S(C){for(var v=C.g.length,A=[],R=0;R<v;R++)A[R]=~C.g[R];return new s(A,~C.h).add(f)}t.abs=function(){return I(this)?S(this):this},t.add=function(C){for(var v=Math.max(this.g.length,C.g.length),A=[],R=0,N=0;N<=v;N++){var O=R+(this.i(N)&65535)+(C.i(N)&65535),D=(O>>>16)+(this.i(N)>>>16)+(C.i(N)>>>16);R=D>>>16,O&=65535,D&=65535,A[N]=D<<16|O}return new s(A,A[A.length-1]&-2147483648?-1:0)};function L(C,v){return C.add(S(v))}t.j=function(C){if(E(this)||E(C))return h;if(I(this))return I(C)?S(this).j(S(C)):S(S(this).j(C));if(I(C))return S(this.j(S(C)));if(0>this.l(g)&&0>C.l(g))return l(this.m()*C.m());for(var v=this.g.length+C.g.length,A=[],R=0;R<2*v;R++)A[R]=0;for(R=0;R<this.g.length;R++)for(var N=0;N<C.g.length;N++){var O=this.i(R)>>>16,D=this.i(R)&65535,Vn=C.i(N)>>>16,es=C.i(N)&65535;A[2*R+2*N]+=D*es,V(A,2*R+2*N),A[2*R+2*N+1]+=O*es,V(A,2*R+2*N+1),A[2*R+2*N+1]+=D*Vn,V(A,2*R+2*N+1),A[2*R+2*N+2]+=O*Vn,V(A,2*R+2*N+2)}for(R=0;R<v;R++)A[R]=A[2*R+1]<<16|A[2*R];for(R=v;R<2*v;R++)A[R]=0;return new s(A,0)};function V(C,v){for(;(C[v]&65535)!=C[v];)C[v+1]+=C[v]>>>16,C[v]&=65535,v++}function K(C,v){this.g=C,this.h=v}function oe(C,v){if(E(v))throw Error("division by zero");if(E(C))return new K(h,h);if(I(C))return v=oe(S(C),v),new K(S(v.g),S(v.h));if(I(v))return v=oe(C,S(v)),new K(S(v.g),v.h);if(30<C.g.length){if(I(C)||I(v))throw Error("slowDivide_ only works with positive integers.");for(var A=f,R=v;0>=R.l(C);)A=ge(A),R=ge(R);var N=te(A,1),O=te(R,1);for(R=te(R,2),A=te(A,2);!E(R);){var D=O.add(R);0>=D.l(C)&&(N=N.add(A),O=D),R=te(R,1),A=te(A,1)}return v=L(C,N.j(v)),new K(N,v)}for(N=h;0<=C.l(v);){for(A=Math.max(1,Math.floor(C.m()/v.m())),R=Math.ceil(Math.log(A)/Math.LN2),R=48>=R?1:Math.pow(2,R-48),O=l(A),D=O.j(v);I(D)||0<D.l(C);)A-=R,O=l(A),D=O.j(v);E(O)&&(O=f),N=N.add(O),C=L(C,D)}return new K(N,C)}t.A=function(C){return oe(this,C).h},t.and=function(C){for(var v=Math.max(this.g.length,C.g.length),A=[],R=0;R<v;R++)A[R]=this.i(R)&C.i(R);return new s(A,this.h&C.h)},t.or=function(C){for(var v=Math.max(this.g.length,C.g.length),A=[],R=0;R<v;R++)A[R]=this.i(R)|C.i(R);return new s(A,this.h|C.h)},t.xor=function(C){for(var v=Math.max(this.g.length,C.g.length),A=[],R=0;R<v;R++)A[R]=this.i(R)^C.i(R);return new s(A,this.h^C.h)};function ge(C){for(var v=C.g.length+1,A=[],R=0;R<v;R++)A[R]=C.i(R)<<1|C.i(R-1)>>>31;return new s(A,C.h)}function te(C,v){var A=v>>5;v%=32;for(var R=C.g.length-A,N=[],O=0;O<R;O++)N[O]=0<v?C.i(O+A)>>>v|C.i(O+A+1)<<32-v:C.i(O+A);return new s(N,C.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,Sb=zH.Md5=r,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.A,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=l,s.fromString=d,zo=zH.Integer=s}).apply(typeof WH<"u"?WH:typeof self<"u"?self:typeof window<"u"?window:{});var aI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qo={};var Ab,Woe,kd,Cb,fg,cI,Db,Rb,Nb;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(u,p,m){return u==Array.prototype||u==Object.prototype||(u[p]=m.value),u};function n(u){u=[typeof globalThis=="object"&&globalThis,u,typeof window=="object"&&window,typeof self=="object"&&self,typeof aI=="object"&&aI];for(var p=0;p<u.length;++p){var m=u[p];if(m&&m.Math==Math)return m}throw Error("Cannot find global object")}var r=n(this);function i(u,p){if(p)e:{var m=r;u=u.split(".");for(var _=0;_<u.length-1;_++){var b=u[_];if(!(b in m))break e;m=m[b]}u=u[u.length-1],_=m[u],p=p(_),p!=_&&p!=null&&e(m,u,{configurable:!0,writable:!0,value:p})}}function o(u,p){u instanceof String&&(u+="");var m=0,_=!1,b={next:function(){if(!_&&m<u.length){var k=m++;return{value:p(k,u[k]),done:!1}}return _=!0,{done:!0,value:void 0}}};return b[Symbol.iterator]=function(){return b},b}i("Array.prototype.values",function(u){return u||function(){return o(this,function(p,m){return m})}});var s=s||{},a=this||self;function c(u){var p=typeof u;return p=p!="object"?p:u?Array.isArray(u)?"array":p:"null",p=="array"||p=="object"&&typeof u.length=="number"}function l(u){var p=typeof u;return p=="object"&&u!=null||p=="function"}function d(u,p,m){return u.call.apply(u.bind,arguments)}function h(u,p,m){if(!u)throw Error();if(2<arguments.length){var _=Array.prototype.slice.call(arguments,2);return function(){var b=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(b,_),u.apply(p,b)}}return function(){return u.apply(p,arguments)}}function f(u,p,m){return f=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?d:h,f.apply(null,arguments)}function g(u,p){var m=Array.prototype.slice.call(arguments,1);return function(){var _=m.slice();return _.push.apply(_,arguments),u.apply(this,_)}}function E(u,p){function m(){}m.prototype=p.prototype,u.aa=p.prototype,u.prototype=new m,u.prototype.constructor=u,u.Qb=function(_,b,k){for(var X=Array(arguments.length-2),it=2;it<arguments.length;it++)X[it-2]=arguments[it];return p.prototype[b].apply(_,X)}}function I(u){let p=u.length;if(0<p){let m=Array(p);for(let _=0;_<p;_++)m[_]=u[_];return m}return[]}function S(u,p){for(let m=1;m<arguments.length;m++){let _=arguments[m];if(c(_)){let b=u.length||0,k=_.length||0;u.length=b+k;for(let X=0;X<k;X++)u[b+X]=_[X]}else u.push(_)}}class L{constructor(p,m){this.i=p,this.j=m,this.h=0,this.g=null}get(){let p;return 0<this.h?(this.h--,p=this.g,this.g=p.next,p.next=null):p=this.i(),p}}function V(u){return/^[\s\xa0]*$/.test(u)}function K(){var u=a.navigator;return u&&(u=u.userAgent)?u:""}function oe(u){return oe[" "](u),u}oe[" "]=function(){};var ge=K().indexOf("Gecko")!=-1&&!(K().toLowerCase().indexOf("webkit")!=-1&&K().indexOf("Edge")==-1)&&!(K().indexOf("Trident")!=-1||K().indexOf("MSIE")!=-1)&&K().indexOf("Edge")==-1;function te(u,p,m){for(let _ in u)p.call(m,u[_],_,u)}function C(u,p){for(let m in u)p.call(void 0,u[m],m,u)}function v(u){let p={};for(let m in u)p[m]=u[m];return p}let A="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function R(u,p){let m,_;for(let b=1;b<arguments.length;b++){_=arguments[b];for(m in _)u[m]=_[m];for(let k=0;k<A.length;k++)m=A[k],Object.prototype.hasOwnProperty.call(_,m)&&(u[m]=_[m])}}function N(u){var p=1;u=u.split(":");let m=[];for(;0<p&&u.length;)m.push(u.shift()),p--;return u.length&&m.push(u.join(":")),m}function O(u){a.setTimeout(()=>{throw u},0)}function D(){var u=ns;let p=null;return u.g&&(p=u.g,u.g=u.g.next,u.g||(u.h=null),p.next=null),p}class Vn{constructor(){this.h=this.g=null}add(p,m){let _=es.get();_.set(p,m),this.h?this.h.next=_:this.g=_,this.h=_}}var es=new L(()=>new ts,u=>u.reset());class ts{constructor(){this.next=this.g=this.h=null}set(p,m){this.h=p,this.g=m,this.next=null}reset(){this.next=this.g=this.h=null}}let Da,Ra=!1,ns=new Vn,Fl=()=>{let u=a.Promise.resolve(void 0);Da=()=>{u.then(hm)}};var hm=()=>{for(var u;u=D();){try{u.h.call(u.g)}catch(m){O(m)}var p=es;p.j(u),100>p.h&&(p.h++,u.next=p.g,p.g=u)}Ra=!1};function _i(){this.s=this.s,this.C=this.C}_i.prototype.s=!1,_i.prototype.ma=function(){this.s||(this.s=!0,this.N())},_i.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function nn(u,p){this.type=u,this.g=this.target=p,this.defaultPrevented=!1}nn.prototype.h=function(){this.defaultPrevented=!0};var kv=(function(){if(!a.addEventListener||!Object.defineProperty)return!1;var u=!1,p=Object.defineProperty({},"passive",{get:function(){u=!0}});try{let m=()=>{};a.addEventListener("test",m,p),a.removeEventListener("test",m,p)}catch{}return u})();function He(u,p){if(nn.call(this,u?u.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,u){var m=this.type=u.type,_=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;if(this.target=u.target||u.srcElement,this.g=p,p=u.relatedTarget){if(ge){e:{try{oe(p.nodeName);var b=!0;break e}catch{}b=!1}b||(p=null)}}else m=="mouseover"?p=u.fromElement:m=="mouseout"&&(p=u.toElement);this.relatedTarget=p,_?(this.clientX=_.clientX!==void 0?_.clientX:_.pageX,this.clientY=_.clientY!==void 0?_.clientY:_.pageY,this.screenX=_.screenX||0,this.screenY=_.screenY||0):(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0),this.button=u.button,this.key=u.key||"",this.ctrlKey=u.ctrlKey,this.altKey=u.altKey,this.shiftKey=u.shiftKey,this.metaKey=u.metaKey,this.pointerId=u.pointerId||0,this.pointerType=typeof u.pointerType=="string"?u.pointerType:Fv[u.pointerType]||"",this.state=u.state,this.i=u,u.defaultPrevented&&He.aa.h.call(this)}}E(He,nn);var Fv={2:"touch",3:"pen",4:"mouse"};He.prototype.h=function(){He.aa.h.call(this);var u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var Na="closure_listenable_"+(1e6*Math.random()|0),Uv=0;function Vv(u,p,m,_,b){this.listener=u,this.proxy=null,this.src=p,this.type=m,this.capture=!!_,this.ha=b,this.key=++Uv,this.da=this.fa=!1}function Ul(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Vl(u){this.src=u,this.g={},this.h=0}Vl.prototype.add=function(u,p,m,_,b){var k=u.toString();u=this.g[k],u||(u=this.g[k]=[],this.h++);var X=wh(u,p,_,b);return-1<X?(p=u[X],m||(p.fa=!1)):(p=new Vv(p,this.src,k,!!_,b),p.fa=m,u.push(p)),p};function Bl(u,p){var m=p.type;if(m in u.g){var _=u.g[m],b=Array.prototype.indexOf.call(_,p,void 0),k;(k=0<=b)&&Array.prototype.splice.call(_,b,1),k&&(Ul(p),u.g[m].length==0&&(delete u.g[m],u.h--))}}function wh(u,p,m,_){for(var b=0;b<u.length;++b){var k=u[b];if(!k.da&&k.listener==p&&k.capture==!!m&&k.ha==_)return b}return-1}var Gl="closure_lm_"+(1e6*Math.random()|0),Je={};function jl(u,p,m,_,b){if(_&&_.once)return sr(u,p,m,_,b);if(Array.isArray(p)){for(var k=0;k<p.length;k++)jl(u,p[k],m,_,b);return null}return m=Wl(m),u&&u[Na]?u.K(p,m,l(_)?!!_.capture:!!_,b):rt(u,p,m,!1,_,b)}function rt(u,p,m,_,b,k){if(!p)throw Error("Invalid event type");var X=l(b)?!!b.capture:!!b,it=wa(u);if(it||(u[Gl]=it=new Vl(u)),m=it.add(p,m,_,X,k),m.proxy)return m;if(_=bh(),m.proxy=_,_.src=u,_.listener=m,u.addEventListener)kv||(b=X),b===void 0&&(b=!1),u.addEventListener(p.toString(),_,b);else if(u.attachEvent)u.attachEvent(Wr(p.toString()),_);else if(u.addListener&&u.removeListener)u.addListener(_);else throw Error("addEventListener and attachEvent are unavailable.");return m}function bh(){function u(m){return p.call(u.src,u.listener,m)}let p=fm;return u}function sr(u,p,m,_,b){if(Array.isArray(p)){for(var k=0;k<p.length;k++)sr(u,p[k],m,_,b);return null}return m=Wl(m),u&&u[Na]?u.L(p,m,l(_)?!!_.capture:!!_,b):rt(u,p,m,!0,_,b)}function rs(u,p,m,_,b){if(Array.isArray(p))for(var k=0;k<p.length;k++)rs(u,p[k],m,_,b);else _=l(_)?!!_.capture:!!_,m=Wl(m),u&&u[Na]?(u=u.i,p=String(p).toString(),p in u.g&&(k=u.g[p],m=wh(k,m,_,b),-1<m&&(Ul(k[m]),Array.prototype.splice.call(k,m,1),k.length==0&&(delete u.g[p],u.h--)))):u&&(u=wa(u))&&(p=u.g[p.toString()],u=-1,p&&(u=wh(p,m,_,b)),(m=-1<u?p[u]:null)&&Hl(m))}function Hl(u){if(typeof u!="number"&&u&&!u.da){var p=u.src;if(p&&p[Na])Bl(p.i,u);else{var m=u.type,_=u.proxy;p.removeEventListener?p.removeEventListener(m,_,u.capture):p.detachEvent?p.detachEvent(Wr(m),_):p.addListener&&p.removeListener&&p.removeListener(_),(m=wa(p))?(Bl(m,u),m.h==0&&(m.src=null,p[Gl]=null)):Ul(u)}}}function Wr(u){return u in Je?Je[u]:Je[u]="on"+u}function fm(u,p){if(u.da)u=!0;else{p=new He(p,this);var m=u.listener,_=u.ha||u.src;u.fa&&Hl(u),u=m.call(_,p)}return u}function wa(u){return u=u[Gl],u instanceof Vl?u:null}var $l="__closure_events_fn_"+(1e9*Math.random()>>>0);function Wl(u){return typeof u=="function"?u:(u[$l]||(u[$l]=function(p){return u.handleEvent(p)}),u[$l])}function dt(){_i.call(this),this.i=new Vl(this),this.M=this,this.F=null}E(dt,_i),dt.prototype[Na]=!0,dt.prototype.removeEventListener=function(u,p,m,_){rs(this,u,p,m,_)};function yt(u,p){var m,_=u.F;if(_)for(m=[];_;_=_.F)m.push(_);if(u=u.M,_=p.type||p,typeof p=="string")p=new nn(p,u);else if(p instanceof nn)p.target=p.target||u;else{var b=p;p=new nn(_,u),R(p,b)}if(b=!0,m)for(var k=m.length-1;0<=k;k--){var X=p.g=m[k];b=wr(X,_,!0,p)&&b}if(X=p.g=u,b=wr(X,_,!0,p)&&b,b=wr(X,_,!1,p)&&b,m)for(k=0;k<m.length;k++)X=p.g=m[k],b=wr(X,_,!1,p)&&b}dt.prototype.N=function(){if(dt.aa.N.call(this),this.i){var u=this.i,p;for(p in u.g){for(var m=u.g[p],_=0;_<m.length;_++)Ul(m[_]);delete u.g[p],u.h--}}this.F=null},dt.prototype.K=function(u,p,m,_){return this.i.add(String(u),p,!1,m,_)},dt.prototype.L=function(u,p,m,_){return this.i.add(String(u),p,!0,m,_)};function wr(u,p,m,_){if(p=u.i.g[String(p)],!p)return!0;p=p.concat();for(var b=!0,k=0;k<p.length;++k){var X=p[k];if(X&&!X.da&&X.capture==m){var it=X.listener,gn=X.ha||X.src;X.fa&&Bl(u.i,X),b=it.call(gn,_)!==!1&&b}}return b&&!_.defaultPrevented}function zl(u,p,m){if(typeof u=="function")m&&(u=f(u,m));else if(u&&typeof u.handleEvent=="function")u=f(u.handleEvent,u);else throw Error("Invalid listener argument");return 2147483647<Number(p)?-1:a.setTimeout(u,p||0)}function ba(u){u.g=zl(()=>{u.g=null,u.i&&(u.i=!1,ba(u))},u.l);let p=u.h;u.h=null,u.m.apply(null,p)}class ql extends _i{constructor(p,m){super(),this.m=p,this.l=m,this.h=null,this.i=!1,this.g=null}j(p){this.h=arguments,this.g?this.i=!0:ba(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function co(u){_i.call(this),this.h=u,this.g={}}E(co,_i);var lo=[];function Oa(u){te(u.g,function(p,m){this.g.hasOwnProperty(m)&&Hl(p)},u),u.g={}}co.prototype.N=function(){co.aa.N.call(this),Oa(this)},co.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var is=a.JSON.stringify,pm=a.JSON.parse,gm=class{stringify(u){return a.JSON.stringify(u,void 0)}parse(u){return a.JSON.parse(u,void 0)}};function Kl(){}Kl.prototype.h=null;function Yl(u){return u.h||(u.h=u.i())}function Xl(){}var br={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Ti(){nn.call(this,"d")}E(Ti,nn);function Ql(){nn.call(this,"c")}E(Ql,nn);var yi={},Oh=null;function Ma(){return Oh=Oh||new dt}yi.La="serverreachability";function Mh(u){nn.call(this,yi.La,u)}E(Mh,nn);function Ii(u){let p=Ma();yt(p,new Mh(p))}yi.STAT_EVENT="statevent";function La(u,p){nn.call(this,yi.STAT_EVENT,u),this.stat=p}E(La,nn);function ct(u){let p=Ma();yt(p,new La(p,u))}yi.Ma="timingevent";function uo(u,p){nn.call(this,yi.Ma,u),this.size=p}E(uo,nn);function ho(u,p){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){u()},p)}function fo(){this.g=!0}fo.prototype.xa=function(){this.g=!1};function Bv(u,p,m,_,b,k){u.info(function(){if(u.g)if(k)for(var X="",it=k.split("&"),gn=0;gn<it.length;gn++){var Fe=it[gn].split("=");if(1<Fe.length){var vn=Fe[0];Fe=Fe[1];var Sn=vn.split("_");X=2<=Sn.length&&Sn[1]=="type"?X+(vn+"="+Fe+"&"):X+(vn+"=redacted&")}}else X=null;else X=k;return"XMLHTTP REQ ("+_+") [attempt "+b+"]: "+p+`
|
|
153
|
+
FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(let n of this.listens.values())for(let r of n.values())this.sendListen_(r);for(let n=0;n<this.outstandingPuts_.length;n++)this.outstandingPuts_[n]&&this.sendPut_(n);for(;this.onDisconnectRequestQueue_.length;){let n=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(n.action,n.pathString,n.data,n.onComplete)}for(let n=0;n<this.outstandingGets_.length;n++)this.outstandingGets_[n]&&this.sendGet_(n)}sendConnectStats_(){let n={},r="js";Ki()&&(this.repoInfo_.nodeAdmin?r="admin_node":r="node"),n["sdk."+r+"."+Ww.replace(/\./g,"-")]=1,hp()?n["framework.cordova"]=1:UT()&&(n["framework.reactnative"]=1),this.reportStats(n)}shouldReconnect_(){let n=Iy.getInstance().currentlyOnline();return fp(this.interruptReasons_)&&n}}t.nextPersistentConnectionId_=0,t.nextConnectionId_=0;return t})(),Oe=class t{constructor(e,n){this.name=e,this.node=n}static Wrap(e,n){return new t(e,n)}};var vd=class{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,n){let r=new Oe(tl,e),i=new Oe(tl,n);return this.compare(r,i)!==0}minPost(){return Oe.MIN}};var py,vy=class extends vd{static get __EMPTY_NODE(){return py}static set __EMPTY_NODE(e){py=e}compare(e,n){return al(e.name,n.name)}isDefinedOn(e){throw kc("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,n){return!1}minPost(){return Oe.MIN}maxPost(){return new Oe(Zs,py)}makePost(e,n){return q(typeof e=="string","KeyIndex indexValue must always be a string."),new Oe(e,py)}toString(){return".key"}},el=new vy;var yd=class{constructor(e,n,r,i,o=null){this.isReverse_=i,this.resultGenerator_=o,this.nodeStack_=[];let s=1;for(;!e.isEmpty();)if(e=e,s=n?r(e.key,n):1,i&&(s*=-1),s<0)this.isReverse_?e=e.left:e=e.right;else if(s===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),n;if(this.resultGenerator_?n=this.resultGenerator_(e.key,e.value):n={key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return n}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}},ui=(()=>{class t{constructor(n,r,i,o,s){this.key=n,this.value=r,this.color=i??t.RED,this.left=o??Hr.EMPTY_NODE,this.right=s??Hr.EMPTY_NODE}copy(n,r,i,o,s){return new t(n??this.key,r??this.value,i??this.color,o??this.left,s??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(n){return this.left.inorderTraversal(n)||!!n(this.key,this.value)||this.right.inorderTraversal(n)}reverseTraversal(n){return this.right.reverseTraversal(n)||n(this.key,this.value)||this.left.reverseTraversal(n)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(n,r,i){let o=this,s=i(n,o.key);return s<0?o=o.copy(null,null,null,o.left.insert(n,r,i),null):s===0?o=o.copy(null,r,null,null,null):o=o.copy(null,null,null,null,o.right.insert(n,r,i)),o.fixUp_()}removeMin_(){if(this.left.isEmpty())return Hr.EMPTY_NODE;let n=this;return!n.left.isRed_()&&!n.left.left.isRed_()&&(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.removeMin_(),null),n.fixUp_()}remove(n,r){let i,o;if(i=this,r(n,i.key)<0)!i.left.isEmpty()&&!i.left.isRed_()&&!i.left.left.isRed_()&&(i=i.moveRedLeft_()),i=i.copy(null,null,null,i.left.remove(n,r),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),!i.right.isEmpty()&&!i.right.isRed_()&&!i.right.left.isRed_()&&(i=i.moveRedRight_()),r(n,i.key)===0){if(i.right.isEmpty())return Hr.EMPTY_NODE;o=i.right.min_(),i=i.copy(o.key,o.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(n,r))}return i.fixUp_()}isRed_(){return this.color}fixUp_(){let n=this;return n.right.isRed_()&&!n.left.isRed_()&&(n=n.rotateLeft_()),n.left.isRed_()&&n.left.left.isRed_()&&(n=n.rotateRight_()),n.left.isRed_()&&n.right.isRed_()&&(n=n.colorFlip_()),n}moveRedLeft_(){let n=this.colorFlip_();return n.right.left.isRed_()&&(n=n.copy(null,null,null,null,n.right.rotateRight_()),n=n.rotateLeft_(),n=n.colorFlip_()),n}moveRedRight_(){let n=this.colorFlip_();return n.left.left.isRed_()&&(n=n.rotateRight_(),n=n.colorFlip_()),n}rotateLeft_(){let n=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,n,null)}rotateRight_(){let n=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,n)}colorFlip_(){let n=this.left.copy(null,null,!this.left.color,null,null),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,r)}checkMaxDepth_(){let n=this.check_();return Math.pow(2,n)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");let n=this.left.check_();if(n!==this.right.check_())throw new Error("Black depths differ");return n+(this.isRed_()?0:1)}}return t.RED=!0,t.BLACK=!1,t})(),sw=class{copy(e,n,r,i,o){return this}insert(e,n,r){return new ui(e,n,null)}remove(e,n){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}},Hr=class t{constructor(e,n=t.EMPTY_NODE){this.comparator_=e,this.root_=n}insert(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,ui.BLACK,null,null))}remove(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,ui.BLACK,null,null))}get(e){let n,r=this.root_;for(;!r.isEmpty();){if(n=this.comparator_(e,r.key),n===0)return r.value;n<0?r=r.left:n>0&&(r=r.right)}return null}getPredecessorKey(e){let n,r=this.root_,i=null;for(;!r.isEmpty();)if(n=this.comparator_(e,r.key),n===0){if(r.left.isEmpty())return i?i.key:null;for(r=r.left;!r.right.isEmpty();)r=r.right;return r.key}else n<0?r=r.left:n>0&&(i=r,r=r.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new yd(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,n){return new yd(this.root_,e,this.comparator_,!1,n)}getReverseIteratorFrom(e,n){return new yd(this.root_,e,this.comparator_,!0,n)}getReverseIterator(e){return new yd(this.root_,null,this.comparator_,!0,e)}};Hr.EMPTY_NODE=new sw;function Ure(t,e){return al(t.name,e.name)}function Qw(t,e){return al(t,e)}var aw;function Vre(t){aw=t}var bj=function(t){return typeof t=="number"?"number:"+dj(t):"string:"+t},Oj=function(t){if(t.isLeafNode()){let e=t.val();q(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Vr(e,".sv"),"Priority must be a string or number.")}else q(t===aw||t.isEmpty(),"priority of unexpected type.");q(t===aw||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};var H2,Sd=(()=>{class t{static set __childrenNodeConstructor(n){H2=n}static get __childrenNodeConstructor(){return H2}constructor(n,r=t.__childrenNodeConstructor.EMPTY_NODE){this.value_=n,this.priorityNode_=r,this.lazyHash_=null,q(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),Oj(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(n){return new t(this.value_,n)}getImmediateChild(n){return n===".priority"?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE}getChild(n){return we(n)?this:Ne(n)===".priority"?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(n,r){return null}updateImmediateChild(n,r){return n===".priority"?this.updatePriority(r):r.isEmpty()&&n!==".priority"?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(n,r).updatePriority(this.priorityNode_)}updateChild(n,r){let i=Ne(n);return i===null?r:r.isEmpty()&&i!==".priority"?this:(q(i!==".priority"||ea(n)===1,".priority must be the last token in a path"),this.updateImmediateChild(i,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(at(n),r)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(n,r){return!1}val(n){return n&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let n="";this.priorityNode_.isEmpty()||(n+="priority:"+bj(this.priorityNode_.val())+":");let r=typeof this.value_;n+=r+":",r==="number"?n+=dj(this.value_):n+=this.value_,this.lazyHash_=lj(n)}return this.lazyHash_}getValue(){return this.value_}compareTo(n){return n===t.__childrenNodeConstructor.EMPTY_NODE?1:n instanceof t.__childrenNodeConstructor?-1:(q(n.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(n))}compareToLeafNode_(n){let r=typeof n.value_,i=typeof this.value_,o=t.VALUE_TYPE_ORDER.indexOf(r),s=t.VALUE_TYPE_ORDER.indexOf(i);return q(o>=0,"Unknown leaf type: "+r),q(s>=0,"Unknown leaf type: "+i),o===s?i==="object"?0:this.value_<n.value_?-1:this.value_===n.value_?0:1:s-o}withIndex(){return this}isIndexed(){return!0}equals(n){if(n===this)return!0;if(n.isLeafNode()){let r=n;return this.value_===r.value_&&this.priorityNode_.equals(r.priorityNode_)}else return!1}}t.VALUE_TYPE_ORDER=["object","boolean","number","string"];return t})(),Mj,Lj;function Bre(t){Mj=t}function Gre(t){Lj=t}var cw=class extends vd{compare(e,n){let r=e.node.getPriority(),i=n.node.getPriority(),o=r.compareTo(i);return o===0?al(e.name,n.name):o}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,n){return!e.getPriority().equals(n.getPriority())}minPost(){return Oe.MIN}maxPost(){return new Oe(Zs,new Sd("[PRIORITY-POST]",Lj))}makePost(e,n){let r=Mj(e);return new Oe(n,new Sd("[PRIORITY-POST]",r))}toString(){return".priority"}},ft=new cw;var jre=Math.log(2),lw=class{constructor(e){let n=o=>parseInt(Math.log(o)/jre,10),r=o=>parseInt(Array(o+1).join("1"),2);this.count=n(e+1),this.current_=this.count-1;let i=r(this.count);this.bits_=e+1&i}nextBitIsOne(){let e=!(this.bits_&1<<this.current_);return this.current_--,e}},Sy=function(t,e,n,r){t.sort(e);let i=function(c,l){let d=l-c,h,f;if(d===0)return null;if(d===1)return h=t[c],f=n?n(h):h,new ui(f,h.node,ui.BLACK,null,null);{let g=parseInt(d/2,10)+c,E=i(c,g),I=i(g+1,l);return h=t[g],f=n?n(h):h,new ui(f,h.node,ui.BLACK,E,I)}},o=function(c){let l=null,d=null,h=t.length,f=function(E,I){let S=h-E,L=h;h-=E;let V=i(S+1,L),K=t[S],oe=n?n(K):K;g(new ui(oe,K.node,I,null,V))},g=function(E){l?(l.left=E,l=E):(d=E,l=E)};for(let E=0;E<c.count;++E){let I=c.nextBitIsOne(),S=Math.pow(2,c.count-(E+1));I?f(S,ui.BLACK):(f(S,ui.BLACK),f(S,ui.RED))}return d},s=new lw(t.length),a=o(s);return new Hr(r||e,a)};var HN,_d={},Ad=class t{static get Default(){return q(_d&&ft,"ChildrenNode.ts has not been loaded"),HN=HN||new t({".priority":_d},{".priority":ft}),HN}constructor(e,n){this.indexes_=e,this.indexSet_=n}get(e){let n=Fs(this.indexes_,e);if(!n)throw new Error("No index defined for "+e);return n instanceof Hr?n:null}hasIndex(e){return Vr(this.indexSet_,e.toString())}addIndex(e,n){q(e!==el,"KeyIndex always exists and isn't meant to be added to the IndexMap.");let r=[],i=!1,o=n.getIterator(Oe.Wrap),s=o.getNext();for(;s;)i=i||e.isDefinedOn(s.node),r.push(s),s=o.getNext();let a;i?a=Sy(r,e.getCompare()):a=_d;let c=e.toString(),l=Object.assign({},this.indexSet_);l[c]=e;let d=Object.assign({},this.indexes_);return d[c]=a,new t(d,l)}addToIndexes(e,n){let r=pp(this.indexes_,(i,o)=>{let s=Fs(this.indexSet_,o);if(q(s,"Missing index implementation for "+o),i===_d)if(s.isDefinedOn(e.node)){let a=[],c=n.getIterator(Oe.Wrap),l=c.getNext();for(;l;)l.name!==e.name&&a.push(l),l=c.getNext();return a.push(e),Sy(a,s.getCompare())}else return _d;else{let a=n.get(e.name),c=i;return a&&(c=c.remove(new Oe(e.name,a))),c.insert(e,e.node)}});return new t(r,this.indexSet_)}removeFromIndexes(e,n){let r=pp(this.indexes_,i=>{if(i===_d)return i;{let o=n.get(e.name);return o?i.remove(new Oe(e.name,o)):i}});return new t(r,this.indexSet_)}};var Fp,ve=(()=>{class t{static get EMPTY_NODE(){return Fp||(Fp=new t(new Hr(Qw),null,Ad.Default))}constructor(n,r,i){this.children_=n,this.priorityNode_=r,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&Oj(this.priorityNode_),this.children_.isEmpty()&&q(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Fp}updatePriority(n){return this.children_.isEmpty()?this:new t(this.children_,n,this.indexMap_)}getImmediateChild(n){if(n===".priority")return this.getPriority();{let r=this.children_.get(n);return r===null?Fp:r}}getChild(n){let r=Ne(n);return r===null?this:this.getImmediateChild(r).getChild(at(n))}hasChild(n){return this.children_.get(n)!==null}updateImmediateChild(n,r){if(q(r,"We should always be passing snapshot nodes"),n===".priority")return this.updatePriority(r);{let i=new Oe(n,r),o,s;r.isEmpty()?(o=this.children_.remove(n),s=this.indexMap_.removeFromIndexes(i,this.children_)):(o=this.children_.insert(n,r),s=this.indexMap_.addToIndexes(i,this.children_));let a=o.isEmpty()?Fp:this.priorityNode_;return new t(o,a,s)}}updateChild(n,r){let i=Ne(n);if(i===null)return r;{q(Ne(n)!==".priority"||ea(n)===1,".priority must be the last token in a path");let o=this.getImmediateChild(i).updateChild(at(n),r);return this.updateImmediateChild(i,o)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(n){if(this.isEmpty())return null;let r={},i=0,o=0,s=!0;if(this.forEachChild(ft,(a,c)=>{r[a]=c.val(n),i++,s&&t.INTEGER_REGEXP_.test(a)?o=Math.max(o,Number(a)):s=!1}),!n&&s&&o<2*i){let a=[];for(let c in r)a[c]=r[c];return a}else return n&&!this.getPriority().isEmpty()&&(r[".priority"]=this.getPriority().val()),r}hash(){if(this.lazyHash_===null){let n="";this.getPriority().isEmpty()||(n+="priority:"+bj(this.getPriority().val())+":"),this.forEachChild(ft,(r,i)=>{let o=i.hash();o!==""&&(n+=":"+r+":"+o)}),this.lazyHash_=n===""?"":lj(n)}return this.lazyHash_}getPredecessorChildName(n,r,i){let o=this.resolveIndex_(i);if(o){let s=o.getPredecessorKey(new Oe(n,r));return s?s.name:null}else return this.children_.getPredecessorKey(n)}getFirstChildName(n){let r=this.resolveIndex_(n);if(r){let i=r.minKey();return i&&i.name}else return this.children_.minKey()}getFirstChild(n){let r=this.getFirstChildName(n);return r?new Oe(r,this.children_.get(r)):null}getLastChildName(n){let r=this.resolveIndex_(n);if(r){let i=r.maxKey();return i&&i.name}else return this.children_.maxKey()}getLastChild(n){let r=this.getLastChildName(n);return r?new Oe(r,this.children_.get(r)):null}forEachChild(n,r){let i=this.resolveIndex_(n);return i?i.inorderTraversal(o=>r(o.name,o.node)):this.children_.inorderTraversal(r)}getIterator(n){return this.getIteratorFrom(n.minPost(),n)}getIteratorFrom(n,r){let i=this.resolveIndex_(r);if(i)return i.getIteratorFrom(n,o=>o);{let o=this.children_.getIteratorFrom(n.name,Oe.Wrap),s=o.peek();for(;s!=null&&r.compare(s,n)<0;)o.getNext(),s=o.peek();return o}}getReverseIterator(n){return this.getReverseIteratorFrom(n.maxPost(),n)}getReverseIteratorFrom(n,r){let i=this.resolveIndex_(r);if(i)return i.getReverseIteratorFrom(n,o=>o);{let o=this.children_.getReverseIteratorFrom(n.name,Oe.Wrap),s=o.peek();for(;s!=null&&r.compare(s,n)>0;)o.getNext(),s=o.peek();return o}}compareTo(n){return this.isEmpty()?n.isEmpty()?0:-1:n.isLeafNode()||n.isEmpty()?1:n===ig?-1:0}withIndex(n){if(n===el||this.indexMap_.hasIndex(n))return this;{let r=this.indexMap_.addIndex(n,this.children_);return new t(this.children_,this.priorityNode_,r)}}isIndexed(n){return n===el||this.indexMap_.hasIndex(n)}equals(n){if(n===this)return!0;if(n.isLeafNode())return!1;{let r=n;if(this.getPriority().equals(r.getPriority()))if(this.children_.count()===r.children_.count()){let i=this.getIterator(ft),o=r.getIterator(ft),s=i.getNext(),a=o.getNext();for(;s&&a;){if(s.name!==a.name||!s.node.equals(a.node))return!1;s=i.getNext(),a=o.getNext()}return s===null&&a===null}else return!1;else return!1}}resolveIndex_(n){return n===el?null:this.indexMap_.get(n.toString())}}return t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t})(),uw=class extends ve{constructor(){super(new Hr(Qw),ve.EMPTY_NODE,Ad.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return ve.EMPTY_NODE}isEmpty(){return!1}},ig=new uw;Object.defineProperties(Oe,{MIN:{value:new Oe(tl,ve.EMPTY_NODE)},MAX:{value:new Oe(Zs,ig)}});vy.__EMPTY_NODE=ve.EMPTY_NODE;Sd.__childrenNodeConstructor=ve;Vre(ig);Gre(ig);var Hre=!0;function At(t,e=null){if(t===null)return ve.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),q(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){let n=t;return new Sd(n,At(e))}if(!(t instanceof Array)&&Hre){let n=[],r=!1;if(dn(t,(s,a)=>{if(s.substring(0,1)!=="."){let c=At(a);c.isEmpty()||(r=r||!c.getPriority().isEmpty(),n.push(new Oe(s,c)))}}),n.length===0)return ve.EMPTY_NODE;let o=Sy(n,Ure,s=>s.name,Qw);if(r){let s=Sy(n,ft.getCompare());return new ve(o,At(e),new Ad({".priority":s},{".priority":ft}))}else return new ve(o,At(e),Ad.Default)}else{let n=ve.EMPTY_NODE;return dn(t,(r,i)=>{if(Vr(t,r)&&r.substring(0,1)!=="."){let o=At(i);(o.isLeafNode()||!o.isEmpty())&&(n=n.updateImmediateChild(r,o))}}),n.updatePriority(At(e))}}Bre(At);var Wp=class extends vd{constructor(e){super(),this.indexPath_=e,q(!we(e)&&Ne(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,n){let r=this.extractChild(e.node),i=this.extractChild(n.node),o=r.compareTo(i);return o===0?al(e.name,n.name):o}makePost(e,n){let r=At(e),i=ve.EMPTY_NODE.updateChild(this.indexPath_,r);return new Oe(n,i)}maxPost(){let e=ve.EMPTY_NODE.updateChild(this.indexPath_,ig);return new Oe(Zs,e)}toString(){return $p(this.indexPath_,0).join("/")}};var dw=class extends vd{compare(e,n){let r=e.node.compareTo(n.node);return r===0?al(e.name,n.name):r}isDefinedOn(e){return!0}indexedValueChanged(e,n){return!e.equals(n)}minPost(){return Oe.MIN}maxPost(){return Oe.MAX}makePost(e,n){let r=At(e);return new Oe(n,r)}toString(){return".value"}},Pj=new dw;function xj(t){return{type:"value",snapshotNode:t}}function Cd(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function zp(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function qp(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}function $re(t,e){return{type:"child_moved",snapshotNode:e,childName:t}}var Kp=class{constructor(e){this.index_=e}updateChild(e,n,r,i,o,s){q(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");let a=e.getImmediateChild(n);return a.getChild(i).equals(r.getChild(i))&&a.isEmpty()===r.isEmpty()||(s!=null&&(r.isEmpty()?e.hasChild(n)?s.trackChildChange(zp(n,a)):q(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?s.trackChildChange(Cd(n,r)):s.trackChildChange(qp(n,r,a))),e.isLeafNode()&&r.isEmpty())?e:e.updateImmediateChild(n,r).withIndex(this.index_)}updateFullNode(e,n,r){return r!=null&&(e.isLeafNode()||e.forEachChild(ft,(i,o)=>{n.hasChild(i)||r.trackChildChange(zp(i,o))}),n.isLeafNode()||n.forEachChild(ft,(i,o)=>{if(e.hasChild(i)){let s=e.getImmediateChild(i);s.equals(o)||r.trackChildChange(qp(i,o,s))}else r.trackChildChange(Cd(i,o))})),n.withIndex(this.index_)}updatePriority(e,n){return e.isEmpty()?ve.EMPTY_NODE:e.updatePriority(n)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}};var Ay=class t{constructor(e){this.indexedFilter_=new Kp(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){let n=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,r=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return n&&r}updateChild(e,n,r,i,o,s){return this.matches(new Oe(n,r))||(r=ve.EMPTY_NODE),this.indexedFilter_.updateChild(e,n,r,i,o,s)}updateFullNode(e,n,r){n.isLeafNode()&&(n=ve.EMPTY_NODE);let i=n.withIndex(this.index_);i=i.updatePriority(ve.EMPTY_NODE);let o=this;return n.forEachChild(ft,(s,a)=>{o.matches(new Oe(s,a))||(i=i.updateImmediateChild(s,ve.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,i,r)}updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){let n=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),n)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){let n=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),n)}else return e.getIndex().maxPost()}};var hw=class{constructor(e){this.withinDirectionalStart=n=>this.reverse_?this.withinEndPost(n):this.withinStartPost(n),this.withinDirectionalEnd=n=>this.reverse_?this.withinStartPost(n):this.withinEndPost(n),this.withinStartPost=n=>{let r=this.index_.compare(this.rangedFilter_.getStartPost(),n);return this.startIsInclusive_?r<=0:r<0},this.withinEndPost=n=>{let r=this.index_.compare(n,this.rangedFilter_.getEndPost());return this.endIsInclusive_?r<=0:r<0},this.rangedFilter_=new Ay(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,n,r,i,o,s){return this.rangedFilter_.matches(new Oe(n,r))||(r=ve.EMPTY_NODE),e.getImmediateChild(n).equals(r)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,n,r,i,o,s):this.fullLimitUpdateChild_(e,n,r,o,s)}updateFullNode(e,n,r){let i;if(n.isLeafNode()||n.isEmpty())i=ve.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<n.numChildren()&&n.isIndexed(this.index_)){i=ve.EMPTY_NODE.withIndex(this.index_);let o;this.reverse_?o=n.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):o=n.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let s=0;for(;o.hasNext()&&s<this.limit_;){let a=o.getNext();if(this.withinDirectionalStart(a))if(this.withinDirectionalEnd(a))i=i.updateImmediateChild(a.name,a.node),s++;else break;else continue}}else{i=n.withIndex(this.index_),i=i.updatePriority(ve.EMPTY_NODE);let o;this.reverse_?o=i.getReverseIterator(this.index_):o=i.getIterator(this.index_);let s=0;for(;o.hasNext();){let a=o.getNext();s<this.limit_&&this.withinDirectionalStart(a)&&this.withinDirectionalEnd(a)?s++:i=i.updateImmediateChild(a.name,ve.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,i,r)}updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,n,r,i,o){let s;if(this.reverse_){let h=this.index_.getCompare();s=(f,g)=>h(g,f)}else s=this.index_.getCompare();let a=e;q(a.numChildren()===this.limit_,"");let c=new Oe(n,r),l=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),d=this.rangedFilter_.matches(c);if(a.hasChild(n)){let h=a.getImmediateChild(n),f=i.getChildAfterChild(this.index_,l,this.reverse_);for(;f!=null&&(f.name===n||a.hasChild(f.name));)f=i.getChildAfterChild(this.index_,f,this.reverse_);let g=f==null?1:s(f,c);if(d&&!r.isEmpty()&&g>=0)return o?.trackChildChange(qp(n,r,h)),a.updateImmediateChild(n,r);{o?.trackChildChange(zp(n,h));let I=a.updateImmediateChild(n,ve.EMPTY_NODE);return f!=null&&this.rangedFilter_.matches(f)?(o?.trackChildChange(Cd(f.name,f.node)),I.updateImmediateChild(f.name,f.node)):I}}else return r.isEmpty()?e:d&&s(l,c)>=0?(o!=null&&(o.trackChildChange(zp(l.name,l.node)),o.trackChildChange(Cd(n,r))),a.updateImmediateChild(n,r).updateImmediateChild(l.name,ve.EMPTY_NODE)):e}};var fw=class t{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=ft}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return q(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return q(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:tl}hasEnd(){return this.endSet_}getIndexEndValue(){return q(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return q(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:Zs}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return q(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===ft}copy(){let e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}};function Wre(t){return t.loadsAllData()?new Kp(t.getIndex()):t.hasLimit()?new hw(t):new Ay(t)}function zre(t,e){let n=t.copy();return n.limitSet_=!0,n.limit_=e,n.viewFrom_="r",n}function qre(t,e,n){let r=t.copy();return r.startSet_=!0,e===void 0&&(e=null),r.indexStartValue_=e,n!=null?(r.startNameSet_=!0,r.indexStartName_=n):(r.startNameSet_=!1,r.indexStartName_=""),r}function Kre(t,e,n){let r=t.copy();return r.endSet_=!0,e===void 0&&(e=null),r.indexEndValue_=e,n!==void 0?(r.endNameSet_=!0,r.indexEndName_=n):(r.endNameSet_=!1,r.indexEndName_=""),r}function Yre(t,e){let n=t.copy();return n.index_=e,n}function $2(t){let e={};if(t.isDefault())return e;let n;if(t.index_===ft?n="$priority":t.index_===Pj?n="$value":t.index_===el?n="$key":(q(t.index_ instanceof Wp,"Unrecognized index type!"),n=t.index_.toString()),e.orderBy=xt(n),t.startSet_){let r=t.startAfterSet_?"startAfter":"startAt";e[r]=xt(t.indexStartValue_),t.startNameSet_&&(e[r]+=","+xt(t.indexStartName_))}if(t.endSet_){let r=t.endBeforeSet_?"endBefore":"endAt";e[r]=xt(t.indexEndValue_),t.endNameSet_&&(e[r]+=","+xt(t.indexEndName_))}return t.limitSet_&&(t.isViewFromLeft()?e.limitToFirst=t.limit_:e.limitToLast=t.limit_),e}function W2(t){let e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_),e.sin=!t.startAfterSet_),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_),e.ein=!t.endBeforeSet_),t.limitSet_){e.l=t.limit_;let n=t.viewFrom_;n===""&&(t.isViewFromLeft()?n="l":n="r"),e.vf=n}return t.index_!==ft&&(e.i=t.index_.toString()),e}var pw=class t extends Ty{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,n){return n!==void 0?"tag$"+n:(q(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,n,r,i){super(),this.repoInfo_=e,this.onDataUpdate_=n,this.authTokenProvider_=r,this.appCheckTokenProvider_=i,this.log_=rg("p:rest:"),this.listens_={}}listen(e,n,r,i){let o=e._path.toString();this.log_("Listen called for "+o+" "+e._queryIdentifier);let s=t.getListenId_(e,r),a={};this.listens_[s]=a;let c=$2(e._queryParams);this.restRequest_(o+".json",c,(l,d)=>{let h=d;if(l===404&&(h=null,l=null),l===null&&this.onDataUpdate_(o,h,!1,r),Fs(this.listens_,s)===a){let f;l?l===401?f="permission_denied":f="rest_error:"+l:f="ok",i(f,null)}})}unlisten(e,n){let r=t.getListenId_(e,n);delete this.listens_[r]}get(e){let n=$2(e._queryParams),r=e._path.toString(),i=new cn;return this.restRequest_(r+".json",n,(o,s)=>{let a=s;o===404&&(a=null,o=null),o===null?(this.onDataUpdate_(r,a,!1,null),i.resolve(a)):i.reject(new Error(a))}),i.promise}refreshAuthToken(e){}restRequest_(e,n={},r){return n.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([i,o])=>{i&&i.accessToken&&(n.auth=i.accessToken),o&&o.token&&(n.ac=o.token);let s=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+gp(n);this.log_("Sending REST request for "+s);let a=new XMLHttpRequest;a.onreadystatechange=()=>{if(r&&a.readyState===4){this.log_("REST Response for "+s+" received. status:",a.status,"response:",a.responseText);let c=null;if(a.status>=200&&a.status<300){try{c=ad(a.responseText)}catch{xn("Failed to parse JSON response for "+s+": "+a.responseText)}r(null,c)}else a.status!==401&&a.status!==404&&xn("Got unsuccessful REST response for "+s+" Status: "+a.status),r(a.status);r=null}},a.open("GET",s,!0),a.send()})}};var gw=class{constructor(){this.rootNode_=ve.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,n){this.rootNode_=this.rootNode_.updateChild(e,n)}};function Cy(){return{value:null,children:new Map}}function Od(t,e,n){if(we(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{let r=Ne(e);t.children.has(r)||t.children.set(r,Cy());let i=t.children.get(r);e=at(e),Od(i,e,n)}}function mw(t,e){if(we(e))return t.value=null,t.children.clear(),!0;if(t.value!==null){if(t.value.isLeafNode())return!1;{let n=t.value;return t.value=null,n.forEachChild(ft,(r,i)=>{Od(t,new Be(r),i)}),mw(t,e)}}else if(t.children.size>0){let n=Ne(e);return e=at(e),t.children.has(n)&&mw(t.children.get(n),e)&&t.children.delete(n),t.children.size===0}else return!0}function Ew(t,e,n){t.value!==null?n(e,t.value):Xre(t,(r,i)=>{let o=new Be(e.toString()+"/"+r);Ew(i,o,n)})}function Xre(t,e){t.children.forEach((n,r)=>{e(r,n)})}var _w=class{constructor(e){this.collection_=e,this.last_=null}get(){let e=this.collection_.get(),n=Object.assign({},e);return this.last_&&dn(this.last_,(r,i)=>{n[r]=n[r]-i}),this.last_=e,n}};var z2=10*1e3,Qre=30*1e3,Jre=300*1e3,Tw=class{constructor(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new _w(e);let r=z2+(Qre-z2)*Math.random();Vp(this.reportStats_.bind(this),Math.floor(r))}reportStats_(){let e=this.statsListener_.get(),n={},r=!1;dn(e,(i,o)=>{o>0&&Vr(this.statsToReport_,i)&&(n[i]=o,r=!0)}),r&&this.server_.reportStats(n),Vp(this.reportStats_.bind(this),Math.floor(Math.random()*2*Jre))}};var Zi=(function(t){return t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE",t})(Zi||{});function Jw(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function Zw(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function eb(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}var yw=class t{constructor(e,n,r){this.path=e,this.affectedTree=n,this.revert=r,this.type=Zi.ACK_USER_WRITE,this.source=Jw()}operationForChild(e){if(we(this.path)){if(this.affectedTree.value!=null)return q(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{let n=this.affectedTree.subtree(new Be(e));return new t(Ve(),n,this.revert)}}else return q(Ne(this.path)===e,"operationForChild called for unrelated child."),new t(at(this.path),this.affectedTree,this.revert)}};var Dy=class t{constructor(e,n){this.source=e,this.path=n,this.type=Zi.LISTEN_COMPLETE}operationForChild(e){return we(this.path)?new t(this.source,Ve()):new t(this.source,at(this.path))}};var Dd=class t{constructor(e,n,r){this.source=e,this.path=n,this.snap=r,this.type=Zi.OVERWRITE}operationForChild(e){return we(this.path)?new t(this.source,Ve(),this.snap.getImmediateChild(e)):new t(this.source,at(this.path),this.snap)}};var Yp=class t{constructor(e,n,r){this.source=e,this.path=n,this.children=r,this.type=Zi.MERGE}operationForChild(e){if(we(this.path)){let n=this.children.subtree(new Be(e));return n.isEmpty()?null:n.value?new Dd(this.source,Ve(),n.value):new t(this.source,Ve(),n)}else return q(Ne(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,at(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}};var eo=class{constructor(e,n,r){this.node_=e,this.fullyInitialized_=n,this.filtered_=r}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(we(e))return this.isFullyInitialized()&&!this.filtered_;let n=Ne(e);return this.isCompleteForChild(n)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}};var Iw=class{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}};function Zre(t,e,n,r){let i=[],o=[];return e.forEach(s=>{s.type==="child_changed"&&t.index_.indexedValueChanged(s.oldSnap,s.snapshotNode)&&o.push($re(s.childName,s.snapshotNode))}),Up(t,i,"child_removed",e,r,n),Up(t,i,"child_added",e,r,n),Up(t,i,"child_moved",o,r,n),Up(t,i,"child_changed",e,r,n),Up(t,i,"value",e,r,n),i}function Up(t,e,n,r,i,o){let s=r.filter(a=>a.type===n);s.sort((a,c)=>tie(t,a,c)),s.forEach(a=>{let c=eie(t,a,o);i.forEach(l=>{l.respondsTo(a.type)&&e.push(l.createEvent(c,t.query_))})})}function eie(t,e,n){return e.type==="value"||e.type==="child_removed"||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}function tie(t,e,n){if(e.childName==null||n.childName==null)throw kc("Should only compare child_ events.");let r=new Oe(e.childName,e.snapshotNode),i=new Oe(n.childName,n.snapshotNode);return t.index_.compare(r,i)}function Gy(t,e){return{eventCache:t,serverCache:e}}function Gp(t,e,n,r){return Gy(new eo(e,n,r),t.serverCache)}function kj(t,e,n,r){return Gy(t.eventCache,new eo(e,n,r))}function Ry(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function nl(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}var $N,nie=()=>($N||($N=new Hr(ere)),$N),qn=class t{static fromObject(e){let n=new t(null);return dn(e,(r,i)=>{n=n.set(new Be(r),i)}),n}constructor(e,n=nie()){this.value=e,this.children=n}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,n){if(this.value!=null&&n(this.value))return{path:Ve(),value:this.value};if(we(e))return null;{let r=Ne(e),i=this.children.get(r);if(i!==null){let o=i.findRootMostMatchingPathAndValue(at(e),n);return o!=null?{path:Ct(new Be(r),o.path),value:o.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(we(e))return this;{let n=Ne(e),r=this.children.get(n);return r!==null?r.subtree(at(e)):new t(null)}}set(e,n){if(we(e))return new t(n,this.children);{let r=Ne(e),o=(this.children.get(r)||new t(null)).set(at(e),n),s=this.children.insert(r,o);return new t(this.value,s)}}remove(e){if(we(e))return this.children.isEmpty()?new t(null):new t(null,this.children);{let n=Ne(e),r=this.children.get(n);if(r){let i=r.remove(at(e)),o;return i.isEmpty()?o=this.children.remove(n):o=this.children.insert(n,i),this.value===null&&o.isEmpty()?new t(null):new t(this.value,o)}else return this}}get(e){if(we(e))return this.value;{let n=Ne(e),r=this.children.get(n);return r?r.get(at(e)):null}}setTree(e,n){if(we(e))return n;{let r=Ne(e),o=(this.children.get(r)||new t(null)).setTree(at(e),n),s;return o.isEmpty()?s=this.children.remove(r):s=this.children.insert(r,o),new t(this.value,s)}}fold(e){return this.fold_(Ve(),e)}fold_(e,n){let r={};return this.children.inorderTraversal((i,o)=>{r[i]=o.fold_(Ct(e,i),n)}),n(e,this.value,r)}findOnPath(e,n){return this.findOnPath_(e,Ve(),n)}findOnPath_(e,n,r){let i=this.value?r(n,this.value):!1;if(i)return i;if(we(e))return null;{let o=Ne(e),s=this.children.get(o);return s?s.findOnPath_(at(e),Ct(n,o),r):null}}foreachOnPath(e,n){return this.foreachOnPath_(e,Ve(),n)}foreachOnPath_(e,n,r){if(we(e))return this;{this.value&&r(n,this.value);let i=Ne(e),o=this.children.get(i);return o?o.foreachOnPath_(at(e),Ct(n,i),r):new t(null)}}foreach(e){this.foreach_(Ve(),e)}foreach_(e,n){this.children.inorderTraversal((r,i)=>{i.foreach_(Ct(e,r),n)}),this.value&&n(e,this.value)}foreachChild(e){this.children.inorderTraversal((n,r)=>{r.value&&e(n,r.value)})}};var di=class t{constructor(e){this.writeTree_=e}static empty(){return new t(new qn(null))}};function jp(t,e,n){if(we(e))return new di(new qn(n));{let r=t.writeTree_.findRootMostValueAndPath(e);if(r!=null){let i=r.path,o=r.value,s=zn(i,e);return o=o.updateChild(s,n),new di(t.writeTree_.set(i,o))}else{let i=new qn(n),o=t.writeTree_.setTree(e,i);return new di(o)}}}function vw(t,e,n){let r=t;return dn(n,(i,o)=>{r=jp(r,Ct(e,i),o)}),r}function q2(t,e){if(we(e))return di.empty();{let n=t.writeTree_.setTree(e,new qn(null));return new di(n)}}function Sw(t,e){return cl(t,e)!=null}function cl(t,e){let n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(zn(n.path,e)):null}function K2(t){let e=[],n=t.writeTree_.value;return n!=null?n.isLeafNode()||n.forEachChild(ft,(r,i)=>{e.push(new Oe(r,i))}):t.writeTree_.children.inorderTraversal((r,i)=>{i.value!=null&&e.push(new Oe(r,i.value))}),e}function Qs(t,e){if(we(e))return t;{let n=cl(t,e);return n!=null?new di(new qn(n)):new di(t.writeTree_.subtree(e))}}function Aw(t){return t.writeTree_.isEmpty()}function Rd(t,e){return Fj(Ve(),t.writeTree_,e)}function Fj(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);{let r=null;return e.children.inorderTraversal((i,o)=>{i===".priority"?(q(o.value!==null,"Priority writes must always be leaf nodes"),r=o.value):n=Fj(Ct(t,i),o,n)}),!n.getChild(t).isEmpty()&&r!==null&&(n=n.updateChild(Ct(t,".priority"),r)),n}}function jy(t,e){return Gj(e,t)}function rie(t,e,n,r,i){q(r>t.lastWriteId,"Stacking an older write on top of newer ones"),i===void 0&&(i=!0),t.allWrites.push({path:e,snap:n,writeId:r,visible:i}),i&&(t.visibleWrites=jp(t.visibleWrites,e,n)),t.lastWriteId=r}function iie(t,e,n,r){q(r>t.lastWriteId,"Stacking an older merge on top of newer ones"),t.allWrites.push({path:e,children:n,writeId:r,visible:!0}),t.visibleWrites=vw(t.visibleWrites,e,n),t.lastWriteId=r}function oie(t,e){for(let n=0;n<t.allWrites.length;n++){let r=t.allWrites[n];if(r.writeId===e)return r}return null}function sie(t,e){let n=t.allWrites.findIndex(a=>a.writeId===e);q(n>=0,"removeWrite called with nonexistent writeId.");let r=t.allWrites[n];t.allWrites.splice(n,1);let i=r.visible,o=!1,s=t.allWrites.length-1;for(;i&&s>=0;){let a=t.allWrites[s];a.visible&&(s>=n&&aie(a,r.path)?i=!1:jr(r.path,a.path)&&(o=!0)),s--}if(i){if(o)return cie(t),!0;if(r.snap)t.visibleWrites=q2(t.visibleWrites,r.path);else{let a=r.children;dn(a,c=>{t.visibleWrites=q2(t.visibleWrites,Ct(r.path,c))})}return!0}else return!1}function aie(t,e){if(t.snap)return jr(t.path,e);for(let n in t.children)if(t.children.hasOwnProperty(n)&&jr(Ct(t.path,n),e))return!0;return!1}function cie(t){t.visibleWrites=Uj(t.allWrites,lie,Ve()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function lie(t){return t.visible}function Uj(t,e,n){let r=di.empty();for(let i=0;i<t.length;++i){let o=t[i];if(e(o)){let s=o.path,a;if(o.snap)jr(n,s)?(a=zn(n,s),r=jp(r,a,o.snap)):jr(s,n)&&(a=zn(s,n),r=jp(r,Ve(),o.snap.getChild(a)));else if(o.children){if(jr(n,s))a=zn(n,s),r=vw(r,a,o.children);else if(jr(s,n))if(a=zn(s,n),we(a))r=vw(r,Ve(),o.children);else{let c=Fs(o.children,Ne(a));if(c){let l=c.getChild(at(a));r=jp(r,Ve(),l)}}}else throw kc("WriteRecord should have .snap or .children")}}return r}function Vj(t,e,n,r,i){if(!r&&!i){let o=cl(t.visibleWrites,e);if(o!=null)return o;{let s=Qs(t.visibleWrites,e);if(Aw(s))return n;if(n==null&&!Sw(s,Ve()))return null;{let a=n||ve.EMPTY_NODE;return Rd(s,a)}}}else{let o=Qs(t.visibleWrites,e);if(!i&&Aw(o))return n;if(!i&&n==null&&!Sw(o,Ve()))return null;{let s=function(l){return(l.visible||i)&&(!r||!~r.indexOf(l.writeId))&&(jr(l.path,e)||jr(e,l.path))},a=Uj(t.allWrites,s,e),c=n||ve.EMPTY_NODE;return Rd(a,c)}}}function uie(t,e,n){let r=ve.EMPTY_NODE,i=cl(t.visibleWrites,e);if(i)return i.isLeafNode()||i.forEachChild(ft,(o,s)=>{r=r.updateImmediateChild(o,s)}),r;if(n){let o=Qs(t.visibleWrites,e);return n.forEachChild(ft,(s,a)=>{let c=Rd(Qs(o,new Be(s)),a);r=r.updateImmediateChild(s,c)}),K2(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}else{let o=Qs(t.visibleWrites,e);return K2(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}}function die(t,e,n,r,i){q(r||i,"Either existingEventSnap or existingServerSnap must exist");let o=Ct(e,n);if(Sw(t.visibleWrites,o))return null;{let s=Qs(t.visibleWrites,o);return Aw(s)?i.getChild(n):Rd(s,i.getChild(n))}}function hie(t,e,n,r){let i=Ct(e,n),o=cl(t.visibleWrites,i);if(o!=null)return o;if(r.isCompleteForChild(n)){let s=Qs(t.visibleWrites,i);return Rd(s,r.getNode().getImmediateChild(n))}else return null}function fie(t,e){return cl(t.visibleWrites,e)}function pie(t,e,n,r,i,o,s){let a,c=Qs(t.visibleWrites,e),l=cl(c,Ve());if(l!=null)a=l;else if(n!=null)a=Rd(c,n);else return[];if(a=a.withIndex(s),!a.isEmpty()&&!a.isLeafNode()){let d=[],h=s.getCompare(),f=o?a.getReverseIteratorFrom(r,s):a.getIteratorFrom(r,s),g=f.getNext();for(;g&&d.length<i;)h(g,r)!==0&&d.push(g),g=f.getNext();return d}else return[]}function gie(){return{visibleWrites:di.empty(),allWrites:[],lastWriteId:-1}}function Ny(t,e,n,r){return Vj(t.writeTree,t.treePath,e,n,r)}function tb(t,e){return uie(t.writeTree,t.treePath,e)}function Y2(t,e,n,r){return die(t.writeTree,t.treePath,e,n,r)}function wy(t,e){return fie(t.writeTree,Ct(t.treePath,e))}function mie(t,e,n,r,i,o){return pie(t.writeTree,t.treePath,e,n,r,i,o)}function nb(t,e,n){return hie(t.writeTree,t.treePath,e,n)}function Bj(t,e){return Gj(Ct(t.treePath,e),t.writeTree)}function Gj(t,e){return{treePath:t,writeTree:e}}var Cw=class{constructor(){this.changeMap=new Map}trackChildChange(e){let n=e.type,r=e.childName;q(n==="child_added"||n==="child_changed"||n==="child_removed","Only child changes supported for tracking"),q(r!==".priority","Only non-priority child changes can be tracked.");let i=this.changeMap.get(r);if(i){let o=i.type;if(n==="child_added"&&o==="child_removed")this.changeMap.set(r,qp(r,e.snapshotNode,i.snapshotNode));else if(n==="child_removed"&&o==="child_added")this.changeMap.delete(r);else if(n==="child_removed"&&o==="child_changed")this.changeMap.set(r,zp(r,i.oldSnap));else if(n==="child_changed"&&o==="child_added")this.changeMap.set(r,Cd(r,e.snapshotNode));else if(n==="child_changed"&&o==="child_changed")this.changeMap.set(r,qp(r,e.snapshotNode,i.oldSnap));else throw kc("Illegal combination of changes: "+e+" occurred after "+i)}else this.changeMap.set(r,e)}getChanges(){return Array.from(this.changeMap.values())}};var Dw=class{getCompleteChild(e){return null}getChildAfterChild(e,n,r){return null}},jj=new Dw,Xp=class{constructor(e,n,r=null){this.writes_=e,this.viewCache_=n,this.optCompleteServerCache_=r}getCompleteChild(e){let n=this.viewCache_.eventCache;if(n.isCompleteForChild(e))return n.getNode().getImmediateChild(e);{let r=this.optCompleteServerCache_!=null?new eo(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return nb(this.writes_,e,r)}}getChildAfterChild(e,n,r){let i=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:nl(this.viewCache_),o=mie(this.writes_,i,n,1,r,e);return o.length===0?null:o[0]}};function Eie(t){return{filter:t}}function _ie(t,e){q(e.eventCache.getNode().isIndexed(t.filter.getIndex()),"Event snap not indexed"),q(e.serverCache.getNode().isIndexed(t.filter.getIndex()),"Server snap not indexed")}function Tie(t,e,n,r,i){let o=new Cw,s,a;if(n.type===Zi.OVERWRITE){let l=n;l.source.fromUser?s=Rw(t,e,l.path,l.snap,r,i,o):(q(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered()&&!we(l.path),s=by(t,e,l.path,l.snap,r,i,a,o))}else if(n.type===Zi.MERGE){let l=n;l.source.fromUser?s=Iie(t,e,l.path,l.children,r,i,o):(q(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered(),s=Nw(t,e,l.path,l.children,r,i,a,o))}else if(n.type===Zi.ACK_USER_WRITE){let l=n;l.revert?s=Aie(t,e,l.path,r,i,o):s=vie(t,e,l.path,l.affectedTree,r,i,o)}else if(n.type===Zi.LISTEN_COMPLETE)s=Sie(t,e,n.path,r,o);else throw kc("Unknown operation type: "+n.type);let c=o.getChanges();return yie(e,s,c),{viewCache:s,changes:c}}function yie(t,e,n){let r=e.eventCache;if(r.isFullyInitialized()){let i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=Ry(t);(n.length>0||!t.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(xj(Ry(e)))}}function Hj(t,e,n,r,i,o){let s=e.eventCache;if(wy(r,n)!=null)return e;{let a,c;if(we(n))if(q(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){let l=nl(e),d=l instanceof ve?l:ve.EMPTY_NODE,h=tb(r,d);a=t.filter.updateFullNode(e.eventCache.getNode(),h,o)}else{let l=Ny(r,nl(e));a=t.filter.updateFullNode(e.eventCache.getNode(),l,o)}else{let l=Ne(n);if(l===".priority"){q(ea(n)===1,"Can't have a priority with additional path components");let d=s.getNode();c=e.serverCache.getNode();let h=Y2(r,n,d,c);h!=null?a=t.filter.updatePriority(d,h):a=s.getNode()}else{let d=at(n),h;if(s.isCompleteForChild(l)){c=e.serverCache.getNode();let f=Y2(r,n,s.getNode(),c);f!=null?h=s.getNode().getImmediateChild(l).updateChild(d,f):h=s.getNode().getImmediateChild(l)}else h=nb(r,l,e.serverCache);h!=null?a=t.filter.updateChild(s.getNode(),l,h,d,i,o):a=s.getNode()}}return Gp(e,a,s.isFullyInitialized()||we(n),t.filter.filtersNodes())}}function by(t,e,n,r,i,o,s,a){let c=e.serverCache,l,d=s?t.filter:t.filter.getIndexedFilter();if(we(n))l=d.updateFullNode(c.getNode(),r,null);else if(d.filtersNodes()&&!c.isFiltered()){let g=c.getNode().updateChild(n,r);l=d.updateFullNode(c.getNode(),g,null)}else{let g=Ne(n);if(!c.isCompleteForPath(n)&&ea(n)>1)return e;let E=at(n),S=c.getNode().getImmediateChild(g).updateChild(E,r);g===".priority"?l=d.updatePriority(c.getNode(),S):l=d.updateChild(c.getNode(),g,S,E,jj,null)}let h=kj(e,l,c.isFullyInitialized()||we(n),d.filtersNodes()),f=new Xp(i,h,o);return Hj(t,h,n,i,f,a)}function Rw(t,e,n,r,i,o,s){let a=e.eventCache,c,l,d=new Xp(i,e,o);if(we(n))l=t.filter.updateFullNode(e.eventCache.getNode(),r,s),c=Gp(e,l,!0,t.filter.filtersNodes());else{let h=Ne(n);if(h===".priority")l=t.filter.updatePriority(e.eventCache.getNode(),r),c=Gp(e,l,a.isFullyInitialized(),a.isFiltered());else{let f=at(n),g=a.getNode().getImmediateChild(h),E;if(we(f))E=r;else{let I=d.getCompleteChild(h);I!=null?Kw(f)===".priority"&&I.getChild(Nj(f)).isEmpty()?E=I:E=I.updateChild(f,r):E=ve.EMPTY_NODE}if(g.equals(E))c=e;else{let I=t.filter.updateChild(a.getNode(),h,E,f,d,s);c=Gp(e,I,a.isFullyInitialized(),t.filter.filtersNodes())}}}return c}function X2(t,e){return t.eventCache.isCompleteForChild(e)}function Iie(t,e,n,r,i,o,s){let a=e;return r.foreach((c,l)=>{let d=Ct(n,c);X2(e,Ne(d))&&(a=Rw(t,a,d,l,i,o,s))}),r.foreach((c,l)=>{let d=Ct(n,c);X2(e,Ne(d))||(a=Rw(t,a,d,l,i,o,s))}),a}function Q2(t,e,n){return n.foreach((r,i)=>{e=e.updateChild(r,i)}),e}function Nw(t,e,n,r,i,o,s,a){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let c=e,l;we(n)?l=r:l=new qn(null).setTree(n,r);let d=e.serverCache.getNode();return l.children.inorderTraversal((h,f)=>{if(d.hasChild(h)){let g=e.serverCache.getNode().getImmediateChild(h),E=Q2(t,g,f);c=by(t,c,new Be(h),E,i,o,s,a)}}),l.children.inorderTraversal((h,f)=>{let g=!e.serverCache.isCompleteForChild(h)&&f.value===null;if(!d.hasChild(h)&&!g){let E=e.serverCache.getNode().getImmediateChild(h),I=Q2(t,E,f);c=by(t,c,new Be(h),I,i,o,s,a)}}),c}function vie(t,e,n,r,i,o,s){if(wy(i,n)!=null)return e;let a=e.serverCache.isFiltered(),c=e.serverCache;if(r.value!=null){if(we(n)&&c.isFullyInitialized()||c.isCompleteForPath(n))return by(t,e,n,c.getNode().getChild(n),i,o,a,s);if(we(n)){let l=new qn(null);return c.getNode().forEachChild(el,(d,h)=>{l=l.set(new Be(d),h)}),Nw(t,e,n,l,i,o,a,s)}else return e}else{let l=new qn(null);return r.foreach((d,h)=>{let f=Ct(n,d);c.isCompleteForPath(f)&&(l=l.set(d,c.getNode().getChild(f)))}),Nw(t,e,n,l,i,o,a,s)}}function Sie(t,e,n,r,i){let o=e.serverCache,s=kj(e,o.getNode(),o.isFullyInitialized()||we(n),o.isFiltered());return Hj(t,s,n,r,jj,i)}function Aie(t,e,n,r,i,o){let s;if(wy(r,n)!=null)return e;{let a=new Xp(r,e,i),c=e.eventCache.getNode(),l;if(we(n)||Ne(n)===".priority"){let d;if(e.serverCache.isFullyInitialized())d=Ny(r,nl(e));else{let h=e.serverCache.getNode();q(h instanceof ve,"serverChildren would be complete if leaf node"),d=tb(r,h)}d=d,l=t.filter.updateFullNode(c,d,o)}else{let d=Ne(n),h=nb(r,d,e.serverCache);h==null&&e.serverCache.isCompleteForChild(d)&&(h=c.getImmediateChild(d)),h!=null?l=t.filter.updateChild(c,d,h,at(n),a,o):e.eventCache.getNode().hasChild(d)?l=t.filter.updateChild(c,d,ve.EMPTY_NODE,at(n),a,o):l=c,l.isEmpty()&&e.serverCache.isFullyInitialized()&&(s=Ny(r,nl(e)),s.isLeafNode()&&(l=t.filter.updateFullNode(l,s,o)))}return s=e.serverCache.isFullyInitialized()||wy(r,Ve())!=null,Gp(e,l,s,t.filter.filtersNodes())}}var ww=class{constructor(e,n){this.query_=e,this.eventRegistrations_=[];let r=this.query_._queryParams,i=new Kp(r.getIndex()),o=Wre(r);this.processor_=Eie(o);let s=n.serverCache,a=n.eventCache,c=i.updateFullNode(ve.EMPTY_NODE,s.getNode(),null),l=o.updateFullNode(ve.EMPTY_NODE,a.getNode(),null),d=new eo(c,s.isFullyInitialized(),i.filtersNodes()),h=new eo(l,a.isFullyInitialized(),o.filtersNodes());this.viewCache_=Gy(h,d),this.eventGenerator_=new Iw(this.query_)}get query(){return this.query_}};function Cie(t){return t.viewCache_.serverCache.getNode()}function Die(t){return Ry(t.viewCache_)}function Rie(t,e){let n=nl(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!we(e)&&!n.getImmediateChild(Ne(e)).isEmpty())?n.getChild(e):null}function J2(t){return t.eventRegistrations_.length===0}function Nie(t,e){t.eventRegistrations_.push(e)}function Z2(t,e,n){let r=[];if(n){q(e==null,"A cancel should cancel all event registrations.");let i=t.query._path;t.eventRegistrations_.forEach(o=>{let s=o.createCancelEvent(n,i);s&&r.push(s)})}if(e){let i=[];for(let o=0;o<t.eventRegistrations_.length;++o){let s=t.eventRegistrations_[o];if(!s.matches(e))i.push(s);else if(e.hasAnyCallback()){i=i.concat(t.eventRegistrations_.slice(o+1));break}}t.eventRegistrations_=i}else t.eventRegistrations_=[];return r}function ej(t,e,n,r){e.type===Zi.MERGE&&e.source.queryId!==null&&(q(nl(t.viewCache_),"We should always have a full cache before handling merges"),q(Ry(t.viewCache_),"Missing event cache, even though we have a server cache"));let i=t.viewCache_,o=Tie(t.processor_,i,e,n,r);return _ie(t.processor_,o.viewCache),q(o.viewCache.serverCache.isFullyInitialized()||!i.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=o.viewCache,$j(t,o.changes,o.viewCache.eventCache.getNode(),null)}function wie(t,e){let n=t.viewCache_.eventCache,r=[];return n.getNode().isLeafNode()||n.getNode().forEachChild(ft,(o,s)=>{r.push(Cd(o,s))}),n.isFullyInitialized()&&r.push(xj(n.getNode())),$j(t,r,n.getNode(),e)}function $j(t,e,n,r){let i=r?[r]:t.eventRegistrations_;return Zre(t.eventGenerator_,e,n,i)}var Oy,My=class{constructor(){this.views=new Map}};function bie(t){q(!Oy,"__referenceConstructor has already been defined"),Oy=t}function Oie(){return q(Oy,"Reference.ts has not been loaded"),Oy}function Mie(t){return t.views.size===0}function rb(t,e,n,r){let i=e.source.queryId;if(i!==null){let o=t.views.get(i);return q(o!=null,"SyncTree gave us an op for an invalid query."),ej(o,e,n,r)}else{let o=[];for(let s of t.views.values())o=o.concat(ej(s,e,n,r));return o}}function Wj(t,e,n,r,i){let o=e._queryIdentifier,s=t.views.get(o);if(!s){let a=Ny(n,i?r:null),c=!1;a?c=!0:r instanceof ve?(a=tb(n,r),c=!1):(a=ve.EMPTY_NODE,c=!1);let l=Gy(new eo(a,c,!1),new eo(r,i,!1));return new ww(e,l)}return s}function Lie(t,e,n,r,i,o){let s=Wj(t,e,r,i,o);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,s),Nie(s,n),wie(s,n)}function Pie(t,e,n,r){let i=e._queryIdentifier,o=[],s=[],a=ta(t);if(i==="default")for(let[c,l]of t.views.entries())s=s.concat(Z2(l,n,r)),J2(l)&&(t.views.delete(c),l.query._queryParams.loadsAllData()||o.push(l.query));else{let c=t.views.get(i);c&&(s=s.concat(Z2(c,n,r)),J2(c)&&(t.views.delete(i),c.query._queryParams.loadsAllData()||o.push(c.query)))}return a&&!ta(t)&&o.push(new(Oie())(e._repo,e._path)),{removed:o,events:s}}function zj(t){let e=[];for(let n of t.views.values())n.query._queryParams.loadsAllData()||e.push(n);return e}function Js(t,e){let n=null;for(let r of t.views.values())n=n||Rie(r,e);return n}function qj(t,e){if(e._queryParams.loadsAllData())return Hy(t);{let r=e._queryIdentifier;return t.views.get(r)}}function Kj(t,e){return qj(t,e)!=null}function ta(t){return Hy(t)!=null}function Hy(t){for(let e of t.views.values())if(e.query._queryParams.loadsAllData())return e;return null}var Ly;function xie(t){q(!Ly,"__referenceConstructor has already been defined"),Ly=t}function kie(){return q(Ly,"Reference.ts has not been loaded"),Ly}var Fie=1,Py=class{constructor(e){this.listenProvider_=e,this.syncPointTree_=new qn(null),this.pendingWriteTree_=gie(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}};function ib(t,e,n,r,i){return rie(t.pendingWriteTree_,e,n,r,i),i?Md(t,new Dd(Jw(),e,n)):[]}function Uie(t,e,n,r){iie(t.pendingWriteTree_,e,n,r);let i=qn.fromObject(n);return Md(t,new Yp(Jw(),e,i))}function Ys(t,e,n=!1){let r=oie(t.pendingWriteTree_,e);if(sie(t.pendingWriteTree_,e)){let o=new qn(null);return r.snap!=null?o=o.set(Ve(),!0):dn(r.children,s=>{o=o.set(new Be(s),!0)}),Md(t,new yw(r.path,o,n))}else return[]}function og(t,e,n){return Md(t,new Dd(Zw(),e,n))}function Vie(t,e,n){let r=qn.fromObject(n);return Md(t,new Yp(Zw(),e,r))}function Bie(t,e){return Md(t,new Dy(Zw(),e))}function Gie(t,e,n){let r=ob(t,n);if(r){let i=sb(r),o=i.path,s=i.queryId,a=zn(o,e),c=new Dy(eb(s),a);return ab(t,o,c)}else return[]}function xy(t,e,n,r,i=!1){let o=e._path,s=t.syncPointTree_.get(o),a=[];if(s&&(e._queryIdentifier==="default"||Kj(s,e))){let c=Pie(s,e,n,r);Mie(s)&&(t.syncPointTree_=t.syncPointTree_.remove(o));let l=c.removed;if(a=c.events,!i){let d=l.findIndex(f=>f._queryParams.loadsAllData())!==-1,h=t.syncPointTree_.findOnPath(o,(f,g)=>ta(g));if(d&&!h){let f=t.syncPointTree_.subtree(o);if(!f.isEmpty()){let g=$ie(f);for(let E=0;E<g.length;++E){let I=g[E],S=I.query,L=Jj(t,I);t.listenProvider_.startListening(Hp(S),Qp(t,S),L.hashFn,L.onComplete)}}}!h&&l.length>0&&!r&&(d?t.listenProvider_.stopListening(Hp(e),null):l.forEach(f=>{let g=t.queryToTagMap.get(Wy(f));t.listenProvider_.stopListening(Hp(f),g)}))}Wie(t,l)}return a}function Yj(t,e,n,r){let i=ob(t,r);if(i!=null){let o=sb(i),s=o.path,a=o.queryId,c=zn(s,e),l=new Dd(eb(a),c,n);return ab(t,s,l)}else return[]}function jie(t,e,n,r){let i=ob(t,r);if(i){let o=sb(i),s=o.path,a=o.queryId,c=zn(s,e),l=qn.fromObject(n),d=new Yp(eb(a),c,l);return ab(t,s,d)}else return[]}function bw(t,e,n,r=!1){let i=e._path,o=null,s=!1;t.syncPointTree_.foreachOnPath(i,(f,g)=>{let E=zn(f,i);o=o||Js(g,E),s=s||ta(g)});let a=t.syncPointTree_.get(i);a?(s=s||ta(a),o=o||Js(a,Ve())):(a=new My,t.syncPointTree_=t.syncPointTree_.set(i,a));let c;o!=null?c=!0:(c=!1,o=ve.EMPTY_NODE,t.syncPointTree_.subtree(i).foreachChild((g,E)=>{let I=Js(E,Ve());I&&(o=o.updateImmediateChild(g,I))}));let l=Kj(a,e);if(!l&&!e._queryParams.loadsAllData()){let f=Wy(e);q(!t.queryToTagMap.has(f),"View does not exist, but we have a tag");let g=zie();t.queryToTagMap.set(f,g),t.tagToQueryMap.set(g,f)}let d=jy(t.pendingWriteTree_,i),h=Lie(a,e,n,d,o,c);if(!l&&!s&&!r){let f=qj(a,e);h=h.concat(qie(t,e,f))}return h}function $y(t,e,n){let i=t.pendingWriteTree_,o=t.syncPointTree_.findOnPath(e,(s,a)=>{let c=zn(s,e),l=Js(a,c);if(l)return l});return Vj(i,e,o,n,!0)}function Hie(t,e){let n=e._path,r=null;t.syncPointTree_.foreachOnPath(n,(l,d)=>{let h=zn(l,n);r=r||Js(d,h)});let i=t.syncPointTree_.get(n);i?r=r||Js(i,Ve()):(i=new My,t.syncPointTree_=t.syncPointTree_.set(n,i));let o=r!=null,s=o?new eo(r,!0,!1):null,a=jy(t.pendingWriteTree_,e._path),c=Wj(i,e,a,o?s.getNode():ve.EMPTY_NODE,o);return Die(c)}function Md(t,e){return Xj(e,t.syncPointTree_,null,jy(t.pendingWriteTree_,Ve()))}function Xj(t,e,n,r){if(we(t.path))return Qj(t,e,n,r);{let i=e.get(Ve());n==null&&i!=null&&(n=Js(i,Ve()));let o=[],s=Ne(t.path),a=t.operationForChild(s),c=e.children.get(s);if(c&&a){let l=n?n.getImmediateChild(s):null,d=Bj(r,s);o=o.concat(Xj(a,c,l,d))}return i&&(o=o.concat(rb(i,t,r,n))),o}}function Qj(t,e,n,r){let i=e.get(Ve());n==null&&i!=null&&(n=Js(i,Ve()));let o=[];return e.children.inorderTraversal((s,a)=>{let c=n?n.getImmediateChild(s):null,l=Bj(r,s),d=t.operationForChild(s);d&&(o=o.concat(Qj(d,a,c,l)))}),i&&(o=o.concat(rb(i,t,r,n))),o}function Jj(t,e){let n=e.query,r=Qp(t,n);return{hashFn:()=>(Cie(e)||ve.EMPTY_NODE).hash(),onComplete:i=>{if(i==="ok")return r?Gie(t,n._path,r):Bie(t,n._path);{let o=rre(i,n);return xy(t,n,null,o)}}}}function Qp(t,e){let n=Wy(e);return t.queryToTagMap.get(n)}function Wy(t){return t._path.toString()+"$"+t._queryIdentifier}function ob(t,e){return t.tagToQueryMap.get(e)}function sb(t){let e=t.indexOf("$");return q(e!==-1&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new Be(t.substr(0,e))}}function ab(t,e,n){let r=t.syncPointTree_.get(e);q(r,"Missing sync point for query tag that we're tracking");let i=jy(t.pendingWriteTree_,e);return rb(r,n,i,null)}function $ie(t){return t.fold((e,n,r)=>{if(n&&ta(n))return[Hy(n)];{let i=[];return n&&(i=zj(n)),dn(r,(o,s)=>{i=i.concat(s)}),i}})}function Hp(t){return t._queryParams.loadsAllData()&&!t._queryParams.isDefault()?new(kie())(t._repo,t._path):t}function Wie(t,e){for(let n=0;n<e.length;++n){let r=e[n];if(!r._queryParams.loadsAllData()){let i=Wy(r),o=t.queryToTagMap.get(i);t.queryToTagMap.delete(i),t.tagToQueryMap.delete(o)}}}function zie(){return Fie++}function qie(t,e,n){let r=e._path,i=Qp(t,e),o=Jj(t,n),s=t.listenProvider_.startListening(Hp(e),i,o.hashFn,o.onComplete),a=t.syncPointTree_.subtree(r);if(i)q(!ta(a.value),"If we're adding a query, it shouldn't be shadowed");else{let c=a.fold((l,d,h)=>{if(!we(l)&&d&&ta(d))return[Hy(d).query];{let f=[];return d&&(f=f.concat(zj(d).map(g=>g.query))),dn(h,(g,E)=>{f=f.concat(E)}),f}});for(let l=0;l<c.length;++l){let d=c[l];t.listenProvider_.stopListening(Hp(d),Qp(t,d))}}return s}var Ow=class t{constructor(e){this.node_=e}getImmediateChild(e){let n=this.node_.getImmediateChild(e);return new t(n)}node(){return this.node_}},Mw=class t{constructor(e,n){this.syncTree_=e,this.path_=n}getImmediateChild(e){let n=Ct(this.path_,e);return new t(this.syncTree_,n)}node(){return $y(this.syncTree_,this.path_)}},Kie=function(t){return t=t||{},t.timestamp=t.timestamp||new Date().getTime(),t},tj=function(t,e,n){if(!t||typeof t!="object")return t;if(q(".sv"in t,"Unexpected leaf node or priority contents"),typeof t[".sv"]=="string")return Yie(t[".sv"],e,n);if(typeof t[".sv"]=="object")return Xie(t[".sv"],e);q(!1,"Unexpected server value: "+JSON.stringify(t,null,2))},Yie=function(t,e,n){if(t==="timestamp")return n.timestamp;q(!1,"Unexpected server value: "+t)},Xie=function(t,e,n){t.hasOwnProperty("increment")||q(!1,"Unexpected server value: "+JSON.stringify(t,null,2));let r=t.increment;typeof r!="number"&&q(!1,"Unexpected increment value: "+r);let i=e.node();if(q(i!==null&&typeof i<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;let s=i.getValue();return typeof s!="number"?r:s+r},Zj=function(t,e,n,r){return lb(e,new Mw(n,t),r)},cb=function(t,e,n){return lb(t,new Ow(e),n)};function lb(t,e,n){let r=t.getPriority().val(),i=tj(r,e.getImmediateChild(".priority"),n),o;if(t.isLeafNode()){let s=t,a=tj(s.getValue(),e,n);return a!==s.getValue()||i!==s.getPriority().val()?new Sd(a,At(i)):t}else{let s=t;return o=s,i!==s.getPriority().val()&&(o=o.updatePriority(new Sd(i))),s.forEachChild(ft,(a,c)=>{let l=lb(c,e.getImmediateChild(a),n);l!==c&&(o=o.updateImmediateChild(a,l))}),o}}var Jp=class{constructor(e="",n=null,r={children:{},childCount:0}){this.name=e,this.parent=n,this.node=r}};function zy(t,e){let n=e instanceof Be?e:new Be(e),r=t,i=Ne(n);for(;i!==null;){let o=Fs(r.node.children,i)||{children:{},childCount:0};r=new Jp(i,r,o),n=at(n),i=Ne(n)}return r}function ll(t){return t.node.value}function ub(t,e){t.node.value=e,Lw(t)}function eH(t){return t.node.childCount>0}function Qie(t){return ll(t)===void 0&&!eH(t)}function qy(t,e){dn(t.node.children,(n,r)=>{e(new Jp(n,t,r))})}function tH(t,e,n,r){n&&!r&&e(t),qy(t,i=>{tH(i,e,!0,r)}),n&&r&&e(t)}function Jie(t,e,n){let r=n?t:t.parent;for(;r!==null;){if(e(r))return!0;r=r.parent}return!1}function sg(t){return new Be(t.parent===null?t.name:sg(t.parent)+"/"+t.name)}function Lw(t){t.parent!==null&&Zie(t.parent,t.name,t)}function Zie(t,e,n){let r=Qie(n),i=Vr(t.node.children,e);r&&i?(delete t.node.children[e],t.node.childCount--,Lw(t)):!r&&!i&&(t.node.children[e]=n.node,t.node.childCount++,Lw(t))}var eoe=/[\[\].#$\/\u0000-\u001F\u007F]/,toe=/[\[\].#$\u0000-\u001F\u007F]/,WN=10*1024*1024,Ky=function(t){return typeof t=="string"&&t.length!==0&&!eoe.test(t)},nH=function(t){return typeof t=="string"&&t.length!==0&&!toe.test(t)},noe=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),nH(t)},Zp=function(t){return t===null||typeof t=="string"||typeof t=="number"&&!By(t)||t&&typeof t=="object"&&Vr(t,".sv")},rl=function(t,e,n,r){r&&e===void 0||ag(Us(t,"value"),e,n)},ag=function(t,e,n){let r=n instanceof Be?new iw(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+Qc(r));if(typeof e=="function")throw new Error(t+"contains a function "+Qc(r)+" with contents = "+e.toString());if(By(e))throw new Error(t+"contains "+e.toString()+" "+Qc(r));if(typeof e=="string"&&e.length>WN/3&&mp(e)>WN)throw new Error(t+"contains a string greater than "+WN+" utf8 bytes "+Qc(r)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let i=!1,o=!1;if(dn(e,(s,a)=>{if(s===".value")i=!0;else if(s!==".priority"&&s!==".sv"&&(o=!0,!Ky(s)))throw new Error(t+" contains an invalid key ("+s+") "+Qc(r)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);Mre(r,s),ag(t,a,r),Lre(r)}),i&&o)throw new Error(t+' contains ".value" child '+Qc(r)+" in addition to actual children.")}},roe=function(t,e){let n,r;for(n=0;n<e.length;n++){r=e[n];let o=$p(r);for(let s=0;s<o.length;s++)if(!(o[s]===".priority"&&s===o.length-1)){if(!Ky(o[s]))throw new Error(t+"contains an invalid key ("+o[s]+") in path "+r.toString()+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`)}}e.sort(Ore);let i=null;for(n=0;n<e.length;n++){if(r=e[n],i!==null&&jr(i,r))throw new Error(t+"contains a path "+i.toString()+" that is ancestor of another path "+r.toString());i=r}},rH=function(t,e,n,r){if(r&&e===void 0)return;let i=Us(t,"values");if(!(e&&typeof e=="object")||Array.isArray(e))throw new Error(i+" must be an object containing the children to replace.");let o=[];dn(e,(s,a)=>{let c=new Be(s);if(ag(i,a,Ct(n,c)),Kw(c)===".priority"&&!Zp(a))throw new Error(i+"contains an invalid value for '"+c.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");o.push(c)}),roe(i,o)},ioe=function(t,e,n){if(!(n&&e===void 0)){if(By(e))throw new Error(Us(t,"priority")+"is "+e.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!Zp(e))throw new Error(Us(t,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},iH=function(t,e,n,r){if(!(r&&n===void 0)&&!Ky(n))throw new Error(Us(t,e)+'was an invalid key = "'+n+`". Firebase keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]").`)},db=function(t,e,n,r){if(!(r&&n===void 0)&&!nH(n))throw new Error(Us(t,e)+'was an invalid path = "'+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},ooe=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),db(t,e,n,r)},Xs=function(t,e){if(Ne(e)===".info")throw new Error(t+" failed = Can't modify data under /.info/")},soe=function(t,e){let n=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!Ky(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||n.length!==0&&!noe(n))throw new Error(Us(t,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};var Pw=class{constructor(){this.eventLists_=[],this.recursionDepth_=0}};function Yy(t,e){let n=null;for(let r=0;r<e.length;r++){let i=e[r],o=i.getPath();n!==null&&!Yw(o,n.path)&&(t.eventLists_.push(n),n=null),n===null&&(n={events:[],path:o}),n.events.push(i)}n&&t.eventLists_.push(n)}function oH(t,e,n){Yy(t,n),sH(t,r=>Yw(r,e))}function vr(t,e,n){Yy(t,n),sH(t,r=>jr(r,e)||jr(e,r))}function sH(t,e){t.recursionDepth_++;let n=!0;for(let r=0;r<t.eventLists_.length;r++){let i=t.eventLists_[r];if(i){let o=i.path;e(o)?(aoe(t.eventLists_[r]),t.eventLists_[r]=null):n=!1}}n&&(t.eventLists_=[]),t.recursionDepth_--}function aoe(t){for(let e=0;e<t.events.length;e++){let n=t.events[e];if(n!==null){t.events[e]=null;let r=n.getEventRunner();Zc&&un("event: "+n.toString()),bd(r)}}}var coe="repo_interrupt",loe=25,xw=class{constructor(e,n,r,i){this.repoInfo_=e,this.forceRestClient_=n,this.authTokenProvider_=r,this.appCheckProvider_=i,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Pw,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Cy(),this.transactionQueueTree_=new Jp,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}};function uoe(t,e,n){if(t.stats_=qw(t.repoInfo_),t.forceRestClient_||are())t.server_=new pw(t.repoInfo_,(r,i,o,s)=>{nj(t,r,i,o,s)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>rj(t,!0),0);else{if(typeof n<"u"&&n!==null){if(typeof n!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{xt(n)}catch(r){throw new Error("Invalid authOverride provided: "+r)}}t.persistentConnection_=new Xw(t.repoInfo_,e,(r,i,o,s)=>{nj(t,r,i,o,s)},r=>{rj(t,r)},r=>{doe(t,r)},t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener(r=>{t.server_.refreshAuthToken(r)}),t.appCheckProvider_.addTokenChangeListener(r=>{t.server_.refreshAppCheckToken(r.token)}),t.statsReporter_=lre(t.repoInfo_,()=>new Tw(t.stats_,t.server_)),t.infoData_=new gw,t.infoSyncTree_=new Py({startListening:(r,i,o,s)=>{let a=[],c=t.infoData_.getNode(r._path);return c.isEmpty()||(a=og(t.infoSyncTree_,r._path,c),setTimeout(()=>{s("ok")},0)),a},stopListening:()=>{}}),hb(t,"connected",!1),t.serverSyncTree_=new Py({startListening:(r,i,o,s)=>(t.server_.listen(r,o,i,(a,c)=>{let l=s(a,c);vr(t.eventQueue_,r._path,l)}),[]),stopListening:(r,i)=>{t.server_.unlisten(r,i)}})}function aH(t){let n=t.infoData_.getNode(new Be(".info/serverTimeOffset")).val()||0;return new Date().getTime()+n}function cg(t){return Kie({timestamp:aH(t)})}function nj(t,e,n,r,i){t.dataUpdateCount++;let o=new Be(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let s=[];if(i)if(r){let c=pp(n,l=>At(l));s=jie(t.serverSyncTree_,o,c,i)}else{let c=At(n);s=Yj(t.serverSyncTree_,o,c,i)}else if(r){let c=pp(n,l=>At(l));s=Vie(t.serverSyncTree_,o,c)}else{let c=At(n);s=og(t.serverSyncTree_,o,c)}let a=o;s.length>0&&(a=Nd(t,o)),vr(t.eventQueue_,a,s)}function rj(t,e){hb(t,"connected",e),e===!1&&goe(t)}function doe(t,e){dn(e,(n,r)=>{hb(t,n,r)})}function hb(t,e,n){let r=new Be("/.info/"+e),i=At(n);t.infoData_.updateSnapshot(r,i);let o=og(t.infoSyncTree_,r,i);vr(t.eventQueue_,r,o)}function Xy(t){return t.nextWriteId_++}function hoe(t,e,n){let r=Hie(t.serverSyncTree_,e);return r!=null?Promise.resolve(r):t.server_.get(e).then(i=>{let o=At(i).withIndex(e._queryParams.getIndex());bw(t.serverSyncTree_,e,n,!0);let s;if(e._queryParams.loadsAllData())s=og(t.serverSyncTree_,e._path,o);else{let a=Qp(t.serverSyncTree_,e);s=Yj(t.serverSyncTree_,e._path,o,a)}return vr(t.eventQueue_,e._path,s),xy(t.serverSyncTree_,e,n,null,!0),o},i=>(Ld(t,"get for query "+xt(e)+" failed: "+i),Promise.reject(new Error(i))))}function foe(t,e,n,r,i){Ld(t,"set",{path:e.toString(),value:n,priority:r});let o=cg(t),s=At(n,r),a=$y(t.serverSyncTree_,e),c=cb(s,a,o),l=Xy(t),d=ib(t.serverSyncTree_,e,c,l,!0);Yy(t.eventQueue_,d),t.server_.put(e.toString(),s.val(!0),(f,g)=>{let E=f==="ok";E||xn("set at "+e+" failed: "+f);let I=Ys(t.serverSyncTree_,l,!E);vr(t.eventQueue_,e,I),na(t,i,f,g)});let h=pb(t,e);Nd(t,h),vr(t.eventQueue_,h,[])}function poe(t,e,n,r){Ld(t,"update",{path:e.toString(),value:n});let i=!0,o=cg(t),s={};if(dn(n,(a,c)=>{i=!1,s[a]=Zj(Ct(e,a),At(c),t.serverSyncTree_,o)}),i)un("update() called with empty data. Don't do anything."),na(t,r,"ok",void 0);else{let a=Xy(t),c=Uie(t.serverSyncTree_,e,s,a);Yy(t.eventQueue_,c),t.server_.merge(e.toString(),n,(l,d)=>{let h=l==="ok";h||xn("update at "+e+" failed: "+l);let f=Ys(t.serverSyncTree_,a,!h),g=f.length>0?Nd(t,e):e;vr(t.eventQueue_,g,f),na(t,r,l,d)}),dn(n,l=>{let d=pb(t,Ct(e,l));Nd(t,d)}),vr(t.eventQueue_,e,[])}}function goe(t){Ld(t,"onDisconnectEvents");let e=cg(t),n=Cy();Ew(t.onDisconnect_,Ve(),(i,o)=>{let s=Zj(i,o,t.serverSyncTree_,e);Od(n,i,s)});let r=[];Ew(n,Ve(),(i,o)=>{r=r.concat(og(t.serverSyncTree_,i,o));let s=pb(t,i);Nd(t,s)}),t.onDisconnect_=Cy(),vr(t.eventQueue_,Ve(),r)}function moe(t,e,n){t.server_.onDisconnectCancel(e.toString(),(r,i)=>{r==="ok"&&mw(t.onDisconnect_,e),na(t,n,r,i)})}function ij(t,e,n,r){let i=At(n);t.server_.onDisconnectPut(e.toString(),i.val(!0),(o,s)=>{o==="ok"&&Od(t.onDisconnect_,e,i),na(t,r,o,s)})}function Eoe(t,e,n,r,i){let o=At(n,r);t.server_.onDisconnectPut(e.toString(),o.val(!0),(s,a)=>{s==="ok"&&Od(t.onDisconnect_,e,o),na(t,i,s,a)})}function _oe(t,e,n,r){if(fp(n)){un("onDisconnect().update() called with empty data. Don't do anything."),na(t,r,"ok",void 0);return}t.server_.onDisconnectMerge(e.toString(),n,(i,o)=>{i==="ok"&&dn(n,(s,a)=>{let c=At(a);Od(t.onDisconnect_,Ct(e,s),c)}),na(t,r,i,o)})}function Toe(t,e,n){let r;Ne(e._path)===".info"?r=bw(t.infoSyncTree_,e,n):r=bw(t.serverSyncTree_,e,n),oH(t.eventQueue_,e._path,r)}function kw(t,e,n){let r;Ne(e._path)===".info"?r=xy(t.infoSyncTree_,e,n):r=xy(t.serverSyncTree_,e,n),oH(t.eventQueue_,e._path,r)}function yoe(t){t.persistentConnection_&&t.persistentConnection_.interrupt(coe)}function Ld(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),un(n,...e)}function na(t,e,n,r){e&&bd(()=>{if(n==="ok")e(null);else{let i=(n||"error").toUpperCase(),o=i;r&&(o+=": "+r);let s=new Error(o);s.code=i,e(s)}})}function Ioe(t,e,n,r,i,o){Ld(t,"transaction on "+e);let s={path:e,update:n,onComplete:r,status:null,order:cj(),applyLocally:o,retryCount:0,unwatcher:i,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},a=fb(t,e,void 0);s.currentInputSnapshot=a;let c=s.update(a.val());if(c===void 0)s.unwatcher(),s.currentOutputSnapshotRaw=null,s.currentOutputSnapshotResolved=null,s.onComplete&&s.onComplete(null,!1,s.currentInputSnapshot);else{ag("transaction failed: Data returned ",c,s.path),s.status=0;let l=zy(t.transactionQueueTree_,e),d=ll(l)||[];d.push(s),ub(l,d);let h;typeof c=="object"&&c!==null&&Vr(c,".priority")?(h=Fs(c,".priority"),q(Zp(h),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):h=($y(t.serverSyncTree_,e)||ve.EMPTY_NODE).getPriority().val();let f=cg(t),g=At(c,h),E=cb(g,a,f);s.currentOutputSnapshotRaw=g,s.currentOutputSnapshotResolved=E,s.currentWriteId=Xy(t);let I=ib(t.serverSyncTree_,e,E,s.currentWriteId,s.applyLocally);vr(t.eventQueue_,e,I),Qy(t,t.transactionQueueTree_)}}function fb(t,e,n){return $y(t.serverSyncTree_,e,n)||ve.EMPTY_NODE}function Qy(t,e=t.transactionQueueTree_){if(e||Jy(t,e),ll(e)){let n=lH(t,e);q(n.length>0,"Sending zero length transaction queue"),n.every(i=>i.status===0)&&voe(t,sg(e),n)}else eH(e)&&qy(e,n=>{Qy(t,n)})}function voe(t,e,n){let r=n.map(l=>l.currentWriteId),i=fb(t,e,r),o=i,s=i.hash();for(let l=0;l<n.length;l++){let d=n[l];q(d.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),d.status=1,d.retryCount++;let h=zn(e,d.path);o=o.updateChild(h,d.currentOutputSnapshotRaw)}let a=o.val(!0),c=e;t.server_.put(c.toString(),a,l=>{Ld(t,"transaction put response",{path:c.toString(),status:l});let d=[];if(l==="ok"){let h=[];for(let f=0;f<n.length;f++)n[f].status=2,d=d.concat(Ys(t.serverSyncTree_,n[f].currentWriteId)),n[f].onComplete&&h.push(()=>n[f].onComplete(null,!0,n[f].currentOutputSnapshotResolved)),n[f].unwatcher();Jy(t,zy(t.transactionQueueTree_,e)),Qy(t,t.transactionQueueTree_),vr(t.eventQueue_,e,d);for(let f=0;f<h.length;f++)bd(h[f])}else{if(l==="datastale")for(let h=0;h<n.length;h++)n[h].status===3?n[h].status=4:n[h].status=0;else{xn("transaction at "+c.toString()+" failed: "+l);for(let h=0;h<n.length;h++)n[h].status=4,n[h].abortReason=l}Nd(t,e)}},s)}function Nd(t,e){let n=cH(t,e),r=sg(n),i=lH(t,n);return Soe(t,i,r),r}function Soe(t,e,n){if(e.length===0)return;let r=[],i=[],s=e.filter(a=>a.status===0).map(a=>a.currentWriteId);for(let a=0;a<e.length;a++){let c=e[a],l=zn(n,c.path),d=!1,h;if(q(l!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),c.status===4)d=!0,h=c.abortReason,i=i.concat(Ys(t.serverSyncTree_,c.currentWriteId,!0));else if(c.status===0)if(c.retryCount>=loe)d=!0,h="maxretry",i=i.concat(Ys(t.serverSyncTree_,c.currentWriteId,!0));else{let f=fb(t,c.path,s);c.currentInputSnapshot=f;let g=e[a].update(f.val());if(g!==void 0){ag("transaction failed: Data returned ",g,c.path);let E=At(g);typeof g=="object"&&g!=null&&Vr(g,".priority")||(E=E.updatePriority(f.getPriority()));let S=c.currentWriteId,L=cg(t),V=cb(E,f,L);c.currentOutputSnapshotRaw=E,c.currentOutputSnapshotResolved=V,c.currentWriteId=Xy(t),s.splice(s.indexOf(S),1),i=i.concat(ib(t.serverSyncTree_,c.path,V,c.currentWriteId,c.applyLocally)),i=i.concat(Ys(t.serverSyncTree_,S,!0))}else d=!0,h="nodata",i=i.concat(Ys(t.serverSyncTree_,c.currentWriteId,!0))}vr(t.eventQueue_,n,i),i=[],d&&(e[a].status=2,(function(f){setTimeout(f,Math.floor(0))})(e[a].unwatcher),e[a].onComplete&&(h==="nodata"?r.push(()=>e[a].onComplete(null,!1,e[a].currentInputSnapshot)):r.push(()=>e[a].onComplete(new Error(h),!1,null))))}Jy(t,t.transactionQueueTree_);for(let a=0;a<r.length;a++)bd(r[a]);Qy(t,t.transactionQueueTree_)}function cH(t,e){let n,r=t.transactionQueueTree_;for(n=Ne(e);n!==null&&ll(r)===void 0;)r=zy(r,n),e=at(e),n=Ne(e);return r}function lH(t,e){let n=[];return uH(t,e,n),n.sort((r,i)=>r.order-i.order),n}function uH(t,e,n){let r=ll(e);if(r)for(let i=0;i<r.length;i++)n.push(r[i]);qy(e,i=>{uH(t,i,n)})}function Jy(t,e){let n=ll(e);if(n){let r=0;for(let i=0;i<n.length;i++)n[i].status!==2&&(n[r]=n[i],r++);n.length=r,ub(e,n.length>0?n:void 0)}qy(e,r=>{Jy(t,r)})}function pb(t,e){let n=sg(cH(t,e)),r=zy(t.transactionQueueTree_,e);return Jie(r,i=>{zN(t,i)}),zN(t,r),tH(r,i=>{zN(t,i)}),n}function zN(t,e){let n=ll(e);if(n){let r=[],i=[],o=-1;for(let s=0;s<n.length;s++)n[s].status===3||(n[s].status===1?(q(o===s-1,"All SENT items should be at beginning of queue."),o=s,n[s].status=3,n[s].abortReason="set"):(q(n[s].status===0,"Unexpected transaction status in abort"),n[s].unwatcher(),i=i.concat(Ys(t.serverSyncTree_,n[s].currentWriteId,!0)),n[s].onComplete&&r.push(n[s].onComplete.bind(null,new Error("set"),!1,null))));o===-1?ub(e,void 0):n.length=o+1,vr(t.eventQueue_,sg(e),i);for(let s=0;s<r.length;s++)bd(r[s])}}function Aoe(t){let e="",n=t.split("/");for(let r=0;r<n.length;r++)if(n[r].length>0){let i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch{}e+="/"+i}return e}function Coe(t){let e={};t.charAt(0)==="?"&&(t=t.substring(1));for(let n of t.split("&")){if(n.length===0)continue;let r=n.split("=");r.length===2?e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):xn(`Invalid query segment '${n}' in query '${t}'`)}return e}var oj=function(t,e){let n=Doe(t),r=n.namespace;n.domain==="firebase.com"&&Wo(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!r||r==="undefined")&&n.domain!=="localhost"&&Wo("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||Jne();let i=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new my(n.host,n.secure,r,i,e,"",r!==n.subdomain),path:new Be(n.pathString)}},Doe=function(t){let e="",n="",r="",i="",o="",s=!0,a="https",c=443;if(typeof t=="string"){let l=t.indexOf("//");l>=0&&(a=t.substring(0,l-1),t=t.substring(l+2));let d=t.indexOf("/");d===-1&&(d=t.length);let h=t.indexOf("?");h===-1&&(h=t.length),e=t.substring(0,Math.min(d,h)),d<h&&(i=Aoe(t.substring(d,h)));let f=Coe(t.substring(Math.min(t.length,h)));l=e.indexOf(":"),l>=0?(s=a==="https"||a==="wss",c=parseInt(e.substring(l+1),10)):l=e.length;let g=e.slice(0,l);if(g.toLowerCase()==="localhost")n="localhost";else if(g.split(".").length<=2)n=g;else{let E=e.indexOf(".");r=e.substring(0,E).toLowerCase(),n=e.substring(E+1),o=r}"ns"in f&&(o=f.ns)}return{host:e,port:c,domain:n,subdomain:r,secure:s,scheme:a,pathString:i,namespace:o}};var sj="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",Roe=(function(){let t=0,e=[];return function(n){let r=n===t;t=n;let i,o=new Array(8);for(i=7;i>=0;i--)o[i]=sj.charAt(n%64),n=Math.floor(n/64);q(n===0,"Cannot push at time == 0");let s=o.join("");if(r){for(i=11;i>=0&&e[i]===63;i--)e[i]=0;e[i]++}else for(i=0;i<12;i++)e[i]=Math.floor(Math.random()*64);for(i=0;i<12;i++)s+=sj.charAt(e[i]);return q(s.length===20,"nextPushId: Length should be 20."),s}})();var ky=class{constructor(e,n,r,i){this.eventType=e,this.eventRegistration=n,this.snapshot=r,this.prevName=i}getPath(){let e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+xt(this.snapshot.exportVal())}},Fy=class{constructor(e,n,r){this.eventRegistration=e,this.error=n,this.path=r}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}};var eg=class{constructor(e,n){this.snapshotCallback=e,this.cancelCallback=n}onValue(e,n){this.snapshotCallback.call(null,e,n)}onCancel(e){return q(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}};var Fw=class{constructor(e,n){this._repo=e,this._path=n}cancel(){let e=new cn;return moe(this._repo,this._path,e.wrapCallback(()=>{})),e.promise}remove(){Xs("OnDisconnect.remove",this._path);let e=new cn;return ij(this._repo,this._path,null,e.wrapCallback(()=>{})),e.promise}set(e){Xs("OnDisconnect.set",this._path),rl("OnDisconnect.set",e,this._path,!1);let n=new cn;return ij(this._repo,this._path,e,n.wrapCallback(()=>{})),n.promise}setWithPriority(e,n){Xs("OnDisconnect.setWithPriority",this._path),rl("OnDisconnect.setWithPriority",e,this._path,!1),ioe("OnDisconnect.setWithPriority",n,!1);let r=new cn;return Eoe(this._repo,this._path,e,n,r.wrapCallback(()=>{})),r.promise}update(e){Xs("OnDisconnect.update",this._path),rH("OnDisconnect.update",e,this._path,!1);let n=new cn;return _oe(this._repo,this._path,e,n.wrapCallback(()=>{})),n.promise}};var il=class t{constructor(e,n,r,i){this._repo=e,this._path=n,this._queryParams=r,this._orderByCalled=i}get key(){return we(this._path)?null:Kw(this._path)}get ref(){return new hi(this._repo,this._path)}get _queryIdentifier(){let e=W2(this._queryParams),n=zw(e);return n==="{}"?"default":n}get _queryObject(){return W2(this._queryParams)}isEqual(e){if(e=Me(e),!(e instanceof t))return!1;let n=this._repo===e._repo,r=Yw(this._path,e._path),i=this._queryIdentifier===e._queryIdentifier;return n&&r&&i}toJSON(){return this.toString()}toString(){return this._repo.toString()+bre(this._path)}};function Noe(t,e){if(t._orderByCalled===!0)throw new Error(e+": You can't combine multiple orderBy calls.")}function gb(t){let e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===el){let r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!==tl)throw new Error(r);if(typeof e!="string")throw new Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!==Zs)throw new Error(r);if(typeof n!="string")throw new Error(i)}}else if(t.getIndex()===ft){if(e!=null&&!Zp(e)||n!=null&&!Zp(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(q(t.getIndex()instanceof Wp||t.getIndex()===Pj,"unknown index type."),e!=null&&typeof e=="object"||n!=null&&typeof n=="object")throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function dH(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}var hi=class t extends il{constructor(e,n){super(e,n,new fw,!1)}get parent(){let e=Nj(this._path);return e===null?null:new t(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}},wd=class t{constructor(e,n,r){this._node=e,this.ref=n,this._index=r}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){let n=new Be(e),r=ol(this.ref,e);return new t(this._node.getChild(n),r,ft)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(r,i)=>e(new t(i,ol(this.ref,r),ft)))}hasChild(e){let n=new Be(e);return!this._node.getChild(n).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}};function hH(t,e){return t=Me(t),t._checkNotDeleted("ref"),e!==void 0?ol(t._root,e):t._root}function ol(t,e){return t=Me(t),Ne(t._path)===null?ooe("child","path",e,!1):db("child","path",e,!1),new hi(t._repo,Ct(t._path,e))}function fH(t){return t=Me(t),new Fw(t._repo,t._path)}function pH(t,e){t=Me(t),Xs("push",t._path),rl("push",e,t._path,!0);let n=aH(t._repo),r=Roe(n),i=ol(t,r),o=ol(t,r),s;return e!=null?s=Zy(o,e).then(()=>o):s=Promise.resolve(o),i.then=s.then.bind(s),i.catch=s.then.bind(s,void 0),i}function gH(t){return Xs("remove",t._path),Zy(t,null)}function Zy(t,e){t=Me(t),Xs("set",t._path),rl("set",e,t._path,!1);let n=new cn;return foe(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}function mH(t,e){rH("update",e,t._path,!1);let n=new cn;return poe(t._repo,t._path,e,n.wrapCallback(()=>{})),n.promise}function eI(t){t=Me(t);let e=new eg(()=>{}),n=new tg(e);return hoe(t._repo,t,n).then(r=>new wd(r,new hi(t._repo,t._path),t._queryParams.getIndex()))}var tg=class t{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,n){let r=n._queryParams.getIndex();return new ky("value",this,new wd(e.snapshotNode,new hi(n._repo,n._path),r))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new Fy(this,e,n):null}matches(e){return e instanceof t?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}},Uy=class t{constructor(e,n){this.eventType=e,this.callbackContext=n}respondsTo(e){let n=e==="children_added"?"child_added":e;return n=n==="children_removed"?"child_removed":n,this.eventType===n}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new Fy(this,e,n):null}createEvent(e,n){q(e.childName!=null,"Child events should have a childName.");let r=ol(new hi(n._repo,n._path),e.childName),i=n._queryParams.getIndex();return new ky(e.type,this,new wd(e.snapshotNode,r,i),e.prevName)}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(e){return e instanceof t?this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)):!1}hasAnyCallback(){return!!this.callbackContext}};function lg(t,e,n,r,i){let o;if(typeof r=="object"&&(o=void 0,i=r),typeof r=="function"&&(o=r),i&&i.onlyOnce){let c=n,l=(d,h)=>{kw(t._repo,t,a),c(d,h)};l.userCallback=n.userCallback,l.context=n.context,n=l}let s=new eg(n,o||void 0),a=e==="value"?new tg(s):new Uy(e,s);return Toe(t._repo,t,a),()=>kw(t._repo,t,a)}function ug(t,e,n,r){return lg(t,"value",e,n,r)}function tI(t,e,n,r){return lg(t,"child_added",e,n,r)}function nI(t,e,n,r){return lg(t,"child_changed",e,n,r)}function mb(t,e,n,r){return lg(t,"child_moved",e,n,r)}function rI(t,e,n,r){return lg(t,"child_removed",e,n,r)}function iI(t,e,n){let r=null,i=n?new eg(n):null;e==="value"?r=new tg(i):e&&(r=new Uy(e,i)),kw(t._repo,t,r)}var sl=class{},Uw=class extends sl{constructor(e,n){super(),this._value=e,this._key=n,this.type="endAt"}_apply(e){rl("endAt",this._value,e._path,!0);let n=Kre(e._queryParams,this._value,this._key);if(dH(n),gb(n),e._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new il(e._repo,e._path,n,e._orderByCalled)}};var Vy=class extends sl{constructor(e,n){super(),this._value=e,this._key=n,this.type="startAt"}_apply(e){rl("startAt",this._value,e._path,!0);let n=qre(e._queryParams,this._value,this._key);if(dH(n),gb(n),e._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new il(e._repo,e._path,n,e._orderByCalled)}};function EH(t=null,e){return iH("startAt","key",e,!0),new Vy(t,e)}var Vw=class extends sl{constructor(e){super(),this._limit=e,this.type="limitToLast"}_apply(e){if(e._queryParams.hasLimit())throw new Error("limitToLast: Limit was already set (by another call to limitToFirst or limitToLast).");return new il(e._repo,e._path,zre(e._queryParams,this._limit),e._orderByCalled)}};function _H(t){if(typeof t!="number"||Math.floor(t)!==t||t<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new Vw(t)}var Bw=class extends sl{constructor(e){super(),this._path=e,this.type="orderByChild"}_apply(e){Noe(e,"orderByChild");let n=new Be(this._path);if(we(n))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");let r=new Wp(n),i=Yre(e._queryParams,r);return gb(i),new il(e._repo,e._path,i,!0)}};function TH(t){if(t==="$key")throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.');if(t==="$priority")throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.');if(t==="$value")throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.');return db("orderByChild","path",t,!1),new Bw(t)}var Gw=class extends sl{constructor(e,n){super(),this._value=e,this._key=n,this.type="equalTo"}_apply(e){if(rl("equalTo",this._value,e._path,!1),e._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(e._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new Uw(this._value,this._key)._apply(new Vy(this._value,this._key)._apply(e))}};function yH(t,e){return iH("equalTo","key",e,!0),new Gw(t,e)}function IH(t,...e){let n=Me(t);for(let r of e)n=r._apply(n);return n}bie(hi);xie(hi);var woe="FIREBASE_DATABASE_EMULATOR_HOST",jw={},boe=!1;function Ooe(t,e,n,r){let i=e.lastIndexOf(":"),o=e.substring(0,i),s=_r(o);t.repoInfo_=new my(e,s,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams,!0,n),r&&(t.authTokenProvider_=r)}function Moe(t,e,n,r,i){let o=r||t.options.databaseURL;o===void 0&&(t.options.projectId||Wo("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),un("Using default host for project ",t.options.projectId),o=`${t.options.projectId}-default-rtdb.firebaseio.com`);let s=oj(o,i),a=s.repoInfo,c,l;typeof process<"u"&&process.env&&(l=process.env[woe]),l?(c=!0,o=`http://${l}?ns=${a.namespace}`,s=oj(o,i),a=s.repoInfo):c=!s.repoInfo.secure;let d=i&&c?new Bp(Bp.OWNER):new JN(t.name,t.options,e);soe("Invalid Firebase Database URL",s),we(s.path)||Wo("Database URL must point to the root of a Firebase Database (not including a child path).");let h=Poe(a,t,d,new QN(t,n));return new Hw(h,t)}function Loe(t,e){let n=jw[e];(!n||n[t.key]!==t)&&Wo(`Database ${e}(${t.repoInfo_}) has already been deleted.`),yoe(t),delete n[t.key]}function Poe(t,e,n,r){let i=jw[e.name];i||(i={},jw[e.name]=i);let o=i[t.toURLString()];return o&&Wo("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),o=new xw(t,boe,n,r),i[t.toURLString()]=o,o}var Hw=class{constructor(e,n){this._repoInternal=e,this.app=n,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(uoe(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new hi(this._repo,Ve())),this._rootInternal}_delete(){return this._rootInternal!==null&&(Loe(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&Wo("Cannot call "+e+" on a deleted database.")}};function xoe(){Rj.IS_TRANSPORT_INITIALIZED&&xn("Transport has already been initialized. Please call this function before calling ref or setting up a listener")}function Eb(){xoe(),Td.forceDisallow(),Ey.forceAllow()}function Pd(t=er(),e){let n=Xi(t,"database").getImmediate({identifier:e});if(!n._instanceStarted){let r=ld("database");r&&vH(n,...r)}return n}function vH(t,e,n,r={}){t=Me(t),t._checkNotDeleted("useEmulator");let i=`${e}:${n}`,o=t._repoInternal;if(t._instanceStarted){if(i===t._repoInternal.repoInfo_.host&&oi(r,o.repoInfo_.emulatorOptions))return;Wo("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let s;if(o.repoInfo_.nodeAdmin)r.mockUserToken&&Wo('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),s=new Bp(Bp.OWNER);else if(r.mockUserToken){let a=typeof r.mockUserToken=="string"?r.mockUserToken:FT(r.mockUserToken,t.app.options.projectId);s=new Bp(a)}_r(e)&&(ks(e),Fc("Database",!0)),Ooe(o,i,r,s)}function koe(t){Xne(Bs),$n(new Xt("database",(e,{instanceIdentifier:n})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),o=e.getProvider("app-check-internal");return Moe(r,i,o,n)},"PUBLIC").setMultipleInstances(!0)),Ge(N2,w2,t),Ge(N2,w2,"esm2017")}var $w=class{constructor(e,n){this.committed=e,this.snapshot=n}toJSON(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}}};function SH(t,e,n){var r;if(t=Me(t),Xs("Reference.transaction",t._path),t.key===".length"||t.key===".keys")throw"Reference.transaction failed: "+t.key+" is a read-only object.";let i=(r=n?.applyLocally)!==null&&r!==void 0?r:!0,o=new cn,s=(c,l,d)=>{let h=null;c?o.reject(c):(h=new wd(d,new hi(t._repo,t._path),ft),o.resolve(new $w(l,h)))},a=ug(t,()=>{});return Ioe(t._repo,t._path,e,s,a,i),o.promise}Xw.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)};Xw.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};koe();var ul,hn=(function(t){return t.added="child_added",t.removed="child_removed",t.changed="child_changed",t.moved="child_moved",t.value="value",t})(hn||{}),Foe=Object.freeze((ul={},ul[hn.added]=tI,ul[hn.removed]=rI,ul[hn.changed]=nI,ul[hn.moved]=mb,ul[hn.value]=ug,ul));function sI(t,e){return new fe(function(n){var r=Foe[e](t,function(i,o){n.next({snapshot:i,prevKey:o,event:e})},n.error.bind(n));return{unsubscribe:function(){iI(t,e,r)}}}).pipe(cS(0))}var oI=function(){return oI=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},oI.apply(this,arguments)};function _b(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function AH(t){return(t==null||t.length===0)&&(t=[hn.added,hn.removed,hn.changed,hn.moved]),t}function CH(t,e){return e===void 0&&(e={}),sI(t,hn.value).pipe(De(function(n){return Tb(n,e)}))}function Tb(t,e){var n;e===void 0&&(e={});var r=t.snapshot.val();return!t.snapshot.exists()||typeof r!="object"?r:oI(oI({},r),e.keyField?(n={},n[e.keyField]=t.snapshot.key,n):null)}function DH(t,e){e===void 0&&(e={});var n=AH(e.events),r=n.map(function(i){return sI(t,i)});return gs.apply(void 0,r)}function Uoe(t){return cr(eI(t)).pipe(De(function(e){var n=hn.value;return{snapshot:e,prevKey:null,event:n}}))}function RH(t,e){e===void 0&&(e={});var n=AH(e.events);return Uoe(t).pipe(Mr(function(r){var i=[lt(r)];return n.forEach(function(o){i.push(sI(t,o))}),gs.apply(void 0,i).pipe(Zm(Boe,[]))}),yo())}function NH(t,e){return e===void 0&&(e={}),RH(t).pipe(De(function(n){return n.map(function(r){return Tb(r,e)})}))}function wH(t,e){for(var n=t.length,r=0;r<n;r++)if(t[r].snapshot.key===e)return r;return-1}function Voe(t,e){if(e==null)return 0;var n=wH(t,e);return n===-1?t.length:n+1}function Boe(t,e){var n=e.snapshot,r=e.prevKey,i=e.event,o=n.key,s=wH(t,o),a=Voe(t,r||void 0);switch(i){case hn.value:if(e.snapshot&&e.snapshot.exists()){var c=null;e.snapshot.forEach(function(h){var f={snapshot:h,event:hn.value,prevKey:c};return c=h.key,t=_b(_b([],t,!0),[f],!1),!1})}return t;case hn.added:if(s>-1){var l=t[s-1];(l&&l.snapshot.key||null)!==r&&(t=t.filter(function(h){return h.snapshot.key!==n.key}),t.splice(a,0,e))}else{if(r==null)return _b([e],t,!0);t=t.slice(),t.splice(a,0,e)}return t;case hn.removed:return t.filter(function(h){return h.snapshot.key!==n.key});case hn.changed:return t.map(function(h){return h.snapshot.key===o?e:h});case hn.moved:if(s>-1){var d=t.splice(s,1)[0];return t=t.slice(),t.splice(a,0,d),t}return t;default:return t}}var dg=class{constructor(e){return e}},bH="database",yb=class{constructor(){return Go(bH)}};var Ib=new z("angularfire2.database-instances");function Goe(t,e){let n=Gs(bH,t,e);return n&&new dg(n)}function joe(t){return(e,n)=>{let r=e.runOutsideAngular(()=>t(n));return new dg(r)}}var Hoe={provide:yb,deps:[[new zt,Ib]]},$oe={provide:dg,useFactory:Goe,deps:[[new zt,Ib],ci]};function oFe(t,...e){return Ge("angularfire",si.full,"rtdb"),Xn([$oe,Hoe,{provide:Ib,useFactory:joe(t),multi:!0,deps:[Ae,ze,ai,jo,[new zt,$c],[new zt,Hs],...e]}])}var OH=ue(NH,!0);var MH=ue(CH,!0),LH=ue(DH,!0);var sFe=ue(yH,!0,2);var hg=ue(eI,!0),aFe=ue(Pd,!0);var cFe=ue(_H,!0,2),PH=ue(iI,!0),xH=ue(tI,!0),kH=ue(nI,!0);var FH=ue(rI,!0),UH=ue(fH,!0),vb=ue(ug,!0),lFe=ue(TH,!0,2);var VH=ue(pH,!0,2),BH=ue(IH,!0,2),xd=ue(hH,!0,2);var GH=ue(gH,!0,2),jH=ue(SH,!0),HH=ue(Zy,!0,2);var uFe=ue(EH,!0,2),$H=ue(mH,!0,2);var WH=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},zH={};var zo,Sb;(function(){var t;function e(C,v){function A(){}A.prototype=v.prototype,C.D=v.prototype,C.prototype=new A,C.prototype.constructor=C,C.C=function(R,N,O){for(var D=Array(arguments.length-2),Vn=2;Vn<arguments.length;Vn++)D[Vn-2]=arguments[Vn];return v.prototype[N].apply(R,D)}}function n(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,n),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function i(C,v,A){A||(A=0);var R=Array(16);if(typeof v=="string")for(var N=0;16>N;++N)R[N]=v.charCodeAt(A++)|v.charCodeAt(A++)<<8|v.charCodeAt(A++)<<16|v.charCodeAt(A++)<<24;else for(N=0;16>N;++N)R[N]=v[A++]|v[A++]<<8|v[A++]<<16|v[A++]<<24;v=C.g[0],A=C.g[1],N=C.g[2];var O=C.g[3],D=v+(O^A&(N^O))+R[0]+3614090360&4294967295;v=A+(D<<7&4294967295|D>>>25),D=O+(N^v&(A^N))+R[1]+3905402710&4294967295,O=v+(D<<12&4294967295|D>>>20),D=N+(A^O&(v^A))+R[2]+606105819&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(v^N&(O^v))+R[3]+3250441966&4294967295,A=N+(D<<22&4294967295|D>>>10),D=v+(O^A&(N^O))+R[4]+4118548399&4294967295,v=A+(D<<7&4294967295|D>>>25),D=O+(N^v&(A^N))+R[5]+1200080426&4294967295,O=v+(D<<12&4294967295|D>>>20),D=N+(A^O&(v^A))+R[6]+2821735955&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(v^N&(O^v))+R[7]+4249261313&4294967295,A=N+(D<<22&4294967295|D>>>10),D=v+(O^A&(N^O))+R[8]+1770035416&4294967295,v=A+(D<<7&4294967295|D>>>25),D=O+(N^v&(A^N))+R[9]+2336552879&4294967295,O=v+(D<<12&4294967295|D>>>20),D=N+(A^O&(v^A))+R[10]+4294925233&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(v^N&(O^v))+R[11]+2304563134&4294967295,A=N+(D<<22&4294967295|D>>>10),D=v+(O^A&(N^O))+R[12]+1804603682&4294967295,v=A+(D<<7&4294967295|D>>>25),D=O+(N^v&(A^N))+R[13]+4254626195&4294967295,O=v+(D<<12&4294967295|D>>>20),D=N+(A^O&(v^A))+R[14]+2792965006&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(v^N&(O^v))+R[15]+1236535329&4294967295,A=N+(D<<22&4294967295|D>>>10),D=v+(N^O&(A^N))+R[1]+4129170786&4294967295,v=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(v^A))+R[6]+3225465664&4294967295,O=v+(D<<9&4294967295|D>>>23),D=N+(v^A&(O^v))+R[11]+643717713&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^v&(N^O))+R[0]+3921069994&4294967295,A=N+(D<<20&4294967295|D>>>12),D=v+(N^O&(A^N))+R[5]+3593408605&4294967295,v=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(v^A))+R[10]+38016083&4294967295,O=v+(D<<9&4294967295|D>>>23),D=N+(v^A&(O^v))+R[15]+3634488961&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^v&(N^O))+R[4]+3889429448&4294967295,A=N+(D<<20&4294967295|D>>>12),D=v+(N^O&(A^N))+R[9]+568446438&4294967295,v=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(v^A))+R[14]+3275163606&4294967295,O=v+(D<<9&4294967295|D>>>23),D=N+(v^A&(O^v))+R[3]+4107603335&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^v&(N^O))+R[8]+1163531501&4294967295,A=N+(D<<20&4294967295|D>>>12),D=v+(N^O&(A^N))+R[13]+2850285829&4294967295,v=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(v^A))+R[2]+4243563512&4294967295,O=v+(D<<9&4294967295|D>>>23),D=N+(v^A&(O^v))+R[7]+1735328473&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^v&(N^O))+R[12]+2368359562&4294967295,A=N+(D<<20&4294967295|D>>>12),D=v+(A^N^O)+R[5]+4294588738&4294967295,v=A+(D<<4&4294967295|D>>>28),D=O+(v^A^N)+R[8]+2272392833&4294967295,O=v+(D<<11&4294967295|D>>>21),D=N+(O^v^A)+R[11]+1839030562&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^v)+R[14]+4259657740&4294967295,A=N+(D<<23&4294967295|D>>>9),D=v+(A^N^O)+R[1]+2763975236&4294967295,v=A+(D<<4&4294967295|D>>>28),D=O+(v^A^N)+R[4]+1272893353&4294967295,O=v+(D<<11&4294967295|D>>>21),D=N+(O^v^A)+R[7]+4139469664&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^v)+R[10]+3200236656&4294967295,A=N+(D<<23&4294967295|D>>>9),D=v+(A^N^O)+R[13]+681279174&4294967295,v=A+(D<<4&4294967295|D>>>28),D=O+(v^A^N)+R[0]+3936430074&4294967295,O=v+(D<<11&4294967295|D>>>21),D=N+(O^v^A)+R[3]+3572445317&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^v)+R[6]+76029189&4294967295,A=N+(D<<23&4294967295|D>>>9),D=v+(A^N^O)+R[9]+3654602809&4294967295,v=A+(D<<4&4294967295|D>>>28),D=O+(v^A^N)+R[12]+3873151461&4294967295,O=v+(D<<11&4294967295|D>>>21),D=N+(O^v^A)+R[15]+530742520&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^v)+R[2]+3299628645&4294967295,A=N+(D<<23&4294967295|D>>>9),D=v+(N^(A|~O))+R[0]+4096336452&4294967295,v=A+(D<<6&4294967295|D>>>26),D=O+(A^(v|~N))+R[7]+1126891415&4294967295,O=v+(D<<10&4294967295|D>>>22),D=N+(v^(O|~A))+R[14]+2878612391&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~v))+R[5]+4237533241&4294967295,A=N+(D<<21&4294967295|D>>>11),D=v+(N^(A|~O))+R[12]+1700485571&4294967295,v=A+(D<<6&4294967295|D>>>26),D=O+(A^(v|~N))+R[3]+2399980690&4294967295,O=v+(D<<10&4294967295|D>>>22),D=N+(v^(O|~A))+R[10]+4293915773&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~v))+R[1]+2240044497&4294967295,A=N+(D<<21&4294967295|D>>>11),D=v+(N^(A|~O))+R[8]+1873313359&4294967295,v=A+(D<<6&4294967295|D>>>26),D=O+(A^(v|~N))+R[15]+4264355552&4294967295,O=v+(D<<10&4294967295|D>>>22),D=N+(v^(O|~A))+R[6]+2734768916&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~v))+R[13]+1309151649&4294967295,A=N+(D<<21&4294967295|D>>>11),D=v+(N^(A|~O))+R[4]+4149444226&4294967295,v=A+(D<<6&4294967295|D>>>26),D=O+(A^(v|~N))+R[11]+3174756917&4294967295,O=v+(D<<10&4294967295|D>>>22),D=N+(v^(O|~A))+R[2]+718787259&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~v))+R[9]+3951481745&4294967295,C.g[0]=C.g[0]+v&4294967295,C.g[1]=C.g[1]+(N+(D<<21&4294967295|D>>>11))&4294967295,C.g[2]=C.g[2]+N&4294967295,C.g[3]=C.g[3]+O&4294967295}r.prototype.u=function(C,v){v===void 0&&(v=C.length);for(var A=v-this.blockSize,R=this.B,N=this.h,O=0;O<v;){if(N==0)for(;O<=A;)i(this,C,O),O+=this.blockSize;if(typeof C=="string"){for(;O<v;)if(R[N++]=C.charCodeAt(O++),N==this.blockSize){i(this,R),N=0;break}}else for(;O<v;)if(R[N++]=C[O++],N==this.blockSize){i(this,R),N=0;break}}this.h=N,this.o+=v},r.prototype.v=function(){var C=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);C[0]=128;for(var v=1;v<C.length-8;++v)C[v]=0;var A=8*this.o;for(v=C.length-8;v<C.length;++v)C[v]=A&255,A/=256;for(this.u(C),C=Array(16),v=A=0;4>v;++v)for(var R=0;32>R;R+=8)C[A++]=this.g[v]>>>R&255;return C};function o(C,v){var A=a;return Object.prototype.hasOwnProperty.call(A,C)?A[C]:A[C]=v(C)}function s(C,v){this.h=v;for(var A=[],R=!0,N=C.length-1;0<=N;N--){var O=C[N]|0;R&&O==v||(A[N]=O,R=!1)}this.g=A}var a={};function c(C){return-128<=C&&128>C?o(C,function(v){return new s([v|0],0>v?-1:0)}):new s([C|0],0>C?-1:0)}function l(C){if(isNaN(C)||!isFinite(C))return h;if(0>C)return S(l(-C));for(var v=[],A=1,R=0;C>=A;R++)v[R]=C/A|0,A*=4294967296;return new s(v,0)}function d(C,v){if(C.length==0)throw Error("number format error: empty string");if(v=v||10,2>v||36<v)throw Error("radix out of range: "+v);if(C.charAt(0)=="-")return S(d(C.substring(1),v));if(0<=C.indexOf("-"))throw Error('number format error: interior "-" character');for(var A=l(Math.pow(v,8)),R=h,N=0;N<C.length;N+=8){var O=Math.min(8,C.length-N),D=parseInt(C.substring(N,N+O),v);8>O?(O=l(Math.pow(v,O)),R=R.j(O).add(l(D))):(R=R.j(A),R=R.add(l(D)))}return R}var h=c(0),f=c(1),g=c(16777216);t=s.prototype,t.m=function(){if(I(this))return-S(this).m();for(var C=0,v=1,A=0;A<this.g.length;A++){var R=this.i(A);C+=(0<=R?R:4294967296+R)*v,v*=4294967296}return C},t.toString=function(C){if(C=C||10,2>C||36<C)throw Error("radix out of range: "+C);if(E(this))return"0";if(I(this))return"-"+S(this).toString(C);for(var v=l(Math.pow(C,6)),A=this,R="";;){var N=oe(A,v).g;A=L(A,N.j(v));var O=((0<A.g.length?A.g[0]:A.h)>>>0).toString(C);if(A=N,E(A))return O+R;for(;6>O.length;)O="0"+O;R=O+R}},t.i=function(C){return 0>C?0:C<this.g.length?this.g[C]:this.h};function E(C){if(C.h!=0)return!1;for(var v=0;v<C.g.length;v++)if(C.g[v]!=0)return!1;return!0}function I(C){return C.h==-1}t.l=function(C){return C=L(this,C),I(C)?-1:E(C)?0:1};function S(C){for(var v=C.g.length,A=[],R=0;R<v;R++)A[R]=~C.g[R];return new s(A,~C.h).add(f)}t.abs=function(){return I(this)?S(this):this},t.add=function(C){for(var v=Math.max(this.g.length,C.g.length),A=[],R=0,N=0;N<=v;N++){var O=R+(this.i(N)&65535)+(C.i(N)&65535),D=(O>>>16)+(this.i(N)>>>16)+(C.i(N)>>>16);R=D>>>16,O&=65535,D&=65535,A[N]=D<<16|O}return new s(A,A[A.length-1]&-2147483648?-1:0)};function L(C,v){return C.add(S(v))}t.j=function(C){if(E(this)||E(C))return h;if(I(this))return I(C)?S(this).j(S(C)):S(S(this).j(C));if(I(C))return S(this.j(S(C)));if(0>this.l(g)&&0>C.l(g))return l(this.m()*C.m());for(var v=this.g.length+C.g.length,A=[],R=0;R<2*v;R++)A[R]=0;for(R=0;R<this.g.length;R++)for(var N=0;N<C.g.length;N++){var O=this.i(R)>>>16,D=this.i(R)&65535,Vn=C.i(N)>>>16,es=C.i(N)&65535;A[2*R+2*N]+=D*es,V(A,2*R+2*N),A[2*R+2*N+1]+=O*es,V(A,2*R+2*N+1),A[2*R+2*N+1]+=D*Vn,V(A,2*R+2*N+1),A[2*R+2*N+2]+=O*Vn,V(A,2*R+2*N+2)}for(R=0;R<v;R++)A[R]=A[2*R+1]<<16|A[2*R];for(R=v;R<2*v;R++)A[R]=0;return new s(A,0)};function V(C,v){for(;(C[v]&65535)!=C[v];)C[v+1]+=C[v]>>>16,C[v]&=65535,v++}function K(C,v){this.g=C,this.h=v}function oe(C,v){if(E(v))throw Error("division by zero");if(E(C))return new K(h,h);if(I(C))return v=oe(S(C),v),new K(S(v.g),S(v.h));if(I(v))return v=oe(C,S(v)),new K(S(v.g),v.h);if(30<C.g.length){if(I(C)||I(v))throw Error("slowDivide_ only works with positive integers.");for(var A=f,R=v;0>=R.l(C);)A=ge(A),R=ge(R);var N=te(A,1),O=te(R,1);for(R=te(R,2),A=te(A,2);!E(R);){var D=O.add(R);0>=D.l(C)&&(N=N.add(A),O=D),R=te(R,1),A=te(A,1)}return v=L(C,N.j(v)),new K(N,v)}for(N=h;0<=C.l(v);){for(A=Math.max(1,Math.floor(C.m()/v.m())),R=Math.ceil(Math.log(A)/Math.LN2),R=48>=R?1:Math.pow(2,R-48),O=l(A),D=O.j(v);I(D)||0<D.l(C);)A-=R,O=l(A),D=O.j(v);E(O)&&(O=f),N=N.add(O),C=L(C,D)}return new K(N,C)}t.A=function(C){return oe(this,C).h},t.and=function(C){for(var v=Math.max(this.g.length,C.g.length),A=[],R=0;R<v;R++)A[R]=this.i(R)&C.i(R);return new s(A,this.h&C.h)},t.or=function(C){for(var v=Math.max(this.g.length,C.g.length),A=[],R=0;R<v;R++)A[R]=this.i(R)|C.i(R);return new s(A,this.h|C.h)},t.xor=function(C){for(var v=Math.max(this.g.length,C.g.length),A=[],R=0;R<v;R++)A[R]=this.i(R)^C.i(R);return new s(A,this.h^C.h)};function ge(C){for(var v=C.g.length+1,A=[],R=0;R<v;R++)A[R]=C.i(R)<<1|C.i(R-1)>>>31;return new s(A,C.h)}function te(C,v){var A=v>>5;v%=32;for(var R=C.g.length-A,N=[],O=0;O<R;O++)N[O]=0<v?C.i(O+A)>>>v|C.i(O+A+1)<<32-v:C.i(O+A);return new s(N,C.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,Sb=zH.Md5=r,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.A,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=l,s.fromString=d,zo=zH.Integer=s}).apply(typeof WH<"u"?WH:typeof self<"u"?self:typeof window<"u"?window:{});var aI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qo={};var Ab,Woe,kd,Cb,fg,cI,Db,Rb,Nb;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(u,p,m){return u==Array.prototype||u==Object.prototype||(u[p]=m.value),u};function n(u){u=[typeof globalThis=="object"&&globalThis,u,typeof window=="object"&&window,typeof self=="object"&&self,typeof aI=="object"&&aI];for(var p=0;p<u.length;++p){var m=u[p];if(m&&m.Math==Math)return m}throw Error("Cannot find global object")}var r=n(this);function i(u,p){if(p)e:{var m=r;u=u.split(".");for(var _=0;_<u.length-1;_++){var b=u[_];if(!(b in m))break e;m=m[b]}u=u[u.length-1],_=m[u],p=p(_),p!=_&&p!=null&&e(m,u,{configurable:!0,writable:!0,value:p})}}function o(u,p){u instanceof String&&(u+="");var m=0,_=!1,b={next:function(){if(!_&&m<u.length){var k=m++;return{value:p(k,u[k]),done:!1}}return _=!0,{done:!0,value:void 0}}};return b[Symbol.iterator]=function(){return b},b}i("Array.prototype.values",function(u){return u||function(){return o(this,function(p,m){return m})}});var s=s||{},a=this||self;function c(u){var p=typeof u;return p=p!="object"?p:u?Array.isArray(u)?"array":p:"null",p=="array"||p=="object"&&typeof u.length=="number"}function l(u){var p=typeof u;return p=="object"&&u!=null||p=="function"}function d(u,p,m){return u.call.apply(u.bind,arguments)}function h(u,p,m){if(!u)throw Error();if(2<arguments.length){var _=Array.prototype.slice.call(arguments,2);return function(){var b=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(b,_),u.apply(p,b)}}return function(){return u.apply(p,arguments)}}function f(u,p,m){return f=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?d:h,f.apply(null,arguments)}function g(u,p){var m=Array.prototype.slice.call(arguments,1);return function(){var _=m.slice();return _.push.apply(_,arguments),u.apply(this,_)}}function E(u,p){function m(){}m.prototype=p.prototype,u.aa=p.prototype,u.prototype=new m,u.prototype.constructor=u,u.Qb=function(_,b,k){for(var X=Array(arguments.length-2),it=2;it<arguments.length;it++)X[it-2]=arguments[it];return p.prototype[b].apply(_,X)}}function I(u){let p=u.length;if(0<p){let m=Array(p);for(let _=0;_<p;_++)m[_]=u[_];return m}return[]}function S(u,p){for(let m=1;m<arguments.length;m++){let _=arguments[m];if(c(_)){let b=u.length||0,k=_.length||0;u.length=b+k;for(let X=0;X<k;X++)u[b+X]=_[X]}else u.push(_)}}class L{constructor(p,m){this.i=p,this.j=m,this.h=0,this.g=null}get(){let p;return 0<this.h?(this.h--,p=this.g,this.g=p.next,p.next=null):p=this.i(),p}}function V(u){return/^[\s\xa0]*$/.test(u)}function K(){var u=a.navigator;return u&&(u=u.userAgent)?u:""}function oe(u){return oe[" "](u),u}oe[" "]=function(){};var ge=K().indexOf("Gecko")!=-1&&!(K().toLowerCase().indexOf("webkit")!=-1&&K().indexOf("Edge")==-1)&&!(K().indexOf("Trident")!=-1||K().indexOf("MSIE")!=-1)&&K().indexOf("Edge")==-1;function te(u,p,m){for(let _ in u)p.call(m,u[_],_,u)}function C(u,p){for(let m in u)p.call(void 0,u[m],m,u)}function v(u){let p={};for(let m in u)p[m]=u[m];return p}let A="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function R(u,p){let m,_;for(let b=1;b<arguments.length;b++){_=arguments[b];for(m in _)u[m]=_[m];for(let k=0;k<A.length;k++)m=A[k],Object.prototype.hasOwnProperty.call(_,m)&&(u[m]=_[m])}}function N(u){var p=1;u=u.split(":");let m=[];for(;0<p&&u.length;)m.push(u.shift()),p--;return u.length&&m.push(u.join(":")),m}function O(u){a.setTimeout(()=>{throw u},0)}function D(){var u=ns;let p=null;return u.g&&(p=u.g,u.g=u.g.next,u.g||(u.h=null),p.next=null),p}class Vn{constructor(){this.h=this.g=null}add(p,m){let _=es.get();_.set(p,m),this.h?this.h.next=_:this.g=_,this.h=_}}var es=new L(()=>new ts,u=>u.reset());class ts{constructor(){this.next=this.g=this.h=null}set(p,m){this.h=p,this.g=m,this.next=null}reset(){this.next=this.g=this.h=null}}let Da,Ra=!1,ns=new Vn,Fl=()=>{let u=a.Promise.resolve(void 0);Da=()=>{u.then(hm)}};var hm=()=>{for(var u;u=D();){try{u.h.call(u.g)}catch(m){O(m)}var p=es;p.j(u),100>p.h&&(p.h++,u.next=p.g,p.g=u)}Ra=!1};function _i(){this.s=this.s,this.C=this.C}_i.prototype.s=!1,_i.prototype.ma=function(){this.s||(this.s=!0,this.N())},_i.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function nn(u,p){this.type=u,this.g=this.target=p,this.defaultPrevented=!1}nn.prototype.h=function(){this.defaultPrevented=!0};var kv=(function(){if(!a.addEventListener||!Object.defineProperty)return!1;var u=!1,p=Object.defineProperty({},"passive",{get:function(){u=!0}});try{let m=()=>{};a.addEventListener("test",m,p),a.removeEventListener("test",m,p)}catch{}return u})();function He(u,p){if(nn.call(this,u?u.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,u){var m=this.type=u.type,_=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;if(this.target=u.target||u.srcElement,this.g=p,p=u.relatedTarget){if(ge){e:{try{oe(p.nodeName);var b=!0;break e}catch{}b=!1}b||(p=null)}}else m=="mouseover"?p=u.fromElement:m=="mouseout"&&(p=u.toElement);this.relatedTarget=p,_?(this.clientX=_.clientX!==void 0?_.clientX:_.pageX,this.clientY=_.clientY!==void 0?_.clientY:_.pageY,this.screenX=_.screenX||0,this.screenY=_.screenY||0):(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0),this.button=u.button,this.key=u.key||"",this.ctrlKey=u.ctrlKey,this.altKey=u.altKey,this.shiftKey=u.shiftKey,this.metaKey=u.metaKey,this.pointerId=u.pointerId||0,this.pointerType=typeof u.pointerType=="string"?u.pointerType:Fv[u.pointerType]||"",this.state=u.state,this.i=u,u.defaultPrevented&&He.aa.h.call(this)}}E(He,nn);var Fv={2:"touch",3:"pen",4:"mouse"};He.prototype.h=function(){He.aa.h.call(this);var u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var Na="closure_listenable_"+(1e6*Math.random()|0),Uv=0;function Vv(u,p,m,_,b){this.listener=u,this.proxy=null,this.src=p,this.type=m,this.capture=!!_,this.ha=b,this.key=++Uv,this.da=this.fa=!1}function Ul(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Vl(u){this.src=u,this.g={},this.h=0}Vl.prototype.add=function(u,p,m,_,b){var k=u.toString();u=this.g[k],u||(u=this.g[k]=[],this.h++);var X=wh(u,p,_,b);return-1<X?(p=u[X],m||(p.fa=!1)):(p=new Vv(p,this.src,k,!!_,b),p.fa=m,u.push(p)),p};function Bl(u,p){var m=p.type;if(m in u.g){var _=u.g[m],b=Array.prototype.indexOf.call(_,p,void 0),k;(k=0<=b)&&Array.prototype.splice.call(_,b,1),k&&(Ul(p),u.g[m].length==0&&(delete u.g[m],u.h--))}}function wh(u,p,m,_){for(var b=0;b<u.length;++b){var k=u[b];if(!k.da&&k.listener==p&&k.capture==!!m&&k.ha==_)return b}return-1}var Gl="closure_lm_"+(1e6*Math.random()|0),Je={};function jl(u,p,m,_,b){if(_&&_.once)return sr(u,p,m,_,b);if(Array.isArray(p)){for(var k=0;k<p.length;k++)jl(u,p[k],m,_,b);return null}return m=Wl(m),u&&u[Na]?u.K(p,m,l(_)?!!_.capture:!!_,b):rt(u,p,m,!1,_,b)}function rt(u,p,m,_,b,k){if(!p)throw Error("Invalid event type");var X=l(b)?!!b.capture:!!b,it=wa(u);if(it||(u[Gl]=it=new Vl(u)),m=it.add(p,m,_,X,k),m.proxy)return m;if(_=bh(),m.proxy=_,_.src=u,_.listener=m,u.addEventListener)kv||(b=X),b===void 0&&(b=!1),u.addEventListener(p.toString(),_,b);else if(u.attachEvent)u.attachEvent(Wr(p.toString()),_);else if(u.addListener&&u.removeListener)u.addListener(_);else throw Error("addEventListener and attachEvent are unavailable.");return m}function bh(){function u(m){return p.call(u.src,u.listener,m)}let p=fm;return u}function sr(u,p,m,_,b){if(Array.isArray(p)){for(var k=0;k<p.length;k++)sr(u,p[k],m,_,b);return null}return m=Wl(m),u&&u[Na]?u.L(p,m,l(_)?!!_.capture:!!_,b):rt(u,p,m,!0,_,b)}function rs(u,p,m,_,b){if(Array.isArray(p))for(var k=0;k<p.length;k++)rs(u,p[k],m,_,b);else _=l(_)?!!_.capture:!!_,m=Wl(m),u&&u[Na]?(u=u.i,p=String(p).toString(),p in u.g&&(k=u.g[p],m=wh(k,m,_,b),-1<m&&(Ul(k[m]),Array.prototype.splice.call(k,m,1),k.length==0&&(delete u.g[p],u.h--)))):u&&(u=wa(u))&&(p=u.g[p.toString()],u=-1,p&&(u=wh(p,m,_,b)),(m=-1<u?p[u]:null)&&Hl(m))}function Hl(u){if(typeof u!="number"&&u&&!u.da){var p=u.src;if(p&&p[Na])Bl(p.i,u);else{var m=u.type,_=u.proxy;p.removeEventListener?p.removeEventListener(m,_,u.capture):p.detachEvent?p.detachEvent(Wr(m),_):p.addListener&&p.removeListener&&p.removeListener(_),(m=wa(p))?(Bl(m,u),m.h==0&&(m.src=null,p[Gl]=null)):Ul(u)}}}function Wr(u){return u in Je?Je[u]:Je[u]="on"+u}function fm(u,p){if(u.da)u=!0;else{p=new He(p,this);var m=u.listener,_=u.ha||u.src;u.fa&&Hl(u),u=m.call(_,p)}return u}function wa(u){return u=u[Gl],u instanceof Vl?u:null}var $l="__closure_events_fn_"+(1e9*Math.random()>>>0);function Wl(u){return typeof u=="function"?u:(u[$l]||(u[$l]=function(p){return u.handleEvent(p)}),u[$l])}function dt(){_i.call(this),this.i=new Vl(this),this.M=this,this.F=null}E(dt,_i),dt.prototype[Na]=!0,dt.prototype.removeEventListener=function(u,p,m,_){rs(this,u,p,m,_)};function yt(u,p){var m,_=u.F;if(_)for(m=[];_;_=_.F)m.push(_);if(u=u.M,_=p.type||p,typeof p=="string")p=new nn(p,u);else if(p instanceof nn)p.target=p.target||u;else{var b=p;p=new nn(_,u),R(p,b)}if(b=!0,m)for(var k=m.length-1;0<=k;k--){var X=p.g=m[k];b=wr(X,_,!0,p)&&b}if(X=p.g=u,b=wr(X,_,!0,p)&&b,b=wr(X,_,!1,p)&&b,m)for(k=0;k<m.length;k++)X=p.g=m[k],b=wr(X,_,!1,p)&&b}dt.prototype.N=function(){if(dt.aa.N.call(this),this.i){var u=this.i,p;for(p in u.g){for(var m=u.g[p],_=0;_<m.length;_++)Ul(m[_]);delete u.g[p],u.h--}}this.F=null},dt.prototype.K=function(u,p,m,_){return this.i.add(String(u),p,!1,m,_)},dt.prototype.L=function(u,p,m,_){return this.i.add(String(u),p,!0,m,_)};function wr(u,p,m,_){if(p=u.i.g[String(p)],!p)return!0;p=p.concat();for(var b=!0,k=0;k<p.length;++k){var X=p[k];if(X&&!X.da&&X.capture==m){var it=X.listener,gn=X.ha||X.src;X.fa&&Bl(u.i,X),b=it.call(gn,_)!==!1&&b}}return b&&!_.defaultPrevented}function zl(u,p,m){if(typeof u=="function")m&&(u=f(u,m));else if(u&&typeof u.handleEvent=="function")u=f(u.handleEvent,u);else throw Error("Invalid listener argument");return 2147483647<Number(p)?-1:a.setTimeout(u,p||0)}function ba(u){u.g=zl(()=>{u.g=null,u.i&&(u.i=!1,ba(u))},u.l);let p=u.h;u.h=null,u.m.apply(null,p)}class ql extends _i{constructor(p,m){super(),this.m=p,this.l=m,this.h=null,this.i=!1,this.g=null}j(p){this.h=arguments,this.g?this.i=!0:ba(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function co(u){_i.call(this),this.h=u,this.g={}}E(co,_i);var lo=[];function Oa(u){te(u.g,function(p,m){this.g.hasOwnProperty(m)&&Hl(p)},u),u.g={}}co.prototype.N=function(){co.aa.N.call(this),Oa(this)},co.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var is=a.JSON.stringify,pm=a.JSON.parse,gm=class{stringify(u){return a.JSON.stringify(u,void 0)}parse(u){return a.JSON.parse(u,void 0)}};function Kl(){}Kl.prototype.h=null;function Yl(u){return u.h||(u.h=u.i())}function Xl(){}var br={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Ti(){nn.call(this,"d")}E(Ti,nn);function Ql(){nn.call(this,"c")}E(Ql,nn);var yi={},Oh=null;function Ma(){return Oh=Oh||new dt}yi.La="serverreachability";function Mh(u){nn.call(this,yi.La,u)}E(Mh,nn);function Ii(u){let p=Ma();yt(p,new Mh(p))}yi.STAT_EVENT="statevent";function La(u,p){nn.call(this,yi.STAT_EVENT,u),this.stat=p}E(La,nn);function ct(u){let p=Ma();yt(p,new La(p,u))}yi.Ma="timingevent";function uo(u,p){nn.call(this,yi.Ma,u),this.size=p}E(uo,nn);function ho(u,p){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){u()},p)}function fo(){this.g=!0}fo.prototype.xa=function(){this.g=!1};function Bv(u,p,m,_,b,k){u.info(function(){if(u.g)if(k)for(var X="",it=k.split("&"),gn=0;gn<it.length;gn++){var Fe=it[gn].split("=");if(1<Fe.length){var vn=Fe[0];Fe=Fe[1];var Sn=vn.split("_");X=2<=Sn.length&&Sn[1]=="type"?X+(vn+"="+Fe+"&"):X+(vn+"=redacted&")}}else X=null;else X=k;return"XMLHTTP REQ ("+_+") [attempt "+b+"]: "+p+`
|
|
154
154
|
`+m+`
|
|
155
155
|
`+X})}function mm(u,p,m,_,b,k,X){u.info(function(){return"XMLHTTP RESP ("+_+") [ attempt "+b+"]: "+p+`
|
|
156
156
|
`+m+`
|
|
@@ -171,4 +171,4 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
171
171
|
`+e.join(`
|
|
172
172
|
`)+`
|
|
173
173
|
)`}copy(e,n){let r=new t;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}};var av=class{constructor(){this.fa=new pt(Z.comparator)}track(e){let n=e.doc.key,r=this.fa.get(n);r?e.type!==0&&r.type===3?this.fa=this.fa.insert(n,e):e.type===3&&r.type!==1?this.fa=this.fa.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.fa=this.fa.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.fa=this.fa.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.fa=this.fa.remove(n):e.type===1&&r.type===2?this.fa=this.fa.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.fa=this.fa.insert(n,{type:2,doc:e.doc}):re(63341,{At:e,ga:r}):this.fa=this.fa.insert(n,e)}pa(){let e=[];return this.fa.inorderTraversal((n,r)=>{e.push(r)}),e}},Eh=class t{constructor(e,n,r,i,o,s,a,c,l){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=o,this.fromCache=s,this.syncStateChanged=a,this.excludesMetadataChanges=c,this.hasCachedResults=l}static fromInitialDocuments(e,n,r,i,o){let s=[];return n.forEach(a=>{s.push({type:0,doc:a})}),new t(e,n,sv.emptySet(n),s,r,i,!0,!1,o)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Cv(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;let n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i].type!==r[i].type||!n[i].doc.isEqual(r[i].doc))return!1;return!0}};var p0=class{constructor(){this.ya=void 0,this.wa=[]}Sa(){return this.wa.some(e=>e.ba())}},g0=class{constructor(){this.queries=Q$(),this.onlineState="Unknown",this.Da=new Set}terminate(){(function(n,r){let i=se(n),o=i.queries;i.queries=Q$(),o.forEach((s,a)=>{for(let c of a.wa)c.onError(r)})})(this,new j(x.ABORTED,"Firestore shutting down"))}};function Q$(){return new pi(t=>$3(t),Cv)}function hM(t,e){return y(this,null,function*(){let n=se(t),r=3,i=e.query,o=n.queries.get(i);o?!o.Sa()&&e.ba()&&(r=2):(o=new p0,r=e.ba()?0:1);try{switch(r){case 0:o.ya=yield n.onListen(i,!0);break;case 1:o.ya=yield n.onListen(i,!1);break;case 2:yield n.onFirstRemoteStoreListen(i)}}catch(s){let a=dM(s,`Initialization of query '${$d(e.query)}' failed`);return void e.onError(a)}n.queries.set(i,o),o.wa.push(e),e.va(n.onlineState),o.ya&&e.Ca(o.ya)&&pM(n)})}function fM(t,e){return y(this,null,function*(){let n=se(t),r=e.query,i=3,o=n.queries.get(r);if(o){let s=o.wa.indexOf(e);s>=0&&(o.wa.splice(s,1),o.wa.length===0?i=e.ba()?0:1:!o.Sa()&&e.ba()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}})}function Iae(t,e){let n=se(t),r=!1;for(let i of e){let o=i.query,s=n.queries.get(o);if(s){for(let a of s.wa)a.Ca(i)&&(r=!0);s.ya=i}}r&&pM(n)}function vae(t,e,n){let r=se(t),i=r.queries.get(e);if(i)for(let o of i.wa)o.onError(n);r.queries.delete(e)}function pM(t){t.Da.forEach(e=>{e.next()})}var m0,J$;(J$=m0||(m0={})).Fa="default",J$.Cache="cache";var Jg=class{constructor(e,n,r){this.query=e,this.Ma=n,this.xa=!1,this.Oa=null,this.onlineState="Unknown",this.options=r||{}}Ca(e){if(!this.options.includeMetadataChanges){let r=[];for(let i of e.docChanges)i.type!==3&&r.push(i);e=new Eh(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.xa?this.Na(e)&&(this.Ma.next(e),n=!0):this.Ba(e,this.onlineState)&&(this.La(e),n=!0),this.Oa=e,n}onError(e){this.Ma.error(e)}va(e){this.onlineState=e;let n=!1;return this.Oa&&!this.xa&&this.Ba(this.Oa,e)&&(this.La(this.Oa),n=!0),n}Ba(e,n){if(!e.fromCache||!this.ba())return!0;let r=n!=="Offline";return(!this.options.ka||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}Na(e){if(e.docChanges.length>0)return!0;let n=this.Oa&&this.Oa.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}La(e){e=Eh.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.xa=!0,this.Ma.next(e)}ba(){return this.options.source!==m0.Cache}};var cv=class{constructor(e){this.key=e}},lv=class{constructor(e){this.key=e}},E0=class{constructor(e,n){this.query=e,this.Ha=n,this.Ya=null,this.hasCachedResults=!1,this.current=!1,this.Za=be(),this.mutatedKeys=be(),this.Xa=z3(e),this.eu=new sv(this.Xa)}get tu(){return this.Ha}nu(e,n){let r=n?n.ru:new av,i=n?n.eu:this.eu,o=n?n.mutatedKeys:this.mutatedKeys,s=i,a=!1,c=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,l=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((d,h)=>{let f=i.get(d),g=cm(this.query,h)?h:null,E=!!f&&this.mutatedKeys.has(f.key),I=!!g&&(g.hasLocalMutations||this.mutatedKeys.has(g.key)&&g.hasCommittedMutations),S=!1;f&&g?f.data.isEqual(g.data)?E!==I&&(r.track({type:3,doc:g}),S=!0):this.iu(f,g)||(r.track({type:2,doc:g}),S=!0,(c&&this.Xa(g,c)>0||l&&this.Xa(g,l)<0)&&(a=!0)):!f&&g?(r.track({type:0,doc:g}),S=!0):f&&!g&&(r.track({type:1,doc:f}),S=!0,(c||l)&&(a=!0)),S&&(g?(s=s.add(g),o=I?o.add(d):o.delete(d)):(s=s.delete(d),o=o.delete(d)))}),this.query.limit!==null)for(;s.size>this.query.limit;){let d=this.query.limitType==="F"?s.last():s.first();s=s.delete(d.key),o=o.delete(d.key),r.track({type:1,doc:d})}return{eu:s,ru:r,Ds:a,mutatedKeys:o}}iu(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){let o=this.eu;this.eu=e.eu,this.mutatedKeys=e.mutatedKeys;let s=e.ru.pa();s.sort((d,h)=>(function(g,E){let I=S=>{switch(S){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return re(20277,{At:S})}};return I(g)-I(E)})(d.type,h.type)||this.Xa(d.doc,h.doc)),this.su(r),i=i!=null&&i;let a=n&&!i?this.ou():[],c=this.Za.size===0&&this.current&&!i?1:0,l=c!==this.Ya;return this.Ya=c,s.length!==0||l?{snapshot:new Eh(this.query,e.eu,o,s,e.mutatedKeys,c===0,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),_u:a}:{_u:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({eu:this.eu,ru:new av,mutatedKeys:this.mutatedKeys,Ds:!1},!1)):{_u:[]}}au(e){return!this.Ha.has(e)&&!!this.eu.has(e)&&!this.eu.get(e).hasLocalMutations}su(e){e&&(e.addedDocuments.forEach(n=>this.Ha=this.Ha.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ha=this.Ha.delete(n)),this.current=e.current)}ou(){if(!this.current)return[];let e=this.Za;this.Za=be(),this.eu.forEach(r=>{this.au(r.key)&&(this.Za=this.Za.add(r.key))});let n=[];return e.forEach(r=>{this.Za.has(r)||n.push(new lv(r))}),this.Za.forEach(r=>{e.has(r)||n.push(new cv(r))}),n}uu(e){this.Ha=e.qs,this.Za=be();let n=this.nu(e.documents);return this.applyChanges(n,!0)}cu(){return Eh.fromInitialDocuments(this.query,this.eu,this.mutatedKeys,this.Ya===0,this.hasCachedResults)}},Ch="SyncEngine",_0=class{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}},T0=class{constructor(e){this.key=e,this.lu=!1}},y0=class{constructor(e,n,r,i,o,s){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=o,this.maxConcurrentLimboResolutions=s,this.hu={},this.Pu=new pi(a=>$3(a),Cv),this.Tu=new Map,this.Iu=new Set,this.du=new pt(Z.comparator),this.Eu=new Map,this.Au=new Kg,this.Ru={},this.Vu=new Map,this.mu=ph.ur(),this.onlineState="Unknown",this.fu=void 0}get isPrimaryClient(){return this.fu===!0}};function Sae(t,e,n=!0){return y(this,null,function*(){let r=wv(t),i,o=r.Pu.get(e);return o?(r.sharedClientState.addLocalQueryTarget(o.targetId),i=o.view.cu()):i=yield jW(r,e,n,!0),i})}function Aae(t,e){return y(this,null,function*(){let n=wv(t);yield jW(n,e,!0,!1)})}function jW(t,e,n,r){return y(this,null,function*(){let i=yield ZI(t.localStore,Rr(e)),o=i.targetId,s=t.sharedClientState.addLocalQueryTarget(o,n),a;return r&&(a=yield gM(t,e,o,s==="current",i.resumeToken)),t.isPrimaryClient&&n&&Nv(t.remoteStore,i),a})}function gM(t,e,n,r,i){return y(this,null,function*(){t.gu=(h,f,g)=>(function(I,S,L,V){return y(this,null,function*(){let K=S.view.nu(L);K.Ds&&(K=yield ZO(I.localStore,S.query,!1).then(({documents:C})=>S.view.nu(C,K)));let oe=V&&V.targetChanges.get(S.targetId),ge=V&&V.targetMismatches.get(S.targetId)!=null,te=S.view.applyChanges(K,I.isPrimaryClient,oe,ge);return I0(I,S.targetId,te._u),te.snapshot})})(t,h,f,g);let o=yield ZO(t.localStore,e,!0),s=new E0(e,o.qs),a=s.nu(o.documents),c=$g.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),l=s.applyChanges(a,t.isPrimaryClient,c);I0(t,n,l._u);let d=new _0(e,n,s);return t.Pu.set(e,d),t.Tu.has(n)?t.Tu.get(n).push(e):t.Tu.set(n,[e]),l.snapshot})}function Cae(t,e,n){return y(this,null,function*(){let r=se(t),i=r.Pu.get(e),o=r.Tu.get(i.targetId);if(o.length>1)return r.Tu.set(i.targetId,o.filter(s=>!Cv(s,e))),void r.Pu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||(yield gh(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&mh(r.remoteStore,i.targetId),_h(r,i.targetId)}).catch(va))):(_h(r,i.targetId),yield gh(r.localStore,i.targetId,!0))})}function Dae(t,e){return y(this,null,function*(){let n=se(t),r=n.Pu.get(e),i=n.Tu.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),mh(n.remoteStore,r.targetId))})}function Rae(t,e,n){return y(this,null,function*(){let r=TM(t);try{let i=yield(function(s,a){let c=se(s),l=Tt.now(),d=a.reduce((g,E)=>g.add(E.key),be()),h,f;return c.persistence.runTransaction("Locally write mutations","readwrite",g=>{let E=Dr(),I=be();return c.Os.getEntries(g,d).next(S=>{E=S,E.forEach((L,V)=>{V.isValidDocument()||(I=I.add(L))})}).next(()=>c.localDocuments.getOverlayedDocuments(g,E)).next(S=>{h=S;let L=[];for(let V of a){let K=Vse(V,h.get(V.key).overlayedDocument);K!=null&&L.push(new gi(V.key,K,k3(K.value.mapValue),yn.exists(!0)))}return c.mutationQueue.addMutationBatch(g,l,L,a)}).next(S=>{f=S;let L=S.applyToLocalDocumentSet(h,I);return c.documentOverlayCache.saveOverlays(g,S.batchId,L)})}).then(()=>({batchId:f.batchId,changes:K3(h)}))})(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),(function(s,a,c){let l=s.Ru[s.currentUser.toKey()];l||(l=new pt(Ie)),l=l.insert(a,c),s.Ru[s.currentUser.toKey()]=l})(r,i.batchId,n),yield Ca(r,i.changes),yield Sh(r.remoteStore)}catch(i){let o=dM(i,"Failed to persist write");n.reject(o)}})}function HW(t,e){return y(this,null,function*(){let n=se(t);try{let r=yield aae(n.localStore,e);e.targetChanges.forEach((i,o)=>{let s=n.Eu.get(o);s&&(ae(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?s.lu=!0:i.modifiedDocuments.size>0?ae(s.lu,14607):i.removedDocuments.size>0&&(ae(s.lu,42227),s.lu=!1))}),yield Ca(n,r,e)}catch(r){yield va(r)}})}function Z$(t,e,n){let r=se(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){let i=[];r.Pu.forEach((o,s)=>{let a=s.view.va(e);a.snapshot&&i.push(a.snapshot)}),(function(s,a){let c=se(s);c.onlineState=a;let l=!1;c.queries.forEach((d,h)=>{for(let f of h.wa)f.va(a)&&(l=!0)}),l&&pM(c)})(r.eventManager,e),i.length&&r.hu.J_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}function Nae(t,e,n){return y(this,null,function*(){let r=se(t);r.sharedClientState.updateQueryState(e,"rejected",n);let i=r.Eu.get(e),o=i&&i.key;if(o){let s=new pt(Z.comparator);s=s.insert(o,Zt.newNoDocument(o,le.min()));let a=be().add(o),c=new Hg(le.min(),new Map,new pt(Ie),s,a);yield HW(r,c),r.du=r.du.remove(o),r.Eu.delete(e),_M(r)}else yield gh(r.localStore,e,!1).then(()=>_h(r,e,n)).catch(va)})}function wae(t,e){return y(this,null,function*(){let n=se(t),r=e.batch.batchId;try{let i=yield sae(n.localStore,e);EM(n,r,null),mM(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),yield Ca(n,i)}catch(i){yield va(i)}})}function bae(t,e,n){return y(this,null,function*(){let r=se(t);try{let i=yield(function(s,a){let c=se(s);return c.persistence.runTransaction("Reject batch","readwrite-primary",l=>{let d;return c.mutationQueue.lookupMutationBatch(l,a).next(h=>(ae(h!==null,37113),d=h.keys(),c.mutationQueue.removeMutationBatch(l,h))).next(()=>c.mutationQueue.performConsistencyCheck(l)).next(()=>c.documentOverlayCache.removeOverlaysForBatchId(l,d,a)).next(()=>c.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,d)).next(()=>c.localDocuments.getDocuments(l,d))})})(r.localStore,e);EM(r,e,n),mM(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),yield Ca(r,i)}catch(i){yield va(i)}})}function mM(t,e){(t.Vu.get(e)||[]).forEach(n=>{n.resolve()}),t.Vu.delete(e)}function EM(t,e,n){let r=se(t),i=r.Ru[r.currentUser.toKey()];if(i){let o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.Ru[r.currentUser.toKey()]=i}}function _h(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(let r of t.Tu.get(e))t.Pu.delete(r),n&&t.hu.pu(r,n);t.Tu.delete(e),t.isPrimaryClient&&t.Au.zr(e).forEach(r=>{t.Au.containsKey(r)||$W(t,r)})}function $W(t,e){t.Iu.delete(e.path.canonicalString());let n=t.du.get(e);n!==null&&(mh(t.remoteStore,n),t.du=t.du.remove(e),t.Eu.delete(n),_M(t))}function I0(t,e,n){for(let r of n)r instanceof cv?(t.Au.addReference(r.key,e),Oae(t,r)):r instanceof lv?(H(Ch,"Document no longer in limbo: "+r.key),t.Au.removeReference(r.key,e),t.Au.containsKey(r.key)||$W(t,r.key)):re(19791,{yu:r})}function Oae(t,e){let n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Iu.has(r)||(H(Ch,"New document in limbo: "+n),t.Iu.add(r),_M(t))}function _M(t){for(;t.Iu.size>0&&t.du.size<t.maxConcurrentLimboResolutions;){let e=t.Iu.values().next().value;t.Iu.delete(e);let n=new Z(ke.fromString(e)),r=t.mu.next();t.Eu.set(r,new T0(n)),t.du=t.du.insert(n,r),Nv(t.remoteStore,new fh(Rr(am(n.path)),r,"TargetPurposeLimboResolution",Ar.ue))}}function Ca(t,e,n){return y(this,null,function*(){let r=se(t),i=[],o=[],s=[];r.Pu.isEmpty()||(r.Pu.forEach((a,c)=>{s.push(r.gu(c,e,n).then(l=>{var d;if((l||n)&&r.isPrimaryClient){let h=l?!l.fromCache:(d=n?.targetChanges.get(c.targetId))===null||d===void 0?void 0:d.current;r.sharedClientState.updateQueryState(c.targetId,h?"current":"not-current")}if(l){i.push(l);let h=XO.Es(c.targetId,l);o.push(h)}}))}),yield Promise.all(s),r.hu.J_(i),yield(function(c,l){return y(this,null,function*(){let d=se(c);try{yield d.persistence.runTransaction("notifyLocalViewChanges","readwrite",h=>P.forEach(l,f=>P.forEach(f.Is,g=>d.persistence.referenceDelegate.addReference(h,f.targetId,g)).next(()=>P.forEach(f.ds,g=>d.persistence.referenceDelegate.removeReference(h,f.targetId,g)))))}catch(h){if(!Sa(h))throw h;H(aM,"Failed to update sequence numbers: "+h)}for(let h of l){let f=h.targetId;if(!h.fromCache){let g=d.Fs.get(f),E=g.snapshotVersion,I=g.withLastLimboFreeSnapshotVersion(E);d.Fs=d.Fs.insert(f,I)}}})})(r.localStore,o))})}function Mae(t,e){return y(this,null,function*(){let n=se(t);if(!n.currentUser.isEqual(e)){H(Ch,"User change. New user:",e.toKey());let r=yield NW(n.localStore,e);n.currentUser=e,(function(o,s){o.Vu.forEach(a=>{a.forEach(c=>{c.reject(new j(x.CANCELLED,s))})}),o.Vu.clear()})(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),yield Ca(n,r.Bs)}})}function Lae(t,e){let n=se(t),r=n.Eu.get(e);if(r&&r.lu)return be().add(r.key);{let i=be(),o=n.Tu.get(e);if(!o)return i;for(let s of o){let a=n.Pu.get(s);i=i.unionWith(a.view.tu)}return i}}function Pae(t,e){return y(this,null,function*(){let n=se(t),r=yield ZO(n.localStore,e.query,!0),i=e.view.uu(r);return n.isPrimaryClient&&I0(n,e.targetId,i._u),i})}function xae(t,e){return y(this,null,function*(){let n=se(t);return OW(n.localStore,e).then(r=>Ca(n,r))})}function kae(t,e,n,r){return y(this,null,function*(){let i=se(t),o=yield(function(a,c){let l=se(a),d=se(l.mutationQueue);return l.persistence.runTransaction("Lookup mutation documents","readonly",h=>d.Xn(h,c).next(f=>f?l.localDocuments.getDocuments(h,f):P.resolve(null)))})(i.localStore,e);o!==null?(n==="pending"?yield Sh(i.remoteStore):n==="acknowledged"||n==="rejected"?(EM(i,e,r||null),mM(i,e),(function(a,c){se(se(a).mutationQueue).rr(c)})(i.localStore,e)):re(6720,"Unknown batchState",{wu:n}),yield Ca(i,o)):H(Ch,"Cannot apply mutation batch with id: "+e)})}function Fae(t,e){return y(this,null,function*(){let n=se(t);if(wv(n),TM(n),e===!0&&n.fu!==!0){let r=n.sharedClientState.getAllActiveQueryTargets(),i=yield e3(n,r.toArray());n.fu=!0,yield h0(n.remoteStore,!0);for(let o of i)Nv(n.remoteStore,o)}else if(e===!1&&n.fu!==!1){let r=[],i=Promise.resolve();n.Tu.forEach((o,s)=>{n.sharedClientState.isLocalQueryTarget(s)?r.push(s):i=i.then(()=>(_h(n,s),gh(n.localStore,s,!0))),mh(n.remoteStore,s)}),yield i,yield e3(n,r),(function(s){let a=se(s);a.Eu.forEach((c,l)=>{mh(a.remoteStore,l)}),a.Au.jr(),a.Eu=new Map,a.du=new pt(Z.comparator)})(n),n.fu=!1,yield h0(n.remoteStore,!1)}})}function e3(t,e,n){return y(this,null,function*(){let r=se(t),i=[],o=[];for(let s of e){let a,c=r.Tu.get(s);if(c&&c.length!==0){a=yield ZI(r.localStore,Rr(c[0]));for(let l of c){let d=r.Pu.get(l),h=yield Pae(r,d);h.snapshot&&o.push(h.snapshot)}}else{let l=yield bW(r.localStore,s);a=yield ZI(r.localStore,l),yield gM(r,WW(l),s,!1,a.resumeToken)}i.push(a)}return r.hu.J_(o),i})}function WW(t){return j3(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function Uae(t){return(function(n){return se(se(n).persistence).Ps()})(se(t).localStore)}function Vae(t,e,n,r){return y(this,null,function*(){let i=se(t);if(i.fu)return void H(Ch,"Ignoring unexpected query state notification.");let o=i.Tu.get(e);if(o&&o.length>0)switch(n){case"current":case"not-current":{let s=yield OW(i.localStore,W3(o[0])),a=Hg.createSynthesizedRemoteEventForCurrentChange(e,n==="current",Gt.EMPTY_BYTE_STRING);yield Ca(i,s,a);break}case"rejected":yield gh(i.localStore,e,!0),_h(i,e,r);break;default:re(64155,n)}})}function Bae(t,e,n){return y(this,null,function*(){let r=wv(t);if(r.fu){for(let i of e){if(r.Tu.has(i)&&r.sharedClientState.isActiveQueryTarget(i)){H(Ch,"Adding an already active target "+i);continue}let o=yield bW(r.localStore,i),s=yield ZI(r.localStore,o);yield gM(r,WW(o),s.targetId,!1,s.resumeToken),Nv(r.remoteStore,s)}for(let i of n)r.Tu.has(i)&&(yield gh(r.localStore,i,!1).then(()=>{mh(r.remoteStore,i),_h(r,i)}).catch(va))}})}function wv(t){let e=se(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=HW.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Lae.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Nae.bind(null,e),e.hu.J_=Iae.bind(null,e.eventManager),e.hu.pu=vae.bind(null,e.eventManager),e}function TM(t){let e=se(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=wae.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=bae.bind(null,e),e}var yM=(()=>{class t{constructor(){this.kind="memory",this.synchronizeTabs=!1}initialize(n){return y(this,null,function*(){this.serializer=Dv(n.databaseInfo.databaseId),this.sharedClientState=this.bu(n),this.persistence=this.Du(n),yield this.persistence.start(),this.localStore=this.vu(n),this.gcScheduler=this.Cu(n,this.localStore),this.indexBackfillerScheduler=this.Fu(n,this.localStore)})}Cu(n,r){return null}Fu(n,r){return null}vu(n){return RW(this.persistence,new JI,n.initialUser,this.serializer)}Du(n){return new Yg(XI.Vi,this.serializer)}bu(n){return new nv}terminate(){return y(this,null,function*(){var n,r;(n=this.gcScheduler)===null||n===void 0||n.stop(),(r=this.indexBackfillerScheduler)===null||r===void 0||r.stop(),this.sharedClientState.shutdown(),yield this.persistence.shutdown()})}}return t.provider={build:()=>new t},t})(),v0=class extends yM{constructor(e){super(),this.cacheSizeBytes=e}Cu(e,n){ae(this.persistence.referenceDelegate instanceof QI,46915);let r=this.persistence.referenceDelegate.garbageCollector;return new qI(r,e.asyncQueue,n)}Du(e){let n=this.cacheSizeBytes!==void 0?rr.withCacheSize(this.cacheSizeBytes):rr.DEFAULT;return new Yg(r=>QI.Vi(r,n),this.serializer)}},uv=class t extends yM{constructor(e,n,r){super(),this.Mu=e,this.cacheSizeBytes=n,this.forceOwnership=r,this.kind="persistent",this.synchronizeTabs=!1}initialize(e){return y(this,null,function*(){yield Ga(t.prototype,this,"initialize").call(this,e),yield this.Mu.initialize(this,e),yield TM(this.Mu.syncEngine),yield Sh(this.Mu.remoteStore),yield this.persistence.ji(()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve()))})}vu(e){return RW(this.persistence,new JI,e.initialUser,this.serializer)}Cu(e,n){let r=this.persistence.referenceDelegate.garbageCollector;return new qI(r,e.asyncQueue,n)}Fu(e,n){let r=new qb(n,this.persistence);return new zb(e.asyncQueue,r)}Du(e){let n=DW(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=this.cacheSizeBytes!==void 0?rr.withCacheSize(this.cacheSizeBytes):rr.DEFAULT;return new YO(this.synchronizeTabs,n,e.clientId,r,e.asyncQueue,kW(),II(),this.serializer,this.sharedClientState,!!this.forceOwnership)}bu(e){return new nv}},S0=class t extends uv{constructor(e,n){super(e,n,!1),this.Mu=e,this.cacheSizeBytes=n,this.synchronizeTabs=!0}initialize(e){return y(this,null,function*(){yield Ga(t.prototype,this,"initialize").call(this,e);let n=this.Mu.syncEngine;this.sharedClientState instanceof Ng&&(this.sharedClientState.syncEngine={Do:kae.bind(null,n),vo:Vae.bind(null,n),Co:Bae.bind(null,n),Ps:Uae.bind(null,n),bo:xae.bind(null,n)},yield this.sharedClientState.start()),yield this.persistence.ji(r=>y(this,null,function*(){yield Fae(this.Mu.syncEngine,r),this.gcScheduler&&(r&&!this.gcScheduler.started?this.gcScheduler.start():r||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(r&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():r||this.indexBackfillerScheduler.stop())}))})}bu(e){let n=kW();if(!Ng.C(n))throw new j(x.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");let r=DW(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new Ng(n,e.asyncQueue,r,e.clientId,e.initialUser)}},IM=(()=>{class t{initialize(n,r){return y(this,null,function*(){this.localStore||(this.localStore=n.localStore,this.sharedClientState=n.sharedClientState,this.datastore=this.createDatastore(r),this.remoteStore=this.createRemoteStore(r),this.eventManager=this.createEventManager(r),this.syncEngine=this.createSyncEngine(r,!n.synchronizeTabs),this.sharedClientState.onlineStateHandler=i=>Z$(this.syncEngine,i,1),this.remoteStore.remoteSyncer.handleCredentialChange=Mae.bind(null,this.syncEngine),yield h0(this.remoteStore,this.syncEngine.isPrimaryClient))})}createEventManager(n){return(function(){return new g0})()}createDatastore(n){let r=Dv(n.databaseInfo.databaseId),i=(function(s){return new o0(s)})(n.databaseInfo);return(function(s,a,c,l){return new l0(s,a,c,l)})(n.authCredentials,n.appCheckCredentials,i,r)}createRemoteStore(n){return(function(i,o,s,a,c){return new d0(i,o,s,a,c)})(this.localStore,this.datastore,n.asyncQueue,r=>Z$(this.syncEngine,r,0),(function(){return rv.C()?new rv:new t0})())}createSyncEngine(n,r){return(function(o,s,a,c,l,d,h){let f=new y0(o,s,a,c,l,d);return h&&(f.fu=!0),f})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,n.initialUser,n.maxConcurrentLimboResolutions,r)}terminate(){return y(this,null,function*(){var n,r;yield(function(o){return y(this,null,function*(){let s=se(o);H(Ml,"RemoteStore shutting down."),s.Ia.add(5),yield lm(s),s.Ea.shutdown(),s.Aa.set("Unknown")})})(this.remoteStore),(n=this.datastore)===null||n===void 0||n.terminate(),(r=this.eventManager)===null||r===void 0||r.terminate()})}}return t.provider={build:()=>new t},t})();var Zg=class{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.xu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.xu(this.observer.error,e):Mt("Uncaught Error in snapshot listener:",e.toString()))}Ou(){this.muted=!0}xu(e,n){setTimeout(()=>{this.muted||e(n)},0)}};var A0=class{constructor(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastTransactionError=null,this.writtenDocs=new Set}lookup(e){return y(this,null,function*(){if(this.ensureCommitNotCalled(),this.mutations.length>0)throw this.lastTransactionError=new j(x.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;let n=yield(function(i,o){return y(this,null,function*(){let s=se(i),a={documents:o.map(h=>Wg(s.serializer,h))},c=yield s.Jo("BatchGetDocuments",s.serializer.databaseId,ke.emptyPath(),a,o.length),l=new Map;c.forEach(h=>{let f=zse(s.serializer,h);l.set(f.key.toString(),f)});let d=[];return o.forEach(h=>{let f=l.get(h.toString());ae(!!f,55234,{key:h}),d.push(f)}),d})})(this.datastore,e);return n.forEach(r=>this.recordVersion(r)),n})}set(e,n){this.write(n.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,n){try{this.write(n.toMutation(e,this.preconditionForUpdate(e)))}catch(r){this.lastTransactionError=r}this.writtenDocs.add(e.toString())}delete(e){this.write(new wl(e,this.precondition(e))),this.writtenDocs.add(e.toString())}commit(){return y(this,null,function*(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;let e=this.readVersions;this.mutations.forEach(n=>{e.delete(n.key.toString())}),e.forEach((n,r)=>{let i=Z.fromPath(r);this.mutations.push(new Bg(i,this.precondition(i)))}),yield(function(r,i){return y(this,null,function*(){let o=se(r),s={writes:i.map(a=>zg(o.serializer,a))};yield o.Wo("Commit",o.serializer.databaseId,ke.emptyPath(),s)})})(this.datastore,this.mutations),this.committed=!0})}recordVersion(e){let n;if(e.isFoundDocument())n=e.version;else{if(!e.isNoDocument())throw re(50498,{Wu:e.constructor.name});n=le.min()}let r=this.readVersions.get(e.key.toString());if(r){if(!n.isEqual(r))throw new j(x.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),n)}precondition(e){let n=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&n?n.isEqual(le.min())?yn.exists(!1):yn.updateTime(n):yn.none()}preconditionForUpdate(e){let n=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&n){if(n.isEqual(le.min()))throw new j(x.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return yn.updateTime(n)}return yn.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}};var C0=class{constructor(e,n,r,i,o){this.asyncQueue=e,this.datastore=n,this.options=r,this.updateFunction=i,this.deferred=o,this.Gu=r.maxAttempts,this.F_=new Qg(this.asyncQueue,"transaction_retry")}zu(){this.Gu-=1,this.ju()}ju(){this.F_.g_(()=>y(this,null,function*(){let e=new A0(this.datastore),n=this.Ju(e);n&&n.then(r=>{this.asyncQueue.enqueueAndForget(()=>e.commit().then(()=>{this.deferred.resolve(r)}).catch(i=>{this.Hu(i)}))}).catch(r=>{this.Hu(r)})}))}Ju(e){try{let n=this.updateFunction(e);return!im(n)&&n.catch&&n.then?n:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(n){return this.deferred.reject(n),null}}Hu(e){this.Gu>0&&this.Yu(e)?(this.Gu-=1,this.asyncQueue.enqueueAndForget(()=>(this.ju(),Promise.resolve()))):this.deferred.reject(e)}Yu(e){if(e.name==="FirebaseError"){let n=e.code;return n==="aborted"||n==="failed-precondition"||n==="already-exists"||!rW(n)}return!1}};var Ia="FirestoreClient",D0=class{constructor(e,n,r,i,o){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=Vt.UNAUTHENTICATED,this.clientId=wg.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=o,this.authCredentials.start(r,s=>y(this,null,function*(){H(Ia,"Received user=",s.uid),yield this.authCredentialListener(s),this.user=s})),this.appCheckCredentials.start(r,s=>(H(Ia,"Received new app check token=",s),this.appCheckCredentialListener(s,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();let e=new ir;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(()=>y(this,null,function*(){try{this._onlineComponents&&(yield this._onlineComponents.terminate()),this._offlineComponents&&(yield this._offlineComponents.terminate()),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){let r=dM(n,"Failed to shutdown persistence");e.reject(r)}})),e.promise}};function xb(t,e){return y(this,null,function*(){t.asyncQueue.verifyOperationInProgress(),H(Ia,"Initializing OfflineComponentProvider");let n=t.configuration;yield e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(i=>y(null,null,function*(){r.isEqual(i)||(yield NW(e.localStore,i),r=i)})),e.persistence.setDatabaseDeletedListener(()=>{Qo("Terminating Firestore due to IndexedDb database deletion"),t.terminate().then(()=>{H("Terminating Firestore due to IndexedDb database deletion completed successfully")}).catch(i=>{Qo("Terminating Firestore due to IndexedDb database deletion failed",i)})}),t._offlineComponents=e})}function t3(t,e){return y(this,null,function*(){t.asyncQueue.verifyOperationInProgress();let n=yield Gae(t);H(Ia,"Initializing OnlineComponentProvider"),yield e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>X$(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>X$(e.remoteStore,i)),t._onlineComponents=e})}function Gae(t){return y(this,null,function*(){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){H(Ia,"Using user provided OfflineComponentProvider");try{yield xb(t,t._uninitializedComponentsProvider._offline)}catch(e){let n=e;if(!(function(i){return i.name==="FirebaseError"?i.code===x.FAILED_PRECONDITION||i.code===x.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11})(n))throw n;Qo("Error using user provided cache. Falling back to memory cache: "+n),yield xb(t,new yM)}}else H(Ia,"Using default OfflineComponentProvider"),yield xb(t,new v0(void 0));return t._offlineComponents})}function vM(t){return y(this,null,function*(){return t._onlineComponents||(t._uninitializedComponentsProvider?(H(Ia,"Using user provided OnlineComponentProvider"),yield t3(t,t._uninitializedComponentsProvider._online)):(H(Ia,"Using default OnlineComponentProvider"),yield t3(t,new IM))),t._onlineComponents})}function jae(t){return vM(t).then(e=>e.syncEngine)}function zW(t){return vM(t).then(e=>e.datastore)}function dv(t){return y(this,null,function*(){let e=yield vM(t),n=e.eventManager;return n.onListen=Sae.bind(null,e.syncEngine),n.onUnlisten=Cae.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=Aae.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=Dae.bind(null,e.syncEngine),n})}function Hae(t,e,n={}){let r=new ir;return t.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return(function(o,s,a,c,l){let d=new Zg({next:f=>{d.Ou(),s.enqueueAndForget(()=>fM(o,h));let g=f.docs.has(a);!g&&f.fromCache?l.reject(new j(x.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&f.fromCache&&c&&c.source==="server"?l.reject(new j(x.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):l.resolve(f)},error:f=>l.reject(f)}),h=new Jg(am(a.path),d,{includeMetadataChanges:!0,ka:!0});return hM(o,h)})(yield dv(t),t.asyncQueue,e,n,r)})),r.promise}function $ae(t,e,n={}){let r=new ir;return t.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return(function(o,s,a,c,l){let d=new Zg({next:f=>{d.Ou(),s.enqueueAndForget(()=>fM(o,h)),f.fromCache&&c.source==="server"?l.reject(new j(x.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(f)},error:f=>l.reject(f)}),h=new Jg(a,d,{includeMetadataChanges:!0,ka:!0});return hM(o,h)})(yield dv(t),t.asyncQueue,e,n,r)})),r.promise}function Wae(t,e,n){let r=new ir;return t.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){try{let i=yield zW(t);r.resolve((function(s,a,c){return y(this,null,function*(){var l;let d=se(s),{request:h,ft:f,parent:g}=Yse(d.serializer,Nse(a),c);d.connection.Qo||delete h.parent;let E=(yield d.Jo("RunAggregationQuery",d.serializer.databaseId,g,h,1)).filter(S=>!!S.result);ae(E.length===1,64727);let I=(l=E[0].result)===null||l===void 0?void 0:l.aggregateFields;return Object.keys(I).reduce((S,L)=>(S[f[L]]=I[L],S),{})})})(i,e,n))}catch(i){r.reject(i)}})),r.promise}function qW(t){let e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}var n3=new Map;var KW="firestore.googleapis.com",r3=!0,hv=class{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new j(x.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=KW,this.ssl=r3}else this.host=e.host,this.ssl=(n=e.ssl)!==null&&n!==void 0?n:r3;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=TW;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<SW)throw new j(x.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}Yoe("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=qW((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),(function(o){if(o.timeoutSeconds!==void 0){if(isNaN(o.timeoutSeconds))throw new j(x.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new j(x.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new j(x.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(function(r,i){return r.timeoutSeconds===i.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}},Ll=class{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new hv({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new j(x.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new j(x.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new hv(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(r){if(!r)return new kb;switch(r.type){case"firstParty":return new Bb(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new j(x.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}})(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}_restart(){return y(this,null,function*(){this._terminateTask==="notTerminated"?yield this._terminate():this._terminateTask="notTerminated"})}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return(function(n){let r=n3.get(n);r&&(H("ComponentProvider","Removing Datastore"),n3.delete(n),r.terminate())})(this),Promise.resolve()}};function YW(t,e,n,r={}){var i;t=or(t,Ll);let o=_r(e),s=t._getSettings(),a=Object.assign(Object.assign({},s),{emulatorOptions:t._getEmulatorOptions()}),c=`${e}:${n}`;o&&(ks(`https://${c}`),Fc("Firestore",!0)),s.host!==KW&&s.host!==c&&Qo("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");let l=Object.assign(Object.assign({},s),{host:c,ssl:o,emulatorOptions:r});if(!oi(l,a)&&(t._setSettings(l),r.mockUserToken)){let d,h;if(typeof r.mockUserToken=="string")d=r.mockUserToken,h=Vt.MOCK_USER;else{d=FT(r.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);let f=r.mockUserToken.sub||r.mockUserToken.user_id;if(!f)throw new j(x.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new Vt(f)}t._authCredentials=new Fb(new vI(d,h))}}var mi=class t{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new t(this.firestore,e,this._query)}},en=class t{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new ua(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new t(this.firestore,e,this._key)}toJSON(){return{type:t._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,n,r){if(rm(n,t._jsonSchema))return new t(e,r||null,new Z(ke.fromString(n.referencePath)))}};en._jsonSchemaVersion="firestore/documentReference/1.0",en._jsonSchema={type:Bt("string",en._jsonSchemaVersion),referencePath:Bt("string")};var ua=class t extends mi{constructor(e,n,r){super(e,n,am(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){let e=this._path.popLast();return e.isEmpty()?null:new en(this.firestore,null,new Z(e))}withConverter(e){return new t(this.firestore,e,this._path)}};function XW(t,e,...n){if(t=Me(t),W0("collection","path",e),t instanceof Ll){let r=ke.fromString(e,...n);return JH(r),new ua(t,null,r)}{if(!(t instanceof en||t instanceof ua))throw new j(x.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=t._path.child(ke.fromString(e,...n));return JH(r),new ua(t.firestore,null,r)}}function QW(t,e){if(t=or(t,Ll),W0("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new j(x.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new mi(t,null,(function(r){return new ao(ke.emptyPath(),r)})(e))}function JW(t,e,...n){if(t=Me(t),arguments.length===1&&(e=wg.newId()),W0("doc","path",e),t instanceof Ll){let r=ke.fromString(e,...n);return QH(r),new en(t,null,new Z(r))}{if(!(t instanceof en||t instanceof ua))throw new j(x.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=t._path.child(ke.fromString(e,...n));return QH(r),new en(t.firestore,t instanceof ua?t.converter:null,new Z(r))}}var i3="AsyncQueue",fv=class{constructor(e=Promise.resolve()){this.Zu=[],this.Xu=!1,this.ec=[],this.tc=null,this.nc=!1,this.rc=!1,this.sc=[],this.F_=new Qg(this,"async_queue_retry"),this.oc=()=>{let r=II();r&&H(i3,"Visibility state changed to "+r.visibilityState),this.F_.y_()},this._c=e;let n=II();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this.oc)}get isShuttingDown(){return this.Xu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.ac(),this.uc(e)}enterRestrictedMode(e){if(!this.Xu){this.Xu=!0,this.rc=e||!1;let n=II();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.oc)}}enqueue(e){if(this.ac(),this.Xu)return new Promise(()=>{});let n=new ir;return this.uc(()=>this.Xu&&this.rc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Zu.push(e),this.cc()))}cc(){return y(this,null,function*(){if(this.Zu.length!==0){try{yield this.Zu[0](),this.Zu.shift(),this.F_.reset()}catch(e){if(!Sa(e))throw e;H(i3,"Operation failed with retryable error: "+e)}this.Zu.length>0&&this.F_.g_(()=>this.cc())}})}uc(e){let n=this._c.then(()=>(this.nc=!0,e().catch(r=>{throw this.tc=r,this.nc=!1,Mt("INTERNAL UNHANDLED ERROR: ",o3(r)),r}).then(r=>(this.nc=!1,r))));return this._c=n,n}enqueueAfterDelay(e,n,r){this.ac(),this.sc.indexOf(e)>-1&&(n=0);let i=f0.createAndSchedule(this,e,n,r,o=>this.lc(o));return this.ec.push(i),i}ac(){this.tc&&re(47125,{hc:o3(this.tc)})}verifyOperationInProgress(){}Pc(){return y(this,null,function*(){let e;do e=this._c,yield e;while(e!==this._c)})}Tc(e){for(let n of this.ec)if(n.timerId===e)return!0;return!1}Ic(e){return this.Pc().then(()=>{this.ec.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(let n of this.ec)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.Pc()})}dc(e){this.sc.push(e)}lc(e){let n=this.ec.indexOf(e);this.ec.splice(n,1)}};function o3(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+`
|
|
174
|
-
`+t.stack),e}function s3(t){return(function(n,r){if(typeof n!="object"||n===null)return!1;let i=n;for(let o of r)if(o in i&&typeof i[o]=="function")return!0;return!1})(t,["next","error","complete"])}var Ei=class extends Ll{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new fv,this._persistenceKey=i?.name||"[DEFAULT]"}_terminate(){return y(this,null,function*(){if(this._firestoreClient){let e=this._firestoreClient.terminate();this._queue=new fv(e),this._firestoreClient=void 0,yield e}})}};function bv(t,e,n){n||(n=Fg);let r=Xi(t,"firestore");if(r.isInitialized(n)){let i=r.getImmediate({identifier:n}),o=r.getOptions(n);if(oi(o,e))return i;throw new j(x.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(e.cacheSizeBytes!==void 0&&e.localCache!==void 0)throw new j(x.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(e.cacheSizeBytes!==void 0&&e.cacheSizeBytes!==-1&&e.cacheSizeBytes<SW)throw new j(x.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return e.host&&_r(e.host)&&ks(e.host),r.initialize({options:e,instanceIdentifier:n})}function Dh(t,e){let n=typeof t=="object"?t:er(),r=typeof t=="string"?t:e||Fg,i=Xi(n,"firestore").getImmediate({identifier:r});if(!i._initialized){let o=ld("firestore");o&&YW(i,...o)}return i}function Rh(t){if(t._terminated)throw new j(x.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||zae(t),t._firestoreClient}function zae(t){var e,n,r;let i=t._freezeSettings(),o=(function(a,c,l,d){return new Qb(a,c,l,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,qW(d.experimentalLongPollingOptions),d.useFetchStreams,d.isUsingEmulator)})(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._componentsProvider||!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._componentsProvider={_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider}),t._firestoreClient=new D0(t._authCredentials,t._appCheckCredentials,t._queue,o,t._componentsProvider&&(function(a){let c=a?._online.build();return{_offline:a?._offline.build(c),_online:c}})(t._componentsProvider))}var R0=class{constructor(e="count",n){this._internalFieldPath=n,this.type="AggregateField",this.aggregateType=e}},N0=class{constructor(e,n,r){this._userDataWriter=n,this._data=r,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}};var Xo=class t{constructor(e){this._byteString=e}static fromBase64String(e){try{return new t(Gt.fromBase64String(e))}catch(n){throw new j(x.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new t(Gt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:t._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(rm(e,t._jsonSchema))return t.fromBase64String(e.bytes)}};Xo._jsonSchemaVersion="firestore/bytes/1.0",Xo._jsonSchema={type:Bt("string",Xo._jsonSchemaVersion),bytes:Bt("string")};var Th=class{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new j(x.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Jt(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}};var em=class{constructor(e){this._methodName=e}};var da=class t{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new j(x.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new j(x.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return Ie(this._lat,e._lat)||Ie(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:t._jsonSchemaVersion}}static fromJSON(e){if(rm(e,t._jsonSchema))return new t(e.latitude,e.longitude)}};da._jsonSchemaVersion="firestore/geoPoint/1.0",da._jsonSchema={type:Bt("string",da._jsonSchemaVersion),latitude:Bt("number"),longitude:Bt("number")};var ha=class t{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return(function(r,i){if(r.length!==i.length)return!1;for(let o=0;o<r.length;++o)if(r[o]!==i[o])return!1;return!0})(this._values,e._values)}toJSON(){return{type:t._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(rm(e,t._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(n=>typeof n=="number"))return new t(e.vectorValues);throw new j(x.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}};ha._jsonSchemaVersion="firestore/vectorValue/1.0",ha._jsonSchema={type:Bt("string",ha._jsonSchemaVersion),vectorValues:Bt("object")};var qae=/^__.*__$/,w0=class{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new gi(e,this.data,this.fieldMask,n,this.fieldTransforms):new Ta(e,this.data,n,this.fieldTransforms)}},pv=class{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new gi(e,this.data,this.fieldMask,n,this.fieldTransforms)}};function ZW(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw re(40011,{Ec:t})}}var b0=class t{constructor(e,n,r,i,o,s){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,o===void 0&&this.Ac(),this.fieldTransforms=o||[],this.fieldMask=s||[]}get path(){return this.settings.path}get Ec(){return this.settings.Ec}Rc(e){return new t(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Vc(e){var n;let r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.Rc({path:r,mc:!1});return i.fc(e),i}gc(e){var n;let r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.Rc({path:r,mc:!1});return i.Ac(),i}yc(e){return this.Rc({path:void 0,mc:!0})}wc(e){return mv(e,this.settings.methodName,this.settings.Sc||!1,this.path,this.settings.bc)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}Ac(){if(this.path)for(let e=0;e<this.path.length;e++)this.fc(this.path.get(e))}fc(e){if(e.length===0)throw this.wc("Document fields must not be empty");if(ZW(this.Ec)&&qae.test(e))throw this.wc('Document fields cannot begin and end with "__"')}},O0=class{constructor(e,n,r){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=r||Dv(e)}Dc(e,n,r,i=!1){return new b0({Ec:e,methodName:n,bc:r,path:Jt.emptyPath(),mc:!1,Sc:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}};function Ov(t){let e=t._freezeSettings(),n=Dv(t._databaseId);return new O0(t._databaseId,!!e.ignoreUndefinedProperties,n)}function e6(t,e,n,r,i,o={}){let s=t.Dc(o.merge||o.mergeFields?2:0,e,n,i);SM("Data must be an object, but it was:",s,r);let a=n6(r,s),c,l;if(o.merge)c=new Cr(s.fieldMask),l=s.fieldTransforms;else if(o.mergeFields){let d=[];for(let h of o.mergeFields){let f=M0(e,h,n);if(!s.contains(f))throw new j(x.INVALID_ARGUMENT,`Field '${f}' is specified in your field mask but missing from your input data.`);i6(d,f)||d.push(f)}c=new Cr(d),l=s.fieldTransforms.filter(h=>c.covers(h.field))}else c=null,l=s.fieldTransforms;return new w0(new Fn(a),c,l)}var gv=class t extends em{_toFieldTransform(e){if(e.Ec!==2)throw e.Ec===1?e.wc(`${this._methodName}() can only appear at the top level of your update data`):e.wc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof t}};function Kae(t,e,n,r){let i=t.Dc(1,e,n);SM("Data must be an object, but it was:",i,r);let o=[],s=Fn.empty();Aa(r,(c,l)=>{let d=AM(e,c,n);l=Me(l);let h=i.gc(d);if(l instanceof gv)o.push(d);else{let f=um(l,h);f!=null&&(o.push(d),s.set(d,f))}});let a=new Cr(o);return new pv(s,a,i.fieldTransforms)}function Yae(t,e,n,r,i,o){let s=t.Dc(1,e,n),a=[M0(e,r,n)],c=[i];if(o.length%2!=0)throw new j(x.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f<o.length;f+=2)a.push(M0(e,o[f])),c.push(o[f+1]);let l=[],d=Fn.empty();for(let f=a.length-1;f>=0;--f)if(!i6(l,a[f])){let g=a[f],E=c[f];E=Me(E);let I=s.gc(g);if(E instanceof gv)l.push(g);else{let S=um(E,I);S!=null&&(l.push(g),d.set(g,S))}}let h=new Cr(l);return new pv(d,h,s.fieldTransforms)}function t6(t,e,n,r=!1){return um(n,t.Dc(r?4:3,e))}function um(t,e){if(r6(t=Me(t)))return SM("Unsupported field value:",e,t),n6(t,e);if(t instanceof em)return(function(r,i){if(!ZW(i.Ec))throw i.wc(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.wc(`${r._methodName}() is not currently supported inside arrays`);let o=r._toFieldTransform(i);o&&i.fieldTransforms.push(o)})(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.mc&&e.Ec!==4)throw e.wc("Nested arrays are not supported");return(function(r,i){let o=[],s=0;for(let a of r){let c=um(a,i.yc(s));c==null&&(c={nullValue:"NULL_VALUE"}),o.push(c),s++}return{arrayValue:{values:o}}})(t,e)}return(function(r,i){if((r=Me(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return Pse(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){let o=Tt.fromDate(r);return{timestampValue:hh(i.serializer,o)}}if(r instanceof Tt){let o=new Tt(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:hh(i.serializer,o)}}if(r instanceof da)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Xo)return{bytesValue:oW(i.serializer,r._byteString)};if(r instanceof en){let o=i.databaseId,s=r.firestore._databaseId;if(!s.isEqual(o))throw i.wc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${o.projectId}/${o.database}`);return{referenceValue:iM(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof ha)return(function(s,a){return{mapValue:{fields:{[J0]:{stringValue:Z0},[ah]:{arrayValue:{values:s.toArray().map(l=>{if(typeof l!="number")throw a.wc("VectorValues must only contain numeric values.");return rM(a.serializer,l)})}}}}}})(r,i);throw i.wc(`Unsupported field value: ${_v(r)}`)})(t,e)}function n6(t,e){let n={};return N3(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Aa(t,(r,i)=>{let o=um(i,e.Vc(r));o!=null&&(n[r]=o)}),{mapValue:{fields:n}}}function r6(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof Tt||t instanceof da||t instanceof Xo||t instanceof en||t instanceof em||t instanceof ha)}function SM(t,e,n){if(!r6(n)||!h3(n)){let r=_v(n);throw r==="an object"?e.wc(t+" a custom object"):e.wc(t+" "+r)}}function M0(t,e,n){if((e=Me(e))instanceof Th)return e._internalPath;if(typeof e=="string")return AM(t,e);throw mv("Field path arguments must be of type string or ",t,!1,void 0,n)}var Xae=new RegExp("[~\\*/\\[\\]]");function AM(t,e,n){if(e.search(Xae)>=0)throw mv(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Th(...e.split("."))._internalPath}catch{throw mv(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function mv(t,e,n,r,i){let o=r&&!r.isEmpty(),s=i!==void 0,a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(o||s)&&(c+=" (found",o&&(c+=` in field ${r}`),s&&(c+=` in document ${i}`),c+=")"),new j(x.INVALID_ARGUMENT,a+t+c)}function i6(t,e){return t.some(n=>n.isEqual(e))}var Pl=class{constructor(e,n,r,i,o){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new en(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){let e=new L0(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){let n=this._document.data.field(Mv("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}},L0=class extends Pl{data(){return super.data()}};function Mv(t,e){return typeof e=="string"?AM(t,e):e instanceof Th?e._internalPath:e._delegate._internalPath}function o6(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new j(x.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var tm=class{},yh=class extends tm{};function s6(t,e,...n){let r=[];e instanceof tm&&r.push(e),r=r.concat(n),(function(o){let s=o.filter(c=>c instanceof Ih).length,a=o.filter(c=>c instanceof nm).length;if(s>1||s>0&&a>0)throw new j(x.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(r);for(let i of r)t=i._apply(t);return t}var nm=class t extends yh{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new t(e,n,r)}_apply(e){let n=this._parse(e);return f6(e._query,n),new mi(e.firestore,e.converter,uO(e._query,n))}_parse(e){let n=Ov(e.firestore);return(function(o,s,a,c,l,d,h){let f;if(l.isKeyField()){if(d==="array-contains"||d==="array-contains-any")throw new j(x.INVALID_ARGUMENT,`Invalid Query. You can't perform '${d}' queries on documentId().`);if(d==="in"||d==="not-in"){c3(h,d);let E=[];for(let I of h)E.push(a3(c,o,I));f={arrayValue:{values:E}}}else f=a3(c,o,h)}else d!=="in"&&d!=="not-in"&&d!=="array-contains-any"||c3(h,d),f=t6(a,s,h,d==="in"||d==="not-in");return Le.create(l,d,f)})(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}};function a6(t,e,n){let r=e,i=Mv("where",t);return nm._create(i,r,n)}var Ih=class t extends tm{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new t(e,n)}_parse(e){let n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:Xe.create(n,this._getOperator())}_apply(e){let n=this._parse(e);return n.getFilters().length===0?e:((function(i,o){let s=i,a=o.getFlattenedFilters();for(let c of a)f6(s,c),s=uO(s,c)})(e._query,n),new mi(e.firestore,e.converter,uO(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}};function c6(...t){return t.forEach(e=>p6("or",e)),Ih._create("or",t)}function l6(...t){return t.forEach(e=>p6("and",e)),Ih._create("and",t)}var P0=class t extends yh{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new t(e,n)}_apply(e){let n=(function(i,o,s){if(i.startAt!==null)throw new j(x.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new j(x.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new Cl(o,s)})(e._query,this._field,this._direction);return new mi(e.firestore,e.converter,(function(i,o){let s=i.explicitOrderBy.concat([o]);return new ao(i.path,i.collectionGroup,s,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)})(e._query,n))}};function u6(t,e="asc"){let n=e,r=Mv("orderBy",t);return P0._create(r,n)}var x0=class t extends yh{constructor(e,n,r){super(),this.type=e,this._limit=n,this._limitType=r}static _create(e,n,r){return new t(e,n,r)}_apply(e){return new mi(e.firestore,e.converter,kI(e._query,this._limit,this._limitType))}};function d6(t){return Xoe("limit",t),x0._create("limit",t,"F")}var k0=class t extends yh{constructor(e,n,r){super(),this.type=e,this._docOrFields=n,this._inclusive=r}static _create(e,n,r){return new t(e,n,r)}_apply(e){let n=Qae(e,this.type,this._docOrFields,this._inclusive);return new mi(e.firestore,e.converter,(function(i,o){return new ao(i.path,i.collectionGroup,i.explicitOrderBy.slice(),i.filters.slice(),i.limit,i.limitType,o,i.endAt)})(e._query,n))}};function h6(...t){return k0._create("startAfter",t,!1)}function Qae(t,e,n,r){if(n[0]=Me(n[0]),n[0]instanceof Pl)return(function(o,s,a,c,l){if(!c)throw new j(x.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${a}().`);let d=[];for(let h of Yd(o))if(h.field.isKeyField())d.push(Al(s,c.key));else{let f=c.data.field(h.field);if(vv(f))throw new j(x.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+h.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(f===null){let g=h.field.canonicalString();throw new j(x.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${g}' (used as the orderBy) does not exist.`)}d.push(f)}return new so(d,l)})(t._query,t.firestore._databaseId,e,n[0]._document,r);{let i=Ov(t.firestore);return(function(s,a,c,l,d,h){let f=s.explicitOrderBy;if(d.length>f.length)throw new j(x.INVALID_ARGUMENT,`Too many arguments provided to ${l}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);let g=[];for(let E=0;E<d.length;E++){let I=d[E];if(f[E].field.isKeyField()){if(typeof I!="string")throw new j(x.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${l}(), but got a ${typeof I}`);if(!tM(s)&&I.indexOf("/")!==-1)throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${l}() must be a plain document ID, but '${I}' contains a slash.`);let S=s.path.child(ke.fromString(I));if(!Z.isDocumentKey(S))throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${l}() must result in a valid document path, but '${S}' is not because it contains an odd number of segments.`);let L=new Z(S);g.push(Al(a,L))}else{let S=t6(c,l,I);g.push(S)}}return new so(g,h)})(t._query,t.firestore._databaseId,i,e,n,r)}}function a3(t,e,n){if(typeof(n=Me(n))=="string"){if(n==="")throw new j(x.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!tM(e)&&n.indexOf("/")!==-1)throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);let r=e.path.child(ke.fromString(n));if(!Z.isDocumentKey(r))throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return Al(t,new Z(r))}if(n instanceof en)return Al(t,n._key);throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${_v(n)}.`)}function c3(t,e){if(!Array.isArray(t)||t.length===0)throw new j(x.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function f6(t,e){let n=(function(i,o){for(let s of i)for(let a of s.getFlattenedFilters())if(o.indexOf(a.op)>=0)return a.op;return null})(t.filters,(function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(n!==null)throw n===e.op?new j(x.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new j(x.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}function p6(t,e){if(!(e instanceof nm||e instanceof Ih))throw new j(x.INVALID_ARGUMENT,`Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}var Ev=class{convertValue(e,n="none"){switch(ga(e)){case 0:return null;case 1:return e.booleanValue;case 2:return _t(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(Zo(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw re(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){let r={};return Aa(e,(i,o)=>{r[i]=this.convertValue(o,n)}),r}convertVectorValue(e){var n,r,i;let o=(i=(r=(n=e.fields)===null||n===void 0?void 0:n[ah].arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.map(s=>_t(s.doubleValue));return new ha(o)}convertGeoPoint(e){return new da(_t(e.latitude),_t(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":let r=Sv(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(kg(e));default:return null}}convertTimestamp(e){let n=Jo(e);return new Tt(n.seconds,n.nanos)}convertDocumentKey(e,n){let r=ke.fromString(e);ae(pW(r),9688,{name:e});let i=new sh(r.get(1),r.get(3)),o=new Z(r.popFirst(5));return i.isEqual(n)||Mt(`Document ${o} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),o}};function g6(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}var F0=class extends Ev{constructor(e){super(),this.firestore=e}convertBytes(e){return new Xo(e)}convertReference(e){let n=this.convertDocumentKey(e,this.firestore._databaseId);return new en(this.firestore,null,n)}};function Jae(){return new R0("count")}var la=class{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}},fa=class t extends Pl{constructor(e,n,r,i,o,s){super(e,n,r,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let n=new Qd(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){let r=this._document.data.field(Mv("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new j(x.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e=this._document,n={};return n.type=t._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}};fa._jsonSchemaVersion="firestore/documentSnapshot/1.0",fa._jsonSchema={type:Bt("string",fa._jsonSchemaVersion),bundleSource:Bt("string","DocumentSnapshot"),bundleName:Bt("string"),bundle:Bt("string")};var Qd=class extends fa{data(e={}){return super.data(e)}},Sl=class t{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new la(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){let e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new Qd(this._firestore,this._userDataWriter,r.key,r,new la(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new j(x.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=(function(i,o){if(i._snapshot.oldDocs.isEmpty()){let s=0;return i._snapshot.docChanges.map(a=>{let c=new Qd(i._firestore,i._userDataWriter,a.doc.key,a.doc,new la(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:c,oldIndex:-1,newIndex:s++}})}{let s=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>o||a.type!==3).map(a=>{let c=new Qd(i._firestore,i._userDataWriter,a.doc.key,a.doc,new la(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter),l=-1,d=-1;return a.type!==0&&(l=s.indexOf(a.doc.key),s=s.delete(a.doc.key)),a.type!==1&&(s=s.add(a.doc),d=s.indexOf(a.doc.key)),{type:Zae(a.type),doc:c,oldIndex:l,newIndex:d}})}})(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new j(x.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e={};e.type=t._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=wg.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;let n=[],r=[],i=[];return this.docs.forEach(o=>{o._document!==null&&(n.push(o._document),r.push(this._userDataWriter.convertObjectMap(o._document.data.value.mapValue.fields,"previous")),i.push(o.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}};function Zae(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return re(61501,{type:t})}}function m6(t){t=or(t,en);let e=or(t.firestore,Ei);return Hae(Rh(e),t._key).then(n=>v6(e,t,n))}Sl._jsonSchemaVersion="firestore/querySnapshot/1.0",Sl._jsonSchema={type:Bt("string",Sl._jsonSchemaVersion),bundleSource:Bt("string","QuerySnapshot"),bundleName:Bt("string"),bundle:Bt("string")};var xl=class extends Ev{constructor(e){super(),this.firestore=e}convertBytes(e){return new Xo(e)}convertReference(e){let n=this.convertDocumentKey(e,this.firestore._databaseId);return new en(this.firestore,null,n)}};function E6(t){t=or(t,mi);let e=or(t.firestore,Ei),n=Rh(e),r=new xl(e);return o6(t._query),$ae(n,t._query).then(i=>new Sl(e,r,t,i))}function _6(t,e,n){t=or(t,en);let r=or(t.firestore,Ei),i=g6(t.converter,e,n);return I6(r,[e6(Ov(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,yn.none())])}function T6(t){return I6(or(t.firestore,Ei),[new wl(t._key,yn.none())])}function y6(t,...e){var n,r,i;t=Me(t);let o={includeMetadataChanges:!1,source:"default"},s=0;typeof e[s]!="object"||s3(e[s])||(o=e[s++]);let a={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(s3(e[s])){let h=e[s];e[s]=(n=h.next)===null||n===void 0?void 0:n.bind(h),e[s+1]=(r=h.error)===null||r===void 0?void 0:r.bind(h),e[s+2]=(i=h.complete)===null||i===void 0?void 0:i.bind(h)}let c,l,d;if(t instanceof en)l=or(t.firestore,Ei),d=am(t._key.path),c={next:h=>{e[s]&&e[s](v6(l,t,h))},error:e[s+1],complete:e[s+2]};else{let h=or(t,mi);l=or(h.firestore,Ei),d=h._query;let f=new xl(l);c={next:g=>{e[s]&&e[s](new Sl(l,f,h,g))},error:e[s+1],complete:e[s+2]},o6(t._query)}return(function(f,g,E,I){let S=new Zg(I),L=new Jg(g,S,E);return f.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return hM(yield dv(f),L)})),()=>{S.Ou(),f.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return fM(yield dv(f),L)}))}})(Rh(l),d,a,c)}function I6(t,e){return(function(r,i){let o=new ir;return r.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return Rae(yield jae(r),i,o)})),o.promise})(Rh(t),e)}function v6(t,e,n){let r=n.docs.get(e._key),i=new xl(t);return new fa(t,i,e._key,r,new la(n.hasPendingWrites,n.fromCache),e.converter)}function S6(t){return A6(t,{count:Jae()})}function A6(t,e){let n=or(t.firestore,Ei),r=Rh(n),i=Sse(e,(o,s)=>new pO(s,o.aggregateType,o._internalFieldPath));return Wae(r,t._query,i).then(o=>(function(a,c,l){let d=new xl(a);return new N0(c,d,l)})(n,t,o))}var U0=class{constructor(e){let n;this.kind="persistent",e?.tabManager?(e.tabManager._initialize(e),n=e.tabManager):(n=ece(void 0),n._initialize(e)),this._onlineComponentProvider=n._onlineComponentProvider,this._offlineComponentProvider=n._offlineComponentProvider}toJSON(){return{kind:this.kind}}};function CM(t){return new U0(t)}var V0=class{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=IM.provider,this._offlineComponentProvider={build:n=>new uv(n,e?.cacheSizeBytes,this.forceOwnership)}}},B0=class{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=IM.provider,this._offlineComponentProvider={build:n=>new S0(n,e?.cacheSizeBytes)}}};function ece(t){return new V0(t?.forceOwnership)}function DM(){return new B0}var tce={maxAttempts:5};function yg(t,e){if((t=Me(t)).firestore!==e)throw new j(x.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}var G0=class{constructor(e,n){this._firestore=e,this._transaction=n,this._dataReader=Ov(e)}get(e){let n=yg(e,this._firestore),r=new F0(this._firestore);return this._transaction.lookup([n._key]).then(i=>{if(!i||i.length!==1)return re(24041);let o=i[0];if(o.isFoundDocument())return new Pl(this._firestore,r,o.key,o,n.converter);if(o.isNoDocument())return new Pl(this._firestore,r,n._key,null,n.converter);throw re(18433,{doc:o})})}set(e,n,r){let i=yg(e,this._firestore),o=g6(i.converter,n,r),s=e6(this._dataReader,"Transaction.set",i._key,o,i.converter!==null,r);return this._transaction.set(i._key,s),this}update(e,n,r,...i){let o=yg(e,this._firestore),s;return s=typeof(n=Me(n))=="string"||n instanceof Th?Yae(this._dataReader,"Transaction.update",o._key,n,r,i):Kae(this._dataReader,"Transaction.update",o._key,n),this._transaction.update(o._key,s),this}delete(e){let n=yg(e,this._firestore);return this._transaction.delete(n._key),this}};var j0=class extends G0{constructor(e,n){super(e,n),this._firestore=e}get(e){let n=yg(e,this._firestore),r=new xl(this._firestore);return super.get(e).then(i=>new fa(this._firestore,r,n._key,i._document,new la(!1,!1),n.converter))}};function C6(t,e,n){t=or(t,Ei);let r=Object.assign(Object.assign({},tce),n);return(function(o){if(o.maxAttempts<1)throw new j(x.INVALID_ARGUMENT,"Max attempts must be at least 1")})(r),(function(o,s,a){let c=new ir;return o.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){let l=yield zW(o);new C0(o.asyncQueue,l,a,s,c).zu()})),c.promise})(Rh(t),i=>e(new j0(t,i)),r)}(function(e,n=!0){(function(i){vh=i})(Bs),$n(new Xt("firestore",(r,{instanceIdentifier:i,options:o})=>{let s=r.getProvider("app").getImmediate(),a=new Ei(new Ub(r.getProvider("auth-internal")),new Gb(s,r.getProvider("app-check-internal")),(function(l,d){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new j(x.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new sh(l.options.projectId,d)})(s,i),s);return o=Object.assign({useFetchStreams:n},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),Ge(qH,KH,e),Ge(qH,KH,"esm2017")})();var uUe=ue(l6,!0,2);var Lv=ue(XW,!0,2),D6=ue(QW,!0,2);var R6=ue(T6,!0,2);var dm=ue(JW,!0,2);var N6=ue(S6,!0),RM=ue(m6,!0);var w6=ue(E6,!0);var dUe=ue(d6,!0,2);var b6=ue(y6,!0);var hUe=ue(c6,!0,2),fUe=ue(u6,!0,2),O6=ue(s6,!0,2);var M6=ue(C6,!0),L6=ue(_6,!0,2);var pUe=ue(h6,!0,2);var gUe=ue(a6,!0,2);var Pv=class{static getFirestoreProdDbName(e,n){return n?.databaseURL?.includes("snippyly-plugin.firebaseio.com")||n?.databaseURL?.includes("snippyly-plugin-staging.firebaseio.com")?"sfdb":n?.storeDbId??(this.isTestingDb(n?.databaseURL??"")?"sdktest":`apikey${e.toLowerCase()}`)}static isTestingDb(e){try{return e.includes("-test")}catch(n){return M.error("Error in isTestingDb:",n),!1}}};var P6=(()=>{let e=class e{constructor(r,i,o){this.configService=r,this.authService=i,this.loggingService=o,this.firestore$=new ie(null);try{Ka([this.authService.getFirebaseConfig$(),this.configService.getApiKey$(),this.configService.getFirestorePersistentCacheEnabled$()]).pipe(mn(([s,a])=>!!s&&!!a),En(1)).subscribe(([s,a,c])=>{if(s&&a&&s?.firebaseOptions?.storeDbId){try{let h=sessionStorage?.getItem("veltFirestoreLogLevel")||qt?.firebaseLogLevel||"silent";H0(h)}catch(h){this.loggingService.catch("Error in FirestoreService setLogLevel: ",h)}let l=Pv.getFirestoreProdDbName(a,s.firebaseOptions),d=this.configService.getProxyConfig();if(d?.v2DbHost){let h={host:d.v2DbHost,ssl:!0};d.forceLongPolling?h.experimentalForceLongPolling=!0:h.experimentalAutoDetectLongPolling=!0,c&&(h.localCache=CM({tabManager:DM()}));try{this.firestore$.next(bv(er(),h,l))}catch(f){this.loggingService.catch("Firestore proxy: initializeFirestore failed, falling back to existing instance. Proxy settings may not be applied: ",f),this.firestore$.next(Dh(l))}}else if(c)try{let h=er(),f=bv(h,{localCache:CM({tabManager:DM()})},l);this.firestore$.next(f)}catch{this.firestore$.next(Dh(l))}else this.firestore$.next(Dh(l))}},s=>{})}catch{}}getFirestore(){return this.firestore$.asObservable()}getFirestoreValue(){return this.firestore$.value}generateFirestoreDocumentId(){try{let r=this.getFirestoreValue()||Dh("DocumentIdDb");if(r){let i=Lv(r,"generateDocumentId");return dm(i).id}return}catch(r){this.loggingService.catch("Error in FirestoreService generateFirestoreDocumentId: ",r);return}}};e.\u0275fac=function(i){return new(i||e)($(Ji),$(Ed),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var xv=(()=>{let e=class e{constructor(r,i,o){this.authService=r,this.configService=i,this.loggingService=o,this.db$=new ie(null);try{this.authService.getFirebaseConfig$().subscribe(s=>{if(s){let a=this.configService.getProxyConfig(),c=s.firebaseOptions.databaseURL;a?.v1DbHost&&c&&(c=CV(c,a.v1DbHost),a?.forceLongPolling&&Eb());let l=Pd(void 0,c);a?.v1DbHost&&c&&this.lockDatabaseHost(l),this.db$.next(l)}},s=>{this.loggingService.catch("Error in DatabaseService constructor: ",s)})}catch(s){this.loggingService.catch("Error in DatabaseService constructor:",s)}}getDb(){return this.db$.asObservable()}getDbValue(){return this.db$.getValue()}lockDatabaseHost(r){try{let o=r?._repo?.repoInfo_;if(o){let s=o.host;Object.defineProperty(o,"host",{get:()=>s,set:()=>{},configurable:!0}),o.internalHost=s}}catch(i){this.loggingService.catch("Error in DatabaseService lockDatabaseHost: ",i)}}};e.\u0275fac=function(i){return new(i||e)($(Ed),$(Ji),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Nr={doc:dm,collection:Lv,collectionGroup:D6,query:O6,getDoc:RM,getDocs:w6,getCountFromServer:N6,setDoc:L6,deleteDoc:R6,onSnapshot:b6,runTransaction:M6},k6=(()=>{let e=class e{constructor(r,i,o){this.firestoreService=r,this.databaseService=i,this.loggingService=o}read(r){return y(this,null,function*(){if((r.store??"firestore")==="rtdb"){let a=this.databaseService.getDbValue();return a?{data:(yield hg(xd(a,r.location)))?.val()}:{data:void 0}}let o=this.firestoreService.getFirestoreValue();return o?{data:(yield RM(dm(o,r.location)))?.data()}:{data:void 0}})}runTransaction(r){return y(this,null,function*(){return r()})}firestoreDoc(r,i){return Nr.doc(r,i)}firestoreCollection(r,i){return Nr.collection(r,i)}firestoreCollectionGroup(r,i){return Nr.collectionGroup(r,i)}firestoreQuery(r,...i){return Nr.query(r,...i)}firestoreGetDoc(r){return Nr.getDoc(r)}firestoreGetDocs(r){return Nr.getDocs(r)}firestoreGetCountFromServer(r){return Nr.getCountFromServer(r)}firestoreSetDoc(r,i,o){return o?Nr.setDoc(r,i,o):Nr.setDoc(r,i)}firestoreDeleteDoc(r){return Nr.deleteDoc(r)}firestoreOnSnapshot(r,i,o){return o?Nr.onSnapshot(r,i,o):Nr.onSnapshot(r,i)}firestoreRunTransaction(r,i){return Nr.runTransaction(r,i)}addComment(r){return this.deferred("addComment")}editComment(r){return this.deferred("editComment")}addReaction(r){return this.deferred("addReaction")}editReaction(r){return this.deferred("editReaction")}deleteReaction(r){return this.deferred("deleteReaction")}recordDocumentView(r){return this.deferred("recordDocumentView")}getActivitiesForDocuments(r){return this.deferred("getActivitiesForDocuments")}getActivitiesForEntity(r){return this.deferred("getActivitiesForEntity")}deleteComment(r){return this.deferred("deleteComment")}setCommentResolved(r){return this.deferred("setCommentResolved")}setCommentMetadata(r){return this.deferred("setCommentMetadata")}bumpCommentViews(r){return this.deferred("bumpCommentViews")}markCommentThreadRead(r){return this.deferred("markCommentThreadRead")}markNotificationRead(r){return this.deferred("markNotificationRead")}addNotification(r){return this.deferred("addNotification")}deleteNotification(r){return this.deferred("deleteNotification")}updateNotification(r){return this.deferred("updateNotification")}updatePresence(r){return this.deferred("updatePresence")}grantAccess(r){return this.deferred("grantAccess")}revokeAccess(r){return this.deferred("revokeAccess")}getAccess(r){return this.deferred("getAccess")}upsertOrgUserProfile(r){return this.deferred("upsertOrgUserProfile")}upsertDocMetadata(r){return this.deferred("upsertDocMetadata")}upsertOrgMetadata(r){return this.deferred("upsertOrgMetadata")}createActivity(r){return this.deferred("createActivity")}saveCrdtVersion(r){return this.deferred("saveCrdtVersion")}getCrdtVersion(r){return this.deferred("getCrdtVersion")}listCrdtVersions(r){return this.deferred("listCrdtVersions")}getOrganizationUsers(r){return this.deferred("getOrganizationUsers")}setLocationMetadata(r){return this.deferred("setLocationMetadata")}fetchLocations(r){return this.deferred("fetchLocations")}createFolder(r){return this.deferred("createFolder")}setDocumentMetadata(r){return this.deferred("setDocumentMetadata")}getDocuments(r){return this.deferred("getDocuments")}fetchDocuments(r){return this.deferred("fetchDocuments")}fetchFolders(r){return this.deferred("fetchFolders")}getNotificationsForDocuments(r){return this.deferred("getNotificationsForDocuments")}getDocumentMetadataFromIds(r){return this.deferred("getDocumentMetadataFromIds")}getCrossOrgUserNotifications(r){return this.deferred("getCrossOrgUserNotifications")}deferred(r){return this.loggingService.warn(`[WB] FirebaseDbAdapter.${r} called but write-op wiring is deferred to Phase A (self-hosting Step 0). The SDK uses its existing direct write path in Step 0.`),Promise.resolve({ok:!1,code:"unimplemented",message:`FirebaseDbAdapter.${r} wiring deferred to Phase A`})}};e.\u0275fac=function(i){return new(i||e)($(P6),$(xv),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var rce={comment:{mode:"persistent",scope:"doc"},notification:{mode:"persistent",scope:"user"},notificationIndex:{mode:"persistent",scope:"user"},crdt:{mode:"persistent",scope:"doc"},presence:{mode:"ephemeral",scope:"doc"},crdtSyncPresence:{mode:"ephemeral",scope:"doc"},crdtPresence:{mode:"ephemeral",scope:"doc"},liveState:{mode:"ephemeral",scope:"doc"},cursor:{mode:"ephemeral",scope:"doc"},huddle:{mode:"ephemeral",scope:"doc"},syncVideoPlayer:{mode:"ephemeral",scope:"doc"},heartbeat:{mode:"ephemeral",scope:"org"},flockSession:{mode:"ephemeral",scope:"doc"},selection:{mode:"ephemeral",scope:"doc"},reaction:{mode:"persistent",scope:"doc"},lastActivityTimestamp:{mode:"persistent",scope:"org"},lastNotificationTimestamp:{mode:"persistent",scope:"org"},documentViews:{mode:"persistent",scope:"doc"}};function F6(t){return rce[t]}var Qe={getDatabase:Pd,ref:xd,query:BH,get:hg,set:HH,update:$H,remove:GH,push:VH,runTransaction:jH,onValue:vb,onChildAdded:xH,onChildChanged:kH,onChildRemoved:FH,off:PH,objectVal:MH,listVal:OH,stateChanges:LH,onDisconnect:UH},U6=(()=>{let e=class e{constructor(r,i){this.databaseService=r,this.loggingService=i}getServerTimeOffset(){return y(this,null,function*(){try{let r=this.databaseService.getDbValue();if(!r)return 0;let o=(yield hg(xd(r,e.SERVER_TIME_OFFSET_PATH)))?.val();return typeof o=="number"?o:0}catch(r){return this.loggingService.catch("Error in FirebaseRealtimeAdapter getServerTimeOffset: ",r),0}})}onServerTimeOffset(r){let i=null,o=null;try{o=this.databaseService.getDb().subscribe(s=>{if(s){let a=xd(s,e.SERVER_TIME_OFFSET_PATH);i=vb(a,c=>{try{r(c?.val())}catch(l){this.loggingService.catch("Error in FirebaseRealtimeAdapter onServerTimeOffset callback: ",l)}})}})}catch(s){this.loggingService.catch("Error in FirebaseRealtimeAdapter onServerTimeOffset: ",s)}return()=>{try{i&&(i(),i=null),o?.unsubscribe(),o=null}catch(s){this.loggingService.catch("Error tearing down FirebaseRealtimeAdapter onServerTimeOffset: ",s)}}}getChannelTag(r){return F6(r)}getDatabaseInstance(r){return r?Qe.getDatabase(void 0,r):Qe.getDatabase()}rtdbRef(r,i){return Qe.ref(r,i)}rtdbQueryRef(r,...i){return Qe.query(r,...i)}rtdbGet(r){return Qe.get(r)}rtdbSet(r,i,o){return this.getChannelTag(r),Qe.set(i,o)}rtdbUpdate(r,i,o){return this.getChannelTag(r),Qe.update(i,o)}rtdbRemove(r,i){return this.getChannelTag(r),Qe.remove(i)}rtdbPush(r,i,o){return this.getChannelTag(r),o===void 0?Qe.push(i):Qe.push(i,o)}rtdbRunTransaction(r,i,o){return this.getChannelTag(r),Qe.runTransaction(i,o)}rtdbOnValue(r,i,o,s,a){return this.getChannelTag(r),typeof s=="function"?a?Qe.onValue(i,o,s,a):Qe.onValue(i,o,s):s?Qe.onValue(i,o,s):Qe.onValue(i,o)}rtdbOnChildAdded(r,i,o,s){return this.getChannelTag(r),s?Qe.onChildAdded(i,o,s):Qe.onChildAdded(i,o)}rtdbOnChildChanged(r,i,o,s){return this.getChannelTag(r),s?Qe.onChildChanged(i,o,s):Qe.onChildChanged(i,o)}rtdbOnChildRemoved(r,i,o,s){return this.getChannelTag(r),s?Qe.onChildRemoved(i,o,s):Qe.onChildRemoved(i,o)}rtdbOff(r,i,o){Qe.off(r,i,o)}rtdbObjectVal$(r,i){return this.getChannelTag(r),Qe.objectVal(i)}rtdbListVal$(r,i){return this.getChannelTag(r),Qe.listVal(i)}rtdbStateChanges$(r,i){return this.getChannelTag(r),Qe.stateChanges(i)}rtdbOnDisconnectSet(r,i,o){return this.getChannelTag(r),Qe.onDisconnect(i).set(o)}rtdbOnDisconnectUpdate(r,i,o){return this.getChannelTag(r),Qe.onDisconnect(i).update(o)}rtdbOnDisconnectRemove(r,i){return this.getChannelTag(r),Qe.onDisconnect(i).remove()}rtdbOnDisconnectCancel(r,i){return this.getChannelTag(r),Qe.onDisconnect(i).cancel()}subscribe(r,i,o,s){return{unsubscribe:()=>{}}}publish(r,i,o){return y(this,null,function*(){return{ok:!1,code:"unimplemented",message:"RealtimeAdapter.publish wiring deferred to Phase A"}})}presence(r,i){return y(this,null,function*(){return{ok:!1,code:"unimplemented",message:"RealtimeAdapter.presence wiring deferred to Phase A"}})}onDisconnect(r,i){return y(this,null,function*(){return()=>{}})}};e.SERVER_TIME_OFFSET_PATH=".info/serverTimeOffset",e.\u0275fac=function(i){return new(i||e)($(xv),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Nh=null,NM=new Set;function V6(t){return NM.add(t),()=>NM.delete(t)}function WUe(t){return new Promise(e=>{let n=!1,r=null,i=()=>{if(!n){n=!0,clearTimeout(o);try{r?.()}catch{}e()}},o=setTimeout(i,t);r=V6(i),Nh&&i()})}function zUe(t){return tf(()=>{let e=!1;try{if(t.isPortableFeedActive())return lt(null)}catch(r){e=!0,t.onError("portable check",r)}let n=new fe(r=>V6(()=>{try{(e||t.isPortableFeedActive())&&r.next(null)}catch(i){e=!0,r.next(null),t.onError("registration re-check",i)}}));return gs(t.firebaseDb$().pipe(mn(r=>!!r)),n)})}function ice(t){let e=t?.message;return typeof e=="string"&&/^NG0205(?!\d)/.test(e)}function qUe(t){if(Nh=t??null,Nh)for(let e of Array.from(NM))try{e()}catch(n){M.catch("Error in portable adapter registration listener: ",n)}}var KUe=(()=>{let e=class e{constructor(r){this.injector=r}get configService(){return this._configService??=this.injector.get(Ji)}get authService(){return this._authService??=this.injector.get(Ed)}isPortableBackendActive(){return this.isPortableActive()}evaluatePortableGates(){try{return{chunkRegistered:!!Nh,flagOn:this.configService.getEnablePortableBackend()===!0,identifyRecorded:!!this.authService.getPortableBackend()}}catch(r){return ice(r)||M.catch("Error in AdapterSelectorService evaluatePortableGates: ",r),null}}isPortableActive(){let r=this.evaluatePortableGates();return!!r&&r.chunkRegistered&&r.flagOn&&r.identifyRecorded}isPortableBackendPending(){let r=this.evaluatePortableGates();return!!r&&!r.chunkRegistered&&r.flagOn&&r.identifyRecorded}isPortableSession(){let r=this.evaluatePortableGates();return!!r&&r.flagOn&&r.identifyRecorded}resolveDbAdapter(){return this.isPortableActive()?Nh.db:this.injector.get(k6)}resolveRealtimeAdapter(){return this.isPortableActive()?Nh.realtime:this.injector.get(U6)}};e.\u0275fac=function(i){return new(i||e)($(ze))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var JUe=new Set(YG);function ZUe(t){try{let e=t?.reasonCode;return typeof e!="string"||!e.trim()?"":` [reason: ${e.trim()}]`}catch{return""}}export{B as a,Ee as b,X6 as c,oce as d,sce as e,ace as f,y as g,gt as h,fe as i,lS as j,Rt as k,ie as l,Xa as m,B4 as n,G4 as o,Wa as p,cr as q,lt as r,j4 as s,H4 as t,R4 as u,De as v,Ka as w,tf as x,$4 as y,wi as z,Q4 as A,To as B,I4 as C,gs as D,mn as E,u4 as F,oS as G,sS as H,T4 as I,Jm as J,En as K,cS as L,yo as M,Qh as N,Ya as O,Zm as P,dS as Q,v4 as R,hS as S,S4 as T,Qa as U,Mr as V,ps as W,A4 as X,eE as Y,C4 as Z,w4 as _,J as $,SE as aa,Q as ba,So as ca,z as da,$ as ea,Y as fa,Xn as ga,Nn as ha,bi as ia,gP as ja,mP as ka,RP as la,NP as ma,ze as na,on as oa,Hn as pa,lr as qa,ki as ra,Ec as sa,Lr as ta,wz as ua,zt as va,vC as wa,Kz as xa,Ns as ya,i_ as za,y_ as Aa,n8 as Ba,V8 as Ca,B8 as Da,G8 as Ea,$8 as Fa,W8 as Ga,c5 as Ha,Ro as Ia,Ae as Ja,m5 as Ka,oq as La,sq as Ma,Vi as Na,bf as Oa,bo as Pa,L_ as Qa,st as Ra,mq as Sa,ji as Ta,vc as Ua,r1 as Va,i9 as Wa,ws as Xa,Hi as Ya,Mf as Za,l1 as _a,p9 as $a,h1 as ab,f1 as bb,k_ as cb,bs as db,T1 as eb,y1 as fb,I9 as gb,S9 as hb,A9 as ib,C9 as jb,D9 as kb,R9 as lb,N9 as mb,I1 as nb,aD as ob,cD as pb,v1 as qb,lD as rb,uD as sb,S1 as tb,dD as ub,hD as vb,C1 as wb,P9 as xb,D1 as yb,N1 as zb,w1 as Ab,V9 as Bb,G9 as Cb,j9 as Db,$9 as Eb,W9 as Fb,z9 as Gb,q9 as Hb,K9 as Ib,Y9 as Jb,X9 as Kb,x1 as Lb,k1 as Mb,lK as Nb,dK as Ob,IK as Pb,W1 as Qb,fD as Rb,z1 as Sb,q1 as Tb,K1 as Ub,CK as Vb,Y1 as Wb,Q1 as Xb,DK as Yb,RK as Zb,NK as _b,wK as $b,PK as ac,xK as bc,kK as cc,FK as dc,UK as ec,VK as fc,BK as gc,GK as hc,jK as ic,HK as jc,$K as kc,WK as lc,qK as mc,YK as nc,XK as oc,QK as pc,JK as qc,ZK as rc,nY as sc,Uf as tc,Vf as uc,_D as vc,FSe as wc,USe as xc,VSe as yc,MY as zc,bD as Ac,BSe as Bc,GSe as Cc,jSe as Dc,$i as Ec,NF as Fc,ZY as Gc,WF as Hc,e7 as Ic,FD as Jc,t7 as Kc,n7 as Lc,r7 as Mc,i7 as Nc,s7 as Oc,c7 as Pc,u7 as Qc,UD as Rc,tT as Sc,nT as Tc,D7 as Uc,w7 as Vc,pU as Wc,Z7 as Xc,eX as Yc,XD as Zc,RU as _c,eR as $c,ld as ad,_r as bd,ks as cd,FT as dd,Fc as ed,Jn as fd,Me as gd,Xt as hd,$n as id,Xi as jd,Zn as kd,Bs as ld,er as md,Ge as nd,$J as od,aLe as pd,cLe as qd,lLe as rd,si as sd,Gs as td,Go as ud,ai as vd,ue as wd,ci as xd,jo as yd,RLe as zd,NLe as Ad,wLe as Bd,Hs as Cd,fee as Dd,gee as Ed,Nee as Fd,Hc as Gd,$c as Hd,dxe as Id,hxe as Jd,tFe as Kd,nFe as Ld,rFe as Md,iFe as Nd,oFe as Od,sFe as Pd,Ho as Qd,bxe as Rd,Oxe as Sd,Mxe as Td,bU as Ud,yX as Vd,np as Wd,qt as Xd,M as Yd,lDe as Zd,uDe as _d,dDe as $d,hDe as ae,fDe as be,pDe as ce,gDe as de,Wi as ee,mDe as fe,EDe as ge,_De as he,TDe as ie,rX as je,iX as ke,oX as le,sX as me,aX as ne,cX as oe,yDe as pe,lX as qe,QD as re,uX as se,Er as te,uT as ue,dX as ve,Zu as we,Mn as xe,hX as ye,dT as ze,fX as Ae,pX as Be,gX as Ce,IDe as De,vDe as Ee,SDe as Fe,mX as Ge,F as He,CU as Ie,oRe as Je,sRe as Ke,aRe as Le,cRe as Me,ed as Ne,hRe as Oe,fRe as Pe,pRe as Qe,Ur as Re,Et as Se,OU as Te,MU as Ue,HRe as Ve,$Re as We,LU as Xe,tR as Ye,PU as Ze,nR as _e,IT as $e,IX as af,vX as bf,SX as cf,AX as df,CX as ef,DX as ff,RX as gf,NX as hf,wX as if,bX as jf,OX as kf,MX as lf,UU as mf,VU as nf,BU as of,GU as pf,jU as qf,zi as rf,gNe as sf,vT as tf,HU as uf,$U as vf,WU as wf,zU as xf,qU as yf,KU as zf,YU as Af,XU as Bf,QU as Cf,JU as Df,ZU as Ef,eV as Ff,tV as Gf,QNe as Hf,JNe as If,nV as Jf,rR as Kf,rV as Lf,iV as Mf,sV as Nf,aV as Of,Owe as Pf,Mwe as Qf,LX as Rf,PX as Sf,kOe as Tf,ST as Uf,lR as Vf,Pc as Wf,CV as Xf,qOe as Yf,Mc as Zf,Vo as _f,KOe as $f,YOe as ag,RV as bg,XOe as cg,QOe as dg,JOe as eg,ZOe as fg,e0e as gg,t0e as hg,n0e as ig,NV as jg,wV as kg,r0e as lg,i0e as mg,kX as ng,o0e as og,s0e as pg,a0e as qg,c0e as rg,bV as sg,nd as tg,l0e as ug,OV as vg,LV as wg,fV as xg,pV as yg,FX as zg,UX as Ag,wT as Bg,sp as Cg,u0e as Dg,d0e as Eg,qi as Fg,h0e as Gg,rd as Hg,GX as Ig,f0e as Jg,gR as Kg,mV as Lg,jX as Mg,DT as Ng,p0e as Og,g0e as Pg,PV as Qg,xV as Rg,HX as Sg,Oc as Tg,$X as Ug,qX as Vg,m0e as Wg,KX as Xg,E0e as Yg,YX as Zg,XX as _g,QX as $g,JX as ah,xc as bh,_0e as ch,T0e as dh,y0e as eh,dR as fh,I0e as gh,eQ as hh,v0e as ih,S0e as jh,VV as kh,A0e as lh,C0e as mh,D0e as nh,R0e as oh,N0e as ph,w0e as qh,b0e as rh,AT as sh,O0e as th,M0e as uh,L0e as vh,mR as wh,P0e as xh,IV as yh,x0e as zh,k0e as Ah,F0e as Bh,U0e as Ch,V0e as Dh,B0e as Eh,G0e as Fh,j0e as Gh,H0e as Hh,$0e as Ih,W0e as Jh,z0e as Kh,q0e as Lh,K0e as Mh,Y0e as Nh,X0e as Oh,Q0e as Ph,J0e as Qh,Z0e as Rh,eMe as Sh,tMe as Th,nMe as Uh,iQ as Vh,rMe as Wh,iMe as Xh,oMe as Yh,vV as Zh,sMe as _h,aMe as $h,cp as ai,oQ as bi,cMe as ci,lMe as di,uMe as ei,dMe as fi,sQ as gi,hMe as hi,fMe as ii,zV as ji,_R as ki,od as li,pMe as mi,op as ni,gMe as oi,mMe as pi,EMe as qi,fR as ri,_Me as si,TMe as ti,yMe as ui,IMe as vi,AQ as wi,vMe as xi,SMe as yi,AMe as zi,SV as Ai,CMe as Bi,CQ as Ci,VQ as Di,BQ as Ei,St as Fi,pd as Gi,NDe as Hi,wDe as Ii,bDe as Ji,ODe as Ki,MDe as Li,LDe as Mi,PDe as Ni,xDe as Oi,kDe as Pi,FDe as Qi,UDe as Ri,VDe as Si,hT as Ti,BDe as Ui,GDe as Vi,jDe as Wi,fT as Xi,HDe as Yi,$De as Zi,WDe as _i,zDe as $i,qDe as aj,KDe as bj,YDe as cj,pT as dj,XDe as ej,QDe as fj,gT as gj,TU as hj,yU as ij,IU as jj,vU as kj,mT as lj,zs as mj,bt as nj,Ji as oj,zc as pj,tne as qj,Xxe as rj,ly as sj,mke as tj,Wn as uj,Eke as vj,YG as wj,Ske as xj,Ake as yj,uUe as zj,dUe as Aj,hUe as Bj,fUe as Cj,pUe as Dj,gUe as Ej,Pv as Fj,P6 as Gj,xv as Hj,k6 as Ij,F6 as Jj,U6 as Kj,V6 as Lj,WUe as Mj,zUe as Nj,qUe as Oj,KUe as Pj,ZUe as Qj,t2 as Rj,n2 as Sj,fy as Tj,Pke as Uj,xke as Vj,C2 as Wj,Ed as Xj};
|
|
174
|
+
`+t.stack),e}function s3(t){return(function(n,r){if(typeof n!="object"||n===null)return!1;let i=n;for(let o of r)if(o in i&&typeof i[o]=="function")return!0;return!1})(t,["next","error","complete"])}var Ei=class extends Ll{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new fv,this._persistenceKey=i?.name||"[DEFAULT]"}_terminate(){return y(this,null,function*(){if(this._firestoreClient){let e=this._firestoreClient.terminate();this._queue=new fv(e),this._firestoreClient=void 0,yield e}})}};function bv(t,e,n){n||(n=Fg);let r=Xi(t,"firestore");if(r.isInitialized(n)){let i=r.getImmediate({identifier:n}),o=r.getOptions(n);if(oi(o,e))return i;throw new j(x.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(e.cacheSizeBytes!==void 0&&e.localCache!==void 0)throw new j(x.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(e.cacheSizeBytes!==void 0&&e.cacheSizeBytes!==-1&&e.cacheSizeBytes<SW)throw new j(x.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return e.host&&_r(e.host)&&ks(e.host),r.initialize({options:e,instanceIdentifier:n})}function Dh(t,e){let n=typeof t=="object"?t:er(),r=typeof t=="string"?t:e||Fg,i=Xi(n,"firestore").getImmediate({identifier:r});if(!i._initialized){let o=ld("firestore");o&&YW(i,...o)}return i}function Rh(t){if(t._terminated)throw new j(x.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||zae(t),t._firestoreClient}function zae(t){var e,n,r;let i=t._freezeSettings(),o=(function(a,c,l,d){return new Qb(a,c,l,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,qW(d.experimentalLongPollingOptions),d.useFetchStreams,d.isUsingEmulator)})(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._componentsProvider||!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._componentsProvider={_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider}),t._firestoreClient=new D0(t._authCredentials,t._appCheckCredentials,t._queue,o,t._componentsProvider&&(function(a){let c=a?._online.build();return{_offline:a?._offline.build(c),_online:c}})(t._componentsProvider))}var R0=class{constructor(e="count",n){this._internalFieldPath=n,this.type="AggregateField",this.aggregateType=e}},N0=class{constructor(e,n,r){this._userDataWriter=n,this._data=r,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}};var Xo=class t{constructor(e){this._byteString=e}static fromBase64String(e){try{return new t(Gt.fromBase64String(e))}catch(n){throw new j(x.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new t(Gt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:t._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(rm(e,t._jsonSchema))return t.fromBase64String(e.bytes)}};Xo._jsonSchemaVersion="firestore/bytes/1.0",Xo._jsonSchema={type:Bt("string",Xo._jsonSchemaVersion),bytes:Bt("string")};var Th=class{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new j(x.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Jt(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}};var em=class{constructor(e){this._methodName=e}};var da=class t{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new j(x.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new j(x.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return Ie(this._lat,e._lat)||Ie(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:t._jsonSchemaVersion}}static fromJSON(e){if(rm(e,t._jsonSchema))return new t(e.latitude,e.longitude)}};da._jsonSchemaVersion="firestore/geoPoint/1.0",da._jsonSchema={type:Bt("string",da._jsonSchemaVersion),latitude:Bt("number"),longitude:Bt("number")};var ha=class t{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return(function(r,i){if(r.length!==i.length)return!1;for(let o=0;o<r.length;++o)if(r[o]!==i[o])return!1;return!0})(this._values,e._values)}toJSON(){return{type:t._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(rm(e,t._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(n=>typeof n=="number"))return new t(e.vectorValues);throw new j(x.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}};ha._jsonSchemaVersion="firestore/vectorValue/1.0",ha._jsonSchema={type:Bt("string",ha._jsonSchemaVersion),vectorValues:Bt("object")};var qae=/^__.*__$/,w0=class{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new gi(e,this.data,this.fieldMask,n,this.fieldTransforms):new Ta(e,this.data,n,this.fieldTransforms)}},pv=class{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new gi(e,this.data,this.fieldMask,n,this.fieldTransforms)}};function ZW(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw re(40011,{Ec:t})}}var b0=class t{constructor(e,n,r,i,o,s){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,o===void 0&&this.Ac(),this.fieldTransforms=o||[],this.fieldMask=s||[]}get path(){return this.settings.path}get Ec(){return this.settings.Ec}Rc(e){return new t(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Vc(e){var n;let r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.Rc({path:r,mc:!1});return i.fc(e),i}gc(e){var n;let r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.Rc({path:r,mc:!1});return i.Ac(),i}yc(e){return this.Rc({path:void 0,mc:!0})}wc(e){return mv(e,this.settings.methodName,this.settings.Sc||!1,this.path,this.settings.bc)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}Ac(){if(this.path)for(let e=0;e<this.path.length;e++)this.fc(this.path.get(e))}fc(e){if(e.length===0)throw this.wc("Document fields must not be empty");if(ZW(this.Ec)&&qae.test(e))throw this.wc('Document fields cannot begin and end with "__"')}},O0=class{constructor(e,n,r){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=r||Dv(e)}Dc(e,n,r,i=!1){return new b0({Ec:e,methodName:n,bc:r,path:Jt.emptyPath(),mc:!1,Sc:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}};function Ov(t){let e=t._freezeSettings(),n=Dv(t._databaseId);return new O0(t._databaseId,!!e.ignoreUndefinedProperties,n)}function e6(t,e,n,r,i,o={}){let s=t.Dc(o.merge||o.mergeFields?2:0,e,n,i);SM("Data must be an object, but it was:",s,r);let a=n6(r,s),c,l;if(o.merge)c=new Cr(s.fieldMask),l=s.fieldTransforms;else if(o.mergeFields){let d=[];for(let h of o.mergeFields){let f=M0(e,h,n);if(!s.contains(f))throw new j(x.INVALID_ARGUMENT,`Field '${f}' is specified in your field mask but missing from your input data.`);i6(d,f)||d.push(f)}c=new Cr(d),l=s.fieldTransforms.filter(h=>c.covers(h.field))}else c=null,l=s.fieldTransforms;return new w0(new Fn(a),c,l)}var gv=class t extends em{_toFieldTransform(e){if(e.Ec!==2)throw e.Ec===1?e.wc(`${this._methodName}() can only appear at the top level of your update data`):e.wc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof t}};function Kae(t,e,n,r){let i=t.Dc(1,e,n);SM("Data must be an object, but it was:",i,r);let o=[],s=Fn.empty();Aa(r,(c,l)=>{let d=AM(e,c,n);l=Me(l);let h=i.gc(d);if(l instanceof gv)o.push(d);else{let f=um(l,h);f!=null&&(o.push(d),s.set(d,f))}});let a=new Cr(o);return new pv(s,a,i.fieldTransforms)}function Yae(t,e,n,r,i,o){let s=t.Dc(1,e,n),a=[M0(e,r,n)],c=[i];if(o.length%2!=0)throw new j(x.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f<o.length;f+=2)a.push(M0(e,o[f])),c.push(o[f+1]);let l=[],d=Fn.empty();for(let f=a.length-1;f>=0;--f)if(!i6(l,a[f])){let g=a[f],E=c[f];E=Me(E);let I=s.gc(g);if(E instanceof gv)l.push(g);else{let S=um(E,I);S!=null&&(l.push(g),d.set(g,S))}}let h=new Cr(l);return new pv(d,h,s.fieldTransforms)}function t6(t,e,n,r=!1){return um(n,t.Dc(r?4:3,e))}function um(t,e){if(r6(t=Me(t)))return SM("Unsupported field value:",e,t),n6(t,e);if(t instanceof em)return(function(r,i){if(!ZW(i.Ec))throw i.wc(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.wc(`${r._methodName}() is not currently supported inside arrays`);let o=r._toFieldTransform(i);o&&i.fieldTransforms.push(o)})(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.mc&&e.Ec!==4)throw e.wc("Nested arrays are not supported");return(function(r,i){let o=[],s=0;for(let a of r){let c=um(a,i.yc(s));c==null&&(c={nullValue:"NULL_VALUE"}),o.push(c),s++}return{arrayValue:{values:o}}})(t,e)}return(function(r,i){if((r=Me(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return Pse(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){let o=Tt.fromDate(r);return{timestampValue:hh(i.serializer,o)}}if(r instanceof Tt){let o=new Tt(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:hh(i.serializer,o)}}if(r instanceof da)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Xo)return{bytesValue:oW(i.serializer,r._byteString)};if(r instanceof en){let o=i.databaseId,s=r.firestore._databaseId;if(!s.isEqual(o))throw i.wc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${o.projectId}/${o.database}`);return{referenceValue:iM(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof ha)return(function(s,a){return{mapValue:{fields:{[J0]:{stringValue:Z0},[ah]:{arrayValue:{values:s.toArray().map(l=>{if(typeof l!="number")throw a.wc("VectorValues must only contain numeric values.");return rM(a.serializer,l)})}}}}}})(r,i);throw i.wc(`Unsupported field value: ${_v(r)}`)})(t,e)}function n6(t,e){let n={};return N3(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Aa(t,(r,i)=>{let o=um(i,e.Vc(r));o!=null&&(n[r]=o)}),{mapValue:{fields:n}}}function r6(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof Tt||t instanceof da||t instanceof Xo||t instanceof en||t instanceof em||t instanceof ha)}function SM(t,e,n){if(!r6(n)||!h3(n)){let r=_v(n);throw r==="an object"?e.wc(t+" a custom object"):e.wc(t+" "+r)}}function M0(t,e,n){if((e=Me(e))instanceof Th)return e._internalPath;if(typeof e=="string")return AM(t,e);throw mv("Field path arguments must be of type string or ",t,!1,void 0,n)}var Xae=new RegExp("[~\\*/\\[\\]]");function AM(t,e,n){if(e.search(Xae)>=0)throw mv(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Th(...e.split("."))._internalPath}catch{throw mv(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function mv(t,e,n,r,i){let o=r&&!r.isEmpty(),s=i!==void 0,a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(o||s)&&(c+=" (found",o&&(c+=` in field ${r}`),s&&(c+=` in document ${i}`),c+=")"),new j(x.INVALID_ARGUMENT,a+t+c)}function i6(t,e){return t.some(n=>n.isEqual(e))}var Pl=class{constructor(e,n,r,i,o){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new en(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){let e=new L0(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){let n=this._document.data.field(Mv("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}},L0=class extends Pl{data(){return super.data()}};function Mv(t,e){return typeof e=="string"?AM(t,e):e instanceof Th?e._internalPath:e._delegate._internalPath}function o6(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new j(x.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var tm=class{},yh=class extends tm{};function s6(t,e,...n){let r=[];e instanceof tm&&r.push(e),r=r.concat(n),(function(o){let s=o.filter(c=>c instanceof Ih).length,a=o.filter(c=>c instanceof nm).length;if(s>1||s>0&&a>0)throw new j(x.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(r);for(let i of r)t=i._apply(t);return t}var nm=class t extends yh{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new t(e,n,r)}_apply(e){let n=this._parse(e);return f6(e._query,n),new mi(e.firestore,e.converter,uO(e._query,n))}_parse(e){let n=Ov(e.firestore);return(function(o,s,a,c,l,d,h){let f;if(l.isKeyField()){if(d==="array-contains"||d==="array-contains-any")throw new j(x.INVALID_ARGUMENT,`Invalid Query. You can't perform '${d}' queries on documentId().`);if(d==="in"||d==="not-in"){c3(h,d);let E=[];for(let I of h)E.push(a3(c,o,I));f={arrayValue:{values:E}}}else f=a3(c,o,h)}else d!=="in"&&d!=="not-in"&&d!=="array-contains-any"||c3(h,d),f=t6(a,s,h,d==="in"||d==="not-in");return Le.create(l,d,f)})(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}};function a6(t,e,n){let r=e,i=Mv("where",t);return nm._create(i,r,n)}var Ih=class t extends tm{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new t(e,n)}_parse(e){let n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:Xe.create(n,this._getOperator())}_apply(e){let n=this._parse(e);return n.getFilters().length===0?e:((function(i,o){let s=i,a=o.getFlattenedFilters();for(let c of a)f6(s,c),s=uO(s,c)})(e._query,n),new mi(e.firestore,e.converter,uO(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}};function c6(...t){return t.forEach(e=>p6("or",e)),Ih._create("or",t)}function l6(...t){return t.forEach(e=>p6("and",e)),Ih._create("and",t)}var P0=class t extends yh{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new t(e,n)}_apply(e){let n=(function(i,o,s){if(i.startAt!==null)throw new j(x.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new j(x.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new Cl(o,s)})(e._query,this._field,this._direction);return new mi(e.firestore,e.converter,(function(i,o){let s=i.explicitOrderBy.concat([o]);return new ao(i.path,i.collectionGroup,s,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)})(e._query,n))}};function u6(t,e="asc"){let n=e,r=Mv("orderBy",t);return P0._create(r,n)}var x0=class t extends yh{constructor(e,n,r){super(),this.type=e,this._limit=n,this._limitType=r}static _create(e,n,r){return new t(e,n,r)}_apply(e){return new mi(e.firestore,e.converter,kI(e._query,this._limit,this._limitType))}};function d6(t){return Xoe("limit",t),x0._create("limit",t,"F")}var k0=class t extends yh{constructor(e,n,r){super(),this.type=e,this._docOrFields=n,this._inclusive=r}static _create(e,n,r){return new t(e,n,r)}_apply(e){let n=Qae(e,this.type,this._docOrFields,this._inclusive);return new mi(e.firestore,e.converter,(function(i,o){return new ao(i.path,i.collectionGroup,i.explicitOrderBy.slice(),i.filters.slice(),i.limit,i.limitType,o,i.endAt)})(e._query,n))}};function h6(...t){return k0._create("startAfter",t,!1)}function Qae(t,e,n,r){if(n[0]=Me(n[0]),n[0]instanceof Pl)return(function(o,s,a,c,l){if(!c)throw new j(x.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${a}().`);let d=[];for(let h of Yd(o))if(h.field.isKeyField())d.push(Al(s,c.key));else{let f=c.data.field(h.field);if(vv(f))throw new j(x.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+h.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(f===null){let g=h.field.canonicalString();throw new j(x.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${g}' (used as the orderBy) does not exist.`)}d.push(f)}return new so(d,l)})(t._query,t.firestore._databaseId,e,n[0]._document,r);{let i=Ov(t.firestore);return(function(s,a,c,l,d,h){let f=s.explicitOrderBy;if(d.length>f.length)throw new j(x.INVALID_ARGUMENT,`Too many arguments provided to ${l}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);let g=[];for(let E=0;E<d.length;E++){let I=d[E];if(f[E].field.isKeyField()){if(typeof I!="string")throw new j(x.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${l}(), but got a ${typeof I}`);if(!tM(s)&&I.indexOf("/")!==-1)throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${l}() must be a plain document ID, but '${I}' contains a slash.`);let S=s.path.child(ke.fromString(I));if(!Z.isDocumentKey(S))throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${l}() must result in a valid document path, but '${S}' is not because it contains an odd number of segments.`);let L=new Z(S);g.push(Al(a,L))}else{let S=t6(c,l,I);g.push(S)}}return new so(g,h)})(t._query,t.firestore._databaseId,i,e,n,r)}}function a3(t,e,n){if(typeof(n=Me(n))=="string"){if(n==="")throw new j(x.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!tM(e)&&n.indexOf("/")!==-1)throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);let r=e.path.child(ke.fromString(n));if(!Z.isDocumentKey(r))throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return Al(t,new Z(r))}if(n instanceof en)return Al(t,n._key);throw new j(x.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${_v(n)}.`)}function c3(t,e){if(!Array.isArray(t)||t.length===0)throw new j(x.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function f6(t,e){let n=(function(i,o){for(let s of i)for(let a of s.getFlattenedFilters())if(o.indexOf(a.op)>=0)return a.op;return null})(t.filters,(function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(n!==null)throw n===e.op?new j(x.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new j(x.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}function p6(t,e){if(!(e instanceof nm||e instanceof Ih))throw new j(x.INVALID_ARGUMENT,`Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}var Ev=class{convertValue(e,n="none"){switch(ga(e)){case 0:return null;case 1:return e.booleanValue;case 2:return _t(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(Zo(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw re(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){let r={};return Aa(e,(i,o)=>{r[i]=this.convertValue(o,n)}),r}convertVectorValue(e){var n,r,i;let o=(i=(r=(n=e.fields)===null||n===void 0?void 0:n[ah].arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.map(s=>_t(s.doubleValue));return new ha(o)}convertGeoPoint(e){return new da(_t(e.latitude),_t(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":let r=Sv(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(kg(e));default:return null}}convertTimestamp(e){let n=Jo(e);return new Tt(n.seconds,n.nanos)}convertDocumentKey(e,n){let r=ke.fromString(e);ae(pW(r),9688,{name:e});let i=new sh(r.get(1),r.get(3)),o=new Z(r.popFirst(5));return i.isEqual(n)||Mt(`Document ${o} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),o}};function g6(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}var F0=class extends Ev{constructor(e){super(),this.firestore=e}convertBytes(e){return new Xo(e)}convertReference(e){let n=this.convertDocumentKey(e,this.firestore._databaseId);return new en(this.firestore,null,n)}};function Jae(){return new R0("count")}var la=class{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}},fa=class t extends Pl{constructor(e,n,r,i,o,s){super(e,n,r,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let n=new Qd(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){let r=this._document.data.field(Mv("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new j(x.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e=this._document,n={};return n.type=t._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}};fa._jsonSchemaVersion="firestore/documentSnapshot/1.0",fa._jsonSchema={type:Bt("string",fa._jsonSchemaVersion),bundleSource:Bt("string","DocumentSnapshot"),bundleName:Bt("string"),bundle:Bt("string")};var Qd=class extends fa{data(e={}){return super.data(e)}},Sl=class t{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new la(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){let e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new Qd(this._firestore,this._userDataWriter,r.key,r,new la(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new j(x.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=(function(i,o){if(i._snapshot.oldDocs.isEmpty()){let s=0;return i._snapshot.docChanges.map(a=>{let c=new Qd(i._firestore,i._userDataWriter,a.doc.key,a.doc,new la(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:c,oldIndex:-1,newIndex:s++}})}{let s=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>o||a.type!==3).map(a=>{let c=new Qd(i._firestore,i._userDataWriter,a.doc.key,a.doc,new la(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter),l=-1,d=-1;return a.type!==0&&(l=s.indexOf(a.doc.key),s=s.delete(a.doc.key)),a.type!==1&&(s=s.add(a.doc),d=s.indexOf(a.doc.key)),{type:Zae(a.type),doc:c,oldIndex:l,newIndex:d}})}})(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new j(x.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e={};e.type=t._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=wg.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;let n=[],r=[],i=[];return this.docs.forEach(o=>{o._document!==null&&(n.push(o._document),r.push(this._userDataWriter.convertObjectMap(o._document.data.value.mapValue.fields,"previous")),i.push(o.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}};function Zae(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return re(61501,{type:t})}}function m6(t){t=or(t,en);let e=or(t.firestore,Ei);return Hae(Rh(e),t._key).then(n=>v6(e,t,n))}Sl._jsonSchemaVersion="firestore/querySnapshot/1.0",Sl._jsonSchema={type:Bt("string",Sl._jsonSchemaVersion),bundleSource:Bt("string","QuerySnapshot"),bundleName:Bt("string"),bundle:Bt("string")};var xl=class extends Ev{constructor(e){super(),this.firestore=e}convertBytes(e){return new Xo(e)}convertReference(e){let n=this.convertDocumentKey(e,this.firestore._databaseId);return new en(this.firestore,null,n)}};function E6(t){t=or(t,mi);let e=or(t.firestore,Ei),n=Rh(e),r=new xl(e);return o6(t._query),$ae(n,t._query).then(i=>new Sl(e,r,t,i))}function _6(t,e,n){t=or(t,en);let r=or(t.firestore,Ei),i=g6(t.converter,e,n);return I6(r,[e6(Ov(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,yn.none())])}function T6(t){return I6(or(t.firestore,Ei),[new wl(t._key,yn.none())])}function y6(t,...e){var n,r,i;t=Me(t);let o={includeMetadataChanges:!1,source:"default"},s=0;typeof e[s]!="object"||s3(e[s])||(o=e[s++]);let a={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(s3(e[s])){let h=e[s];e[s]=(n=h.next)===null||n===void 0?void 0:n.bind(h),e[s+1]=(r=h.error)===null||r===void 0?void 0:r.bind(h),e[s+2]=(i=h.complete)===null||i===void 0?void 0:i.bind(h)}let c,l,d;if(t instanceof en)l=or(t.firestore,Ei),d=am(t._key.path),c={next:h=>{e[s]&&e[s](v6(l,t,h))},error:e[s+1],complete:e[s+2]};else{let h=or(t,mi);l=or(h.firestore,Ei),d=h._query;let f=new xl(l);c={next:g=>{e[s]&&e[s](new Sl(l,f,h,g))},error:e[s+1],complete:e[s+2]},o6(t._query)}return(function(f,g,E,I){let S=new Zg(I),L=new Jg(g,S,E);return f.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return hM(yield dv(f),L)})),()=>{S.Ou(),f.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return fM(yield dv(f),L)}))}})(Rh(l),d,a,c)}function I6(t,e){return(function(r,i){let o=new ir;return r.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return Rae(yield jae(r),i,o)})),o.promise})(Rh(t),e)}function v6(t,e,n){let r=n.docs.get(e._key),i=new xl(t);return new fa(t,i,e._key,r,new la(n.hasPendingWrites,n.fromCache),e.converter)}function S6(t){return A6(t,{count:Jae()})}function A6(t,e){let n=or(t.firestore,Ei),r=Rh(n),i=Sse(e,(o,s)=>new pO(s,o.aggregateType,o._internalFieldPath));return Wae(r,t._query,i).then(o=>(function(a,c,l){let d=new xl(a);return new N0(c,d,l)})(n,t,o))}var U0=class{constructor(e){let n;this.kind="persistent",e?.tabManager?(e.tabManager._initialize(e),n=e.tabManager):(n=ece(void 0),n._initialize(e)),this._onlineComponentProvider=n._onlineComponentProvider,this._offlineComponentProvider=n._offlineComponentProvider}toJSON(){return{kind:this.kind}}};function CM(t){return new U0(t)}var V0=class{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=IM.provider,this._offlineComponentProvider={build:n=>new uv(n,e?.cacheSizeBytes,this.forceOwnership)}}},B0=class{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=IM.provider,this._offlineComponentProvider={build:n=>new S0(n,e?.cacheSizeBytes)}}};function ece(t){return new V0(t?.forceOwnership)}function DM(){return new B0}var tce={maxAttempts:5};function yg(t,e){if((t=Me(t)).firestore!==e)throw new j(x.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}var G0=class{constructor(e,n){this._firestore=e,this._transaction=n,this._dataReader=Ov(e)}get(e){let n=yg(e,this._firestore),r=new F0(this._firestore);return this._transaction.lookup([n._key]).then(i=>{if(!i||i.length!==1)return re(24041);let o=i[0];if(o.isFoundDocument())return new Pl(this._firestore,r,o.key,o,n.converter);if(o.isNoDocument())return new Pl(this._firestore,r,n._key,null,n.converter);throw re(18433,{doc:o})})}set(e,n,r){let i=yg(e,this._firestore),o=g6(i.converter,n,r),s=e6(this._dataReader,"Transaction.set",i._key,o,i.converter!==null,r);return this._transaction.set(i._key,s),this}update(e,n,r,...i){let o=yg(e,this._firestore),s;return s=typeof(n=Me(n))=="string"||n instanceof Th?Yae(this._dataReader,"Transaction.update",o._key,n,r,i):Kae(this._dataReader,"Transaction.update",o._key,n),this._transaction.update(o._key,s),this}delete(e){let n=yg(e,this._firestore);return this._transaction.delete(n._key),this}};var j0=class extends G0{constructor(e,n){super(e,n),this._firestore=e}get(e){let n=yg(e,this._firestore),r=new xl(this._firestore);return super.get(e).then(i=>new fa(this._firestore,r,n._key,i._document,new la(!1,!1),n.converter))}};function C6(t,e,n){t=or(t,Ei);let r=Object.assign(Object.assign({},tce),n);return(function(o){if(o.maxAttempts<1)throw new j(x.INVALID_ARGUMENT,"Max attempts must be at least 1")})(r),(function(o,s,a){let c=new ir;return o.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){let l=yield zW(o);new C0(o.asyncQueue,l,a,s,c).zu()})),c.promise})(Rh(t),i=>e(new j0(t,i)),r)}(function(e,n=!0){(function(i){vh=i})(Bs),$n(new Xt("firestore",(r,{instanceIdentifier:i,options:o})=>{let s=r.getProvider("app").getImmediate(),a=new Ei(new Ub(r.getProvider("auth-internal")),new Gb(s,r.getProvider("app-check-internal")),(function(l,d){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new j(x.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new sh(l.options.projectId,d)})(s,i),s);return o=Object.assign({useFetchStreams:n},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),Ge(qH,KH,e),Ge(qH,KH,"esm2017")})();var pUe=ue(l6,!0,2);var Lv=ue(XW,!0,2),D6=ue(QW,!0,2);var R6=ue(T6,!0,2);var dm=ue(JW,!0,2);var N6=ue(S6,!0),RM=ue(m6,!0);var w6=ue(E6,!0);var gUe=ue(d6,!0,2);var b6=ue(y6,!0);var mUe=ue(c6,!0,2),EUe=ue(u6,!0,2),O6=ue(s6,!0,2);var M6=ue(C6,!0),L6=ue(_6,!0,2);var _Ue=ue(h6,!0,2);var TUe=ue(a6,!0,2);var Pv=class{static getFirestoreProdDbName(e,n){return n?.databaseURL?.includes("snippyly-plugin.firebaseio.com")||n?.databaseURL?.includes("snippyly-plugin-staging.firebaseio.com")?"sfdb":n?.storeDbId??(this.isTestingDb(n?.databaseURL??"")?"sdktest":`apikey${e.toLowerCase()}`)}static isTestingDb(e){try{return e.includes("-test")}catch(n){return M.error("Error in isTestingDb:",n),!1}}};var P6=(()=>{let e=class e{constructor(r,i,o){this.configService=r,this.authService=i,this.loggingService=o,this.firestore$=new ie(null);try{Ka([this.authService.getFirebaseConfig$(),this.configService.getApiKey$(),this.configService.getFirestorePersistentCacheEnabled$()]).pipe(mn(([s,a])=>!!s&&!!a),En(1)).subscribe(([s,a,c])=>{if(s&&a&&s?.firebaseOptions?.storeDbId){try{let h=sessionStorage?.getItem("veltFirestoreLogLevel")||qt?.firebaseLogLevel||"silent";H0(h)}catch(h){this.loggingService.catch("Error in FirestoreService setLogLevel: ",h)}let l=Pv.getFirestoreProdDbName(a,s.firebaseOptions),d=this.configService.getProxyConfig();if(d?.v2DbHost){let h={host:d.v2DbHost,ssl:!0};d.forceLongPolling?h.experimentalForceLongPolling=!0:h.experimentalAutoDetectLongPolling=!0,c&&(h.localCache=CM({tabManager:DM()}));try{this.firestore$.next(bv(er(),h,l))}catch(f){this.loggingService.catch("Firestore proxy: initializeFirestore failed, falling back to existing instance. Proxy settings may not be applied: ",f),this.firestore$.next(Dh(l))}}else if(c)try{let h=er(),f=bv(h,{localCache:CM({tabManager:DM()})},l);this.firestore$.next(f)}catch{this.firestore$.next(Dh(l))}else this.firestore$.next(Dh(l))}},s=>{})}catch{}}getFirestore(){return this.firestore$.asObservable()}getFirestoreValue(){return this.firestore$.value}generateFirestoreDocumentId(){try{let r=this.getFirestoreValue()||Dh("DocumentIdDb");if(r){let i=Lv(r,"generateDocumentId");return dm(i).id}return}catch(r){this.loggingService.catch("Error in FirestoreService generateFirestoreDocumentId: ",r);return}}};e.\u0275fac=function(i){return new(i||e)($(Ji),$(Ed),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var xv=(()=>{let e=class e{constructor(r,i,o){this.authService=r,this.configService=i,this.loggingService=o,this.db$=new ie(null);try{this.authService.getFirebaseConfig$().subscribe(s=>{if(s){let a=this.configService.getProxyConfig(),c=s.firebaseOptions.databaseURL;a?.v1DbHost&&c&&(c=CV(c,a.v1DbHost),a?.forceLongPolling&&Eb());let l=Pd(void 0,c);a?.v1DbHost&&c&&this.lockDatabaseHost(l),this.db$.next(l)}},s=>{this.loggingService.catch("Error in DatabaseService constructor: ",s)})}catch(s){this.loggingService.catch("Error in DatabaseService constructor:",s)}}getDb(){return this.db$.asObservable()}getDbValue(){return this.db$.getValue()}lockDatabaseHost(r){try{let o=r?._repo?.repoInfo_;if(o){let s=o.host;Object.defineProperty(o,"host",{get:()=>s,set:()=>{},configurable:!0}),o.internalHost=s}}catch(i){this.loggingService.catch("Error in DatabaseService lockDatabaseHost: ",i)}}};e.\u0275fac=function(i){return new(i||e)($(Ed),$(Ji),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Nr={doc:dm,collection:Lv,collectionGroup:D6,query:O6,getDoc:RM,getDocs:w6,getCountFromServer:N6,setDoc:L6,deleteDoc:R6,onSnapshot:b6,runTransaction:M6},k6=(()=>{let e=class e{constructor(r,i,o){this.firestoreService=r,this.databaseService=i,this.loggingService=o}read(r){return y(this,null,function*(){if((r.store??"firestore")==="rtdb"){let a=this.databaseService.getDbValue();return a?{data:(yield hg(xd(a,r.location)))?.val()}:{data:void 0}}let o=this.firestoreService.getFirestoreValue();return o?{data:(yield RM(dm(o,r.location)))?.data()}:{data:void 0}})}runTransaction(r){return y(this,null,function*(){return r()})}firestoreDoc(r,i){return Nr.doc(r,i)}firestoreCollection(r,i){return Nr.collection(r,i)}firestoreCollectionGroup(r,i){return Nr.collectionGroup(r,i)}firestoreQuery(r,...i){return Nr.query(r,...i)}firestoreGetDoc(r){return Nr.getDoc(r)}firestoreGetDocs(r){return Nr.getDocs(r)}firestoreGetCountFromServer(r){return Nr.getCountFromServer(r)}firestoreSetDoc(r,i,o){return o?Nr.setDoc(r,i,o):Nr.setDoc(r,i)}firestoreDeleteDoc(r){return Nr.deleteDoc(r)}firestoreOnSnapshot(r,i,o){return o?Nr.onSnapshot(r,i,o):Nr.onSnapshot(r,i)}firestoreRunTransaction(r,i){return Nr.runTransaction(r,i)}addComment(r){return this.deferred("addComment")}editComment(r){return this.deferred("editComment")}addReaction(r){return this.deferred("addReaction")}editReaction(r){return this.deferred("editReaction")}deleteReaction(r){return this.deferred("deleteReaction")}recordDocumentView(r){return this.deferred("recordDocumentView")}getActivitiesForDocuments(r){return this.deferred("getActivitiesForDocuments")}getActivitiesForEntity(r){return this.deferred("getActivitiesForEntity")}deleteComment(r){return this.deferred("deleteComment")}setCommentResolved(r){return this.deferred("setCommentResolved")}setCommentMetadata(r){return this.deferred("setCommentMetadata")}bumpCommentViews(r){return this.deferred("bumpCommentViews")}markCommentThreadRead(r){return this.deferred("markCommentThreadRead")}markNotificationRead(r){return this.deferred("markNotificationRead")}addNotification(r){return this.deferred("addNotification")}deleteNotification(r){return this.deferred("deleteNotification")}updateNotification(r){return this.deferred("updateNotification")}updatePresence(r){return this.deferred("updatePresence")}grantAccess(r){return this.deferred("grantAccess")}revokeAccess(r){return this.deferred("revokeAccess")}getAccess(r){return this.deferred("getAccess")}upsertOrgUserProfile(r){return this.deferred("upsertOrgUserProfile")}upsertDocMetadata(r){return this.deferred("upsertDocMetadata")}upsertOrgMetadata(r){return this.deferred("upsertOrgMetadata")}createActivity(r){return this.deferred("createActivity")}saveCrdtVersion(r){return this.deferred("saveCrdtVersion")}getCrdtVersion(r){return this.deferred("getCrdtVersion")}listCrdtVersions(r){return this.deferred("listCrdtVersions")}getOrganizationUsers(r){return this.deferred("getOrganizationUsers")}setLocationMetadata(r){return this.deferred("setLocationMetadata")}fetchLocations(r){return this.deferred("fetchLocations")}createFolder(r){return this.deferred("createFolder")}setDocumentMetadata(r){return this.deferred("setDocumentMetadata")}getDocuments(r){return this.deferred("getDocuments")}fetchDocuments(r){return this.deferred("fetchDocuments")}fetchFolders(r){return this.deferred("fetchFolders")}fetchCommentAnnotations(r){return this.deferred("fetchCommentAnnotations")}getCommentAnnotationsCount(r){return this.deferred("getCommentAnnotationsCount")}markNotificationReadDoc(r){return this.deferred("markNotificationReadDoc")}getNotificationsForDocuments(r){return this.deferred("getNotificationsForDocuments")}getDocumentMetadataFromIds(r){return this.deferred("getDocumentMetadataFromIds")}getCrossOrgUserNotifications(r){return this.deferred("getCrossOrgUserNotifications")}deferred(r){return this.loggingService.warn(`[WB] FirebaseDbAdapter.${r} called but write-op wiring is deferred to Phase A (self-hosting Step 0). The SDK uses its existing direct write path in Step 0.`),Promise.resolve({ok:!1,code:"unimplemented",message:`FirebaseDbAdapter.${r} wiring deferred to Phase A`})}};e.\u0275fac=function(i){return new(i||e)($(P6),$(xv),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var rce={comment:{mode:"persistent",scope:"doc"},notification:{mode:"persistent",scope:"user"},notificationIndex:{mode:"persistent",scope:"user"},crdt:{mode:"persistent",scope:"doc"},presence:{mode:"ephemeral",scope:"doc"},crdtSyncPresence:{mode:"ephemeral",scope:"doc"},crdtPresence:{mode:"ephemeral",scope:"doc"},liveState:{mode:"ephemeral",scope:"doc"},cursor:{mode:"ephemeral",scope:"doc"},huddle:{mode:"ephemeral",scope:"doc"},syncVideoPlayer:{mode:"ephemeral",scope:"doc"},heartbeat:{mode:"ephemeral",scope:"org"},flockSession:{mode:"ephemeral",scope:"doc"},selection:{mode:"ephemeral",scope:"doc"},reaction:{mode:"persistent",scope:"doc"},lastActivityTimestamp:{mode:"persistent",scope:"org"},lastNotificationTimestamp:{mode:"persistent",scope:"org"},documentViews:{mode:"persistent",scope:"doc"}};function F6(t){return rce[t]}var Qe={getDatabase:Pd,ref:xd,query:BH,get:hg,set:HH,update:$H,remove:GH,push:VH,runTransaction:jH,onValue:vb,onChildAdded:xH,onChildChanged:kH,onChildRemoved:FH,off:PH,objectVal:MH,listVal:OH,stateChanges:LH,onDisconnect:UH},U6=(()=>{let e=class e{constructor(r,i){this.databaseService=r,this.loggingService=i}getServerTimeOffset(){return y(this,null,function*(){try{let r=this.databaseService.getDbValue();if(!r)return 0;let o=(yield hg(xd(r,e.SERVER_TIME_OFFSET_PATH)))?.val();return typeof o=="number"?o:0}catch(r){return this.loggingService.catch("Error in FirebaseRealtimeAdapter getServerTimeOffset: ",r),0}})}onServerTimeOffset(r){let i=null,o=null;try{o=this.databaseService.getDb().subscribe(s=>{if(s){let a=xd(s,e.SERVER_TIME_OFFSET_PATH);i=vb(a,c=>{try{r(c?.val())}catch(l){this.loggingService.catch("Error in FirebaseRealtimeAdapter onServerTimeOffset callback: ",l)}})}})}catch(s){this.loggingService.catch("Error in FirebaseRealtimeAdapter onServerTimeOffset: ",s)}return()=>{try{i&&(i(),i=null),o?.unsubscribe(),o=null}catch(s){this.loggingService.catch("Error tearing down FirebaseRealtimeAdapter onServerTimeOffset: ",s)}}}getChannelTag(r){return F6(r)}getDatabaseInstance(r){return r?Qe.getDatabase(void 0,r):Qe.getDatabase()}rtdbRef(r,i){return Qe.ref(r,i)}rtdbQueryRef(r,...i){return Qe.query(r,...i)}rtdbGet(r){return Qe.get(r)}rtdbSet(r,i,o){return this.getChannelTag(r),Qe.set(i,o)}rtdbUpdate(r,i,o){return this.getChannelTag(r),Qe.update(i,o)}rtdbRemove(r,i){return this.getChannelTag(r),Qe.remove(i)}rtdbPush(r,i,o){return this.getChannelTag(r),o===void 0?Qe.push(i):Qe.push(i,o)}rtdbRunTransaction(r,i,o){return this.getChannelTag(r),Qe.runTransaction(i,o)}rtdbOnValue(r,i,o,s,a){return this.getChannelTag(r),typeof s=="function"?a?Qe.onValue(i,o,s,a):Qe.onValue(i,o,s):s?Qe.onValue(i,o,s):Qe.onValue(i,o)}rtdbOnChildAdded(r,i,o,s){return this.getChannelTag(r),s?Qe.onChildAdded(i,o,s):Qe.onChildAdded(i,o)}rtdbOnChildChanged(r,i,o,s){return this.getChannelTag(r),s?Qe.onChildChanged(i,o,s):Qe.onChildChanged(i,o)}rtdbOnChildRemoved(r,i,o,s){return this.getChannelTag(r),s?Qe.onChildRemoved(i,o,s):Qe.onChildRemoved(i,o)}rtdbOff(r,i,o){Qe.off(r,i,o)}rtdbObjectVal$(r,i){return this.getChannelTag(r),Qe.objectVal(i)}rtdbListVal$(r,i){return this.getChannelTag(r),Qe.listVal(i)}rtdbStateChanges$(r,i){return this.getChannelTag(r),Qe.stateChanges(i)}rtdbOnDisconnectSet(r,i,o){return this.getChannelTag(r),Qe.onDisconnect(i).set(o)}rtdbOnDisconnectUpdate(r,i,o){return this.getChannelTag(r),Qe.onDisconnect(i).update(o)}rtdbOnDisconnectRemove(r,i){return this.getChannelTag(r),Qe.onDisconnect(i).remove()}rtdbOnDisconnectCancel(r,i){return this.getChannelTag(r),Qe.onDisconnect(i).cancel()}subscribe(r,i,o,s){return{unsubscribe:()=>{}}}publish(r,i,o){return y(this,null,function*(){return{ok:!1,code:"unimplemented",message:"RealtimeAdapter.publish wiring deferred to Phase A"}})}presence(r,i){return y(this,null,function*(){return{ok:!1,code:"unimplemented",message:"RealtimeAdapter.presence wiring deferred to Phase A"}})}onDisconnect(r,i){return y(this,null,function*(){return()=>{}})}};e.SERVER_TIME_OFFSET_PATH=".info/serverTimeOffset",e.\u0275fac=function(i){return new(i||e)($(xv),$(bt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Nh=null,NM=new Set;function V6(t){return NM.add(t),()=>NM.delete(t)}function YUe(t){return new Promise(e=>{let n=!1,r=null,i=()=>{if(!n){n=!0,clearTimeout(o);try{r?.()}catch{}e()}},o=setTimeout(i,t);r=V6(i),Nh&&i()})}function XUe(t){return tf(()=>{let e=!1;try{if(t.isPortableFeedActive())return lt(null)}catch(r){e=!0,t.onError("portable check",r)}let n=new fe(r=>V6(()=>{try{(e||t.isPortableFeedActive())&&r.next(null)}catch(i){e=!0,r.next(null),t.onError("registration re-check",i)}}));return gs(t.firebaseDb$().pipe(mn(r=>!!r)),n)})}function ice(t){let e=t?.message;return typeof e=="string"&&/^NG0205(?!\d)/.test(e)}function QUe(t){if(Nh=t??null,Nh)for(let e of Array.from(NM))try{e()}catch(n){M.catch("Error in portable adapter registration listener: ",n)}}var JUe=(()=>{let e=class e{constructor(r){this.injector=r}get configService(){return this._configService??=this.injector.get(Ji)}get authService(){return this._authService??=this.injector.get(Ed)}isPortableBackendActive(){return this.isPortableActive()}evaluatePortableGates(){try{return{chunkRegistered:!!Nh,flagOn:this.configService.getEnablePortableBackend()===!0,identifyRecorded:!!this.authService.getPortableBackend()}}catch(r){return ice(r)||M.catch("Error in AdapterSelectorService evaluatePortableGates: ",r),null}}isPortableActive(){let r=this.evaluatePortableGates();return!!r&&r.chunkRegistered&&r.flagOn&&r.identifyRecorded}isPortableBackendPending(){let r=this.evaluatePortableGates();return!!r&&!r.chunkRegistered&&r.flagOn&&r.identifyRecorded}isPortableSession(){let r=this.evaluatePortableGates();return!!r&&r.flagOn&&r.identifyRecorded}resolveDbAdapter(){return this.isPortableActive()?Nh.db:this.injector.get(k6)}resolveRealtimeAdapter(){return this.isPortableActive()?Nh.realtime:this.injector.get(U6)}};e.\u0275fac=function(i){return new(i||e)($(ze))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var nVe=new Set(YG);function rVe(t){try{let e=t?.reasonCode;return typeof e!="string"||!e.trim()?"":` [reason: ${e.trim()}]`}catch{return""}}export{B as a,Ee as b,X6 as c,oce as d,sce as e,ace as f,y as g,gt as h,fe as i,lS as j,Rt as k,ie as l,Xa as m,B4 as n,G4 as o,Wa as p,cr as q,lt as r,j4 as s,H4 as t,R4 as u,De as v,Ka as w,tf as x,$4 as y,wi as z,Q4 as A,To as B,I4 as C,gs as D,mn as E,u4 as F,oS as G,sS as H,T4 as I,Jm as J,En as K,cS as L,yo as M,Qh as N,Ya as O,Zm as P,dS as Q,v4 as R,hS as S,S4 as T,Qa as U,Mr as V,ps as W,A4 as X,eE as Y,C4 as Z,w4 as _,J as $,SE as aa,Q as ba,So as ca,z as da,$ as ea,Y as fa,Xn as ga,Nn as ha,bi as ia,gP as ja,mP as ka,RP as la,NP as ma,ze as na,on as oa,Hn as pa,lr as qa,ki as ra,Ec as sa,Lr as ta,wz as ua,zt as va,vC as wa,Kz as xa,Ns as ya,i_ as za,y_ as Aa,n8 as Ba,V8 as Ca,B8 as Da,G8 as Ea,$8 as Fa,W8 as Ga,c5 as Ha,Ro as Ia,Ae as Ja,m5 as Ka,oq as La,sq as Ma,Vi as Na,bf as Oa,bo as Pa,L_ as Qa,st as Ra,mq as Sa,ji as Ta,vc as Ua,r1 as Va,i9 as Wa,ws as Xa,Hi as Ya,Mf as Za,l1 as _a,p9 as $a,h1 as ab,f1 as bb,k_ as cb,bs as db,T1 as eb,y1 as fb,I9 as gb,S9 as hb,A9 as ib,C9 as jb,D9 as kb,R9 as lb,N9 as mb,I1 as nb,aD as ob,cD as pb,v1 as qb,lD as rb,uD as sb,S1 as tb,dD as ub,hD as vb,C1 as wb,P9 as xb,D1 as yb,N1 as zb,w1 as Ab,V9 as Bb,G9 as Cb,j9 as Db,$9 as Eb,W9 as Fb,z9 as Gb,q9 as Hb,K9 as Ib,Y9 as Jb,X9 as Kb,x1 as Lb,k1 as Mb,lK as Nb,dK as Ob,IK as Pb,W1 as Qb,fD as Rb,z1 as Sb,q1 as Tb,K1 as Ub,CK as Vb,Y1 as Wb,Q1 as Xb,DK as Yb,RK as Zb,NK as _b,wK as $b,PK as ac,xK as bc,kK as cc,FK as dc,UK as ec,VK as fc,BK as gc,GK as hc,jK as ic,HK as jc,$K as kc,WK as lc,qK as mc,YK as nc,XK as oc,QK as pc,JK as qc,ZK as rc,nY as sc,Uf as tc,Vf as uc,_D as vc,FSe as wc,USe as xc,VSe as yc,MY as zc,bD as Ac,BSe as Bc,GSe as Cc,jSe as Dc,$i as Ec,NF as Fc,ZY as Gc,WF as Hc,e7 as Ic,FD as Jc,t7 as Kc,n7 as Lc,r7 as Mc,i7 as Nc,s7 as Oc,c7 as Pc,u7 as Qc,UD as Rc,tT as Sc,nT as Tc,D7 as Uc,w7 as Vc,pU as Wc,Z7 as Xc,eX as Yc,XD as Zc,RU as _c,eR as $c,ld as ad,_r as bd,ks as cd,FT as dd,Fc as ed,Jn as fd,Me as gd,Xt as hd,$n as id,Xi as jd,Zn as kd,Bs as ld,er as md,Ge as nd,$J as od,aLe as pd,cLe as qd,lLe as rd,si as sd,Gs as td,Go as ud,ai as vd,ue as wd,ci as xd,jo as yd,RLe as zd,NLe as Ad,wLe as Bd,Hs as Cd,fee as Dd,gee as Ed,Nee as Fd,Hc as Gd,$c as Hd,dxe as Id,hxe as Jd,oFe as Kd,sFe as Ld,aFe as Md,cFe as Nd,lFe as Od,uFe as Pd,Ho as Qd,bxe as Rd,Oxe as Sd,Mxe as Td,bU as Ud,yX as Vd,np as Wd,qt as Xd,M as Yd,lDe as Zd,uDe as _d,dDe as $d,hDe as ae,fDe as be,pDe as ce,gDe as de,Wi as ee,mDe as fe,EDe as ge,_De as he,TDe as ie,rX as je,iX as ke,oX as le,sX as me,aX as ne,cX as oe,yDe as pe,lX as qe,QD as re,uX as se,Er as te,uT as ue,dX as ve,Zu as we,Mn as xe,hX as ye,dT as ze,fX as Ae,pX as Be,gX as Ce,IDe as De,vDe as Ee,SDe as Fe,mX as Ge,F as He,CU as Ie,oRe as Je,sRe as Ke,aRe as Le,cRe as Me,ed as Ne,hRe as Oe,fRe as Pe,pRe as Qe,Ur as Re,Et as Se,OU as Te,MU as Ue,HRe as Ve,$Re as We,LU as Xe,tR as Ye,PU as Ze,nR as _e,IT as $e,IX as af,vX as bf,SX as cf,AX as df,CX as ef,DX as ff,RX as gf,NX as hf,wX as if,bX as jf,OX as kf,MX as lf,UU as mf,VU as nf,BU as of,GU as pf,jU as qf,zi as rf,gNe as sf,vT as tf,HU as uf,$U as vf,WU as wf,zU as xf,qU as yf,KU as zf,YU as Af,XU as Bf,QU as Cf,JU as Df,ZU as Ef,eV as Ff,tV as Gf,QNe as Hf,JNe as If,nV as Jf,rR as Kf,rV as Lf,iV as Mf,sV as Nf,aV as Of,Owe as Pf,Mwe as Qf,LX as Rf,PX as Sf,kOe as Tf,ST as Uf,lR as Vf,Pc as Wf,CV as Xf,qOe as Yf,Mc as Zf,Vo as _f,KOe as $f,YOe as ag,RV as bg,XOe as cg,QOe as dg,JOe as eg,ZOe as fg,e0e as gg,t0e as hg,n0e as ig,NV as jg,wV as kg,r0e as lg,i0e as mg,kX as ng,o0e as og,s0e as pg,a0e as qg,c0e as rg,bV as sg,nd as tg,l0e as ug,OV as vg,LV as wg,fV as xg,pV as yg,FX as zg,UX as Ag,wT as Bg,sp as Cg,u0e as Dg,d0e as Eg,qi as Fg,h0e as Gg,rd as Hg,GX as Ig,f0e as Jg,gR as Kg,mV as Lg,jX as Mg,DT as Ng,p0e as Og,g0e as Pg,PV as Qg,xV as Rg,HX as Sg,Oc as Tg,$X as Ug,qX as Vg,m0e as Wg,KX as Xg,E0e as Yg,YX as Zg,XX as _g,QX as $g,JX as ah,xc as bh,_0e as ch,T0e as dh,y0e as eh,dR as fh,I0e as gh,eQ as hh,v0e as ih,S0e as jh,VV as kh,A0e as lh,C0e as mh,D0e as nh,R0e as oh,N0e as ph,w0e as qh,b0e as rh,AT as sh,O0e as th,M0e as uh,L0e as vh,mR as wh,P0e as xh,IV as yh,x0e as zh,k0e as Ah,F0e as Bh,U0e as Ch,V0e as Dh,B0e as Eh,G0e as Fh,j0e as Gh,H0e as Hh,$0e as Ih,W0e as Jh,z0e as Kh,q0e as Lh,K0e as Mh,Y0e as Nh,X0e as Oh,Q0e as Ph,J0e as Qh,Z0e as Rh,eMe as Sh,tMe as Th,nMe as Uh,iQ as Vh,rMe as Wh,iMe as Xh,oMe as Yh,vV as Zh,sMe as _h,aMe as $h,cp as ai,oQ as bi,cMe as ci,lMe as di,uMe as ei,dMe as fi,sQ as gi,hMe as hi,fMe as ii,zV as ji,_R as ki,od as li,pMe as mi,op as ni,gMe as oi,mMe as pi,EMe as qi,fR as ri,_Me as si,TMe as ti,yMe as ui,IMe as vi,AQ as wi,vMe as xi,SMe as yi,AMe as zi,SV as Ai,CMe as Bi,CQ as Ci,VQ as Di,BQ as Ei,St as Fi,pd as Gi,NDe as Hi,wDe as Ii,bDe as Ji,ODe as Ki,MDe as Li,LDe as Mi,PDe as Ni,xDe as Oi,kDe as Pi,FDe as Qi,UDe as Ri,VDe as Si,hT as Ti,BDe as Ui,GDe as Vi,jDe as Wi,fT as Xi,HDe as Yi,$De as Zi,WDe as _i,zDe as $i,qDe as aj,KDe as bj,YDe as cj,pT as dj,XDe as ej,QDe as fj,gT as gj,TU as hj,yU as ij,IU as jj,vU as kj,mT as lj,zs as mj,bt as nj,Ji as oj,zc as pj,tne as qj,Xxe as rj,ly as sj,mke as tj,Wn as uj,Eke as vj,YG as wj,Ske as xj,Ake as yj,Cke as zj,Dke as Aj,Rke as Bj,Nke as Cj,pUe as Dj,gUe as Ej,mUe as Fj,EUe as Gj,_Ue as Hj,TUe as Ij,Pv as Jj,P6 as Kj,xv as Lj,k6 as Mj,F6 as Nj,U6 as Oj,V6 as Pj,YUe as Qj,XUe as Rj,QUe as Sj,JUe as Tj,rVe as Uj,t2 as Vj,n2 as Wj,fy as Xj,Uke as Yj,Vke as Zj,C2 as _j,Ed as $j};
|