@veltdev/sdk-dev 6.0.45 → 6.0.48
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-LWTRRGHL.js → chunk-2JUCNJVT.js} +1 -1
- package/{chunk-6K62XPB3.js → chunk-3ZXDIHWH.js} +1 -1
- package/{chunk-6E6YYWQ4.js → chunk-4TJLDLXL.js} +1 -1
- package/{chunk-QT57U43N.js → chunk-4X4U6BCZ.js} +1 -1
- package/{chunk-N65XETWG.js → chunk-5BRGARUT.js} +1 -1
- package/{chunk-7KXS2DSG.js → chunk-5LVKB6WR.js} +1 -1
- package/{chunk-BB7YQNOZ.js → chunk-73NZOSQ7.js} +1 -1
- package/{chunk-3A34IHUM.js → chunk-75AXPP7W.js} +1 -1
- package/{chunk-U52DCY3D.js → chunk-7PJNDZBS.js} +1 -1
- package/{chunk-SP25RLYB.js → chunk-CA2ADXMI.js} +1 -1
- package/{chunk-I3POWLVT.js → chunk-DIJZXNYM.js} +1 -1
- package/{chunk-I4SBC3EE.js → chunk-DODWXAOU.js} +1 -1
- package/{chunk-ZOA2LIG4.js → chunk-DXHPEQ4G.js} +1 -1
- package/{chunk-CU4CNZ3O.js → chunk-ERR5JJQ6.js} +1 -1
- package/chunk-GMOKXYBV.js +1 -0
- package/chunk-IVILSRE6.js +174 -0
- package/{chunk-R3KBXENN.js → chunk-J4BNFYDJ.js} +1 -1
- package/{chunk-NZWI6NA5.js → chunk-JAY6MWIC.js} +1 -1
- package/{chunk-EFWZWZAR.js → chunk-JXGKDJNP.js} +1 -1
- package/{chunk-3SLQQKJ6.js → chunk-KQ2IQQ7I.js} +1 -1
- package/{chunk-ACPZ3R7G.js → chunk-KTYDD32V.js} +1 -1
- package/{chunk-VYRSFZO2.js → chunk-M73LQ5VH.js} +1 -1
- package/chunk-MZC3HS3Y.js +193 -0
- package/{chunk-LCF6FZ5S.js → chunk-N64P7BW5.js} +1 -1
- package/{chunk-XY7DGMPO.js → chunk-O4M4L56J.js} +1 -1
- package/{chunk-CQ6HOISZ.js → chunk-R76BH34P.js} +1 -1
- package/{chunk-4GZCXZSN.js → chunk-TYZHQEQS.js} +1 -1
- package/{chunk-QNEPYZBW.js → chunk-UC4FKE64.js} +1 -1
- package/{chunk-OXMSOSYV.js → chunk-UPOFOTYZ.js} +1 -1
- package/{chunk-BEMVY5TX.js → chunk-VXEM7LQL.js} +1 -1
- package/{chunk-36A7ZG4L.js → chunk-WAKKXWFR.js} +1 -1
- package/{chunk-XUBFTUBO.js → chunk-XWVAXYOL.js} +1 -1
- package/{chunk-D5QZV6VO.js → chunk-YI7Q4N2F.js} +1 -1
- package/chunk-ZAVZABAE.js +1 -0
- package/{chunk-QBZHSLQ3.js → chunk-ZIVW7HYM.js} +1 -1
- package/{chunk-E47OMTOM.js → chunk-ZIWWEHWC.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 +17 -17
- 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 +3 -3
- package/chunk-JV7MPTE5.js +0 -1
- package/chunk-QUMZPTVX.js +0 -174
- package/chunk-YKZV3FEU.js +0 -1
- package/chunk-ZMILEE6P.js +0 -193
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
var b4=Object.create;var Gm=Object.defineProperty,w4=Object.defineProperties,O4=Object.getOwnPropertyDescriptor,L4=Object.getOwnPropertyDescriptors,M4=Object.getOwnPropertyNames,Bm=Object.getOwnPropertySymbols,DM=Object.getPrototypeOf,IS=Object.prototype.hasOwnProperty,RM=Object.prototype.propertyIsEnumerable,P4=Reflect.get;var CM=(t,e,n)=>e in t?Gm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e)=>{for(var n in e||={})IS.call(e,n)&&CM(t,n,e[n]);if(Bm)for(var n of Bm(e))RM.call(e,n)&&CM(t,n,e[n]);return t},le=(t,e)=>w4(t,L4(e));var vS=(t,e)=>{var n={};for(var r in t)IS.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Bm)for(var r of Bm(t))e.indexOf(r)<0&&RM.call(t,r)&&(n[r]=t[r]);return n};var dle=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},hle=(t,e)=>{for(var n in e)Gm(t,n,{get:e[n],enumerable:!0})},x4=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of M4(e))!IS.call(t,i)&&i!==n&&Gm(t,i,{get:()=>e[i],enumerable:!(r=O4(e,i))||r.enumerable});return t};var fle=(t,e,n)=>(n=t!=null?b4(DM(t)):{},x4(e||!t||!t.__esModule?Gm(n,"default",{value:t,enumerable:!0}):n,t));var ec=(t,e,n)=>P4(DM(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 SS(t){return _e(t?.lift)}function Ee(t){return e=>{if(SS(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 vs(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 jm=vs(t=>function(n){t(this),this.message=n?`${n.length} errors occurred during unsubscription:
|
|
2
|
+
${n.map((r,i)=>`${i+1}) ${r.toString()}`).join(`
|
|
3
|
+
`)}`:"",this.name="UnsubscriptionError",this.errors=n});function tc(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 jm?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{NM(o)}catch(s){e=e??[],s instanceof jm?e=[...e,...s.errors]:e.push(s)}}if(e)throw new jm(e)}}add(e){var n;if(e&&e!==this)if(this.closed)NM(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)&&tc(n,e)}remove(e){let{_finalizers:n}=this;n&&tc(n,e),e instanceof t&&e._removeParent(this)}};gt.EMPTY=(()=>{let t=new gt;return t.closed=!0,t})();var AS=gt.EMPTY;function Hm(t){return t instanceof gt||t&&"closed"in t&&_e(t.remove)&&_e(t.add)&&_e(t.unsubscribe)}function NM(t){_e(t)?t():t.unsubscribe()}var Zr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var hu={setTimeout(t,e,...n){let{delegate:r}=hu;return r?.setTimeout?r.setTimeout(t,e,...n):setTimeout(t,e,...n)},clearTimeout(t){let{delegate:e}=hu;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function $m(t){hu.setTimeout(()=>{let{onUnhandledError:e}=Zr;if(e)e(t);else throw t})}function ei(){}var bM=CS("C",void 0,void 0);function wM(t){return CS("E",void 0,t)}function OM(t){return CS("N",t,void 0)}function CS(t,e,n){return{kind:t,value:e,error:n}}var nc=null;function fu(t){if(Zr.useDeprecatedSynchronousErrorHandling){let e=!nc;if(e&&(nc={errorThrown:!1,error:null}),t(),e){let{errorThrown:n,error:r}=nc;if(nc=null,n)throw r}}else t()}function LM(t){Zr.useDeprecatedSynchronousErrorHandling&&nc&&(nc.errorThrown=!0,nc.error=t)}var rc=class extends gt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Hm(e)&&e.add(this)):this.destination=U4}static create(e,n,r){return new ti(e,n,r)}next(e){this.isStopped?RS(OM(e),this):this._next(e)}error(e){this.isStopped?RS(wM(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?RS(bM,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()}}},k4=Function.prototype.bind;function DS(t,e){return k4.call(t,e)}var NS=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:n}=this;if(n.next)try{n.next(e)}catch(r){Wm(r)}}error(e){let{partialObserver:n}=this;if(n.error)try{n.error(e)}catch(r){Wm(r)}else Wm(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(n){Wm(n)}}},ti=class extends rc{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&&Zr.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&DS(e.next,o),error:e.error&&DS(e.error,o),complete:e.complete&&DS(e.complete,o)}):i=e}this.destination=new NS(i)}};function Wm(t){Zr.useDeprecatedSynchronousErrorHandling?LM(t):$m(t)}function F4(t){throw t}function RS(t,e){let{onStoppedNotification:n}=Zr;n&&hu.setTimeout(()=>n(t,e))}var U4={closed:!0,next:ei,error:F4,complete:ei};function pe(t,e,n,r,i){return new bS(t,e,n,r,i)}var bS=class extends rc{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 Tn(t,e){return Ee((n,r)=>{let i=0;n.subscribe(pe(r,o=>t.call(e,o,i++)&&r.next(o)))})}var pu=typeof Symbol=="function"&&Symbol.observable||"@@observable";function ni(t){return t}function MM(t){return t.length===0?ni:t.length===1?t[0]:function(n){return t.reduce((r,i)=>i(r),n)}}var he=(()=>{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=B4(n)?n:new ti(n,r,i);return fu(()=>{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=PM(r),new r((i,o)=>{let s=new ti({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)}[pu](){return this}pipe(...n){return MM(n)(this)}toPromise(n){return n=PM(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 PM(t){var e;return(e=t??Zr.Promise)!==null&&e!==void 0?e:Promise}function V4(t){return t&&_e(t.next)&&_e(t.error)&&_e(t.complete)}function B4(t){return t&&t instanceof rc||V4(t)&&Hm(t)}var ic=new he(t=>t.complete());function yn(t){return t<=0?()=>ic:Ee((e,n)=>{let r=0;e.subscribe(pe(n,i=>{++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function wS(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 kM(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 xM(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 oc(t){return this instanceof oc?(this.v=t,this):new oc(t)}function FM(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,R){o.push([g,I,S,R])>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 oc?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 UM(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 xM=="function"?xM(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 gu=t=>t&&typeof t.length=="number"&&typeof t!="function";function zm(t){return _e(t?.then)}function qm(t){return _e(t[pu])}function Km(t){return Symbol.asyncIterator&&_e(t?.[Symbol.asyncIterator])}function Ym(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 G4(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Xm=G4();function Qm(t){return _e(t?.[Xm])}function Jm(t){return FM(this,arguments,function*(){let n=t.getReader();try{for(;;){let{value:r,done:i}=yield oc(n.read());if(i)return yield oc(void 0);yield yield oc(r)}}finally{n.releaseLock()}})}function Zm(t){return _e(t?.getReader)}function Re(t){if(t instanceof he)return t;if(t!=null){if(qm(t))return j4(t);if(gu(t))return H4(t);if(zm(t))return $4(t);if(Km(t))return VM(t);if(Qm(t))return W4(t);if(Zm(t))return z4(t)}throw Ym(t)}function j4(t){return new he(e=>{let n=t[pu]();if(_e(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function H4(t){return new he(e=>{for(let n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function $4(t){return new he(e=>{t.then(n=>{e.closed||(e.next(n),e.complete())},n=>e.error(n)).then(null,$m)})}function W4(t){return new he(e=>{for(let n of t)if(e.next(n),e.closed)return;e.complete()})}function VM(t){return new he(e=>{q4(t,e).catch(n=>e.error(n))})}function z4(t){return VM(Jm(t))}function q4(t,e){var n,r,i,o;return kM(this,void 0,void 0,function*(){try{for(n=UM(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 BM(t){return Ee((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(pe(n,l=>{r=!0,i=l,o||Re(t(l)).subscribe(o=pe(n,a,c))},()=>{s=!0,(!r||!o||o.closed)&&n.complete()}))})}var eE=class extends gt{constructor(e,n){super()}schedule(e,n=0){return this}};var rf={setInterval(t,e,...n){let{delegate:r}=rf;return r?.setInterval?r.setInterval(t,e,...n):setInterval(t,e,...n)},clearInterval(t){let{delegate:e}=rf;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var Fi=class extends eE{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 rf.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&&rf.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,tc(r,this),e!=null&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,super.unsubscribe()}}};var sc={now(){return(sc.delegate||Date).now()},delegate:void 0};var mu=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)}};mu.now=sc.now;var Ui=class extends mu{constructor(e,n=mu.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 bn=new Ui(Fi),OS=bn;function tE(t){return t&&_e(t.schedule)}function nE(t){return t instanceof Date&&!isNaN(t)}function wo(t=0,e,n=OS){let r=-1;return e!=null&&(tE(e)?n=e:r=e),new he(i=>{let o=nE(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 K4(t,e=bn){return BM(()=>wo(t,e))}function LS(t){return t[t.length-1]}function rE(t){return _e(LS(t))?t.pop():void 0}function Vi(t){return tE(LS(t))?t.pop():void 0}function GM(t,e){return typeof LS(t)=="number"?t.pop():e}function wn(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 MS(t){return Ee((e,n)=>{let r=null,i=!1,o;r=e.subscribe(pe(n,void 0,void 0,s=>{o=Re(t(s,MS(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}var{isArray:Y4}=Array,{getPrototypeOf:X4,prototype:Q4,keys:J4}=Object;function iE(t){if(t.length===1){let e=t[0];if(Y4(e))return{args:e,keys:null};if(Z4(e)){let n=J4(e);return{args:n.map(r=>e[r]),keys:n}}}return{args:t,keys:null}}function Z4(t){return t&&typeof t=="object"&&X4(t)===Q4}function Ss(t,e=0){return Ee((n,r)=>{n.subscribe(pe(r,i=>wn(r,t,()=>r.next(i),e),()=>wn(r,t,()=>r.complete(),e),i=>wn(r,t,()=>r.error(i),e)))})}function As(t,e=0){return Ee((n,r)=>{r.add(t.schedule(()=>n.subscribe(r),e))})}function jM(t,e){return Re(t).pipe(As(e),Ss(e))}function HM(t,e){return Re(t).pipe(As(e),Ss(e))}function $M(t,e){return new he(n=>{let r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function WM(t,e){return new he(n=>{let r;return wn(n,e,()=>{r=t[Xm](),wn(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 oE(t,e){if(!t)throw new Error("Iterable cannot be null");return new he(n=>{wn(n,e,()=>{let r=t[Symbol.asyncIterator]();wn(n,e,()=>{r.next().then(i=>{i.done?n.complete():n.next(i.value)})},0,!0)})})}function zM(t,e){return oE(Jm(t),e)}function qM(t,e){if(t!=null){if(qm(t))return jM(t,e);if(gu(t))return $M(t,e);if(zm(t))return HM(t,e);if(Km(t))return oE(t,e);if(Qm(t))return WM(t,e);if(Zm(t))return zM(t,e)}throw Ym(t)}function hr(t,e){return e?qM(t,e):Re(t)}function Ce(t,e){return Ee((n,r)=>{let i=0;n.subscribe(pe(r,o=>{r.next(t.call(e,o,i++))}))})}var{isArray:ez}=Array;function tz(t,e){return ez(e)?t(...e):t(e)}function Eu(t){return Ce(e=>tz(t,e))}function sE(t,e){return t.reduce((n,r,i)=>(n[r]=e[i],n),{})}function ac(...t){let e=Vi(t),n=rE(t),{args:r,keys:i}=iE(t);if(r.length===0)return hr([],e);let o=new he(nz(r,e,i?s=>sE(i,s):ni));return n?o.pipe(Eu(n)):o}function nz(t,e,n=ni){return r=>{KM(e,()=>{let{length:i}=t,o=new Array(i),s=i,a=i;for(let c=0;c<i;c++)KM(e,()=>{let l=hr(t[c],e),d=!1;l.subscribe(pe(r,h=>{o[c]=h,d||(d=!0,a--),a||r.next(n(o.slice()))},()=>{--s||r.complete()}))},r)},r)}}function KM(t,e,n){t?wn(n,t,e):e()}function YM(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;Re(n(I,d++)).subscribe(pe(e,R=>{i?.(R),o?g(R):e.next(R)},()=>{S=!0},void 0,()=>{if(S)try{for(l--;c.length&&l<r;){let R=c.shift();s?wn(e,s,()=>E(R)):E(R)}f()}catch(R){e.error(R)}}))};return t.subscribe(pe(e,g,()=>{h=!0,f()})),()=>{a?.()}}function Bi(t,e,n=1/0){return _e(e)?Bi((r,i)=>Ce((o,s)=>e(r,o,i,s))(Re(t(r,i))),n):(typeof e=="number"&&(n=e),Ee((r,i)=>YM(r,i,t,n)))}function XM(t,e,n,r,i){return(o,s)=>{let a=n,c=e,l=0;o.subscribe(pe(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 aE(t=1/0){return Bi(ni,t)}function QM(){return aE(1)}function PS(t,e){return _e(e)?Bi(t,e,1):Bi(t,1)}var JM=vs(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Ue=(()=>{class t extends he{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){let r=new cE(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new JM}next(n){fu(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(n)}})}error(n){fu(()=>{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(){fu(()=>{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?AS:(this.currentObservers=null,o.push(n),new gt(()=>{this.currentObservers=null,tc(o,n)}))}_checkFinalizedStatuses(n){let{hasError:r,thrownError:i,isStopped:o}=this;r?n.error(i):o&&n.complete()}asObservable(){let n=new he;return n.source=this,n}}return t.create=(e,n)=>new cE(e,n),t})(),cE=class extends Ue{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:AS}};function rz(t){return Ee((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(pe(n,a=>{o?.unsubscribe(),r=!0,i=a,o=pe(n,s,ei),Re(t(a)).subscribe(o)},()=>{s(),n.complete()},void 0,()=>{i=o=null}))})}function lE(t,e=bn){return Ee((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(pe(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 Cs(...t){return QM()(hr(t,Vi(t)))}function ZM(){return Ee((t,e)=>{t.subscribe(pe(e,ei))})}function eP(t){return Ce(()=>t)}function xS(t,e){return e?n=>Cs(e.pipe(yn(1),ZM()),n.pipe(xS(t))):Bi((n,r)=>Re(t(n,r)).pipe(yn(1),eP(n)))}function kS(t,e=bn){let n=wo(t,e);return xS(()=>n)}function it(...t){let e=Vi(t);return hr(t,e)}function ri(t,e=ni){return t=t??iz,Ee((n,r)=>{let i,o=!0;n.subscribe(pe(r,s=>{let a=e(s);(o||!t(i,a))&&(o=!1,i=a,r.next(s))}))})}function iz(t,e){return t===e}var tP=vs(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function of(t){return Ee((e,n)=>{try{e.subscribe(n)}finally{n.add(t)}})}function nP(){return Ee((t,e)=>{let n=null;t._refCount++;let r=pe(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 FS=class extends he{constructor(e,n){super(),this.source=e,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,SS(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(pe(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 nP()(this)}};function cc(){return Ee((t,e)=>{let n,r=!1;t.subscribe(pe(e,i=>{let o=n;n=i,r&&e.next([o,i]),r=!0}))})}var de=class extends Ue{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 lc=class extends Ue{constructor(e=1/0,n=1/0,r=sc){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 oz(t=0,e=bn){return t<0&&(t=0),wo(t,t,e)}function uE(t,e){return Ee(XM(t,e,arguments.length>=2,!0))}function VS(t={}){let{connector:e=()=>new Ue,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 Ee((I,S)=>{l++,!h&&!d&&f();let R=c=c??e();S.add(()=>{l--,l===0&&!h&&!d&&(a=US(E,i))}),R.subscribe(S),!s&&l>0&&(s=new ti({next:U=>R.next(U),error:U=>{h=!0,f(),a=US(g,n,U),R.error(U)},complete:()=>{d=!0,f(),a=US(g,r),R.complete()}}),Re(I).subscribe(s))})(o)}}function US(t,e,...n){if(e===!0){t();return}if(e===!1)return;let r=new ti({next:()=>{r.unsubscribe(),t()}});return Re(e(...n)).subscribe(r)}function sz(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,VS({connector:()=>new lc(r,e,n),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function dE(t){return Tn((e,n)=>t<=n)}function az(t){return Ee((e,n)=>{let r=!1,i=pe(n,()=>{i?.unsubscribe(),r=!0},ei);Re(t).subscribe(i),e.subscribe(pe(n,o=>r&&n.next(o)))})}function cn(...t){let e=Vi(t);return Ee((n,r)=>{(e?Cs(t,n,e):Cs(t,n)).subscribe(r)})}function er(t,e){return Ee((n,r)=>{let i=null,o=0,s=!1,a=()=>s&&!i&&r.complete();n.subscribe(pe(r,c=>{i?.unsubscribe();let l=0,d=o++;Re(t(c,d)).subscribe(i=pe(r,h=>r.next(e?e(c,h,d,l++):h),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function Ds(t){return Ee((e,n)=>{Re(t).subscribe(pe(n,()=>n.complete(),ei)),!n.closed&&e.subscribe(n)})}function cz(t,e=!1){return Ee((n,r)=>{let i=0;n.subscribe(pe(r,o=>{let s=t(o,i++);(s||e)&&r.next(o),!s&&r.complete()}))})}function hE(t,e,n){let r=_e(t)||e||n?{next:t,error:e,complete:n}:t;return r?Ee((i,o)=>{var s;(s=r.subscribe)===null||s===void 0||s.call(r);let a=!0;i.subscribe(pe(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)}))}):ni}function rP(t,e){return Ee((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=Re(t(E)).subscribe(pe(r,d,h)),g=()=>{if(s){s=!1;let E=a;a=null,r.next(E),!l&&f(E)}};n.subscribe(pe(r,E=>{s=!0,a=E,!(c&&!c.closed)&&(i?g():f(E))},()=>{l=!0,!(o&&s&&c&&!c.closed)&&r.complete()}))})}function lz(t,e=bn,n){let r=wo(t,e);return rP(()=>r,n)}var uz=vs(t=>function(n=null){t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=n});function dz(t,e){let{first:n,each:r,with:i=hz,scheduler:o=e??bn,meta:s=null}=nE(t)?{first:t}:typeof t=="number"?{each:t}:t;if(n==null&&r==null)throw new TypeError("No timeout provided.");return Ee((a,c)=>{let l,d,h=null,f=0,g=E=>{d=wn(c,o,()=>{try{l.unsubscribe(),Re(i({meta:s,lastValue:h,seen:f})).subscribe(c)}catch(I){c.error(I)}},E)};l=a.subscribe(pe(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 hz(t){throw new uz(t)}function fz(t=sc){return Ce(e=>({value:e,timestamp:t.now()}))}var BS;function fE(){return BS}function Gi(t){let e=BS;return BS=t,e}var iP=Symbol("NotFound");function _u(t){return t===iP||t?.name==="\u0275NotFound"}var On=null,pE=!1,GS=1,pz=null,ln=Symbol("SIGNAL");function Te(t){let e=On;return On=t,e}function _E(){return On}var uc={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 Tu(t){if(pE)throw new Error("");if(On===null)return;On.consumerOnSignalRead(t);let e=On.producersTail;if(e!==void 0&&e.producer===t)return;let n,r=On.recomputing;if(r&&(n=e!==void 0?e.nextProducer:On.producers,n!==void 0&&n.producer===t)){On.producersTail=n,n.lastReadVersion=t.version;return}let i=t.consumersTail;if(i!==void 0&&i.consumer===On&&(!r||mz(i,On)))return;let o=vu(On),s={producer:t,consumer:On,nextProducer:n,prevConsumer:i,lastReadVersion:t.version,nextConsumer:void 0};On.producersTail=s,e!==void 0?e.nextProducer=s:On.producers=s,o&&cP(t,s)}function oP(){GS++}function TE(t){if(!(vu(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===GS)){if(!t.producerMustRecompute(t)&&!Iu(t)){EE(t);return}t.producerRecomputeValue(t),EE(t)}}function jS(t){if(t.consumers===void 0)return;let e=pE;pE=!0;try{for(let n=t.consumers;n!==void 0;n=n.nextConsumer){let r=n.consumer;r.dirty||gz(r)}}finally{pE=e}}function HS(){return On?.consumerAllowSignalWrites!==!1}function gz(t){t.dirty=!0,jS(t),t.consumerMarkedDirty?.(t)}function EE(t){t.dirty=!1,t.lastCleanEpoch=GS}function dc(t){return t&&sP(t),Te(t)}function sP(t){t.producersTail=void 0,t.recomputing=!0}function yu(t,e){Te(e),t&&aP(t)}function aP(t){t.recomputing=!1;let e=t.producersTail,n=e!==void 0?e.nextProducer:t.producers;if(n!==void 0){if(vu(t))do n=$S(n);while(n!==void 0);e!==void 0?e.nextProducer=void 0:t.producers=void 0}}function Iu(t){for(let e=t.producers;e!==void 0;e=e.nextProducer){let n=e.producer,r=e.lastReadVersion;if(r!==n.version||(TE(n),r!==n.version))return!0}return!1}function hc(t){if(vu(t)){let e=t.producers;for(;e!==void 0;)e=$S(e)}t.producers=void 0,t.producersTail=void 0,t.consumers=void 0,t.consumersTail=void 0}function cP(t,e){let n=t.consumersTail,r=vu(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)cP(i.producer,i)}function $S(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,!vu(e)){let o=e.producers;for(;o!==void 0;)o=$S(o)}return n}function vu(t){return t.consumerIsAlwaysLive||t.consumers!==void 0}function yE(t){pz?.(t)}function mz(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 IE(t,e){return Object.is(t,e)}function af(t,e){let n=Object.create(Ez);n.computation=t,e!==void 0&&(n.equal=e);let r=()=>{if(TE(n),Tu(n),n.value===sf)throw n.error;return n.value};return r[ln]=n,yE(n),r}var gE=Symbol("UNSET"),mE=Symbol("COMPUTING"),sf=Symbol("ERRORED"),Ez=le(V({},uc),{value:gE,dirty:!0,error:null,equal:IE,kind:"computed",producerMustRecompute(t){return t.value===gE||t.value===mE},producerRecomputeValue(t){if(t.value===mE)throw new Error("");let e=t.value;t.value=mE;let n=dc(t),r,i=!1;try{r=t.computation(),Te(null),i=e!==gE&&e!==sf&&r!==sf&&t.equal(e,r)}catch(o){r=sf,t.error=o}finally{yu(t,n)}if(i){t.value=e;return}t.value=r,t.version++}});function _z(){throw new Error}var lP=_z;function uP(t){lP(t)}function WS(t){lP=t}var Tz=null;function zS(t,e){let n=Object.create(vE);n.value=t,e!==void 0&&(n.equal=e);let r=()=>dP(n);return r[ln]=n,yE(n),[r,s=>Su(n,s),s=>qS(n,s)]}function dP(t){return Tu(t),t.value}function Su(t,e){HS()||uP(t),t.equal(t.value,e)||(t.value=e,yz(t))}function qS(t,e){HS()||uP(t),Su(t,e(t.value))}var vE=le(V({},uc),{equal:IE,value:void 0,kind:"signal"});function yz(t){t.version++,oP(),jS(t),Tz?.(t)}var Au={schedule(t){let e=requestAnimationFrame,n=cancelAnimationFrame,{delegate:r}=Au;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}=Au;return(e?.requestAnimationFrame||requestAnimationFrame)(...t)},cancelAnimationFrame(...t){let{delegate:e}=Au;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...t)},delegate:void 0};var Iz=1,KS,YS={};function hP(t){return t in YS?(delete YS[t],!0):!1}var fP={setImmediate(t){let e=Iz++;return YS[e]=!0,KS||(KS=Promise.resolve()),KS.then(()=>hP(e)&&t()),e},clearImmediate(t){hP(t)}};var{setImmediate:vz,clearImmediate:Sz}=fP,cf={setImmediate(...t){let{delegate:e}=cf;return(e?.setImmediate||vz)(...t)},clearImmediate(t){let{delegate:e}=cf;return(e?.clearImmediate||Sz)(t)},delegate:void 0};var SE=class extends Fi{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=cf.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&&(cf.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))}};var AE=class extends Ui{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 Az=new AE(SE);var CE=class extends Fi{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 DE=class extends Ui{};var XS=new DE(CE);var RE=class extends Fi{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=Au.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&&(Au.cancelAnimationFrame(n),e._scheduled=void 0)}};var NE=class extends Ui{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 Cz=new NE(RE);function Dz(t){return!!t&&(t instanceof he||_e(t.lift)&&_e(t.subscribe))}function Rz(t,e){let n=typeof e=="object";return new Promise((r,i)=>{let o=new ti({next:s=>{r(s),o.unsubscribe()},error:i,complete:()=>{n?r(e.defaultValue):i(new tP)}});t.subscribe(o)})}function lf(t){return new he(e=>{Re(t()).subscribe(e)})}function Nz(...t){let e=rE(t),{args:n,keys:r}=iE(t),i=new he(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;Re(n[d]).subscribe(pe(o,f=>{h||(h=!0,l--),a[d]=f},()=>c--,void 0,()=>{(!c||!h)&&(l||o.next(r?sE(r,a):a),o.complete())}))}});return e?i.pipe(Eu(e)):i}var bz=["addListener","removeListener"],wz=["addEventListener","removeEventListener"],Oz=["on","off"];function ji(t,e,n,r){if(_e(n)&&(r=n,n=void 0),r)return ji(t,e,n).pipe(Eu(r));let[i,o]=Pz(t)?wz.map(s=>a=>t[s](e,a,n)):Lz(t)?bz.map(pP(t,e)):Mz(t)?Oz.map(pP(t,e)):[];if(!i&&gu(t))return Bi(s=>ji(s,e,n))(Re(t));if(!i)throw new TypeError("Invalid event target");return new he(s=>{let a=(...c)=>s.next(1<c.length?c:c[0]);return i(a),()=>o(a)})}function pP(t,e){return n=>r=>t[n](e,r)}function Lz(t){return _e(t.addListener)&&_e(t.removeListener)}function Mz(t){return _e(t.on)&&_e(t.off)}function Pz(t){return _e(t.addEventListener)&&_e(t.removeEventListener)}function xz(t,e,n){return lf(()=>t()?e:n)}function Rs(...t){let e=Vi(t),n=GM(t,1/0),r=t;return r.length?r.length===1?Re(r[0]):aE(n)(hr(r,e)):ic}function gP(t){let e=Te(null);try{return t()}finally{Te(e)}}var mP=le(V({},uc),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"});function EP(t){if(t.dirty=!1,t.version>0&&!Iu(t))return;t.version++;let e=dc(t);try{t.cleanup(),t.fn()}finally{yu(t,e)}}var pc=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(".")}},cA=new pc("20.3.35");var ME="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",ee=class extends Error{code;constructor(e,n){super(Os(e,n)),this.code=e}};function kz(t){return`NG0${Math.abs(t)}`}function Os(t,e){return`${kz(t)}${e?": "+e:""}`}var Mt=globalThis;function ze(t){for(let e in t)if(t[e]===ze)return e;throw Error("")}function yP(t,e){for(let n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function Lo(t){if(typeof t=="string")return t;if(Array.isArray(t))return`[${t.map(Lo).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 PE(t,e){return t?e?`${t} ${e}`:t:e||""}var Fz=ze({__forward_ref__:ze});function xE(t){return t.__forward_ref__=xE,t.toString=function(){return Lo(this())},t}function $t(t){return lA(t)?t():t}function lA(t){return typeof t=="function"&&t.hasOwnProperty(Fz)&&t.__forward_ref__===xE}function J(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function Mo(t){return{providers:t.providers||[],imports:t.imports||[]}}function kE(t){return Uz(t,FE)}function Uz(t,e){return t.hasOwnProperty(e)&&t[e]||null}function Vz(t){let e=t?.[FE]??null;return e||null}function JS(t){return t&&t.hasOwnProperty(OE)?t[OE]:null}var FE=ze({\u0275prov:ze}),OE=ze({\u0275inj:ze}),K=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=J({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function uA(t){return t&&!!t.\u0275providers}var dA=ze({\u0275cmp:ze}),hA=ze({\u0275dir:ze}),fA=ze({\u0275pipe:ze}),pA=ze({\u0275mod:ze}),df=ze({\u0275fac:ze}),_c=ze({__NG_ELEMENT_ID__:ze}),_P=ze({__NG_ENV_ID__:ze});function pr(t){return typeof t=="string"?t:t==null?"":String(t)}function IP(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():pr(t)}var vP=ze({ngErrorCode:ze}),Bz=ze({ngErrorMessage:ze}),Gz=ze({ngTokenPath:ze});function gA(t,e){return SP("",-200,e)}function UE(t,e){throw new ee(-201,!1)}function SP(t,e,n){let r=new ee(e,t);return r[vP]=e,r[Bz]=t,n&&(r[Gz]=n),r}function jz(t){return t[vP]}var ZS;function AP(){return ZS}function $n(t){let e=ZS;return ZS=t,e}function mA(t,e,n){let r=kE(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;UE(t,"Injector")}var Hz={},fc=Hz,eA="__NG_DI_FLAG__",tA=class{injector;constructor(e){this.injector=e}retrieve(e,n){let r=gc(n)||0;try{return this.injector.get(e,r&8?null:fc,r)}catch(i){if(_u(i))return i;throw i}}};function $z(t,e=0){let n=fE();if(n===void 0)throw new ee(-203,!1);if(n===null)return mA(t,void 0,e);{let r=Wz(e),i=n.retrieve(t,r);if(_u(i)){if(r.optional)return null;throw i}return i}}function q(t,e=0){return(AP()||$z)($t(t),e)}function Y(t,e){return q(t,gc(e))}function gc(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function Wz(t){return{optional:!!(t&8),host:!!(t&1),self:!!(t&2),skipSelf:!!(t&4)}}function nA(t){let e=[];for(let n=0;n<t.length;n++){let r=$t(t[n]);if(Array.isArray(r)){if(r.length===0)throw new ee(900,!1);let i,o=0;for(let s=0;s<r.length;s++){let a=r[s],c=zz(a);typeof c=="number"?c===-1?i=a.token:o|=c:i=a}e.push(q(i,o))}else e.push(q(r))}return e}function EA(t,e){return t[eA]=e,t.prototype[eA]=e,t}function zz(t){return t[eA]}function bs(t,e){let n=t.hasOwnProperty(df);return n?t[df]:null}function CP(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 DP(t){return t.flat(Number.POSITIVE_INFINITY)}function VE(t,e){t.forEach(n=>Array.isArray(n)?VE(n,e):e(n))}function _A(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function gf(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function RP(t,e){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function NP(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 mf(t,e,n){let r=Du(t,e);return r>=0?t[r|1]=n:(r=~r,NP(t,r,e,n)),r}function BE(t,e){let n=Du(t,e);if(n>=0)return t[n|1]}function Du(t,e){return qz(t,e,1)}function qz(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 ii={},Ln=[],Ls=new K(""),TA=new K("",-1),yA=new K(""),hf=class{get(e,n=fc){if(n===fc){let i=SP("",-201);throw i.name="\u0275NotFound",i}return n}};function bP(t){return t[pA]||null}function Ms(t){return t[dA]||null}function GE(t){return t[hA]||null}function IA(t){return t[fA]||null}function tr(t){return{\u0275providers:t}}function wP(...t){return{\u0275providers:vA(!0,t),\u0275fromNgModule:!0}}function vA(t,...e){let n=[],r=new Set,i,o=s=>{n.push(s)};return VE(e,s=>{let a=s;LE(a,o,[],r)&&(i||=[],i.push(a))}),i!==void 0&&OP(i,o),n}function OP(t,e){for(let n=0;n<t.length;n++){let{ngModule:r,providers:i}=t[n];SA(i,o=>{e(o,r)})}}function LE(t,e,n,r){if(t=$t(t),!t)return!1;let i=null,o=JS(t),s=!o&&Ms(t);if(!o&&!s){let c=t.ngModule;if(o=JS(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)LE(l,e,n,r)}}else if(o){if(o.imports!=null&&!a){r.add(i);let l;VE(o.imports,d=>{LE(d,e,n,r)&&(l||=[],l.push(d))}),l!==void 0&&OP(l,e)}if(!a){let l=bs(i)||(()=>new i);e({provide:i,useFactory:l,deps:Ln},i),e({provide:yA,useValue:i,multi:!0},i),e({provide:Ls,useValue:()=>q(i),multi:!0},i)}let c=o.providers;if(c!=null&&!a){let l=t;SA(c,d=>{e(d,l)})}}else return!1;return i!==t&&t.providers!==void 0}function SA(t,e){for(let n of t)uA(n)&&(n=n.\u0275providers),Array.isArray(n)?SA(n,e):e(n)}var Kz=ze({provide:String,useValue:ze});function LP(t){return t!==null&&typeof t=="object"&&Kz in t}function Yz(t){return!!(t&&t.useExisting)}function Xz(t){return!!(t&&t.useFactory)}function mc(t){return typeof t=="function"}function MP(t){return!!t.useClass}var Ef=new K(""),bE={},TP={},QS;function Ru(){return QS===void 0&&(QS=new hf),QS}var Mn=class{},Ec=class extends Mn{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,iA(e,s=>this.processProvider(s)),this.records.set(TA,Cu(void 0,this)),i.has("environment")&&this.records.set(Mn,Cu(void 0,this));let o=this.records.get(Ef);o!=null&&typeof o.value=="string"&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(yA,Ln,{self:!0}))}retrieve(e,n){let r=gc(n)||0;try{return this.get(e,fc,r)}catch(i){if(_u(i))return i;throw i}}destroy(){uf(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 uf(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){uf(this);let n=Gi(this),r=$n(void 0),i;try{return e()}finally{Gi(n),$n(r)}}get(e,n=fc,r){if(uf(this),e.hasOwnProperty(_P))return e[_P](this);let i=gc(r),o,s=Gi(this),a=$n(void 0);try{if(!(i&4)){let l=this.records.get(e);if(l===void 0){let d=t8(e)&&kE(e);d&&this.injectableDefInScope(d)?l=Cu(rA(e),bE):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,i)}let c=i&2?Ru():this.parent;return n=i&8&&n===fc?null:n,c.get(e,n)}catch(c){let l=jz(c);throw l===-200||l===-201?new ee(l,null):c}finally{$n(a),Gi(s)}}resolveInjectorInitializers(){let e=Te(null),n=Gi(this),r=$n(void 0),i;try{let o=this.get(Ls,Ln,{self:!0});for(let s of o)s()}finally{Gi(n),$n(r),Te(e)}}toString(){let e=[],n=this.records;for(let r of n.keys())e.push(Lo(r));return`R3Injector[${e.join(", ")}]`}processProvider(e){e=$t(e);let n=mc(e)?e:$t(e&&e.provide),r=Jz(e);if(!mc(e)&&e.multi===!0){let i=this.records.get(n);i||(i=Cu(void 0,bE,!0),i.factory=()=>nA(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===TP)throw gA(Lo(e));return n.value===bE&&(n.value=TP,n.value=n.factory(void 0,r)),typeof n.value=="object"&&n.value&&e8(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{Te(i)}}injectableDefInScope(e){if(!e.providedIn)return!1;let n=$t(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 rA(t){let e=kE(t),n=e!==null?e.factory:bs(t);if(n!==null)return n;if(t instanceof K)throw new ee(204,!1);if(t instanceof Function)return Qz(t);throw new ee(204,!1)}function Qz(t){if(t.length>0)throw new ee(204,!1);let n=Vz(t);return n!==null?()=>n.factory(t):()=>new t}function Jz(t){if(LP(t))return Cu(void 0,t.useValue);{let e=AA(t);return Cu(e,bE)}}function AA(t,e,n){let r;if(mc(t)){let i=$t(t);return bs(i)||rA(i)}else if(LP(t))r=()=>$t(t.useValue);else if(Xz(t))r=()=>t.useFactory(...nA(t.deps||[]));else if(Yz(t))r=(i,o)=>q($t(t.useExisting),o!==void 0&&o&8?8:void 0);else{let i=$t(t&&(t.useClass||t.provide));if(Zz(t))r=()=>new i(...nA(t.deps));else return bs(i)||rA(i)}return r}function uf(t){if(t.destroyed)throw new ee(205,!1)}function Cu(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function Zz(t){return!!t.deps}function e8(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function t8(t){return typeof t=="function"||typeof t=="object"&&t.ngMetadataName==="InjectionToken"}function iA(t,e){for(let n of t)Array.isArray(n)?iA(n,e):n&&uA(n)?iA(n.\u0275providers,e):e(n)}function Hi(t,e){let n;t instanceof Ec?(uf(t),n=t):n=new tA(t);let r,i=Gi(n),o=$n(void 0);try{return e()}finally{Gi(i),$n(o)}}function CA(){return AP()!==void 0||fE()!=null}var oi=0,ge=1,ye=2,Wt=3,kr=4,Wn=5,Tc=6,Nu=7,Ct=8,Po=9,$i=10,Ye=11,bu=12,DA=13,yc=14,Pn=15,Ps=16,Ic=17,Wi=18,_f=19,RA=20,Oo=21,jE=22,xo=23,gr=24,vc=25,Sc=26,Xe=27,PP=1,NA=6,xs=7,Tf=8,Ac=9,Dt=10;function zi(t){return Array.isArray(t)&&typeof t[PP]=="object"}function si(t){return Array.isArray(t)&&t[PP]===!0}function bA(t){return(t.flags&4)!==0}function ko(t){return t.componentOffset>-1}function wu(t){return(t.flags&1)===1}function ai(t){return!!t.template}function Ou(t){return(t[ye]&512)!==0}function Cc(t){return(t[ye]&256)===256}var Tt=(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})(Tt||{}),wE,ff="svg",wA="math";function xP(){return wE||(wE={},Ns(Tt.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),Ns(Tt.STYLE,void 0,[["*",["style"]]]),Ns(Tt.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),Ns(Tt.URL,wA,[["*",["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"]]]),Ns(Tt.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),Ns(Tt.URL,ff,[["a",["href","xlink:href"]]]),Ns(Tt.ATTRIBUTE_NO_BINDING,ff,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),Ns(Tt.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]]])),wE}function Ns(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)wE[`${o}|${s.toLowerCase()}`]=t}}function kP(t,e,n){let r=xP(),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}`]??Tt.NONE}function Fr(t){for(;Array.isArray(t);)t=t[oi];return t}function OA(t,e){return Fr(e[t])}function mr(t,e){return Fr(e[t.index])}function yf(t,e){return t.data[e]}function Dc(t,e){return t[e]}function If(t,e,n,r){n>=t.data.length&&(t.data[n]=null,t.blueprint[n]=null),e[n]=r}function Ur(t,e){let n=e[t];return zi(n)?n:n[oi]}function FP(t){return(t[ye]&4)===4}function HE(t){return(t[ye]&128)===128}function UP(t){return si(t[Wt])}function Er(t,e){return e==null?null:t[e]}function LA(t){t[Ic]=0}function $E(t){t[ye]&1024||(t[ye]|=1024,HE(t)&&ks(t))}function VP(t,e){for(;t>0;)e=e[yc],t--;return e}function Lu(t){return!!(t[ye]&9216||t[gr]?.dirty)}function WE(t){t[$i].changeDetectionScheduler?.notify(8),t[ye]&64&&(t[ye]|=1024),Lu(t)&&ks(t)}function ks(t){t[$i].changeDetectionScheduler?.notify(0);let e=ws(t);for(;e!==null&&!(e[ye]&8192||(e[ye]|=8192,!HE(e)));)e=ws(e)}function MA(t,e){if(Cc(t))throw new ee(911,!1);t[Oo]===null&&(t[Oo]=[]),t[Oo].push(e)}function BP(t,e){if(t[Oo]===null)return;let n=t[Oo].indexOf(e);n!==-1&&t[Oo].splice(n,1)}function ws(t){let e=t[Wt];return si(e)?e[Wt]:e}function PA(t){return t[Nu]??=[]}function xA(t){return t.cleanup??=[]}function GP(t,e,n,r){let i=PA(e);i.push(n),t.firstCreatePass&&xA(t).push(r,i.length-1)}var Se={lFrame:ZP(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var oA=!1;function jP(){return Se.lFrame.elementDepthCount}function HP(){Se.lFrame.elementDepthCount++}function kA(){Se.lFrame.elementDepthCount--}function zE(){return Se.bindingsEnabled}function FA(){return Se.skipHydrationRootTNode!==null}function UA(t){return Se.skipHydrationRootTNode===t}function VA(){Se.skipHydrationRootTNode=null}function re(){return Se.lFrame.lView}function Qe(){return Se.lFrame.tView}function $P(t){return Se.lFrame.contextLView=t,t[Ct]}function WP(t){return Se.lFrame.contextLView=null,t}function zt(){let t=BA();for(;t!==null&&t.type===64;)t=t.parent;return t}function BA(){return Se.lFrame.currentTNode}function zP(){let t=Se.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function Rc(t,e){let n=Se.lFrame;n.currentTNode=t,n.isParent=e}function GA(){return Se.lFrame.isParent}function jA(){Se.lFrame.isParent=!1}function HA(){return Se.lFrame.contextLView}function $A(){return oA}function Mu(t){let e=oA;return oA=t,e}function zn(){let t=Se.lFrame,e=t.bindingRootIndex;return e===-1&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function WA(){return Se.lFrame.bindingIndex}function qP(t){return Se.lFrame.bindingIndex=t}function qi(){return Se.lFrame.bindingIndex++}function vf(t){let e=Se.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function KP(){return Se.lFrame.inI18n}function YP(t,e){let n=Se.lFrame;n.bindingIndex=n.bindingRootIndex=t,qE(e)}function XP(){return Se.lFrame.currentDirectiveIndex}function qE(t){Se.lFrame.currentDirectiveIndex=t}function QP(t){let e=Se.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function KE(){return Se.lFrame.currentQueryIndex}function Sf(t){Se.lFrame.currentQueryIndex=t}function n8(t){let e=t[ge];return e.type===2?e.declTNode:e.type===1?t[Wn]:null}function zA(t,e,n){if(n&4){let i=e,o=t;for(;i=i.parent,i===null&&!(n&1);)if(i=n8(o),i===null||(o=o[yc],i.type&10))break;if(i===null)return!1;e=i,t=o}let r=Se.lFrame=JP();return r.currentTNode=e,r.lView=t,!0}function YE(t){let e=JP(),n=t[ge];Se.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function JP(){let t=Se.lFrame,e=t===null?null:t.child;return e===null?ZP(t):e}function ZP(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 ex(){let t=Se.lFrame;return Se.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var qA=ex;function XE(){let t=ex();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 tx(t){return(Se.lFrame.contextLView=VP(t,Se.lFrame.contextLView))[Ct]}function _r(){return Se.lFrame.selectedIndex}function Fs(t){Se.lFrame.selectedIndex=t}function Nc(){let t=Se.lFrame;return yf(t.tView,t.selectedIndex)}function nx(){Se.lFrame.currentNamespace=ff}function rx(){r8()}function r8(){Se.lFrame.currentNamespace=null}function KA(){return Se.lFrame.currentNamespace}var ix=!0;function QE(){return ix}function Af(t){ix=t}function sA(t,e=null,n=null,r){let i=YA(t,e,n,r);return i.resolveInjectorInitializers(),i}function YA(t,e=null,n=null,r,i=new Set){let o=[n||Ln,wP(t)];return r=r||(typeof t=="object"?void 0:Lo(t)),new Ec(o,e||Ru(),r||null,i)}var Ke=class t{static THROW_IF_NOT_FOUND=fc;static NULL=new hf;static create(e,n){if(Array.isArray(e))return sA({name:""},n,e,"");{let r=e.name??"";return sA({name:r},e.parent,e.providers,r)}}static \u0275prov=J({token:t,providedIn:"any",factory:()=>q(TA)});static __NG_ELEMENT_ID__=-1},qt=new K(""),qn=(()=>{class t{static __NG_ELEMENT_ID__=i8;static __NG_ENV_ID__=n=>n}return t})(),pf=class extends qn{_lView;constructor(e){super(),this._lView=e}get destroyed(){return Cc(this._lView)}onDestroy(e){let n=this._lView;return MA(n,e),()=>BP(n,e)}};function i8(){return new pf(re())}var fr=class{_console=console;handleError(e){this._console.error("ERROR",e)}},Ki=new K("",{providedIn:"root",factory:()=>{let t=Y(Mn),e;return n=>{t.destroyed&&!e?setTimeout(()=>{throw n}):(e??=t.get(fr),e.handleError(n))}}}),ox={provide:Ls,useValue:()=>{Y(fr)},multi:!0};function Yi(t){return typeof t=="function"&&t[ln]!==void 0}function bc(t,e){let[n,r,i]=zS(t,e?.equal),o=n,s=o[ln];return o.set=r,o.update=i,o.asReadonly=XA.bind(o),o}function XA(){let t=this[ln];if(t.readonlyFn===void 0){let e=()=>this();e[ln]=t,t.readonlyFn=e}return t.readonlyFn}function QA(t){return Yi(t)&&typeof t.set=="function"}var Pu=(()=>{class t{view;node;constructor(n,r){this.view=n,this.node=r}static __NG_ELEMENT_ID__=o8}return t})();function o8(){return new Pu(re(),zt())}var xr=class{},xu=new K("",{providedIn:"root",factory:()=>!1});var JA=new K(""),JE=new K(""),Us=(()=>{class t{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new de(!1);get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new he(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=J({token:t,providedIn:"root",factory:()=>new t})}return t})(),Xi=(()=>{class t{internalPendingTasks=Y(Us);scheduler=Y(xr);errorHandler=Y(Ki);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=J({token:t,providedIn:"root",factory:()=>new t})}return t})();function wc(...t){}var Cf=(()=>{class t{static \u0275prov=J({token:t,providedIn:"root",factory:()=>new aA})}return t})(),aA=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 Yu(t){return{toString:t}.toString()}var ZE="__parameters__";function h8(t){return function(...n){if(t){let r=t(...n);for(let i in r)this[i]=r[i]}}}function jx(t,e,n){return Yu(()=>{let r=h8(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(ZE)?c[ZE]:Object.defineProperty(c,ZE,{value:[]})[ZE];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 f8=EA(jx("Inject",t=>({token:t})),-1),Yt=EA(jx("Optional"),8);function Hx(t){let e=Mt.ng;if(e&&e.\u0275compilerFacade)return e.\u0275compilerFacade;throw new Error("JIT compiler unavailable")}function p8(t){return typeof t=="function"}var d_=class{previousValue;currentValue;firstChange;constructor(e,n,r){this.previousValue=e,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}};function $x(t,e,n,r){e!==null?e.applyValueToInputSignal(e,r):t[n]=r}var YC=(()=>{let t=()=>Wx;return t.ngInherit=!0,t})();function Wx(t){return t.type.prototype.ngOnChanges&&(t.setInput=m8),g8}function g8(){let t=qx(this),e=t?.current;if(e){let n=t.previous;if(n===ii)t.previous=e;else for(let r in e)n[r]=e[r];t.current=null,this.ngOnChanges(e)}}function m8(t,e,n,r,i){let o=this.declaredInputs[r],s=qx(t)||E8(t,{previous:ii,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[o];a[o]=new d_(l&&l.currentValue,n,c===ii),$x(t,e,i,n)}var zx="__ngSimpleChanges__";function qx(t){return t[zx]||null}function E8(t,e){return t[zx]=e}var sx=[];var ot=function(t,e=null,n){for(let r=0;r<sx.length;r++){let i=sx[r];i(t,e,n)}};function _8(t,e,n){let{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){let s=Wx(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 Kx(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 s_(t,e,n){Yx(t,e,3,n)}function a_(t,e,n,r){(t[ye]&3)===n&&Yx(t,e,n,r)}function ZA(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[Ic]&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[Ic]+=65536),(a<o||o==-1)&&(T8(t,n,e,c),t[Ic]=(t[Ic]&4294901760)+c+2),c++}function ax(t,e){ot(4,t,e);let n=Te(null);try{e.call(t)}finally{Te(n),ot(5,t,e)}}function T8(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[Ic]>>16&&(t[ye]&3)===e&&(t[ye]+=16384,ax(a,o)):ax(a,o)}var Fu=-1,Lc=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 y8(t){return(t.flags&8)!==0}function I8(t){return(t.flags&16)!==0}function v8(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];A8(o)?t.setProperty(e,o,s):t.setAttribute(e,o,s),r++}}return r}function S8(t){return t===3||t===4||t===6}function A8(t){return t.charCodeAt(0)===64}function Uu(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?cx(t,n,i,null,e[++r]):cx(t,n,i,null,null))}}return t}function cx(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 Xx(t){return t!==Fu}function h_(t){return t&32767}function C8(t){return t>>16}function f_(t,e){let n=C8(t),r=e;for(;n>0;)r=r[yc],n--;return r}var uC=!0;function p_(t){let e=uC;return uC=t,e}var D8=256,Qx=D8-1,Jx=5,R8=0,Qi={};function N8(t,e,n){let r;typeof n=="string"?r=n.charCodeAt(0)||0:n.hasOwnProperty(_c)&&(r=n[_c]),r==null&&(r=n[_c]=R8++);let i=r&Qx,o=1<<i;e.data[t+(i>>Jx)]|=o}function g_(t,e){let n=Zx(t,e);if(n!==-1)return n;let r=e[ge];r.firstCreatePass&&(t.injectorIndex=e.length,eC(r.data,t),eC(e,null),eC(r.blueprint,null));let i=XC(t,e),o=t.injectorIndex;if(Xx(i)){let s=h_(i),a=f_(i,e),c=a[ge].data;for(let l=0;l<8;l++)e[o+l]=a[s+l]|c[s+l]}return e[o+8]=i,o}function eC(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Zx(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function XC(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=ik(i),r===null)return Fu;if(n++,i=i[yc],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return Fu}function dC(t,e,n){N8(t,e,n)}function ek(t,e,n){if(n&8||t!==void 0)return t;UE(e,"NodeInjector")}function tk(t,e,n,r){if(n&8&&r===void 0&&(r=null),(n&3)===0){let i=t[Po],o=$n(void 0);try{return i?i.get(e,r,n&8):mA(e,r,n&8)}finally{$n(o)}}return ek(r,e,n)}function nk(t,e,n,r=0,i){if(t!==null){if(e[ye]&2048&&!(r&2)){let s=M8(t,e,n,r,Qi);if(s!==Qi)return s}let o=rk(t,e,n,r,Qi);if(o!==Qi)return o}return tk(e,n,r,i)}function rk(t,e,n,r,i){let o=w8(n);if(typeof o=="function"){if(!zA(e,t,r))return r&1?ek(i,n,r):tk(e,n,r,i);try{let s;if(s=o(r),s==null&&!(r&8))UE(n);else return s}finally{qA()}}else if(typeof o=="number"){let s=null,a=Zx(t,e),c=Fu,l=r&1?e[Pn][Wn]:null;for((a===-1||r&4)&&(c=a===-1?XC(t,e):e[a+8],c===Fu||!ux(r,!1)?a=-1:(s=e[ge],a=h_(c),e=f_(c,e)));a!==-1;){let d=e[ge];if(lx(o,a,d.data)){let h=b8(a,e,n,s,r,l);if(h!==Qi)return h}c=e[a+8],c!==Fu&&ux(r,e[ge].data[a+8]===l)&&lx(o,a,e)?(s=d,a=h_(c),e=f_(c,e)):a=-1}}return i}function b8(t,e,n,r,i,o){let s=e[ge],a=s.data[t+8],c=r==null?ko(a)&&uC:r!=s&&(a.type&3)!==0,l=i&1&&o===a,d=c_(a,s,n,c,l);return d!==null?Nf(e,s,d,a,i):Qi}function c_(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&&ai(g)&&g.type===n)return c}return null}function Nf(t,e,n,r,i){let o=t[n],s=e.data;if(o instanceof Lc){let a=o;if(a.resolving){let g=IP(s[n]);throw gA(g)}let c=p_(a.canSeeViewProviders);a.resolving=!0;let l=s[n].type||s[n],d,h=a.injectImpl?$n(a.injectImpl):null,f=zA(t,r,0);try{o=t[n]=a.factory(void 0,i,s,t,r),e.firstCreatePass&&n>=r.directiveStart&&_8(n,s[n],e)}finally{h!==null&&$n(h),p_(c),a.resolving=!1,qA()}}return o}function w8(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=t.hasOwnProperty(_c)?t[_c]:void 0;return typeof e=="number"?e>=0?e&Qx:O8:e}function lx(t,e,n){let r=1<<t;return!!(n[e+(t>>Jx)]&r)}function ux(t,e){return!(t&2)&&!(t&1&&e)}var Oc=class{_tNode;_lView;constructor(e,n){this._tNode=e,this._lView=n}get(e,n,r){return nk(this._tNode,this._lView,e,gc(r),n)}};function O8(){return new Oc(zt(),re())}function L8(t){return Yu(()=>{let e=t.prototype.constructor,n=e[df]||hC(e),r=Object.prototype,i=Object.getPrototypeOf(t.prototype).constructor;for(;i&&i!==r;){let o=i[df]||hC(i);if(o&&o!==n)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function hC(t){return lA(t)?()=>{let e=hC($t(t));return e&&e()}:bs(t)}function M8(t,e,n,r,i){let o=t,s=e;for(;o!==null&&s!==null&&s[ye]&2048&&!Ou(s);){let a=rk(o,s,n,r|2,Qi);if(a!==Qi)return a;let c=o.parent;if(!c){let l=s[RA];if(l){let d=l.get(n,Qi,r);if(d!==Qi)return d}c=ik(s),s=s[yc]}o=c}return i}function ik(t){let e=t[ge],n=e.type;return n===2?e.declTNode:n===1?t[Wn]:null}function P8(){return Xu(zt(),re())}function Xu(t,e){return new Bs(mr(t,e))}var Bs=(()=>{class t{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=P8}return t})();function ok(t){return t instanceof Bs?t.nativeElement:t}function x8(){return this._results[Symbol.iterator]()}var m_=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 Ue}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=DP(e);(this._changesDetected=!CP(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]=x8};function sk(t){return(t.flags&128)===128}var QC=(function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t})(QC||{}),ak=new Map,k8=0;function F8(){return k8++}function U8(t){ak.set(t[_f],t)}function fC(t){ak.delete(t[_f])}var dx="__ngContext__";function Vu(t,e){zi(e)?(t[dx]=e[_f],U8(e)):t[dx]=e}function ck(t){return uk(t[bu])}function lk(t){return uk(t[kr])}function uk(t){for(;t!==null&&!si(t);)t=t[kr];return t}var pC;function JC(t){pC=t}function ZC(){if(pC!==void 0)return pC;if(typeof document<"u")return document;throw new ee(210,!1)}var L_=new K("",{providedIn:"root",factory:()=>V8}),V8="ng",M_=new K(""),Go=new K("",{providedIn:"platform",factory:()=>"unknown"});var B8=new K(""),Qu=new K("",{providedIn:"root",factory:()=>ZC().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var G8="h",j8="b";var dk="r";var hk="di";var fk=!1,pk=new K("",{providedIn:"root",factory:()=>fk});var H8=(t,e,n,r)=>{};function $8(t,e,n,r){H8(t,e,n,r)}function P_(t){return(t.flags&32)===32}var W8=()=>null;function gk(t,e,n=!1){return W8(t,e,n)}function mk(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];Sf(o),a.contentQueries(2,e[s],s)}}}finally{Te(r)}}}function gC(t,e,n){Sf(0);let r=Te(null);try{e(t,n)}finally{Te(r)}}function eD(t,e,n){if(bA(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 Uo=(function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t})(Uo||{});var z8="svg",q8="math",K8={"http://www.w3.org/2000/svg":z8,"http://www.w3.org/1998/Math/MathML":q8},e_;function Y8(){if(e_===void 0&&(e_=null,Mt.trustedTypes))try{e_=Mt.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return e_}function x_(t){return Y8()?.createHTML(t)||t}var t_;function X8(){if(t_===void 0&&(t_=null,Mt.trustedTypes))try{t_=Mt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return t_}function hx(t){return X8()?.createHTML(t)||t}var Vo=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${ME})`}},mC=class extends Vo{getTypeName(){return"HTML"}},EC=class extends Vo{getTypeName(){return"Style"}},_C=class extends Vo{getTypeName(){return"Script"}},TC=class extends Vo{getTypeName(){return"URL"}},yC=class extends Vo{getTypeName(){return"ResourceURL"}};function Tr(t){return t instanceof Vo?t.changingThisBreaksApplicationSecurity:t}function Zi(t,e){let n=Ek(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${ME})`)}return n===e}function Ek(t){return t instanceof Vo&&t.getTypeName()||null}function tD(t){return new mC(t)}function nD(t){return new EC(t)}function rD(t){return new _C(t)}function iD(t){return new TC(t)}function oD(t){return new yC(t)}function Q8(t){let e=new vC(t);return J8()?new IC(e):e}var IC=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let n=new window.DOMParser().parseFromString(x_(e),"text/html").body;return n===null?this.inertDocumentHelper.getInertBodyElement(e):(n.firstChild?.remove(),n)}catch{return null}}},vC=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=x_(e),n}};function J8(){try{return!!new window.DOMParser().parseFromString(x_(""),"text/html")}catch{return!1}}var Z8=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Lf(t){return t=String(t),t.match(Z8)?t:"unsafe:"+t}function jo(t){let e={};for(let n of t.split(","))e[n]=!0;return e}function Mf(...t){let e={};for(let n of t)for(let r in n)n.hasOwnProperty(r)&&(e[r]=!0);return e}var _k=jo("area,br,col,hr,img,wbr"),Tk=jo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),yk=jo("rp,rt"),e5=Mf(yk,Tk),t5=Mf(Tk,jo("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")),n5=Mf(yk,jo("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")),fx=Mf(_k,t5,n5,e5),Ik=jo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),r5=jo("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"),i5=jo("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"),o5=Mf(Ik,r5,i5),s5=jo("script,style,template"),SC=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=l5(n);continue}for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let o=c5(n);if(o){n=o;break}n=i.pop()}}return this.buf.join("")}startElement(e){let n=px(e).toLowerCase();if(!fx.hasOwnProperty(n))return this.sanitizedSomething=!0,!s5.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(!o5.hasOwnProperty(a)){this.sanitizedSomething=!0;continue}let c=o.value;Ik[a]&&(c=Lf(c)),this.buf.push(" ",s,'="',gx(c),'"')}return this.buf.push(">"),!0}endElement(e){let n=px(e).toLowerCase();fx.hasOwnProperty(n)&&!_k.hasOwnProperty(n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(e){this.buf.push(gx(e))}};function a5(t,e){return(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function c5(t){let e=t.nextSibling;if(e&&t!==e.previousSibling)throw vk(e);return e}function l5(t){let e=t.firstChild;if(e&&a5(t,e))throw vk(e);return e}function px(t){let e=t.nodeName;return typeof e=="string"?e:"FORM"}function vk(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}var u5=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d5=/([^\#-~ |!])/g;function gx(t){return t.replace(/&/g,"&").replace(u5,function(e){let n=e.charCodeAt(0),r=e.charCodeAt(1);return"&#"+((n-55296)*1024+(r-56320)+65536)+";"}).replace(d5,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}var n_;function k_(t,e){let n=null;try{n_=n_||Q8(t);let r=e?String(e):"";n=n_.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=n_.getInertBodyElement(r)}while(r!==o);let a=new SC().sanitizeChildren(mx(n)||n);return x_(a)}finally{if(n){let r=mx(n)||n;for(;r.firstChild;)r.firstChild.remove()}}}function mx(t){return"content"in t&&h5(t)?t.content:null}function h5(t){return t.nodeType===Node.ELEMENT_NODE&&t.nodeName==="TEMPLATE"}var f5=/^>|^->|<!--|-->|--!>|<!-$/g,p5=/(<|>)/g,g5="\u200B$1\u200B";function m5(t){return t.replace(f5,e=>e.replace(p5,g5))}function E5(t,e){return t.createText(e)}function _5(t,e,n){t.setValue(e,n)}function T5(t,e){return t.createComment(m5(e))}function Sk(t,e,n){return t.createElement(e,n)}function E_(t,e,n,r,i){t.insertBefore(e,n,r,i)}function Ak(t,e,n){t.appendChild(e,n)}function Ex(t,e,n,r,i){r!==null?E_(t,e,n,r,i):Ak(t,e,n)}function Ck(t,e,n,r){t.removeChild(null,e,n,r)}function y5(t,e,n){t.setAttribute(e,"style",n)}function I5(t,e,n){n===""?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n)}function Dk(t,e,n){let{mergedAttrs:r,classes:i,styles:o}=n;r!==null&&v8(t,e,r),i!==null&&I5(t,e,i),o!==null&&y5(t,e,o)}function v5(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 S5(t,e,n){if(e!==void 0&&n!==void 0&&D5(e,n)!==Tt.HTML)return t;let r=sD();return r?hx(r.sanitize(Tt.HTML,t)||""):Zi(t,"HTML")?hx(Tr(t)):k_(ZC(),pr(t))}function A5(t){let e=sD();return e?e.sanitize(Tt.STYLE,t)||"":Zi(t,"Style")?Tr(t):pr(t)}function C5(t){let e=sD();return e?e.sanitize(Tt.URL,t)||"":Zi(t,"URL")?Tr(t):Lf(pr(t))}function sD(){let t=re();return t&&t[$i].sanitizer}function D5(t,e){let[n,r]=R5(t);return kP(r,e,n)}function R5(t){t=t.toLowerCase();let e=v5(t,!1);if(e[0])return e;let r=_r()===-1?null:Nc(),i=r?.namespace;if(t==="#host"&&r?.type===2){let o=mr(r,re());if(o.tagName&&(t=o.tagName.toLowerCase()),i==null){let s=o.namespaceURI;i=s&&K8[s]}}return[i,t]}function N5(t){return t.ownerDocument.defaultView}function b5(t){return t.ownerDocument}function w5(t){return t instanceof Function?t():t}function O5(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 Rk="ng-template";function L5(t,e,n,r){let i=0;if(r){for(;i<e.length&&typeof e[i]=="string";i+=2)if(e[i]==="class"&&O5(e[i+1].toLowerCase(),n,0)!==-1)return!0}else if(aD(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 aD(t){return t.type===4&&t.value!==Rk}function M5(t,e,n){let r=t.type===4&&!n?Rk:t.value;return e===r}function P5(t,e,n){let r=4,i=t.attrs,o=i!==null?F5(i):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!ci(r)&&!ci(c))return!1;if(s&&ci(c))continue;s=!1,r=c|r&1;continue}if(!s)if(r&4){if(r=2|r&1,c!==""&&!M5(t,c,n)||c===""&&e.length===1){if(ci(r))return!1;s=!0}}else if(r&8){if(i===null||!L5(t,i,c,n)){if(ci(r))return!1;s=!0}}else{let l=e[++a],d=x5(c,i,aD(t),n);if(d===-1){if(ci(r))return!1;s=!0;continue}if(l!==""){let h;if(d>o?h="":h=i[d+1].toLowerCase(),r&2&&l!==h){if(ci(r))return!1;s=!0}}}}return ci(r)||s}function ci(t){return(t&1)===0}function x5(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 U5(e,t)}function Nk(t,e,n=!1){for(let r=0;r<e.length;r++)if(P5(t,e[r],n))return!0;return!1}function k5(t){let e=t.attrs;if(e!=null){let n=e.indexOf(5);if((n&1)===0)return e[n+1]}return null}function F5(t){for(let e=0;e<t.length;e++){let n=t[e];if(S8(n))return e}return t.length}function U5(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 V5(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 _x(t,e){return t?":not("+e.trim()+")":e}function B5(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!==""&&!ci(s)&&(e+=_x(o,i),i=""),r=s,o=o||!ci(r);n++}return i!==""&&(e+=_x(o,i)),e}function G5(t){return t.map(B5).join(",")}function j5(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(!ci(i))break;i=o}r++}return n.length&&e.push(1,...n),e}var un={};function cD(t,e,n,r,i,o,s,a,c,l,d){let h=Xe+r,f=h+i,g=H5(h,f),E=typeof l=="function"?l():l;return g[ge]={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 H5(t,e){let n=[];for(let r=0;r<e;r++)n.push(r<t?null:un);return n}function $5(t){let e=t.tView;return e===null||e.incompleteFirstPass?t.tView=cD(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):e}function lD(t,e,n,r,i,o,s,a,c,l,d){let h=e.blueprint.slice();return h[oi]=i,h[ye]=r|4|128|8|64|1024,(l!==null||t&&t[ye]&2048)&&(h[ye]|=2048),LA(h),h[Wt]=h[yc]=t,h[Ct]=n,h[$i]=s||t&&t[$i],h[Ye]=a||t&&t[Ye],h[Po]=c||t&&t[Po]||null,h[Wn]=o,h[_f]=F8(),h[Tc]=d,h[RA]=l,h[Pn]=e.type==2?t[Pn]:h,h}function W5(t,e,n){let r=mr(e,t),i=$5(n),o=t[$i].rendererFactory,s=uD(t,lD(t,i,null,bk(n),r,e,null,o.createRenderer(r,n),null,null,null));return t[e.index]=s}function bk(t){let e=16;return t.signals?e=4096:t.onPush&&(e=64),e}function wk(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 uD(t,e){return t[bu]?t[DA][kr]=e:t[bu]=e,t[DA]=e,e}function z5(t=1){Ok(Qe(),re(),_r()+t,!1)}function Ok(t,e,n,r){if(!r)if((e[ye]&3)===3){let o=t.preOrderCheckHooks;o!==null&&s_(e,o,n)}else{let o=t.preOrderHooks;o!==null&&a_(e,o,0,n)}Fs(n)}var F_=(function(t){return t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",t})(F_||{});function AC(t,e,n,r){let i=Te(null);try{let[o,s,a]=t.inputs[n],c=null;(s&F_.SignalBased)!==0&&(c=e[o][ln]),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):$x(e,c,o,r)}finally{Te(i)}}var li=(function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t})(li||{}),q5;function dD(t,e){return q5(t,e)}var Mc=new Set,U_=(function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t})(U_||{}),kc=new K(""),Tx=new Set;function Ho(t){Tx.has(t)||(Tx.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var Lk=!1,CC=class extends Ue{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,CA()&&(this.destroyRef=Y(qn,{optional:!0})??void 0,this.pendingTasks=Y(Us,{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)}})}}},Fo=CC;function Mk(t){let e,n;function r(){t=wc;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 yx(t){return queueMicrotask(()=>t()),()=>{t=wc}}var hD="isAngularZone",__=hD+"_ID",K5=0,De=class t{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Fo(!1);onMicrotaskEmpty=new Fo(!1);onStable=new Fo(!1);onError=new Fo(!1);constructor(e){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:o=Lk}=e;if(typeof Zone>"u")throw new ee(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,Q5(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(hD)===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new ee(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new ee(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,Y5,wc,wc);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)}},Y5={};function fD(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 X5(t){if(t.isCheckStableRunning||t.callbackScheduled)return;t.callbackScheduled=!0;function e(){Mk(()=>{t.callbackScheduled=!1,DC(t),t.isCheckStableRunning=!0,fD(t),t.isCheckStableRunning=!1})}t.scheduleInRootZone?Zone.root.run(()=>{e()}):t._outer.run(()=>{e()}),DC(t)}function Q5(t){let e=()=>{X5(t)},n=K5++;t._inner=t._inner.fork({name:"angular",properties:{[hD]:!0,[__]:n,[__+n]:!0},onInvokeTask:(r,i,o,s,a,c)=>{if(J5(c))return r.invokeTask(o,s,a,c);try{return Ix(t),r.invokeTask(o,s,a,c)}finally{(t.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),vx(t)}},onInvoke:(r,i,o,s,a,c,l)=>{try{return Ix(t),r.invoke(o,s,a,c,l)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!Z5(c)&&e(),vx(t)}},onHasTask:(r,i,o,s)=>{r.hasTask(o,s),i===o&&(s.change=="microTask"?(t._hasPendingMicrotasks=s.microTask,DC(t),fD(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 DC(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.callbackScheduled===!0?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function Ix(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function vx(t){t._nesting--,fD(t)}var Bu=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Fo;onMicrotaskEmpty=new Fo;onStable=new Fo;onError=new Fo;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 J5(t){return Pk(t,"__ignore_ng_zone__")}function Z5(t){return Pk(t,"__scheduler_tick__")}function Pk(t,e){return!Array.isArray(t)||t.length!==1?!1:t[0]?.data?.[e]===!0}function xk(t="zone.js",e){return t==="noop"?new Bu:t==="zone.js"?new De(e):t}var pD=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=J({token:t,providedIn:"root",factory:()=>new t})}return t})(),kk=[0,1,2,3],Fk=(()=>{class t{ngZone=Y(De);scheduler=Y(xr);errorHandler=Y(fr,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){Y(kc,{optional:!0})}execute(){let n=this.sequences.size>0;n&&ot(16),this.executing=!0;for(let r of kk)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[vc]??=[]).push(n),ks(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(U_.AFTER_NEXT_RENDER,n):n()}static \u0275prov=J({token:t,providedIn:"root",factory:()=>new t})}return t})(),T_=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?.[vc];e&&(this.view[vc]=e.filter(n=>n!==this))}};function eq(t,e){let n=e?.injector??Y(Ke);return Ho("NgAfterNextRender"),nq(t,n,e,!0)}function tq(t){return t instanceof Function?[void 0,void 0,t,void 0]:[t.earlyRead,t.write,t.mixedReadWrite,t.read]}function nq(t,e,n,r){let i=e.get(pD);i.impl??=e.get(Fk);let o=e.get(kc,null,{optional:!0}),s=n?.manualCleanup!==!0?e.get(qn):null,a=e.get(Pu,null,{optional:!0}),c=new T_(i.impl,tq(t),a?.view,r,s,o?.snapshot(null));return i.impl.register(c),c}var Uk=new K("",{providedIn:"root",factory:()=>({queue:new Set,isScheduled:!1,scheduler:null})});function Vk(t,e,n){let r=t.get(Uk);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 rq(t,e){let n=t.get(Uk);if(e.detachedLeaveAnimationFns){for(let r of e.detachedLeaveAnimationFns)n.queue.delete(r);e.detachedLeaveAnimationFns=void 0}}function iq(t,e){for(let[n,r]of e)Vk(t,r.animateFns)}function Sx(t,e,n,r){let i=t?.[Sc]?.enter;e!==null&&i&&i.has(n.index)&&iq(r,i)}function ku(t,e,n,r,i,o,s,a){if(i!=null){let c,l=!1;si(i)?c=i:zi(i)&&(l=!0,i=i[oi]);let d=Fr(i);t===0&&r!==null?(Sx(a,r,o,n),s==null?Ak(e,r,d):E_(e,r,d,s||null,!0)):t===1&&r!==null?(Sx(a,r,o,n),E_(e,r,d,s||null,!0)):t===2?Ax(a,o,n,h=>{Ck(e,d,l,h)}):t===3&&Ax(a,o,n,()=>{e.destroyNode(d)}),c!=null&&gq(e,t,n,c,o,r,s)}}function oq(t,e){Bk(t,e),e[oi]=null,e[Wn]=null}function sq(t,e,n,r,i,o){r[oi]=i,r[Wn]=e,B_(t,r,n,1,i,o)}function Bk(t,e){e[$i].changeDetectionScheduler?.notify(9),B_(t,e,e[Ye],2,null,null)}function aq(t){let e=t[bu];if(!e)return tC(t[ge],t);for(;e;){let n=null;if(zi(e))n=e[bu];else{let r=e[Dt];r&&(n=r)}if(!n){for(;e&&!e[kr]&&e!==t;)zi(e)&&tC(e[ge],e),e=e[Wt];e===null&&(e=t),zi(e)&&tC(e[ge],e),n=e&&e[kr]}e=n}}function gD(t,e){let n=t[Ac],r=n.indexOf(e);n.splice(r,1)}function V_(t,e){if(Cc(e))return;let n=e[Ye];n.destroyNode&&B_(t,e,n,3,null,null),aq(e)}function tC(t,e){if(Cc(e))return;let n=Te(null);try{e[ye]&=-129,e[ye]|=256,e[gr]&&hc(e[gr]),uq(t,e),lq(t,e),e[ge].type===1&&e[Ye].destroy();let r=e[Ps];if(r!==null&&si(e[Wt])){r!==e[Wt]&&gD(r,e);let i=e[Wi];i!==null&&i.detachView(t)}fC(e)}finally{Te(n)}}function Ax(t,e,n,r){let i=t?.[Sc];if(i==null||i.leave==null||!i.leave.has(e.index))return r(!1);t&&Mc.add(t),Vk(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),cq(t,r)}else t&&Mc.delete(t),r(!1)},i)}function cq(t,e){let n=t[Sc]?.running;if(n){n.then(()=>{t[Sc].running=void 0,Mc.delete(t),e(!0)});return}e(!1)}function lq(t,e){let n=t.cleanup,r=e[Nu];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[Nu]=null);let i=e[Oo];if(i!==null){e[Oo]=null;for(let s=0;s<i.length;s++){let a=i[s];a()}}let o=e[xo];if(o!==null){e[xo]=null;for(let s of o)s.destroy()}}function uq(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 Lc)){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 Gk(t,e,n){return dq(t,e.parent,n)}function dq(t,e,n){let r=e;for(;r!==null&&r.type&168;)e=r,r=e.parent;if(r===null)return n[oi];if(ko(r)){let{encapsulation:i}=t.data[r.directiveStart+r.componentOffset];if(i===Uo.None||i===Uo.Emulated)return null}return mr(r,n)}function jk(t,e,n){return fq(t,e,n)}function hq(t,e,n){return t.type&40?mr(t,n):null}var fq=hq,Cx;function mD(t,e,n,r){let i=Gk(t,r,e),o=e[Ye],s=r.parent||e[Wn],a=jk(s,r,e);if(i!=null)if(Array.isArray(n))for(let c=0;c<n.length;c++)Ex(o,i,n[c],a,!1);else Ex(o,i,n,a,!1);Cx!==void 0&&Cx(o,r,e,n,i)}function Df(t,e){if(e!==null){let n=e.type;if(n&3)return mr(e,t);if(n&4)return RC(-1,t[e.index]);if(n&8){let r=e.child;if(r!==null)return Df(t,r);{let i=t[e.index];return si(i)?RC(-1,i):Fr(i)}}else{if(n&128)return Df(t,e.next);if(n&32)return dD(e,t)()||Fr(t[e.index]);{let r=Hk(t,e);if(r!==null){if(Array.isArray(r))return r[0];let i=ws(t[Pn]);return Df(i,r)}else return Df(t,e.next)}}}return null}function Hk(t,e){if(e!==null){let r=t[Pn][Wn],i=e.projection;return r.projection[i]}return null}function RC(t,e){let n=Dt+t+1;if(n<e.length){let r=e[n],i=r[ge].firstChild;if(i!==null)return Df(r,i)}return e[xs]}function ED(t,e,n,r,i,o,s){for(;n!=null;){let a=r[Po];if(n.type===128){n=n.next;continue}let c=r[n.index],l=n.type;if(s&&e===0&&(c&&Vu(Fr(c),r),n.flags|=2),!P_(n))if(l&8)ED(t,e,n.child,r,i,o,!1),ku(e,t,a,i,c,n,o,r);else if(l&32){let d=dD(n,r),h;for(;h=d();)ku(e,t,a,i,h,n,o,r);ku(e,t,a,i,c,n,o,r)}else l&16?$k(t,e,r,n,i,o):ku(e,t,a,i,c,n,o,r);n=s?n.projectionNext:n.next}}function B_(t,e,n,r,i,o){ED(n,r,t.firstChild,e,i,o,!1)}function pq(t,e,n){let r=e[Ye],i=Gk(t,n,e),o=n.parent||e[Wn],s=jk(o,n,e);$k(r,0,e,n,i,s)}function $k(t,e,n,r,i,o){let s=n[Pn],c=s[Wn].projection[r.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let d=c[l];ku(e,t,n[Po],i,d,r,o,n)}else{let l=c,d=s[Wt];sk(r)&&(l.flags|=128),ED(t,e,l,d,i,o,!0)}}function gq(t,e,n,r,i,o,s){let a=r[xs],c=Fr(r);a!==c&&ku(e,t,n,o,a,i,s);for(let l=Dt;l<r.length;l++){let d=r[l];B_(d[ge],d,t,e,o,a)}}function mq(t,e,n,r,i){if(e)i?t.addClass(n,r):t.removeClass(n,r);else{let o=r.indexOf("-")===-1?void 0:li.DashCase;i==null?t.removeStyle(n,r,o):(typeof i=="string"&&i.endsWith("!important")&&(i=i.slice(0,-10),o|=li.Important),t.setStyle(n,r,i,o))}}function Wk(t,e,n,r,i){let o=_r(),s=r&2;try{Fs(-1),s&&e.length>Xe&&Ok(t,e,Xe,!1),ot(s?2:0,i,n),n(r,i)}finally{Fs(o),ot(s?3:1,i,n)}}function G_(t,e,n){Iq(t,e,n),(n.flags&64)===64&&vq(t,e,n)}function Pf(t,e,n=mr){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 Eq(t,e,n,r){let o=r.get(pk,fk)||n===Uo.ShadowDom,s=t.selectRootElement(e,o);return _q(s),s}function _q(t){Tq(t)}var Tq=()=>null;function yq(t){return t==="class"?"className":t==="for"?"htmlFor":t==="formaction"?"formAction":t==="innerHtml"?"innerHTML":t==="readonly"?"readOnly":t==="tabindex"?"tabIndex":t}function zk(t,e,n,r,i,o){let s=e[ge];if(j_(t,s,e,n,r)){ko(t)&&Kk(e,t.index);return}t.type&3&&(n=yq(n)),qk(t,e,n,r,i,o)}function qk(t,e,n,r,i,o){if(t.type&3){let s=mr(t,e);r=o!=null?o(r,t.value||"",n):r,i.setProperty(s,n,r)}else t.type&12}function Kk(t,e){let n=Ur(e,t);n[ye]&16||(n[ye]|=64)}function Iq(t,e,n){let r=n.directiveStart,i=n.directiveEnd;ko(n)&&W5(e,n,t.data[r+n.componentOffset]),t.firstCreatePass||g_(n,e);let o=n.initialInputs;for(let s=r;s<i;s++){let a=t.data[s],c=Nf(e,t,s,n);if(Vu(c,e),o!==null&&Cq(e,s-r,c,a,n,o),ai(a)){let l=Ur(n.index,e);l[Ct]=Nf(e,t,s,n)}}}function vq(t,e,n){let r=n.directiveStart,i=n.directiveEnd,o=n.index,s=XP();try{Fs(o);for(let a=r;a<i;a++){let c=t.data[a],l=e[a];qE(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&Sq(c,l)}}finally{Fs(-1),qE(s)}}function Sq(t,e){t.hostBindings!==null&&t.hostBindings(1,e)}function _D(t,e){let n=t.directiveRegistry,r=null;if(n)for(let i=0;i<n.length;i++){let o=n[i];Nk(e,o.selectors,!1)&&(r??=[],ai(o)?r.unshift(o):r.push(o))}return r}function Aq(t,e,n,r,i,o){let s=mr(t,e);Yk(e[Ye],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?pr(o):s(o,r||"",i);t.setAttribute(e,i,a,n)}}function Cq(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];AC(r,n,c,l)}}function TD(t,e,n,r,i){let o=Xe+n,s=e[ge],a=i(s,e,t,r,n);e[o]=a,Rc(t,!0);let c=t.type===2;return c?(Dk(e[Ye],a,t),(jP()===0||wu(t))&&Vu(a,e),HP()):Vu(a,e),QE()&&(!c||!P_(t))&&mD(s,e,a,t),t}function yD(t){let e=t;return GA()?jA():(e=e.parent,Rc(e,!1)),e}function Dq(t,e){let n=t[Po];if(!n)return;let r;try{r=n.get(Ki,null)}catch{r=null}r?.(e)}function j_(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];AC(h,n[l],d,i),a=!0}if(o)for(let c of o){let l=n[c],d=e.data[c];AC(d,l,r,i),a=!0}return a}function Rq(t,e){let n=Ur(e,t),r=n[ge];Nq(r,n);let i=n[oi];i!==null&&n[Tc]===null&&(n[Tc]=gk(i,n[Po])),ot(18),ID(r,n,n[Ct]),ot(19,n[Ct])}function Nq(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}function ID(t,e,n){YE(e);try{let r=t.viewQuery;r!==null&&gC(1,r,n);let i=t.template;i!==null&&Wk(t,e,i,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),e[Wi]?.finishViewCreation(t),t.staticContentQueries&&mk(t,e),t.staticViewQueries&&gC(2,t.viewQuery,n);let o=t.components;o!==null&&bq(e,o)}catch(r){throw t.firstCreatePass&&(t.incompleteFirstPass=!0,t.firstCreatePass=!1),r}finally{e[ye]&=-5,XE()}}function bq(t,e){for(let n=0;n<e.length;n++)Rq(t,e[n])}function xf(t,e,n,r){let i=Te(null);try{let o=e.tView,a=t[ye]&4096?4096:16,c=lD(t,o,n,a,null,e,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null),l=t[e.index];c[Ps]=l;let d=t[Wi];return d!==null&&(c[Wi]=d.createEmbeddedView(o)),ID(o,c,n),c}finally{Te(i)}}function Gu(t,e){return!e||e.firstChild===null||sk(t)}function bf(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(Fr(o)),si(o)&&Xk(o,r);let s=n.type;if(s&8)bf(t,e,n.child,r);else if(s&32){let a=dD(n,e),c;for(;c=a();)r.push(c)}else if(s&16){let a=Hk(e,n);if(Array.isArray(a))r.push(...a);else{let c=ws(e[Pn]);bf(c[ge],c,a,r,!0)}}n=i?n.projectionNext:n.next}return r}function Xk(t,e){for(let n=Dt;n<t.length;n++){let r=t[n],i=r[ge].firstChild;i!==null&&bf(r[ge],r,i,e)}t[xs]!==t[oi]&&e.push(t[xs])}function Qk(t){if(t[vc]!==null){for(let e of t[vc])e.impl.addSequence(e);t[vc].length=0}}var Jk=[];function wq(t){return t[gr]??Oq(t)}function Oq(t){let e=Jk.pop()??Object.create(Mq);return e.lView=t,e}function Lq(t){t.lView[gr]!==t&&(t.lView=null,Jk.push(t))}var Mq=le(V({},uc),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{ks(t.lView)},consumerOnSignalRead(){this.lView[gr]=this}});function Pq(t){let e=t[gr]??Object.create(xq);return e.lView=t,e}var xq=le(V({},uc),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let e=ws(t.lView);for(;e&&!Zk(e[ge]);)e=ws(e);e&&$E(e)},consumerOnSignalRead(){this.lView[gr]=this}});function Zk(t){return t.type!==2}function e1(t){if(t[xo]===null)return;let e=!0;for(;e;){let n=!1;for(let r of t[xo])r.dirty&&(n=!0,r.zone===null||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=n&&!!(t[ye]&8192)}}var kq=100;function t1(t,e=0){let r=t[$i].rendererFactory,i=!1;i||r.begin?.();try{Fq(t,e)}finally{i||r.end?.()}}function Fq(t,e){let n=$A();try{Mu(!0),NC(t,e);let r=0;for(;Lu(t);){if(r===kq)throw new ee(103,!1);r++,NC(t,1)}}finally{Mu(n)}}function Uq(t,e,n,r){if(Cc(e))return;let i=e[ye],o=!1,s=!1;YE(e);let a=!0,c=null,l=null;o||(Zk(t)?(l=wq(e),c=dc(l)):_E()===null?(a=!1,l=Pq(e),c=dc(l)):e[gr]&&(hc(e[gr]),e[gr]=null));try{LA(e),qP(t.bindingStartIndex),n!==null&&Wk(t,e,n,2,r);let d=(i&3)===3;if(!o)if(d){let g=t.preOrderCheckHooks;g!==null&&s_(e,g,null)}else{let g=t.preOrderHooks;g!==null&&a_(e,g,0,null),ZA(e,0)}if(s||Vq(e),e1(e),n1(e,0),t.contentQueries!==null&&mk(t,e),!o)if(d){let g=t.contentCheckHooks;g!==null&&s_(e,g)}else{let g=t.contentHooks;g!==null&&a_(e,g,1),ZA(e,1)}Gq(t,e);let h=t.components;h!==null&&i1(e,h,0);let f=t.viewQuery;if(f!==null&&gC(2,f,r),!o)if(d){let g=t.viewCheckHooks;g!==null&&s_(e,g)}else{let g=t.viewHooks;g!==null&&a_(e,g,2),ZA(e,2)}if(t.firstUpdatePass===!0&&(t.firstUpdatePass=!1),e[jE]){for(let g of e[jE])g();e[jE]=null}o||(Qk(e),e[ye]&=-73)}catch(d){throw o||ks(e),d}finally{l!==null&&(yu(l,c),a&&Lq(l)),XE()}}function n1(t,e){for(let n=ck(t);n!==null;n=lk(n))for(let r=Dt;r<n.length;r++){let i=n[r];r1(i,e)}}function Vq(t){for(let e=ck(t);e!==null;e=lk(e)){if(!(e[ye]&2))continue;let n=e[Ac];for(let r=0;r<n.length;r++){let i=n[r];$E(i)}}}function Bq(t,e,n){ot(18);let r=Ur(e,t);r1(r,n),ot(19,r[Ct])}function r1(t,e){HE(t)&&NC(t,e)}function NC(t,e){let r=t[ge],i=t[ye],o=t[gr],s=!!(e===0&&i&16);if(s||=!!(i&64&&e===0),s||=!!(i&1024),s||=!!(o?.dirty&&Iu(o)),s||=!1,o&&(o.dirty=!1),t[ye]&=-9217,s)Uq(r,t,r.template,t[Ct]);else if(i&8192){let a=Te(null);try{e1(t),n1(t,1);let c=r.components;c!==null&&i1(t,c,1),Qk(t)}finally{Te(a)}}}function i1(t,e,n){for(let r=0;r<e.length;r++)Bq(t,e[r],n)}function Gq(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)Fs(~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{Fs(-1)}}function vD(t,e){let n=$A()?64:1088;for(t[$i].changeDetectionScheduler?.notify(e);t;){t[ye]|=n;let r=ws(t);if(Ou(t)&&!r)return t;t=r}return null}function o1(t,e,n,r){return[t,!0,0,e,null,r,null,n,null,null]}function s1(t,e){let n=Dt+e;if(n<t.length)return t[n]}function kf(t,e,n,r=!0){let i=e[ge];if(jq(i,e,t,n),r){let s=RC(n,t),a=e[Ye],c=a.parentNode(t[xs]);c!==null&&sq(i,t[Wn],a,e,c,s)}let o=e[Tc];o!==null&&o.firstChild!==null&&(o.firstChild=null)}function a1(t,e){let n=wf(t,e);return n!==void 0&&V_(n[ge],n),n}function wf(t,e){if(t.length<=Dt)return;let n=Dt+e,r=t[n];if(r){let i=r[Ps];i!==null&&i!==t&&gD(i,r),e>0&&(t[n-1][kr]=r[kr]);let o=gf(t,Dt+e);oq(r[ge],r);let s=o[Wi];s!==null&&s.detachView(o[ge]),r[Wt]=null,r[kr]=null,r[ye]&=-129}return r}function jq(t,e,n,r){let i=Dt+r,o=n.length;r>0&&(n[i-1][kr]=e),r<o-Dt?(e[kr]=n[i],_A(n,Dt+r,e)):(n.push(e),e[kr]=null),e[Wt]=n;let s=e[Ps];s!==null&&n!==s&&c1(s,e);let a=e[Wi];a!==null&&a.insertView(t),WE(e),e[ye]|=128}function c1(t,e){let n=t[Ac],r=e[Wt];if(zi(r))t[ye]|=2;else{let i=r[Wt][Pn];e[Pn]!==i&&(t[ye]|=2)}n===null?t[Ac]=[e]:n.push(e)}var Vs=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,n=e[ge];return bf(n,e,n.firstChild,[])}constructor(e,n){this._lView=e,this._cdRefInjectingView=n}get context(){return this._lView[Ct]}set context(e){this._lView[Ct]=e}get destroyed(){return Cc(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[Wt];if(si(e)){let n=e[Tf],r=n?n.indexOf(this):-1;r>-1&&(wf(e,r),gf(n,r))}this._attachedToViewContainer=!1}V_(this._lView[ge],this._lView)}onDestroy(e){MA(this._lView,e)}markForCheck(){vD(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ye]&=-129}reattach(){WE(this._lView),this._lView[ye]|=128}detectChanges(){this._lView[ye]|=1024,t1(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new ee(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=Ou(this._lView),n=this._lView[Ps];n!==null&&!e&&gD(n,this._lView),Bk(this._lView[ge],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new ee(902,!1);this._appRef=e;let n=Ou(this._lView),r=this._lView[Ps];r!==null&&!n&&c1(r,this._lView),WE(this._lView)}};function Hq(t){return Lu(t._lView)||!!(t._lView[ye]&64)}function $q(t){$E(t._lView)}var Ji=(()=>{class t{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=Wq;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=xf(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:r,dehydratedView:i});return new Vs(o)}}return t})();function Wq(){return H_(zt(),re())}function H_(t,e){return t.type&4?new Ji(e,t,Xu(t,e)):null}function Fc(t,e,n,r,i){let o=t.data[e];if(o===null)o=zq(t,e,n,r,i),KP()&&(o.flags|=32);else if(o.type&64){o.type=n,o.value=r,o.attrs=i;let s=zP();o.injectorIndex=s===null?-1:s.injectorIndex}return Rc(o,!0),o}function zq(t,e,n,r,i){let o=BA(),s=GA(),a=s?o:o&&o.parent,c=t.data[e]=Kq(t,a,n,e,r,i);return qq(t,c,o,s),c}function qq(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 Kq(t,e,n,r,i,o){let s=e?e.injectorIndex:-1,a=0;return FA()&&(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:KA(),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 STe=new RegExp(`^(\\d+)*(${j8}|${G8})*(.*)`);function Yq(t){let e=t[NA]??[],r=t[Wt][Ye],i=[];for(let o of e)o.data[hk]!==void 0?i.push(o):Xq(o,r);t[NA]=i}function Xq(t,e){let n=0,r=t.firstChild;if(r){let i=t.data[dk];for(;n<i;){let o=r.nextSibling;Ck(e,r,!1),r=o,n++}}}var Qq=()=>null,Jq=()=>null;function y_(t,e){return Qq(t,e)}function l1(t,e,n){return Jq(t,e,n)}var u1=class{},$_=class{},bC=class{resolveComponentFactory(e){throw new ee(917,!1)}},Ff=class{static NULL=new bC},Bo=class{},W_=(()=>{class t{destroyNode=null;static __NG_ELEMENT_ID__=()=>Zq()}return t})();function Zq(){let t=re(),e=zt(),n=Ur(e.index,t);return(zi(n)?n:t)[Ye]}var d1=(()=>{class t{static \u0275prov=J({token:t,providedIn:"root",factory:()=>null})}return t})();var l_={},wC=class{injector;parentInjector;constructor(e,n){this.injector=e,this.parentInjector=n}get(e,n,r){let i=this.injector.get(e,l_,r);return i!==l_||n===l_?i:this.parentInjector.get(e,n,r)}};function I_(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=PE(i,a);else if(o==2){let c=a,l=e[++s];r=PE(r,c+": "+l+";")}}n?t.styles=r:t.stylesWithoutHost=r,n?t.classes=i:t.classesWithoutHost=i}function st(t,e=0){let n=re();if(n===null)return q(t,e);let r=zt();return nk(r,n,$t(t),e)}function e9(){let t="invalid";throw new Error(t)}function h1(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}r9(t,e,n,a,o,c,l)}o!==null&&r!==null&&t9(n,r,o)}function t9(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 ee(-301,!1);r.push(e[i],o)}}function n9(t,e,n){e.componentOffset=n,(t.components??=[]).push(e.index)}function r9(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&&ai(g)&&(c=!0,n9(t,n,f)),dC(g_(n,e),t,g.type)}l9(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=wk(t,e,a,null);a>0&&(n.directiveToIndex=new Map);for(let f=0;f<a;f++){let g=r[f];if(n.mergedAttrs=Uu(n.mergedAttrs,g.hostAttrs),o9(t,n,e,h,g),c9(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++}i9(t,n,o)}function i9(t,e,n){for(let r=e.directiveStart;r<e.directiveEnd;r++){let i=t.data[r];if(n===null||!n.has(i))Dx(0,e,i,r),Dx(1,e,i,r),Nx(e,r,!1);else{let o=n.get(i);Rx(0,e,o,r),Rx(1,e,o,r),Nx(e,r,!0)}}}function Dx(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),f1(e,o)}}function Rx(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),f1(e,s)}}function f1(t,e){e==="class"?t.flags|=8:e==="style"&&(t.flags|=16)}function Nx(t,e,n){let{attrs:r,inputs:i,hostDirectiveInputs:o}=t;if(r===null||!n&&i===null||n&&o===null||aD(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 o9(t,e,n,r,i){t.data[r]=i;let o=i.factory||(i.factory=bs(i.type,!0)),s=new Lc(o,ai(i),st,null);t.blueprint[r]=s,n[r]=s,s9(t,e,r,wk(t,n,i.hostVars,un),i)}function s9(t,e,n,r,i){let o=i.hostBindings;if(o){let s=t.hostBindingOpCodes;s===null&&(s=t.hostBindingOpCodes=[]);let a=~e.index;a9(s)!=a&&s.push(a),s.push(n,r,o)}}function a9(t){let e=t.length;for(;e>0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function c9(t,e,n){if(n){if(e.exportAs)for(let r=0;r<e.exportAs.length;r++)n[e.exportAs[r]]=t;ai(e)&&(n[""]=t)}}function l9(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function SD(t,e,n,r,i,o,s,a){let c=e[ge],l=c.consts,d=Er(l,s),h=Fc(c,t,n,r,d);return o&&h1(c,e,h,Er(l,a),i),h.mergedAttrs=Uu(h.mergedAttrs,h.attrs),h.attrs!==null&&I_(h,h.attrs,!1),h.mergedAttrs!==null&&I_(h,h.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,h),h}function AD(t,e){Kx(t,e),bA(e)&&t.queries.elementEnd(e)}function u9(t,e,n,r,i,o){let s=e.consts,a=Er(s,i),c=Fc(e,t,n,r,a);if(c.mergedAttrs=Uu(c.mergedAttrs,c.attrs),o!=null){let l=Er(s,o);c.localNames=[];for(let d=0;d<l.length;d+=2)c.localNames.push(l[d],-1)}return c.attrs!==null&&I_(c,c.attrs,!1),c.mergedAttrs!==null&&I_(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}function CD(t){return z_(t)?Array.isArray(t)||!(t instanceof Map)&&Symbol.iterator in t:!1}function p1(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 z_(t){return t!==null&&(typeof t=="function"||typeof t=="object")}function eo(t,e,n){return t[e]=n}function Uf(t,e){return t[e]}function In(t,e,n){if(n===un)return!1;let r=t[e];return Object.is(r,n)?!1:(t[e]=n,!0)}function ju(t,e,n,r){let i=In(t,e,n);return In(t,e+1,r)||i}function DD(t,e,n,r,i){let o=ju(t,e,n,r);return In(t,e+2,i)||o}function Hu(t,e,n,r,i,o){let s=ju(t,e,n,r);return ju(t,e+2,i,o)||s}function u_(t,e,n){return function r(i){let o=ko(t)?Ur(t.index,e):e;vD(o,5);let s=e[Ct],a=bx(e,s,n,i),c=r.__ngNextListenerFn__;for(;c;)a=bx(e,s,c,i)&&a,c=c.__ngNextListenerFn__;return a}}function bx(t,e,n,r){let i=Te(null);try{return ot(6,e,n),n(r)!==!1}catch(o){return Dq(t,o),!1}finally{ot(7,e,n),Te(i)}}function g1(t,e,n,r,i,o,s,a){let c=wu(t),l=!1,d=null;if(!r&&c&&(d=h9(e,n,o,t.index)),d!==null){let h=d.__ngLastListenerFn__||d;h.__ngNextListenerFn__=s,d.__ngLastListenerFn__=s,l=!0}else{let h=mr(t,n),f=r?r(h):h;$8(n,f,o,a);let g=i.listen(f,o,a);if(!d9(o)){let E=r?I=>r(Fr(I[t.index])):t.index;m1(E,e,n,o,a,g,!1)}}return l}function d9(t){return t.startsWith("animation")||t.startsWith("transition")}function h9(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[Nu],c=i[o+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(o+=2)}return null}function m1(t,e,n,r,i,o,s){let a=e.firstCreatePass?xA(e):null,c=PA(n),l=c.length;c.push(i,o),a&&a.push(r,t,l,(l+1)*(s?-1:1))}function wx(t,e,n,r,i,o){let s=e[n],a=e[ge],l=a.data[n].outputs[r],h=s[l].subscribe(o);m1(t.index,a,e,i,o,h,!0)}var OC=Symbol("BINDING");var v_=class extends Ff{ngModule;constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){let n=Ms(e);return new $u(n,this.ngModule)}};function f9(t){return Object.keys(t).map(e=>{let[n,r,i]=t[e],o={propName:n,templateName:e,isSignal:(r&F_.SignalBased)!==0};return i&&(o.transform=i),o})}function p9(t){return Object.keys(t).map(e=>({propName:t[e],templateName:e}))}function g9(t,e,n){let r=e instanceof Mn?e:e?.injector;return r&&t.getStandaloneInjector!==null&&(r=t.getStandaloneInjector(r)||r),r?new wC(n,r):n}function m9(t){let e=t.get(Bo,null);if(e===null)throw new ee(407,!1);let n=t.get(d1,null),r=t.get(xr,null);return{rendererFactory:e,sanitizer:n,changeDetectionScheduler:r,ngReflect:!1}}function E9(t,e){let n=E1(t);return Sk(e,n,n==="svg"?ff:n==="math"?wA:null)}function _9(t){if(t?.toLowerCase()==="script")throw new ee(905,!1)}function E1(t){return(t.selectors[0][0]||"div").toLowerCase()}var $u=class extends $_{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=f9(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=p9(this.componentDef.outputs),this.cachedOutputs}constructor(e,n){super(),this.componentDef=e,this.ngModule=n,this.componentType=e.type,this.selector=G5(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=T9(r,c,s,o),d=g9(c,i||this.ngModule,e),h=m9(d),f=h.rendererFactory.createRenderer(null,c),g=r?Eq(f,r,c.encapsulation,d):E9(c,f);_9(g?.tagName);let E=s?.some(Ox)||o?.some(R=>typeof R!="function"&&R.bindings.some(Ox)),I=lD(null,l,null,512|bk(c),null,null,h,f,d,null,gk(g,d,!0));I[Xe]=g,YE(I);let S=null;try{let R=SD(Xe,I,2,"#host",()=>l.directiveRegistry,!0,0);Dk(f,g,R),Vu(g,I),G_(l,I,R),eD(l,R,I),AD(l,R),n!==void 0&&I9(R,this.ngContentSelectors,n),S=Ur(R.index,I),I[Ct]=S[Ct],ID(l,I,null)}catch(R){throw S!==null&&fC(S),fC(I),R}finally{ot(23),XE()}return new S_(this.componentType,I,!!E)}finally{Te(a)}}};function T9(t,e,n,r){let i=t?["ng-version","20.3.35"]:j5(e.selectors[0]),o=null,s=null,a=0;if(n)for(let d of n)a+=d[OC].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[OC].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=GE(h);c.push(f)}return cD(0,null,y9(o,s),1,a,c,null,null,null,[i],null)}function y9(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 Ox(t){let e=t[OC].kind;return e==="input"||e==="twoWay"}var S_=class extends u1{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,n,r){super(),this._rootLView=n,this._hasInputBindings=r,this._tNode=yf(n[ge],Xe),this.location=Xu(this._tNode,n),this.instance=Ur(this._tNode.index,n)[Ct],this.hostView=this.changeDetectorRef=new Vs(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=j_(r,i[ge],i,e,n);this.previousInputValues.set(e,n);let s=Ur(r.index,i);vD(s,1)}get injector(){return new Oc(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function I9(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 to=(()=>{class t{static __NG_ELEMENT_ID__=v9}return t})();function v9(){let t=zt();return T1(t,re())}var S9=to,_1=class extends S9{_lContainer;_hostTNode;_hostLView;constructor(e,n,r){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=r}get element(){return Xu(this._hostTNode,this._hostLView)}get injector(){return new Oc(this._hostTNode,this._hostLView)}get parentInjector(){let e=XC(this._hostTNode,this._hostLView);if(Xx(e)){let n=f_(e,this._hostLView),r=h_(e),i=n[ge].data[r+8];return new Oc(i,n)}else return new Oc(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=Lx(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-Dt}createEmbeddedView(e,n,r){let i,o;typeof r=="number"?i=r:r!=null&&(i=r.index,o=r.injector);let s=y_(this._lContainer,e.ssrId),a=e.createEmbeddedViewImpl(n||{},o,s);return this.insertImpl(a,i,Gu(this._hostTNode,s)),a}createComponent(e,n,r,i,o,s,a){let c=e&&!p8(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 $u(Ms(e)),h=r||this.parentInjector;if(!o&&d.ngModule==null){let R=(c?h:this.parentInjector).get(Mn,null);R&&(o=R)}let f=Ms(d.componentType??{}),g=y_(this._lContainer,f?.id??null),E=g?.firstChild??null,I=d.create(h,i,E,o,s,a);return this.insertImpl(I.hostView,l,Gu(this._hostTNode,g)),I}insert(e,n){return this.insertImpl(e,n,!0)}insertImpl(e,n,r){let i=e._lView;if(UP(i)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=i[Wt],l=new _1(c,c[Wn],c[Wt]);l.detach(l.indexOf(e))}}let o=this._adjustIndex(n),s=this._lContainer;return kf(s,i,o,r),e.attachToViewContainerRef(),_A(nC(s),o,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=Lx(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),r=wf(this._lContainer,n);r&&(gf(nC(this._lContainer),n),V_(r[ge],r))}detach(e){let n=this._adjustIndex(e,-1),r=wf(this._lContainer,n);return r&&gf(nC(this._lContainer),n)!=null?new Vs(r):null}_adjustIndex(e,n=0){return e??this.length+n}};function Lx(t){return t[Tf]}function nC(t){return t[Tf]||(t[Tf]=[])}function T1(t,e){let n,r=e[t.index];return si(r)?n=r:(n=o1(r,e,null,t),e[t.index]=n,uD(e,n)),C9(n,e,t,r),new _1(n,t,e)}function A9(t,e){let n=t[Ye],r=n.createComment(""),i=mr(e,t),o=n.parentNode(i);return E_(n,o,r,n.nextSibling(i),!1),r}var C9=N9,D9=()=>!1;function R9(t,e,n){return D9(t,e,n)}function N9(t,e,n,r){if(t[xs])return;let i;n.type&8?i=Fr(r):i=A9(e,n),t[xs]=i}var LC=class t{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},MC=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++)ND(e,n).matches!==null&&this.queries[n].setDirty()}},A_=class{flags;read;predicate;constructor(e,n,r=null){this.flags=n,this.read=r,typeof e=="string"?this.predicate=P9(e):this.predicate=e}},PC=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)}},xC=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,b9(n,o)),this.matchTNodeWithReadOption(e,n,c_(n,e,o,!1,!1))}else r===Ji?n.type&4&&this.matchTNodeWithReadOption(e,n,-1):this.matchTNodeWithReadOption(e,n,c_(n,e,r,!1,!1))}matchTNodeWithReadOption(e,n,r){if(r!==null){let i=this.metadata.read;if(i!==null)if(i===Bs||i===to||i===Ji&&n.type&4)this.addMatch(n.index,-2);else{let o=c_(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 b9(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 w9(t,e){return t.type&11?Xu(t,e):t.type&4?H_(t,e):null}function O9(t,e,n,r){return n===-1?w9(e,t):n===-2?L9(t,e,r):Nf(t,t[ge],n,e)}function L9(t,e,n){if(n===Bs)return Xu(e,t);if(n===Ji)return H_(e,t);if(n===to)return T1(e,t)}function y1(t,e,n,r){let i=e[Wi].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(O9(e,d,s[c+1],n.metadata.read))}}i.matches=a}return i.matches}function kC(t,e,n,r){let i=t.queries.getByIndex(n),o=i.matches;if(o!==null){let s=y1(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=Dt;h<d.length;h++){let f=d[h];f[Ps]===f[Wt]&&kC(f[ge],f,l,r)}if(d[Ac]!==null){let h=d[Ac];for(let f=0;f<h.length;f++){let g=h[f];kC(g[ge],g,l,r)}}}}}return r}function RD(t,e){return t[Wi].queries[e].queryList}function I1(t,e,n){let r=new m_((n&4)===4);return GP(t,e,r,r.destroy),(e[Wi]??=new MC).queries.push(new LC(r))-1}function v1(t,e,n){let r=Qe();return r.firstCreatePass&&(S1(r,new A_(t,e,n),-1),(e&2)===2&&(r.staticViewQueries=!0)),I1(r,re(),e)}function M9(t,e,n,r){let i=Qe();if(i.firstCreatePass){let o=zt();S1(i,new A_(e,n,r),o.index),x9(i,t),(n&2)===2&&(i.staticContentQueries=!0)}return I1(i,re(),n)}function P9(t){return t.split(",").map(e=>e.trim())}function S1(t,e,n){t.queries===null&&(t.queries=new PC),t.queries.track(new xC(e,n))}function x9(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 ND(t,e){return t.queries.getByIndex(e)}function A1(t,e){let n=t[ge],r=ND(n,e);return r.crossesNgTemplate?kC(n,t,e,[]):y1(n,t,r,e)}function C1(t,e,n){let r,i=af(()=>{r._dirtyCounter();let o=F9(r,t);if(e&&o===void 0)throw new ee(-951,!1);return o});return r=i[ln],r._dirtyCounter=bc(0),r._flatValue=void 0,i}function D1(t){return C1(!0,!1,t)}function R1(t){return C1(!0,!0,t)}function k9(t,e){let n=t[ln];n._lView=re(),n._queryIndex=e,n._queryList=RD(n._lView,e),n._queryList.onDirty(()=>n._dirtyCounter.update(r=>r+1))}function F9(t,e){let n=t._lView,r=t._queryIndex;if(n===void 0||r===void 0||n[ye]&4)return e?void 0:Ln;let i=RD(n,r),o=A1(n,r);return i.reset(o,ok),e?i.first:i._changesDetected||t._flatValue===void 0?t._flatValue=i.toArray():t._flatValue}function N1(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=>V9(i,a)))}return o}return C_.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(()=>B9(o));e.push(c)}),b1(),Promise.all(e).then(()=>{})}var C_=new Map,U9=new Set;function b1(){let t=C_;return C_=new Map,t}function w1(){return C_.size===0}function V9(t,e){return typeof e=="string"?e:e.status!==void 0&&e.status!==200?Promise.reject(new ee(918,!1)):e.text()}function B9(t){U9.delete(t)}var Pc=class{},O1=class{};function L1(t,e){return new Wu(t,e??null,[])}var Wu=class extends Pc{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new v_(this);constructor(e,n,r,i=!0){super(),this.ngModuleType=e,this._parent=n;let o=bP(e);this._bootstrapComponents=w5(o.bootstrap),this._r3Injector=YA(e,n,[{provide:Pc,useValue:this},{provide:Ff,useValue:this.componentFactoryResolver},...r],Lo(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)}},D_=class extends O1{moduleType;constructor(e){super(),this.moduleType=e}create(e){return new Wu(this.moduleType,e,[])}};function M1(t,e,n){return new Wu(t,e,n,!1)}var R_=class extends Pc{injector;componentFactoryResolver=new v_(this);instance=null;constructor(e){super();let n=new Ec([...e.providers,{provide:Pc,useValue:this},{provide:Ff,useValue:this.componentFactoryResolver}],e.parent||Ru(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function P1(t,e,n=null){return new R_({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var G9=(()=>{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=vA(!1,n.type),i=r.length>0?P1([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=J({token:t,providedIn:"environment",factory:()=>new t(q(Mn))})}return t})();function j9(t){return Yu(()=>{let e=k1(t),n=le(V({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection===QC.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:e.standalone?i=>i.get(G9).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||Uo.Emulated,styles:t.styles||Ln,_:null,schemas:t.schemas||null,tView:null,id:""});e.standalone&&Ho("NgStandalone"),F1(n);let r=t.dependencies;return n.directiveDefs=N_(r,x1),n.pipeDefs=N_(r,IA),n.id=W9(n),n})}function x1(t){return Ms(t)||GE(t)}function Gs(t){return Yu(()=>({type:t.type,bootstrap:t.bootstrap||Ln,declarations:t.declarations||Ln,imports:t.imports||Ln,exports:t.exports||Ln,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null}))}function H9(t,e){if(t==null)return ii;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=F_.None,c=null),n[o]=[r,a,c],e[o]=s}return n}function $9(t){if(t==null)return ii;let e={};for(let n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function no(t){return Yu(()=>{let e=k1(t);return F1(e),e})}function Vf(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 k1(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||ii,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:t.signals===!0,selectors:t.selectors||Ln,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,inputs:H9(t.inputs,e),outputs:$9(t.outputs),debugInfo:null}}function F1(t){t.features?.forEach(e=>e(t))}function N_(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 W9(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 z9(t){return Object.getPrototypeOf(t.prototype).constructor}function U1(t){let e=z9(t.type),n=!0,r=[t];for(;e;){let i;if(ai(t))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new ee(903,!1);i=e.\u0275dir}if(i){if(n){r.push(i);let s=t;s.inputs=rC(t.inputs),s.declaredInputs=rC(t.declaredInputs),s.outputs=rC(t.outputs);let a=i.hostBindings;a&&Q9(t,a);let c=i.viewQuery,l=i.contentQueries;if(c&&Y9(t,c),l&&X9(t,l),q9(t,i),yP(t.outputs,i.outputs),ai(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===U1&&(n=!1)}}e=Object.getPrototypeOf(e)}K9(r)}function q9(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 K9(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=Uu(i.hostAttrs,n=Uu(n,i.hostAttrs))}}function rC(t){return t===ii?{}:t===Ln?[]:t}function Y9(t,e){let n=t.viewQuery;n?t.viewQuery=(r,i)=>{e(r,i),n(r,i)}:t.viewQuery=e}function X9(t,e){let n=t.contentQueries;n?t.contentQueries=(r,i,o)=>{e(r,i,o),n(r,i,o)}:t.contentQueries=e}function Q9(t,e){let n=t.hostBindings;n?t.hostBindings=(r,i)=>{e(r,i),n(r,i)}:t.hostBindings=e}function J9(t){let e=n=>{let r=Array.isArray(t);n.hostDirectives===null?(n.resolveHostDirectives=Z9,n.hostDirectives=r?t.map(FC):[t]):r?n.hostDirectives.unshift(...t.map(FC)):n.hostDirectives.unshift(t)};return e.ngInherit=!0,e}function Z9(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,V1(s,e,r),i.set(s,[a,e.length-1])}o===0&&ai(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 V1(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)Mx(FC(o),e,n)}else Mx(r,e,n)}function Mx(t,e,n){let r=GE(t.directive);eK(r.declaredInputs,t.inputs),V1(r,e,n),n.set(r,t),e.push(r)}function FC(t){return typeof t=="function"?{directive:$t(t),inputs:ii,outputs:ii}:{directive:$t(t.directive),inputs:Px(t.inputs),outputs:Px(t.outputs)}}function Px(t){if(t===void 0||t.length===0)return ii;let e={};for(let n=0;n<t.length;n+=2)e[t[n]]=t[n+1];return e}function eK(t,e){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n],i=t[n];t[r]=i}}function B1(t,e,n,r,i,o,s,a){if(n.firstCreatePass){t.mergedAttrs=Uu(t.mergedAttrs,t.attrs);let d=t.tView=cD(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),Rc(t,!1);let c=nK(n,e,t,r);QE()&&mD(n,e,c,t),Vu(c,e);let l=o1(c,e,c,t);e[r+Xe]=l,uD(e,l),R9(l,t,e)}function tK(t,e,n,r,i,o,s,a,c,l,d){let h=n+Xe,f;return e.firstCreatePass?(f=Fc(e,h,4,s||null,a||null),zE()&&h1(e,t,f,Er(e.consts,l),_D),Kx(e,f)):f=e.data[h],B1(f,t,e,n,r,i,o,c),wu(f)&&G_(e,t,f),l!=null&&Pf(t,f,d),f}function zu(t,e,n,r,i,o,s,a,c,l,d){let h=n+Xe,f;if(e.firstCreatePass){if(f=Fc(e,h,4,s||null,a||null),l!=null){let g=Er(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 B1(f,t,e,n,r,i,o,c),l!=null&&Pf(t,f,d),f}function G1(t,e,n,r,i,o,s,a){let c=re(),l=Qe(),d=Er(l.consts,o);return tK(c,l,t,e,n,r,i,d,void 0,s,a),G1}function j1(t,e,n,r,i,o,s,a){let c=re(),l=Qe(),d=Er(l.consts,o);return zu(c,l,t,e,n,r,i,d,void 0,s,a),j1}var nK=rK;function rK(t,e,n,r){return Af(!0),e[Ye].createComment("")}var q_=new K(""),Ju=new K(""),Bf=(()=>{class t{_ngZone;registry;_isZoneStable=!0;_callbacks=[];_taskTrackingZone=null;_destroyRef;constructor(n,r,i){this._ngZone=n,this.registry=r,CA()&&(this._destroyRef=Y(qn,{optional:!0})??void 0),bD||(H1(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:()=>{De.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)(q(De),q(Gf),q(Ju))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})(),Gf=(()=>{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 bD?.findTestabilityInTree(this,n,r)??null}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})();function H1(t){bD=t}var bD;function K_(t){return!!t&&typeof t.then=="function"}function wD(t){return!!t&&typeof t.subscribe=="function"}var $1=new K("");var OD=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,r)=>{this.resolve=n,this.reject=r});appInits=Y($1,{optional:!0})??[];injector=Y(Ke);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let i of this.appInits){let o=Hi(this.injector,i);if(K_(o))n.push(o);else if(wD(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=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),W1=new K("");function z1(){WS(()=>{let t="";throw new ee(600,t)})}function q1(t){return t.isBoundToModule}var iK=10;function LD(t,e){return Array.isArray(e)?e.reduce(LD,t):V(V({},t),e)}var js=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=Y(Ki);afterRenderManager=Y(pD);zonelessEnabled=Y(xu);rootEffectScheduler=Y(Cf);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Ue;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=Y(Us);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(Ce(n=>!n))}constructor(){Y(kc,{optional:!0})}whenStable(){let n;return new Promise(r=>{n=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{n.unsubscribe()})}_injector=Y(Mn);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,r){return this.bootstrapImpl(n,r)}bootstrapImpl(n,r,i=Ke.NULL){return this._injector.get(De).run(()=>{ot(10);let s=n instanceof $_;if(!this._injector.get(OD).done){let E="";throw new ee(405,E)}let c;s?c=n:c=this._injector.get(Ff).resolveComponentFactory(n),this.componentTypes.push(c.componentType);let l=q1(c)?void 0:this._injector.get(Pc),d=r||c.selector,h=c.create(i,[],d,l),f=h.location.nativeElement,g=h.injector.get(q_,null);return g?.registerApplication(f),h.onDestroy(()=>{this.detachView(h.hostView),Rf(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(U_.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new ee(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++<iK;)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&&!Lu(i))continue;let o=r&&!this.zonelessEnabled?0:1;t1(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})=>Lu(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;Rf(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(W1,[]).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),()=>Rf(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new ee(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=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Rf(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function K1(t,e){let n=re(),r=qi();if(In(n,r,e)){let i=Qe(),o=Nc();if(j_(o,i,n,t,e))ko(o)&&Kk(n,o.index);else{let a=mr(o,n);Yk(n[Ye],a,null,o.value,t,e,null)}}return K1}function Y1(t,e,n,r){let i=re(),o=qi();if(In(i,o,e)){let s=Qe(),a=Nc();Aq(a,i,t,e,n,r)}return Y1}var wTe=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";function oK(){return re()[Pn][Ct]}var UC=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 iC(t,e,n,r,i){return t===n&&Object.is(e,r)?1:Object.is(i(t,e),i(n,r))?-1:0}function sK(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=iC(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=iC(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),R=n(o,d);if(Object.is(R,S)){let U=n(c,g);Object.is(U,I)?(t.swap(o,s),t.updateValue(s,g),c--,s--):t.move(s,o),t.updateValue(o,d),o++;continue}if(r??=new b_,i??=kx(t,o,s,n),VC(t,r,o,R))t.updateValue(o,d),o++,s++;else if(i.has(R))r.set(I,t.detach(o)),s--;else{let U=t.create(o,e[o]);t.attach(o,U),o++,s++}}for(;o<=c;)xx(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=iC(o,d,o,h,n);if(f!==0)f<0&&t.updateValue(o,h),o++,l=c.next();else{r??=new b_,i??=kx(t,o,s,n);let g=n(o,h);if(VC(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;)xx(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 VC(t,e,n,r){return e!==void 0&&e.has(r)?(t.attach(n,e.get(r)),e.delete(r),!0):!1}function xx(t,e,n,r,i){if(VC(t,e,r,n(r,i)))t.updateValue(r,i);else{let o=t.create(r,i);t.attach(r,o)}}function kx(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 b_=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 aK(t,e,n,r,i,o,s,a){Ho("NgControlFlow");let c=re(),l=Qe(),d=Er(l.consts,o);return zu(c,l,t,e,n,r,i,d,256,s,a),MD}function MD(t,e,n,r,i,o,s,a){Ho("NgControlFlow");let c=re(),l=Qe(),d=Er(l.consts,o);return zu(c,l,t,e,n,r,i,d,512,s,a),MD}function cK(t,e){Ho("NgControlFlow");let n=re(),r=qi(),i=n[r]!==un?n[r]:-1,o=i!==-1?w_(n,Xe+i):void 0,s=0;if(In(n,r,t)){let a=Te(null);try{if(o!==void 0&&a1(o,s),t!==-1){let c=Xe+t,l=w_(n,c),d=HC(n[ge],c),h=l1(l,d,n),f=xf(n,d,e,{dehydratedView:h});kf(l,f,s,Gu(d,h))}}finally{Te(a)}}else if(o!==void 0){let a=s1(o,s);a!==void 0&&(a[Ct]=e)}}var BC=class{lContainer;$implicit;$index;constructor(e,n,r){this.lContainer=e,this.$implicit=n,this.$index=r}get $count(){return this.lContainer.length-Dt}};function lK(t){return t}function uK(t,e){return e}var GC=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,n,r){this.hasEmptyBlock=e,this.trackByFn=n,this.liveCollection=r}};function dK(t,e,n,r,i,o,s,a,c,l,d,h,f){Ho("NgControlFlow");let g=re(),E=Qe(),I=c!==void 0,S=re(),R=a?s.bind(S[Pn][Ct]):s,U=new GC(I,R);S[Xe+t]=U,zu(g,E,t+1,e,n,r,i,Er(E.consts,o),256),I&&zu(g,E,t+2,c,l,d,h,Er(E.consts,f),512)}var jC=class extends UC{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-Dt}at(e){return this.getLView(e)[Ct].$implicit}attach(e,n){let r=n[Tc];this.needsIndexUpdate||=e!==this.length,kf(this.lContainer,n,e,Gu(this.templateTNode,r)),fK(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,pK(this.lContainer,e),gK(this.lContainer,e)}create(e,n){let r=y_(this.lContainer,this.templateTNode.tView.ssrId),i=xf(this.hostLView,this.templateTNode,new BC(this.lContainer,n,e),{dehydratedView:r});return this.operationsCounter?.recordCreate(),i}destroy(e){V_(e[ge],e),this.operationsCounter?.recordDestroy()}updateValue(e,n){this.getLView(e)[Ct].$implicit=n}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[Ct].$index=e}getLView(e){return mK(this.lContainer,e)}};function hK(t){let e=Te(null),n=_r();try{let r=re(),i=r[ge],o=r[n],s=n+1,a=w_(r,s);if(o.liveCollection===void 0){let l=HC(i,s);o.liveCollection=new jC(a,r,l)}else o.liveCollection.reset();let c=o.liveCollection;if(sK(c,t,o.trackByFn),c.updateIndexes(),o.hasEmptyBlock){let l=qi(),d=c.length===0;if(In(r,l,d)){let h=n+2,f=w_(r,h);if(d){let g=HC(i,h),E=l1(f,g,r),I=xf(r,g,void 0,{dehydratedView:E});kf(f,I,0,Gu(g,E))}else i.firstUpdatePass&&Yq(f),a1(f,0)}}}finally{Te(e)}}function w_(t,e){return t[e]}function fK(t,e){if(t.length<=Dt)return;let n=Dt+e,r=t[n],i=r?r[Sc]:void 0;if(r&&i&&i.detachedLeaveAnimationFns&&i.detachedLeaveAnimationFns.length>0){let o=r[Po];rq(o,i),Mc.delete(r),i.detachedLeaveAnimationFns=void 0}}function pK(t,e){if(t.length<=Dt)return;let n=Dt+e,r=t[n],i=r?r[Sc]:void 0;i&&i.leave&&i.leave.size>0&&(i.detachedLeaveAnimationFns=[])}function gK(t,e){return wf(t,e)}function mK(t,e){return s1(t,e)}function HC(t,e){return yf(t,e)}function X1(t,e,n){let r=re(),i=qi();if(In(r,i,e)){let o=Qe(),s=Nc();zk(s,r,t,e,r[Ye],n)}return X1}function $C(t,e,n,r,i){j_(e,t,n,i?"class":"style",r)}function PD(t,e,n,r){let i=re(),o=i[ge],s=t+Xe,a=o.firstCreatePass?SD(s,i,2,e,_D,zE(),n,r):o.data[s];if(TD(a,i,t,e,Z1),wu(a)){let c=i[ge];G_(c,i,a),eD(c,a,i)}return r!=null&&Pf(i,a),PD}function xD(){let t=Qe(),e=zt(),n=yD(e);return t.firstCreatePass&&AD(t,n),UA(n)&&VA(),kA(),n.classesWithoutHost!=null&&y8(n)&&$C(t,n,re(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&I8(n)&&$C(t,n,re(),n.stylesWithoutHost,!1),xD}function Q1(t,e,n,r){return PD(t,e,n,r),xD(),Q1}function kD(t,e,n,r){let i=re(),o=i[ge],s=t+Xe,a=o.firstCreatePass?u9(s,o,2,e,n,r):o.data[s];return TD(a,i,t,e,Z1),r!=null&&Pf(i,a),kD}function FD(){let t=zt(),e=yD(t);return UA(e)&&VA(),kA(),FD}function J1(t,e,n,r){return kD(t,e,n,r),FD(),J1}var Z1=(t,e,n,r,i)=>(Af(!0),Sk(e[Ye],r,KA()));function UD(t,e,n){let r=re(),i=r[ge],o=t+Xe,s=i.firstCreatePass?SD(o,r,8,"ng-container",_D,zE(),e,n):i.data[o];if(TD(s,r,t,"ng-container",EK),wu(s)){let a=r[ge];G_(a,r,s),eD(a,s,r)}return n!=null&&Pf(r,s),UD}function VD(){let t=Qe(),e=zt(),n=yD(e);return t.firstCreatePass&&AD(t,n),VD}function eF(t,e,n){return UD(t,e,n),VD(),eF}var EK=(t,e,n,r,i)=>(Af(!0),T5(e[Ye],""));function _K(){return re()}function tF(t,e,n){let r=re(),i=qi();if(In(r,i,e)){let o=Qe(),s=Nc();qk(s,r,t,e,r[Ye],n)}return tF}var r_=void 0;function TK(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return e===1&&n===0?1:5}var yK=["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"]],r_,[["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"]],r_,[["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}",r_,"{1} 'at' {0}",r_],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",TK],oC={};function yr(t){let e=IK(t),n=Fx(e);if(n)return n;let r=e.split("-")[0];if(n=Fx(r),n)return n;if(r==="en")return yK;throw new ee(701,!1)}function Fx(t){if(!(t in oC)){let e=Mt.ng&&Mt.ng.common&&Mt.ng.common.locales&&Mt.ng.common.locales[t];return e!==void 0&&(oC[t]=e),e}return oC[t]}var Nt=(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})(Nt||{});function IK(t){return t.toLowerCase().replace(/_/g,"-")}var jf="en-US";var vK=jf;function nF(t){typeof t=="string"&&(vK=t.toLowerCase().replace(/_/g,"-"))}function rF(t,e,n){let r=re(),i=Qe(),o=zt();return oF(i,r,r[Ye],o,t,e,n),rF}function iF(t,e,n){let r=re(),i=Qe(),o=zt();return(o.type&3||n)&&g1(o,i,r,n,r[Ye],t,e,u_(o,r,e)),iF}function oF(t,e,n,r,i,o,s){let a=!0,c=null;if((r.type&3||s)&&(c??=u_(r,e,o),g1(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??=u_(r,e,o),wx(r,e,f,g,i,c)}if(l&&l.length)for(let h of l)c??=u_(r,e,o),wx(r,e,h,i,i,c)}}function SK(t=1){return tx(t)}function AK(t,e){let n=null,r=k5(t);for(let i=0;i<e.length;i++){let o=e[i];if(o==="*"){n=i;continue}if(r===null?Nk(t,o,!0):V5(r,o))return i}return n}function CK(t){let e=re()[Pn][Wn];if(!e.projection){let n=t?t.length:1,r=e.projection=RP(n,null),i=r.slice(),o=e.child;for(;o!==null;){if(o.type!==128){let s=t?AK(o,t):0;s!==null&&(i[s]?i[s].projectionNext=o:r[s]=o,i[s]=o)}o=o.next}}}function DK(t,e=0,n,r,i,o){let s=re(),a=Qe(),c=r?t+1:null;c!==null&&zu(s,a,c,r,i,o,null,n);let l=Fc(a,Xe+t,16,null,n||null);l.projection===null&&(l.projection=e),jA();let h=!s[Tc]||FA();s[Pn][Wn].projection[l.projection]===null&&c!==null?RK(s,a,c):h&&!P_(l)&&pq(a,s,l)}function RK(t,e,n){let r=Xe+n,i=e.data[r],o=t[r],s=y_(o,i.tView.ssrId),a=xf(t,i,void 0,{dehydratedView:s});kf(o,a,0,Gu(i,s))}function NK(t,e,n,r){M9(t,e,n,r)}function bK(t,e,n){v1(t,e,n)}function wK(t){let e=re(),n=Qe(),r=KE();Sf(r+1);let i=ND(n,r);if(t.dirty&&FP(e)===((i.metadata.flags&2)===2)){if(i.matches===null)t.reset([]);else{let o=A1(e,r);t.reset(o,ok),t.notifyOnChanges()}return!0}return!1}function OK(){return RD(re(),KE())}function LK(t,e,n,r){k9(t,v1(e,n,r))}function MK(t=1){Sf(KE()+t)}function PK(t){let e=HA();return Dc(e,Xe+t)}function i_(t,e){return t<<17|e<<2}function xc(t){return t>>17&32767}function xK(t){return(t&2)==2}function kK(t,e){return t&131071|e<<17}function WC(t){return t|2}function qu(t){return(t&131068)>>2}function sC(t,e){return t&-131069|e<<2}function FK(t){return(t&1)===1}function zC(t){return t|1}function UK(t,e,n,r,i,o){let s=o?e.classBindings:e.styleBindings,a=xc(s),c=qu(s);t[r]=n;let l=!1,d;if(Array.isArray(n)){let h=n;d=h[1],(d===null||Du(h,d)>0)&&(l=!0)}else d=n;if(i)if(c!==0){let f=xc(t[a+1]);t[r+1]=i_(f,a),f!==0&&(t[f+1]=sC(t[f+1],r)),t[a+1]=kK(t[a+1],r)}else t[r+1]=i_(a,0),a!==0&&(t[a+1]=sC(t[a+1],r)),a=r;else t[r+1]=i_(c,0),a===0?a=r:t[c+1]=sC(t[c+1],r),c=r;l&&(t[r+1]=WC(t[r+1])),Ux(t,d,r,!0),Ux(t,d,r,!1),VK(e,d,t,r,o),s=i_(a,c),o?e.classBindings=s:e.styleBindings=s}function VK(t,e,n,r,i){let o=i?t.residualClasses:t.residualStyles;o!=null&&typeof e=="string"&&Du(o,e)>=0&&(n[r+1]=zC(n[r+1]))}function Ux(t,e,n,r){let i=t[n+1],o=e===null,s=r?xc(i):qu(i),a=!1;for(;s!==0&&(a===!1||o);){let c=t[s],l=t[s+1];BK(c,e)&&(a=!0,t[s+1]=r?zC(l):WC(l)),s=r?xc(l):qu(l)}a&&(t[n+1]=r?WC(i):zC(i))}function BK(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?Du(t,e)>=0:!1}var Kt={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function sF(t){return t.substring(Kt.key,Kt.keyEnd)}function GK(t){return t.substring(Kt.value,Kt.valueEnd)}function jK(t){return lF(t),aF(t,Ku(t,0,Kt.textEnd))}function aF(t,e){let n=Kt.textEnd;return n===e?-1:(e=Kt.keyEnd=$K(t,Kt.key=e,n),Ku(t,e,n))}function HK(t){return lF(t),cF(t,Ku(t,0,Kt.textEnd))}function cF(t,e){let n=Kt.textEnd,r=Kt.key=Ku(t,e,n);return n===r?-1:(r=Kt.keyEnd=WK(t,r,n),r=Vx(t,r,n,58),r=Kt.value=Ku(t,r,n),r=Kt.valueEnd=zK(t,r,n),Vx(t,r,n,59))}function lF(t){Kt.key=0,Kt.keyEnd=0,Kt.value=0,Kt.valueEnd=0,Kt.textEnd=t.length}function Ku(t,e,n){for(;e<n&&t.charCodeAt(e)<=32;)e++;return e}function $K(t,e,n){for(;e<n&&t.charCodeAt(e)>32;)e++;return e}function WK(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 Vx(t,e,n,r){return e=Ku(t,e,n),e<n&&e++,e}function zK(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=Bx(t,c,s,n):e===s-4&&o===85&&i===82&&r===76&&c===40?a=s=Bx(t,41,s,n):c>32&&(a=s),o=i,i=r,r=c&-33}return a}function Bx(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 uF(t,e,n){return hF(t,e,n,!1),uF}function dF(t,e){return hF(t,e,null,!0),dF}function qK(t){fF(mF,KK,t,!1)}function KK(t,e){for(let n=HK(e);n>=0;n=cF(e,n))mF(t,sF(e),GK(e))}function YK(t){fF(nY,XK,t,!0)}function XK(t,e){for(let n=jK(e);n>=0;n=aF(e,n))mf(t,sF(e),!0)}function hF(t,e,n,r){let i=re(),o=Qe(),s=vf(2);if(o.firstUpdatePass&&gF(o,t,s,r),e!==un&&In(i,s,e)){let a=o.data[_r()];EF(o,a,i,i[Ye],t,i[s+1]=iY(e,n),r,s)}}function fF(t,e,n,r){let i=Qe(),o=vf(2);i.firstUpdatePass&&gF(i,null,o,r);let s=re();if(n!==un&&In(s,o,n)){let a=i.data[_r()];if(_F(a,r)&&!pF(i,o)){let c=r?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(n=PE(c,n||"")),$C(i,a,s,n,r)}else rY(i,a,s,s[Ye],s[o+1],s[o+1]=tY(t,e,n),r,o)}}function pF(t,e){return e>=t.expandoStartIndex}function gF(t,e,n,r){let i=t.data;if(i[n+1]===null){let o=i[_r()],s=pF(t,n);_F(o,r)&&e===null&&!s&&(e=!1),e=QK(i,o,e,r),UK(i,o,e,n,s,r)}}function QK(t,e,n,r){let i=QP(t),o=r?e.residualClasses:e.residualStyles;if(i===null)(r?e.classBindings:e.styleBindings)===0&&(n=aC(null,t,e,n,r),n=Of(n,e.attrs,r),o=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==i)if(n=aC(i,t,e,n,r),o===null){let c=JK(t,e,r);c!==void 0&&Array.isArray(c)&&(c=aC(null,t,e,c[1],r),c=Of(c,e.attrs,r),ZK(t,e,r,c))}else o=eY(t,e,r)}return o!==void 0&&(r?e.residualClasses=o:e.residualStyles=o),n}function JK(t,e,n){let r=n?e.classBindings:e.styleBindings;if(qu(r)!==0)return t[xc(r)]}function ZK(t,e,n,r){let i=n?e.classBindings:e.styleBindings;t[xc(i)]=r}function eY(t,e,n){let r,i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o<i;o++){let s=t[o].hostAttrs;r=Of(r,s,n)}return Of(r,e.attrs,n)}function aC(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=Of(r,o.hostAttrs,i),o!==t);)a++;return t!==null&&(n.directiveStylingLast=a),r}function Of(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]),mf(t,s,n?!0:e[++o]))}return t===void 0?null:t}function tY(t,e,n){if(n==null||n==="")return Ln;let r=[],i=Tr(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 mF(t,e,n){mf(t,e,Tr(n))}function nY(t,e,n){let r=String(e);r!==""&&!r.includes(" ")&&mf(t,r,n)}function rY(t,e,n,r,i,o,s,a){i===un&&(i=Ln);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&&EF(t,e,n,r,E,I,s,a),d=c<i.length?i[c]:null,h=l<o.length?o[l]:null}}function EF(t,e,n,r,i,o,s,a){if(!(e.type&3))return;let c=t.data,l=c[a+1],d=FK(l)?Gx(c,e,n,i,qu(l),s):void 0;if(!O_(d)){O_(o)||xK(l)&&(o=Gx(c,null,n,i,a,s));let h=OA(_r(),n);mq(r,s,h,i,o)}}function Gx(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===un&&(f=h?Ln:void 0);let g=h?BE(f,r):d===r?f:void 0;if(l&&!O_(g)&&(g=BE(c,r)),O_(g)&&(a=g,s))return a;let E=t[i+1];i=s?xc(E):qu(E)}if(e!==null){let c=o?e.residualClasses:e.residualStyles;c!=null&&(a=BE(c,r))}return a}function O_(t){return t!==void 0}function iY(t,e){return t==null||t===""||(typeof e=="string"?t=t+e:typeof t=="object"&&(t=Lo(Tr(t)))),t}function _F(t,e){return(t.flags&(e?8:16))!==0}function oY(t,e=""){let n=re(),r=Qe(),i=t+Xe,o=r.firstCreatePass?Fc(r,i,1,e,null):r.data[i],s=sY(r,n,o,e,t);n[i]=s,QE()&&mD(r,n,s,o),Rc(o,!1)}var sY=(t,e,n,r,i)=>(Af(!0),E5(e[Ye],r));function TF(t,e,n,r=""){return In(t,qi(),n)?e+pr(n)+r:un}function aY(t,e,n,r,i,o=""){let s=WA(),a=ju(t,s,n,i);return vf(2),a?e+pr(n)+r+pr(i)+o:un}function cY(t,e,n,r,i,o,s,a=""){let c=WA(),l=DD(t,c,n,i,s);return vf(3),l?e+pr(n)+r+pr(i)+o+pr(s)+a:un}function yF(t){return BD("",t),yF}function BD(t,e,n){let r=re(),i=TF(r,t,e,n);return i!==un&&GD(r,_r(),i),BD}function IF(t,e,n,r,i){let o=re(),s=aY(o,t,e,n,r,i);return s!==un&&GD(o,_r(),s),IF}function vF(t,e,n,r,i,o,s){let a=re(),c=cY(a,t,e,n,r,i,o,s);return c!==un&&GD(a,_r(),c),vF}function GD(t,e,n){let r=OA(e,t);_5(t[Ye],r,n)}function SF(t,e,n){QA(e)&&(e=e());let r=re(),i=qi();if(In(r,i,e)){let o=Qe(),s=Nc();zk(s,r,t,e,r[Ye],n)}return SF}function lY(t,e){let n=QA(t);return n&&t.set(e),n}function AF(t,e){let n=re(),r=Qe(),i=zt();return oF(r,n,n[Ye],i,t,e),AF}var CF={};function DF(t){let e=Qe(),n=re(),r=t+Xe,i=Fc(e,r,128,null,null);return Rc(i,!1),If(e,n,r,CF),DF}function uY(t){Ho("NgLet");let e=Qe(),n=re(),r=_r();return If(e,n,r,t),t}function dY(t){let e=HA(),n=Dc(e,Xe+t);if(n===CF)throw new ee(314,!1);return n}function hY(t){return In(re(),qi(),t)?pr(t):un}function fY(t,e,n=""){return TF(re(),t,e,n)}function pY(t,e,n){let r=Qe();if(r.firstCreatePass){let i=ai(t);qC(n,r.data,r.blueprint,i,!0),qC(e,r.data,r.blueprint,i,!1)}}function qC(t,e,n,r,i){if(t=$t(t),Array.isArray(t))for(let o=0;o<t.length;o++)qC(t[o],e,n,r,i);else{let o=Qe(),s=re(),a=zt(),c=mc(t)?t:$t(t.provide),l=AA(t),d=a.providerIndexes&1048575,h=a.directiveStart,f=a.providerIndexes>>20;if(mc(t)||!t.multi){let g=new Lc(l,i,st,null),E=lC(c,e,i?d:d+f,h);E===-1?(dC(g_(a,s),o,c),cC(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=lC(c,e,d+f,h),E=lC(c,e,d,d+f),I=g>=0&&n[g],S=E>=0&&n[E];if(i&&!S||!i&&!I){dC(g_(a,s),o,c);let R=EY(i?mY:gY,n.length,i,r,l,t);!i&&S&&(n[E].providerFactory=R),cC(o,t,e.length,0),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),n.push(R),s.push(R)}else{let R=RF(n[i?E:g],l,!i&&r);cC(o,t,g>-1?g:E,R)}!i&&r&&S&&n[E].componentProviders++}}}function cC(t,e,n,r){let i=mc(e),o=MP(e);if(i||o){let c=(o?$t(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 RF(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function lC(t,e,n,r){for(let i=n;i<r;i++)if(e[i]===t)return i;return-1}function gY(t,e,n,r,i){return KC(this.multi,[])}function mY(t,e,n,r,i){let o=this.multi,s;if(this.providerFactory){let a=this.providerFactory.componentProviders,c=Nf(r,r[ge],this.providerFactory.index,i);s=c.slice(0,a),KC(o,s);for(let l=a;l<c.length;l++)s.push(c[l])}else s=[],KC(o,s);return s}function KC(t,e){for(let n=0;n<t.length;n++){let r=t[n];e.push(r())}return e}function EY(t,e,n,r,i,o){let s=new Lc(t,n,st,null);return s.multi=[],s.index=e,s.componentProviders=0,RF(s,i,r&&!n),s}function _Y(t,e=[]){return n=>{n.providersResolver=(r,i)=>pY(r,i?i(t):t,e)}}function TY(t,e,n){let r=t.\u0275cmp;r.directiveDefs=N_(e,x1),r.pipeDefs=N_(n,IA)}function yY(t,e,n){let r=zn()+t,i=re();return i[r]===un?eo(i,r,n?e.call(n):e()):Uf(i,r)}function IY(t,e,n,r){return NF(re(),zn(),t,e,n,r)}function vY(t,e,n,r,i){return bF(re(),zn(),t,e,n,r,i)}function SY(t,e,n,r,i,o){return wF(re(),zn(),t,e,n,r,i,o)}function AY(t,e,n,r,i,o,s){return wY(re(),zn(),t,e,n,r,i,o,s)}function CY(t,e,n,r,i,o,s,a){let c=zn()+t,l=re(),d=Hu(l,c,n,r,i,o);return In(l,c+4,s)||d?eo(l,c+5,a?e.call(a,n,r,i,o,s):e(n,r,i,o,s)):Uf(l,c+5)}function DY(t,e,n,r,i,o,s,a,c){let l=zn()+t,d=re(),h=Hu(d,l,n,r,i,o);return ju(d,l+4,s,a)||h?eo(d,l+6,c?e.call(c,n,r,i,o,s,a):e(n,r,i,o,s,a)):Uf(d,l+6)}function RY(t,e,n,r,i,o,s,a,c,l){let d=zn()+t,h=re(),f=Hu(h,d,n,r,i,o);return DD(h,d+4,s,a,c)||f?eo(h,d+7,l?e.call(l,n,r,i,o,s,a,c):e(n,r,i,o,s,a,c)):Uf(h,d+7)}function NY(t,e,n,r,i,o,s,a,c,l,d){let h=zn()+t,f=re(),g=Hu(f,h,n,r,i,o);return Hu(f,h+4,s,a,c,l)||g?eo(f,h+8,d?e.call(d,n,r,i,o,s,a,c,l):e(n,r,i,o,s,a,c,l)):Uf(f,h+8)}function bY(t,e,n,r){return OF(re(),zn(),t,e,n,r)}function Hf(t,e){let n=t[e];return n===un?void 0:n}function NF(t,e,n,r,i,o){let s=e+n;return In(t,s,i)?eo(t,s+1,o?r.call(o,i):r(i)):Hf(t,s+1)}function bF(t,e,n,r,i,o,s){let a=e+n;return ju(t,a,i,o)?eo(t,a+2,s?r.call(s,i,o):r(i,o)):Hf(t,a+2)}function wF(t,e,n,r,i,o,s,a){let c=e+n;return DD(t,c,i,o,s)?eo(t,c+3,a?r.call(a,i,o,s):r(i,o,s)):Hf(t,c+3)}function wY(t,e,n,r,i,o,s,a,c){let l=e+n;return Hu(t,l,i,o,s,a)?eo(t,l+4,c?r.call(c,i,o,s,a):r(i,o,s,a)):Hf(t,l+4)}function OF(t,e,n,r,i,o){let s=e+n,a=!1;for(let c=0;c<i.length;c++)In(t,s++,i[c])&&(a=!0);return a?eo(t,s,r.apply(o,i)):Hf(t,s)}function OY(t,e){let n=Qe(),r,i=t+Xe;n.firstCreatePass?(r=LY(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=bs(r.type,!0)),s,a=$n(st);try{let c=p_(!1),l=o();return p_(c),If(n,re(),i,l),l}finally{$n(a)}}function LY(t,e){if(e)for(let n=e.length-1;n>=0;n--){let r=e[n];if(t===r.name)return r}}function MY(t,e,n){let r=t+Xe,i=re(),o=Dc(i,r);return Y_(i,r)?NF(i,zn(),e,o.transform,n,o):o.transform(n)}function PY(t,e,n,r){let i=t+Xe,o=re(),s=Dc(o,i);return Y_(o,i)?bF(o,zn(),e,s.transform,n,r,s):s.transform(n,r)}function xY(t,e,n,r,i){let o=t+Xe,s=re(),a=Dc(s,o);return Y_(s,o)?wF(s,zn(),e,a.transform,n,r,i,a):a.transform(n,r,i)}function kY(t,e,n){let r=t+Xe,i=re(),o=Dc(i,r);return Y_(i,r)?OF(i,zn(),e,o.transform,n,o):o.transform.apply(o,n)}function Y_(t,e){return t[ge].data[e].pure}function FY(t,e){return H_(t,e)}var o_=null;function LF(t){o_!==null&&(t.defaultEncapsulation!==o_.defaultEncapsulation||t.preserveWhitespaces!==o_.preserveWhitespaces)||(o_=t)}var MF=new K("");var UY=(()=>{class t{zone=Y(De);changeDetectionScheduler=Y(xr);applicationRef=Y(js);applicationErrorHandler=Y(Ki);_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=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function PF({ngZoneFactory:t,ignoreChangesOutsideZone:e,scheduleInRootZone:n}){return t??=()=>new De(le(V({},jD()),{scheduleInRootZone:n})),[{provide:De,useFactory:t},{provide:Ls,multi:!0,useFactory:()=>{let r=Y(UY,{optional:!0});return()=>r.initialize()}},{provide:Ls,multi:!0,useFactory:()=>{let r=Y(VY);return()=>{r.initialize()}}},e===!0?{provide:JA,useValue:!0}:[],{provide:JE,useValue:n??Lk},{provide:Ki,useFactory:()=>{let r=Y(De),i=Y(Mn),o;return s=>{r.runOutsideAngular(()=>{i.destroyed&&!o?setTimeout(()=>{throw s}):(o??=i.get(fr),o.handleError(s))})}}}]}function jD(t){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:t?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:t?.runCoalescing??!1}}var VY=(()=>{class t{subscription=new gt;initialized=!1;zone=Y(De);pendingTasks=Y(Us);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(()=>{De.assertNotInAngularZone(),queueMicrotask(()=>{n!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(n),n=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{De.assertInAngularZone(),n??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var HD=(()=>{class t{applicationErrorHandler=Y(Ki);appRef=Y(js);taskService=Y(Us);ngZone=Y(De);zonelessEnabled=Y(xu);tracing=Y(kc,{optional:!0});disableScheduling=Y(JA,{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(__):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(Y(JE,{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 Bu||!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?yx:Mk;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(__+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,yx(()=>{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=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function BY(){return Ho("NgZoneless"),tr([{provide:xr,useExisting:HD},{provide:De,useClass:Bu},{provide:xu,useValue:!0},{provide:JE,useValue:!1},[]])}function GY(){return typeof $localize<"u"&&$localize.locale||jf}var $f=new K("",{providedIn:"root",factory:()=>Y($f,{optional:!0,skipSelf:!0})||GY()});var X_=class{destroyed=!1;listeners=null;errorHandler=Y(fr,{optional:!0});destroyRef=Y(qn);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new ee(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(Os(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 Wf(t){return gP(t)}function zf(t,e){return af(t,e?.equal)}var $D=class{[ln];constructor(e){this[ln]=e}destroy(){this[ln].destroy()}};function WD(t,e){let n=e?.injector??Y(Ke),r=e?.manualCleanup!==!0?n.get(qn):null,i,o=n.get(Pu,null,{optional:!0}),s=n.get(xr);return o!==null?(i=$Y(o.view,s,t),r instanceof pf&&r._lView===o.view&&(r=null)):i=WY(t,n.get(Cf),s),i.injector=n,r!==null&&(i.onDestroyFn=r.onDestroy(()=>i.destroy())),new $D(i)}var xF=le(V({},mP),{cleanupFns:void 0,zone:null,onDestroyFn:wc,run(){let t=Mu(!1);try{EP(this)}finally{Mu(t)}},cleanup(){if(!this.cleanupFns?.length)return;let t=Te(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],Te(t)}}}),jY=le(V({},xF),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){hc(this),this.onDestroyFn(),this.cleanup(),this.scheduler.remove(this)}}),HY=le(V({},xF),{consumerMarkedDirty(){this.view[ye]|=8192,ks(this.view),this.notifier.notify(13)},destroy(){hc(this),this.onDestroyFn(),this.cleanup(),this.view[xo]?.delete(this)}});function $Y(t,e,n){let r=Object.create(HY);return r.view=t,r.zone=typeof Zone<"u"?Zone.current:null,r.notifier=e,r.fn=kF(r,n),t[xo]??=new Set,t[xo].add(r),r.consumerMarkedDirty(r),r}function WY(t,e,n){let r=Object.create(jY);return r.fn=kF(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 kF(t,e){return()=>{e(n=>(t.cleanupFns??=[]).push(n))}}var $F=Symbol("InputSignalNode#UNSET"),r7=le(V({},vE),{transformFn:void 0,applyValueToInputSignal(t,e){Su(t,e)}});function WF(t,e){let n=Object.create(r7);n.value=t,n.transformFn=e?.transform;function r(){if(Tu(n),n.value===$F){let i=null;throw new ee(-950,i)}return n.value}return r[ln]=n,r}var i7=new K("");i7.__NG_ELEMENT_ID__=t=>{let e=zt();if(e===null)throw new ee(204,!1);if(e.type&2)return e.value;if(t&8)return null;throw new ee(204,!1)};function $Ae(t){return new X_}function FF(t,e){return WF(t,e)}function o7(t){return WF($F,t)}var WAe=(FF.required=o7,FF);function UF(t,e){return D1(e)}function s7(t,e){return R1(e)}var zAe=(UF.required=s7,UF);function a7(t,e,n){let r=new D_(n);return Promise.resolve(r)}function VF(t){for(let e=t.length-1;e>=0;e--)if(t[e]!==void 0)return t[e]}var Q_=new K(""),c7=new K("");function qf(t){return!t.moduleRef}function l7(t){let e=qf(t)?t.r3Injector:t.moduleRef.injector,n=e.get(De);return n.run(()=>{qf(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();let r=e.get(Ki),i;if(n.runOutsideAngular(()=>{i=n.onError.subscribe({next:r})}),qf(t)){let o=()=>e.destroy(),s=t.platformInjector.get(Q_);s.add(o),e.onDestroy(()=>{i.unsubscribe(),s.delete(o)})}else{let o=()=>t.moduleRef.destroy(),s=t.platformInjector.get(Q_);s.add(o),t.moduleRef.onDestroy(()=>{Rf(t.allPlatformModules,t.moduleRef),i.unsubscribe(),s.delete(o)})}return d7(r,n,()=>{let o=e.get(Us),s=o.add(),a=e.get(OD);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get($f,jf);if(nF(c||jf),!e.get(c7,!0))return qf(t)?e.get(js):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(qf(t)){let d=e.get(js);return t.rootComponent!==void 0&&d.bootstrap(t.rootComponent),d}else return zF?.(t.moduleRef,t.allPlatformModules),t.moduleRef}).finally(()=>{o.remove(s)})})})}var zF;function BF(){zF=u7}function u7(t,e){let n=t.injector.get(js);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>n.bootstrap(r));else if(t.instance.ngDoBootstrap)t.instance.ngDoBootstrap(n);else throw new ee(-403,!1);e.push(t)}function d7(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 qF=(()=>{class t{_injector;_modules=[];_destroyListeners=[];_destroyed=!1;constructor(n){this._injector=n}bootstrapModuleFactory(n,r){let i=r?.scheduleInRootZone,o=()=>xk(r?.ngZone,le(V({},jD({eventCoalescing:r?.ngZoneEventCoalescing,runCoalescing:r?.ngZoneRunCoalescing})),{scheduleInRootZone:i})),s=r?.ignoreChangesOutsideZone,a=[PF({ngZoneFactory:o,ignoreChangesOutsideZone:s}),{provide:xr,useExisting:HD},ox],c=M1(n.moduleType,this.injector,a);return BF(),l7({moduleRef:c,allPlatformModules:this._modules,platformInjector:this.injector})}bootstrapModule(n,r=[]){let i=LD({},r);return BF(),a7(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 ee(404,!1);this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());let n=this._injector.get(Q_,null);n&&(n.forEach(r=>r()),n.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static \u0275fac=function(r){return new(r||t)(q(Ke))};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})(),ZD=null;function h7(t){if(tR())throw new ee(400,!1);z1(),ZD=t;let e=t.get(qF);return g7(t),e}function eR(t,e,n=[]){let r=`Platform: ${e}`,i=new K(r);return(o=[])=>{let s=tR();if(!s){let a=[...n,...o,{provide:i,useValue:!0}];s=t?.(a)??h7(f7(a,r))}return p7(i)}}function f7(t=[],e){return Ke.create({name:e,providers:[{provide:Ef,useValue:"platform"},{provide:Q_,useValue:new Set([()=>ZD=null])},...t]})}function p7(t){let e=tR();if(!e)throw new ee(-401,!1);return e}function tR(){return ZD?.get(qF)??null}function g7(t){let e=t.get(M_,null);Hi(t,()=>{e?.forEach(n=>n())})}function nR(){return!1}var m7=(()=>{class t{static __NG_ELEMENT_ID__=E7}return t})();function E7(t){return _7(zt(),re(),(t&16)===16)}function _7(t,e,n){if(ko(t)&&!n){let r=Ur(t.index,e);return new Vs(r,r)}else if(t.type&175){let r=e[Pn];return new Vs(r,e)}return null}var zD=class{constructor(){}supports(e){return CD(e)}create(e){return new qD(e)}},T7=(t,e)=>e,qD=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||T7}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<GF(r,i,o)?n:r,a=GF(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=[]),!CD(e))throw new ee(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,p1(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 KD(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 J_),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 J_),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}},KD=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}},YD=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}},J_=class{map=new Map;put(e){let n=e.trackById,r=this.map.get(n);r||(r=new YD,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 GF(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 XD=class{constructor(){}supports(e){return e instanceof Map||z_(e)}create(){return new QD}},QD=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||z_(e)))throw new ee(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 JD(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))}},JD=class{key;previousValue=null;currentValue=null;_nextPrevious=null;_next=null;_prev=null;_nextAdded=null;_nextRemoved=null;_nextChanged=null;constructor(e){this.key=e}};function jF(){return new rR([new zD])}var rR=(()=>{class t{factories;static \u0275prov=J({token:t,providedIn:"root",factory:jF});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||jF())}}}find(n){let r=this.factories.find(i=>i.supports(n));if(r!=null)return r;throw new ee(901,!1)}}return t})();function HF(){return new Z_([new XD])}var Z_=(()=>{class t{static \u0275prov=J({token:t,providedIn:"root",factory:HF});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||HF())}}}find(n){let r=this.factories.find(i=>i.supports(n));if(r)return r;throw new ee(901,!1)}}return t})();var KF=eR(null,"core",[]),YF=(()=>{class t{constructor(n){}static \u0275fac=function(r){return new(r||t)(q(js))};static \u0275mod=Gs({type:t});static \u0275inj=Mo({})}return t})();function qAe(t){return typeof t=="boolean"?t:t!=null&&t!=="false"}function KAe(t,e=NaN){return!isNaN(parseFloat(t))&&!isNaN(Number(t))?Number(t):e}function YAe(t,e){let n=Ms(t),r=e.elementInjector||Ru();return new $u(n).create(r,e.projectableNodes,e.hostElement,e.environmentInjector,e.directives,e.bindings)}var XF=null;function ro(){return XF}function iR(t){XF??=t}var Kf=class{},Zu=(()=>{class t{historyGo(n){throw new Error("")}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:()=>Y(QF),providedIn:"platform"})}return t})();var QF=(()=>{class t extends Zu{_location;_history;_doc=Y(qt);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ro().getBaseHref(this._doc)}onPopState(n){let r=ro().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",n,!1),()=>r.removeEventListener("popstate",n)}onHashChange(n){let r=ro().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=J({token:t,factory:()=>new t,providedIn:"platform"})}return t})();function eU(t,e){return t?e?t.endsWith("/")?e.startsWith("/")?t+e.slice(1):t+e:e.startsWith("/")?t+e:`${t}/${e}`:t:e}function JF(t){let e=t.search(/#|\?|$/);return t[e-1]==="/"?t.slice(0,e-1)+t.slice(e):t}function Hs(t){return t&&t[0]!=="?"?`?${t}`:t}var eT=(()=>{class t{historyGo(n){throw new Error("")}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:()=>Y(nU),providedIn:"root"})}return t})(),tU=new K(""),nU=(()=>{class t extends eT{_platformLocation;_baseHref;_removeListenerFns=[];constructor(n,r){super(),this._platformLocation=n,this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??Y(qt).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 eU(this._baseHref,n)}path(n=!1){let r=this._platformLocation.pathname+Hs(this._platformLocation.search),i=this._platformLocation.hash;return i&&n?`${r}${i}`:r}pushState(n,r,i,o){let s=this.prepareExternalUrl(i+Hs(o));this._platformLocation.pushState(n,r,s)}replaceState(n,r,i,o){let s=this.prepareExternalUrl(i+Hs(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)(q(Zu),q(tU,8))};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),rU=(()=>{class t{_subject=new Ue;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(n){this._locationStrategy=n;let r=this._locationStrategy.getBaseHref();this._basePath=v7(JF(ZF(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+Hs(r))}normalize(n){return t.stripTrailingSlash(I7(this._basePath,ZF(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+Hs(r)),i)}replaceState(n,r="",i=null){this._locationStrategy.replaceState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+Hs(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=Hs;static joinWithSlash=eU;static stripTrailingSlash=JF;static \u0275fac=function(r){return new(r||t)(q(eT))};static \u0275prov=J({token:t,factory:()=>y7(),providedIn:"root"})}return t})();function y7(){return new rU(q(eT))}function I7(t,e){if(!t||!e.startsWith(t))return e;let n=e.substring(t.length);return n===""||["/",";","?","#"].includes(n[0])?n:e}function ZF(t){return t.replace(/\/index.html$/,"")}function v7(t){if(new RegExp("^(https?:)?//").test(t)){let[,n]=t.split(/\/\/[^\/]+/);return n}return t}var xn=(function(t){return t[t.Format=0]="Format",t[t.Standalone=1]="Standalone",t})(xn||{}),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||{}),nr=(function(t){return t[t.Short=0]="Short",t[t.Medium=1]="Medium",t[t.Long=2]="Long",t[t.Full=3]="Full",t})(nr||{}),Wo={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 lU(t){return yr(t)[Nt.LocaleId]}function uU(t,e,n){let r=yr(t),i=[r[Nt.DayPeriodsFormat],r[Nt.DayPeriodsStandalone]],o=Vr(i,e);return Vr(o,n)}function dU(t,e,n){let r=yr(t),i=[r[Nt.DaysFormat],r[Nt.DaysStandalone]],o=Vr(i,e);return Vr(o,n)}function hU(t,e,n){let r=yr(t),i=[r[Nt.MonthsFormat],r[Nt.MonthsStandalone]],o=Vr(i,e);return Vr(o,n)}function fU(t,e){let r=yr(t)[Nt.Eras];return Vr(r,e)}function Yf(t,e){let n=yr(t);return Vr(n[Nt.DateFormat],e)}function Xf(t,e){let n=yr(t);return Vr(n[Nt.TimeFormat],e)}function Qf(t,e){let r=yr(t)[Nt.DateTimeFormat];return Vr(r,e)}function Jf(t,e){let n=yr(t),r=n[Nt.NumberSymbols][e];if(typeof r>"u"){if(e===Wo.CurrencyDecimal)return n[Nt.NumberSymbols][Wo.Decimal];if(e===Wo.CurrencyGroup)return n[Nt.NumberSymbols][Wo.Group]}return r}function pU(t){if(!t[Nt.ExtraData])throw new ee(2303,!1)}function gU(t){let e=yr(t);return pU(e),(e[Nt.ExtraData][2]||[]).map(r=>typeof r=="string"?oR(r):[oR(r[0]),oR(r[1])])}function mU(t,e,n){let r=yr(t);pU(r);let i=[r[Nt.ExtraData][0],r[Nt.ExtraData][1]],o=Vr(i,e)||[];return Vr(o,n)||[]}function Vr(t,e){for(let n=e;n>-1;n--)if(typeof t[n]<"u")return t[n];throw new ee(2304,!1)}function oR(t){let[e,n]=t.split(":");return{hours:+e,minutes:+n}}var S7=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,tT={},A7=/((?:[^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]*)/,C7=256;function EU(t,e,n,r){let i=x7(t);D7(e),e=$o(n,e)||e;let s=[],a;for(;e;)if(a=A7.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=TU(r,c),i=P7(i,r));let l="";return s.forEach(d=>{let h=L7(d);l+=h?h(i,n,c):d==="''"?"'":d.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}function D7(t){if(t.length>C7)throw new ee(2300,!1)}function sT(t,e,n){let r=new Date(0);return r.setFullYear(t,e,n),r.setHours(0,0,0),r}function $o(t,e){let n=lU(t);if(tT[n]??={},tT[n][e])return tT[n][e];let r="";switch(e){case"shortDate":r=Yf(t,nr.Short);break;case"mediumDate":r=Yf(t,nr.Medium);break;case"longDate":r=Yf(t,nr.Long);break;case"fullDate":r=Yf(t,nr.Full);break;case"shortTime":r=Xf(t,nr.Short);break;case"mediumTime":r=Xf(t,nr.Medium);break;case"longTime":r=Xf(t,nr.Long);break;case"fullTime":r=Xf(t,nr.Full);break;case"short":let i=$o(t,"shortTime"),o=$o(t,"shortDate");r=nT(Qf(t,nr.Short),[i,o]);break;case"medium":let s=$o(t,"mediumTime"),a=$o(t,"mediumDate");r=nT(Qf(t,nr.Medium),[s,a]);break;case"long":let c=$o(t,"longTime"),l=$o(t,"longDate");r=nT(Qf(t,nr.Long),[c,l]);break;case"full":let d=$o(t,"fullTime"),h=$o(t,"fullDate");r=nT(Qf(t,nr.Full),[d,h]);break}return r&&(tT[n][e]=r),r}function nT(t,e){return e&&(t=t.replace(/\{([^}]+)}/g,function(n,r){return e!=null&&r in e?e[r]:n})),t}function ui(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 R7(t,e){return ui(t,3).substring(0,e)}function Pt(t,e,n=0,r=!1,i=!1){return function(o,s){let a=N7(t,o);if((n>0||a>-n)&&(a+=n),t===3)a===0&&n===-12&&(a=12);else if(t===6)return R7(a,e);let c=Jf(s,Wo.MinusSign);return ui(a,e,c,r,i)}}function N7(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 ee(2301,!1)}}function ct(t,e,n=xn.Format,r=!1){return function(i,o){return b7(i,o,t,e,n,r)}}function b7(t,e,n,r,i,o){switch(n){case 2:return hU(e,i,r)[t.getMonth()];case 1:return dU(e,i,r)[t.getDay()];case 0:let s=t.getHours(),a=t.getMinutes();if(o){let l=gU(e),d=mU(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 uU(e,i,r)[s<12?0:1];case 3:return fU(e,r)[t.getFullYear()<=0?0:1];default:let c=n;throw new ee(2302,!1)}}function rT(t){return function(e,n,r){let i=-1*r,o=Jf(n,Wo.MinusSign),s=i>0?Math.floor(i/60):Math.ceil(i/60);switch(t){case 0:return(i>=0?"+":"")+ui(s,2,o)+ui(Math.abs(i%60),2,o);case 1:return"GMT"+(i>=0?"+":"")+ui(s,1,o);case 2:return"GMT"+(i>=0?"+":"")+ui(s,2,o)+":"+ui(Math.abs(i%60),2,o);case 3:return r===0?"Z":(i>=0?"+":"")+ui(s,2,o)+":"+ui(Math.abs(i%60),2,o);default:throw new ee(2310,!1)}}}var w7=0,oT=4;function O7(t){let e=sT(t,w7,1).getDay();return sT(t,0,1+(e<=oT?oT:oT+7)-e)}function _U(t){let e=t.getDay(),n=e===0?-3:oT-e;return sT(t.getFullYear(),t.getMonth(),t.getDate()+n)}function sR(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=_U(n),s=O7(o.getFullYear()),a=o.getTime()-s.getTime();i=1+Math.round(a/6048e5)}return ui(i,t,Jf(r,Wo.MinusSign))}}function iT(t,e=!1){return function(n,r){let o=_U(n).getFullYear();return ui(o,t,Jf(r,Wo.MinusSign),e)}}var aR={};function L7(t){if(aR[t])return aR[t];let e;switch(t){case"G":case"GG":case"GGG":e=ct(3,tt.Abbreviated);break;case"GGGG":e=ct(3,tt.Wide);break;case"GGGGG":e=ct(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=iT(1);break;case"YY":e=iT(2,!0);break;case"YYY":e=iT(3);break;case"YYYY":e=iT(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=ct(2,tt.Abbreviated);break;case"MMMM":e=ct(2,tt.Wide);break;case"MMMMM":e=ct(2,tt.Narrow);break;case"LLL":e=ct(2,tt.Abbreviated,xn.Standalone);break;case"LLLL":e=ct(2,tt.Wide,xn.Standalone);break;case"LLLLL":e=ct(2,tt.Narrow,xn.Standalone);break;case"w":e=sR(1);break;case"ww":e=sR(2);break;case"W":e=sR(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=ct(1,tt.Abbreviated,xn.Standalone);break;case"cccc":e=ct(1,tt.Wide,xn.Standalone);break;case"ccccc":e=ct(1,tt.Narrow,xn.Standalone);break;case"cccccc":e=ct(1,tt.Short,xn.Standalone);break;case"E":case"EE":case"EEE":e=ct(1,tt.Abbreviated);break;case"EEEE":e=ct(1,tt.Wide);break;case"EEEEE":e=ct(1,tt.Narrow);break;case"EEEEEE":e=ct(1,tt.Short);break;case"a":case"aa":case"aaa":e=ct(0,tt.Abbreviated);break;case"aaaa":e=ct(0,tt.Wide);break;case"aaaaa":e=ct(0,tt.Narrow);break;case"b":case"bb":case"bbb":e=ct(0,tt.Abbreviated,xn.Standalone,!0);break;case"bbbb":e=ct(0,tt.Wide,xn.Standalone,!0);break;case"bbbbb":e=ct(0,tt.Narrow,xn.Standalone,!0);break;case"B":case"BB":case"BBB":e=ct(0,tt.Abbreviated,xn.Format,!0);break;case"BBBB":e=ct(0,tt.Wide,xn.Format,!0);break;case"BBBBB":e=ct(0,tt.Narrow,xn.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=rT(0);break;case"ZZZZZ":e=rT(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":e=rT(1);break;case"OOOO":case"ZZZZ":case"zzzz":e=rT(2);break;default:return null}return aR[t]=e,e}function TU(t,e){t=t.replace(/:/g,"");let n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(n)?e:n}function M7(t,e){return t=new Date(t.getTime()),t.setMinutes(t.getMinutes()+e),t}function P7(t,e,n){let i=t.getTimezoneOffset(),o=TU(e,i);return M7(t,-1*(o-i))}function x7(t){if(iU(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 sT(i,o-1,s)}let n=parseFloat(t);if(!isNaN(t-n))return new Date(n);let r;if(r=t.match(S7))return k7(r)}let e=new Date(t);if(!iU(e))throw new ee(2311,!1);return e}function k7(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 iU(t){return t instanceof Date&&!isNaN(t.valueOf())}var cR=/\s+/,oU=[],F7=(()=>{class t{_ngEl;_renderer;initialClasses=oU;rawClass;stateMap=new Map;constructor(n,r){this._ngEl=n,this._renderer=r}set klass(n){this.initialClasses=n!=null?n.trim().split(cR):oU}set ngClass(n){this.rawClass=typeof n=="string"?n.trim().split(cR):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(cR).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(Bs),st(W_))};static \u0275dir=no({type:t,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return t})();var aT=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}},yU=(()=>{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 aT(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),sU(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);sU(o,i)})}static ngTemplateContextGuard(n,r){return!0}static \u0275fac=function(r){return new(r||t)(st(to),st(Ji),st(rR))};static \u0275dir=no({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return t})();function sU(t,e){t.context.$implicit=e.item}var U7=(()=>{class t{_viewContainer;_context=new cT;_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){aU(n,!1),this._thenTemplateRef=n,this._thenViewRef=null,this._updateView()}set ngIfElse(n){aU(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(to),st(Ji))};static \u0275dir=no({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return t})(),cT=class{$implicit=null;ngIf=null};function aU(t,e){if(t&&!t.createEmbeddedView)throw new ee(2020,!1)}var lT=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()}},lR=(()=>{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=no({type:t,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}})}return t})(),V7=(()=>{class t{ngSwitch;_view;ngSwitchCase;constructor(n,r,i){this.ngSwitch=i,i._addCase(),this._view=new lT(n,r)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}static \u0275fac=function(r){return new(r||t)(st(to),st(Ji),st(lR,9))};static \u0275dir=no({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}})}return t})(),B7=(()=>{class t{constructor(n,r,i){i._addDefault(new lT(n,r))}static \u0275fac=function(r){return new(r||t)(st(to),st(Ji),st(lR,9))};static \u0275dir=no({type:t,selectors:[["","ngSwitchDefault",""]]})}return t})();var G7=(()=>{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:li.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(Bs),st(Z_),st(W_))};static \u0275dir=no({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return t})(),j7=(()=>{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(to))};static \u0275dir=no({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[YC]})}return t})();function IU(t,e){return new ee(2100,!1)}var H7=/(?:[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,$7=(()=>{class t{transform(n){if(n==null)return null;if(typeof n!="string")throw IU(t,n);return n.replace(H7,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}static \u0275fac=function(r){return new(r||t)};static \u0275pipe=Vf({name:"titlecase",type:t,pure:!0})}return t})();var W7="mediumDate",vU=new K(""),SU=new K(""),z7=(()=>{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??W7,a=i??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return EU(n,s,o||this.locale,a)}catch(s){throw IU(t,s.message)}}static \u0275fac=function(r){return new(r||t)(st($f,16),st(vU,24),st(SU,24))};static \u0275pipe=Vf({name:"date",type:t,pure:!0})}return t})();function q7(t,e){return{key:t,value:e}}var K7=(()=>{class t{differs;constructor(n){this.differs=n}differ;keyValues=[];compareFn=cU;transform(n,r=cU){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(q7(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(Z_,16))};static \u0275pipe=Vf({name:"keyvalue",type:t,pure:!1})}return t})();function cU(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 uR=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=Gs({type:t});static \u0275inj=Mo({})}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 Uc=class{};var dR="browser";function AU(t){return t===dR}var ep=class{_doc;constructor(e){this._doc=e}manager},tp=(()=>{class t extends ep{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)(q(qt))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})(),dT=new K(""),hT=(()=>{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 tp));this._plugins=i.slice().reverse();let o=n.find(s=>s instanceof tp);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 ee(5101,!1);return this._eventNameToPlugin.set(n,r),r}static \u0275fac=function(r){return new(r||t)(q(dT),q(De))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})(),hR="ng-app-id";function CU(t){for(let e of t)e.remove()}function DU(t,e){let n=e.createElement("style");return n.textContent=t,n}function Y7(t,e,n,r){let i=t.head?.querySelectorAll(`style[${hR}="${e}"],link[${hR}="${e}"]`);if(i)for(let o of i)o.removeAttribute(hR),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 pR(t,e){let n=e.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),n}var fT=(()=>{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,Y7(n,r,this.inline,this.external),this.hosts.add(n.head)}addStyles(n,r){for(let i of n)this.addUsage(i,this.inline,DU);r?.forEach(i=>this.addUsage(i,this.external,pR))}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&&(CU(i.elements),r.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])CU(n);this.hosts.clear()}addHost(n){this.hosts.add(n);for(let[r,{elements:i}]of this.inline)i.push(this.addElement(n,DU(r,this.doc)));for(let[r,{elements:i}]of this.external)i.push(this.addElement(n,pR(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)(q(qt),q(L_),q(Qu,8),q(Go))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})(),fR={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"},mR=/%COMP%/g;var NU="%COMP%",X7=`_nghost-${NU}`,Q7=`_ngcontent-${NU}`,J7=!0,bU=new K("",{providedIn:"root",factory:()=>J7});function Z7(t){return Q7.replace(mR,t)}function eX(t){return X7.replace(mR,t)}function wU(t,e){return e.map(n=>n.replace(mR,t))}var pT=(()=>{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 np(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 uT?i.applyToHost(n):i instanceof rp&&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 Uo.Emulated:o=new uT(c,l,r,this.appId,d,s,a,h,f);break;case Uo.ShadowDom:return new gR(c,l,n,r,s,a,this.nonce,h,f);default:o=new rp(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)(q(hT),q(fT),q(L_),q(bU),q(qt),q(De),q(Qu),q(kc,8))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})(),np=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(fR[n]||n,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,n){(RU(e)?e.content:e).appendChild(n)}insertBefore(e,n,r){e&&(RU(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 ee(-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=fR[i];o?e.setAttributeNS(o,n,r):e.setAttribute(n,r)}else e.setAttribute(n,r)}removeAttribute(e,n,r){if(r){let i=fR[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&(li.DashCase|li.Important)?e.style.setProperty(n,r,i&li.Important?"important":""):e.style[n]=r}removeStyle(e,n,r){r&li.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=ro().getGlobalEventTarget(this.doc,e),!e))throw new ee(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 RU(t){return t.tagName==="TEMPLATE"&&t.content!==void 0}var gR=class extends np{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=wU(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=pR(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)}},rp=class extends np{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?wU(l,d):d,this.styleUrls=r.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&Mc.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},uT=class extends rp{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=Z7(d),this.hostAttr=eX(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 gT=class t extends Kf{supportsDOMEvents=!0;static makeCurrent(){iR(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=tX();return n==null?null:nX(n)}resetBaseElement(){ip=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Zf(document.cookie,e)}},ip=null;function tX(){return ip=ip||document.head.querySelector("base"),ip?ip.getAttribute("href"):null}function nX(t){return new URL(t,document.baseURI).pathname}var mT=class{addToWindow(e){Mt.getAngularTestability=(r,i=!0)=>{let o=e.findTestabilityInTree(r,i);if(o==null)throw new ee(5103,!1);return o},Mt.getAllAngularTestabilities=()=>e.getAllTestabilities(),Mt.getAllAngularRootElements=()=>e.getAllRootElements();let n=r=>{let i=Mt.getAllAngularTestabilities(),o=i.length,s=function(){o--,o==0&&r()};i.forEach(a=>{a.whenStable(s)})};Mt.frameworkStabilizers||(Mt.frameworkStabilizers=[]),Mt.frameworkStabilizers.push(n)}findTestabilityInTree(e,n,r){if(n==null)return null;let i=e.getTestability(n);return i??(r?ro().isShadowRoot(n)?this.findTestabilityInTree(e,n.host,!0):this.findTestabilityInTree(e,n.parentElement,!0):null)}},rX=(()=>{class t{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})(),OU=["alt","control","meta","shift"],iX={"\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"},oX={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},LU=(()=>{class t extends ep{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(()=>ro().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."),OU.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=iX[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"),OU.forEach(s=>{if(s!==i){let a=oX[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)(q(qt))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})();function sX(){gT.makeCurrent()}function aX(){return new fr}function cX(){return JC(document),document}var lX=[{provide:Go,useValue:dR},{provide:M_,useValue:sX,multi:!0},{provide:qt,useFactory:cX}],uX=eR(KF,"browser",lX);var dX=[{provide:Ju,useClass:mT},{provide:q_,useClass:Bf,deps:[De,Gf,Ju]},{provide:Bf,useClass:Bf,deps:[De,Gf,Ju]}],hX=[{provide:Ef,useValue:"root"},{provide:fr,useFactory:aX},{provide:dT,useClass:tp,multi:!0,deps:[qt]},{provide:dT,useClass:LU,multi:!0,deps:[qt]},pT,fT,hT,{provide:Bo,useExisting:pT},{provide:Uc,useClass:rX},[]],fX=(()=>{class t{constructor(){}static \u0275fac=function(r){return new(r||t)};static \u0275mod=Gs({type:t});static \u0275inj=Mo({providers:[...hX,...dX],imports:[uR,YF]})}return t})();var Bc=class{},op=class{},$s=class t{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
|
|
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 _T=class{encodeKey(e){return MU(e)}encodeValue(e){return MU(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function pX(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 gX=/%(\d[a-f0-9])/gi,mX={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function MU(t){return encodeURIComponent(t).replace(gX,(e,n)=>mX[n]??e)}function ET(t){return`${t}`}var zo=class t{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new _T,e.fromString){if(e.fromObject)throw new ee(2805,!1);this.map=pX(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(ET):[ET(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(ET(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(ET(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 TT=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 EX(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function PU(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer}function xU(t){return typeof Blob<"u"&&t instanceof Blob}function kU(t){return typeof FormData<"u"&&t instanceof FormData}function _X(t){return typeof URLSearchParams<"u"&&t instanceof URLSearchParams}var FU="Content-Type",UU="Accept",BU="X-Request-URL",GU="text/plain",jU="application/json",TX=`${jU}, ${GU}, */*`,ed=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(EX(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 ee(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 $s,this.context??=new TT,!this.params)this.params=new zo,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"||PU(this.body)||xU(this.body)||kU(this.body)||_X(this.body)?this.body:this.body instanceof zo?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||kU(this.body)?null:xU(this.body)?this.body.type||null:PU(this.body)?null:typeof this.body=="string"?GU:this.body instanceof zo?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?jU: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,R=e.reportProgress??this.reportProgress,U=e.headers||this.headers,H=e.params||this.params,Q=e.context??this.context;return e.setHeaders!==void 0&&(U=Object.keys(e.setHeaders).reduce((ae,ne)=>ae.set(ne,e.setHeaders[ne]),U)),e.setParams&&(H=Object.keys(e.setParams).reduce((ae,ne)=>ae.set(ne,e.setParams[ne]),H)),new t(n,r,I,{params:H,headers:U,context:Q,reportProgress:R,responseType:i,withCredentials:S,transferCache:g,keepalive:o,cache:a,priority:s,timeout:E,mode:c,redirect:l,credentials:d,referrer:h,integrity:f})}},Vc=(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})(Vc||{}),nd=class{headers;status;statusText;url;ok;type;redirected;constructor(e,n=200,r="OK"){this.headers=e.headers||new $s,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}},yT=class t extends nd{constructor(e={}){super(e)}type=Vc.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})}},sp=class t extends nd{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=Vc.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})}},td=class extends nd{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}},yX=200,IX=204;function ER(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 HU=(()=>{class t{handler;constructor(n){this.handler=n}request(n,r,i={}){let o;if(n instanceof ed)o=n;else{let c;i.headers instanceof $s?c=i.headers:c=new $s(i.headers);let l;i.params&&(i.params instanceof zo?l=i.params:l=new zo({fromObject:i.params})),o=new ed(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=it(o).pipe(PS(c=>this.handler.handle(c)));if(n instanceof ed||i.observe==="events")return s;let a=s.pipe(Tn(c=>c instanceof sp));switch(i.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return a.pipe(Ce(c=>{if(c.body!==null&&!(c.body instanceof ArrayBuffer))throw new ee(2806,!1);return c.body}));case"blob":return a.pipe(Ce(c=>{if(c.body!==null&&!(c.body instanceof Blob))throw new ee(2807,!1);return c.body}));case"text":return a.pipe(Ce(c=>{if(c.body!==null&&typeof c.body!="string")throw new ee(2808,!1);return c.body}));default:return a.pipe(Ce(c=>c.body))}case"response":return a;default:throw new ee(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 zo().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,ER(i,r))}post(n,r,i={}){return this.request("POST",n,ER(i,r))}put(n,r,i={}){return this.request("PUT",n,ER(i,r))}static \u0275fac=function(r){return new(r||t)(q(Bc))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})();var vX=new K("");function $U(t,e){return e(t)}function SX(t,e){return(n,r)=>e.intercept(n,{handle:i=>t(i,r)})}function AX(t,e,n){return(r,i)=>Hi(n,()=>e(r,o=>t(o,i)))}var WU=new K(""),TR=new K(""),zU=new K(""),yR=new K("",{providedIn:"root",factory:()=>!0});function CX(){let t=null;return(e,n)=>{t===null&&(t=(Y(WU,{optional:!0})??[]).reduceRight(SX,$U));let r=Y(Xi);if(Y(yR)){let o=r.add();return t(e,n).pipe(of(o))}else return t(e,n)}}var IT=(()=>{class t extends Bc{backend;injector;chain=null;pendingTasks=Y(Xi);contributeToStability=Y(yR);constructor(n,r){super(),this.backend=n,this.injector=r}handle(n){if(this.chain===null){let r=this.injector.get(Bc,null,{skipSelf:!0}),i=r!==null&&this.backend===r,o=this.injector.get(zU,[],i?{self:!0}:void 0),s=Array.from(new Set([...this.injector.get(TR),...o]));this.chain=s.reduceRight((a,c)=>AX(a,c,this.injector),$U)}if(this.contributeToStability){let r=this.pendingTasks.add();return this.chain(n,i=>this.backend.handle(i)).pipe(of(r))}else return this.chain(n,r=>this.backend.handle(r))}static \u0275fac=function(r){return new(r||t)(q(op),q(Mn))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})();var DX=/^\)\]\}',?\n/,RX=RegExp(`^${BU}:`,"m");function NX(t){return"responseURL"in t&&t.responseURL?t.responseURL:RX.test(t.getAllResponseHeaders())?t.getResponseHeader(BU):null}var _R=(()=>{class t{xhrFactory;constructor(n){this.xhrFactory=n}handle(n){if(n.method==="JSONP")throw new ee(-2800,!1);let r=this.xhrFactory;return it(null).pipe(er(()=>new he(o=>{let s=r.build();if(s.open(n.method,n.urlWithParams),n.withCredentials&&(s.withCredentials=!0),n.headers.forEach((S,R)=>s.setRequestHeader(S,R.join(","))),n.headers.has(UU)||s.setRequestHeader(UU,TX),!n.headers.has(FU)){let S=n.detectContentTypeHeader();S!==null&&s.setRequestHeader(FU,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",R=new $s(s.getAllResponseHeaders()),U=NX(s)||n.url;return c=new yT({headers:R,status:s.status,statusText:S,url:U}),c},d=()=>{let{headers:S,status:R,statusText:U,url:H}=l(),Q=null;R!==IX&&(Q=typeof s.response>"u"?s.responseText:s.response),R===0&&(R=Q?yX:0);let ae=R>=200&&R<300;if(n.responseType==="json"&&typeof Q=="string"){let ne=Q;Q=Q.replace(DX,"");try{Q=Q!==""?JSON.parse(Q):null}catch(A){Q=ne,ae&&(ae=!1,Q={error:A,text:Q})}}ae?(o.next(new sp({body:Q,headers:S,status:R,statusText:U,url:H||void 0})),o.complete()):o.error(new td({error:Q,headers:S,status:R,statusText:U,url:H||void 0}))},h=S=>{let{url:R}=l(),U=new td({error:S,status:s.status||0,statusText:s.statusText||"Unknown Error",url:R||void 0});o.error(U)},f=h;n.timeout&&(f=S=>{let{url:R}=l(),U=new td({error:new DOMException("Request timed out","TimeoutError"),status:s.status||0,statusText:s.statusText||"Request timeout",url:R||void 0});o.error(U)});let g=!1,E=S=>{g||(o.next(l()),g=!0);let R={type:Vc.DownloadProgress,loaded:S.loaded};S.lengthComputable&&(R.total=S.total),n.responseType==="text"&&s.responseText&&(R.partialText=s.responseText),o.next(R)},I=S=>{let R={type:Vc.UploadProgress,loaded:S.loaded};S.lengthComputable&&(R.total=S.total),o.next(R)};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:Vc.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)(q(Uc))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})(),qU=new K(""),bX="XSRF-TOKEN",wX=new K("",{providedIn:"root",factory:()=>bX}),OX="X-XSRF-TOKEN",LX=new K("",{providedIn:"root",factory:()=>OX}),ap=class{},MX=(()=>{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)(q(qt),q(wX))};static \u0275prov=J({token:t,factory:t.\u0275fac})}return t})();function PX(t,e){if(!Y(qU)||t.method==="GET"||t.method==="HEAD")return e(t);try{let i=Y(Zu).href,{origin:o}=new URL(i),{origin:s}=new URL(t.url,o);if(o!==s)return e(t)}catch{return e(t)}let n=Y(ap).getToken(),r=Y(LX);return n!=null&&!t.headers.has(r)&&(t=t.clone({headers:t.headers.set(r,n)})),e(t)}var IR=(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})(IR||{});function xX(t,e){return{\u0275kind:t,\u0275providers:e}}function kX(...t){let e=[HU,_R,IT,{provide:Bc,useExisting:IT},{provide:op,useFactory:()=>Y(vX,{optional:!0})??Y(_R)},{provide:TR,useValue:PX,multi:!0},{provide:qU,useValue:!0},{provide:ap,useClass:MX}];for(let n of t)e.push(...n.\u0275providers);return tr(e)}var VU=new K("");function FX(){return xX(IR.LegacyInterceptors,[{provide:VU,useFactory:CX},{provide:TR,useExisting:VU,multi:!0}])}var vR=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:function(r){let i=null;return r?i=new(r||t):i=q(UX),i},providedIn:"root"})}return t})(),UX=(()=>{class t extends vR{_doc;constructor(n){super(),this._doc=n}sanitize(n,r){if(r==null)return null;switch(n){case Tt.NONE:return r;case Tt.HTML:return Zi(r,"HTML")?Tr(r):k_(this._doc,String(r)).toString();case Tt.STYLE:return Zi(r,"Style")?Tr(r):r;case Tt.SCRIPT:if(Zi(r,"Script"))return Tr(r);throw new ee(5200,!1);case Tt.URL:return Zi(r,"URL")?Tr(r):Lf(String(r));case Tt.RESOURCE_URL:if(Zi(r,"ResourceURL"))return Tr(r);throw new ee(5201,!1);default:throw new ee(5202,!1)}}bypassSecurityTrustHtml(n){return tD(n)}bypassSecurityTrustStyle(n){return nD(n)}bypassSecurityTrustScript(n){return rD(n)}bypassSecurityTrustUrl(n){return iD(n)}bypassSecurityTrustResourceUrl(n){return oD(n)}static \u0275fac=function(r){return new(r||t)(q(qt))};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Xt={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 kn=class kn{static showLogs(){try{return Xt.debugMode||!!sessionStorage.getItem("debugMode")||!!sessionStorage.getItem("forceDebugMode")}catch(e){return kn.catch("Error in showLogs: ",e),!1}}};kn.log=kn.showLogs()?console.log:()=>{},kn.warn=kn.showLogs()?console.warn:()=>{},kn.error=kn.showLogs()?console.error:()=>{},kn.debug=kn.showLogs()?console.debug:()=>{},kn.info=kn.showLogs()?console.info:()=>{},kn.logsEnabled=!0,kn.catch=(e,n)=>{try{kn.logsEnabled&&(n!==void 0?console.warn("Velt: ",e,n):console.warn("Velt: ",e))}catch{}};var O=kn;var vRe={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"},SRe={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"},ARe={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"},CRe={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"},DRe={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"},RRe={TEXT_SELECTED:"textSelected"},NRe={SUGGESTION_CREATED:"suggestionCreated",SUGGESTION_APPROVED:"suggestionApproved",SUGGESTION_REJECTED:"suggestionRejected",SUGGESTION_STALE:"suggestionStale",TARGET_EDIT_START:"targetEditStart",TARGET_EDIT_COMMIT:"targetEditCommit"},di={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"},bRe={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"},wRe={MULTIPLE_USERS_ONLINE:"multipleUsersOnline",USER_STATE_CHANGE:"userStateChange"},ORe={SETTINGS_UPDATED:"settingsUpdated"},LRe={UPDATE_DATA:"updateData"},BX=(function(t){return t.ADDED="added",t.UPDATED="updated",t.DELETED="deleted",t.APPROVED="approved",t.RESOLVED="resolved",t})(BX||{}),GX=(function(t){return t.INVITE="invite",t.REMOVE="remove",t})(GX||{}),jX=(function(t){return t.CREATED="created",t.JOINED="joined",t})(jX||{}),HX=(function(t){return t.UPDATE_DATA="updateData",t})(HX||{}),$X=(function(t){return t.ADDED="added",t.UPDATED="updated",t.DELETED="deleted",t.APPROVED="approved",t.RESOLVED="resolved",t})($X||{}),WX=(function(t){return t.ADDED="added",t.UPDATED="updated",t.DELETED="deleted",t})(WX||{}),MRe={ADDED:"added",UPDATED:"updated",DELETED:"deleted"},zX=(function(t){return t.FIRST_VIEWED="firstViewed",t})(zX||{}),SR=(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})(SR||{}),qX=(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})(qX||{}),Ir=(function(t){return t.DESKTOP="Desktop",t.MOBILE="Mobile",t.TABLET="Tablet",t.MONITOR="Monitor",t.UNKNOWN="Unknown",t})(Ir||{}),rd=(function(t){return t.PORTRAIT="portrait",t.LANDSCAPE="landscape",t.UNKNOWN="unknown",t})(rd||{}),vT=(function(t){return t.Portrait="(orientation: portrait)",t.Landscape="(orientation: landscape)",t})(vT||{}),KX=(function(t){return t.DIFFERENT_DEVICE="differentDevice",t.ELEMENT_DELETED="elementDeleted",t})(KX||{}),id=(function(t){return t.ADMIN="Admin",t.COMMENTER="Commenter",t})(id||{}),Fn={PUBLIC:"public",RESTRICTED:"restricted",ORGANIZATION_PRIVATE:"organizationPrivate"},YX=(function(t){return t.DEFAULT="default",t.DYNAMIC_ID="dynamicId",t})(YX||{}),ST={PUBLIC:"public",PRIVATE:"private"},XX=(function(t){return t.MINIMAL="minimal",t.VERBOSE="verbose",t})(XX||{}),QX=(function(t){return t.DEFAULT="default",t.EXPANDED="expanded",t})(QX||{}),JX=(function(t){return t.TOTAL="total",t.UNREAD="unread",t})(JX||{}),PRe={ONLINE:"online",OFFLINE:"offline",PENDING_INIT:"pendingInit",PENDING_DATA:"pendingData"},xRe={ALL:"all",ORGANIZATION:"organization",ORGANIZATION_USER_GROUP:"organizationUserGroup",DOCUMENT:"document",FOLDER:"folder"},kRe={AND:"and",OR:"or"},ZX=(function(t){return t.RESTRICTED_SELF="restrictedSelf",t.RESTRICTED_SELECTED_PEOPLE="restrictedSelectedPeople",t.ORGANIZATION_PRIVATE="organizationPrivate",t.PUBLIC="public",t})(ZX||{});var B=class B{};B.SNIPPYLY_HOST_URL_PROD="https://snippyly.com",B.SNIPPYLY_HOST_URL_STAGING="https://snippyly-staging.web.app",B.USER_TYPE_ANONYMOUS="anonymous",B.USER_TYPE_SIGNED_IN="signedIn",B.LOCALSTORAGE_DATA_ID="snippylytempdata",B.NO_ORGANIZATION_ID="veltNoOrganization",B.DEFAULT_QUERY_HASH="default",B.LISTENER_BATCH_SIZE=5,B.PAGINATED_CONTACT_LIST_DEFAULT=!0,B.LISTENER_CONTEXT_BATCH_SIZE=25,B.FIRESTORE_MAX_DISJUNCTIONS=30,B.FIRESTORE_IN_QUERY_LIMIT=30,B.DEFAULT_VELT_CONTEXT="default:velt",B.VISIBILITY_SELF_PREFIX="__velt_private_self:",B.VISIBILITY_ORG_PREFIX="organizationPrivate:",B.FIREBASE_PARTIAL_PATH_ORGANIZATIONS="organizations",B.FIREBASE_PARTIAL_PATH_FOLDERS="folders",B.FIREBASE_PARTIAL_PATH_DOCS="docs",B.FIREBASE_PARTIAL_PATH_DOCUMENT_CONFIGURATIONS="documentConfigurations",B.FIREBASE_PARTIAL_PATH_PRESENCE="presence",B.FIREBASE_PARTIAL_PATH_ORGANIZATION_USERS="orgIamUsers",B.FIREBASE_PARTIAL_PATH_CENTRAL_USERS="users",B.FIREBASE_PARTIAL_PATH_FOLDER_USERS="folderIamUsers",B.FIREBASE_PARTIAL_PATH_DOCUMENT_USERS="docIamUsers",B.FIREBASE_PARTIAL_PATH_CURSOR="cursor",B.FIREBASE_PARTIAL_PATH_ARROW="arrow",B.FIREBASE_PARTIAL_PATH_AREA="area",B.FIREBASE_PARTIAL_PATH_COMMENT="comment",B.FIREBASE_PARTIAL_PATH_LOCATION="location",B.FIREBASE_PARTIAL_PATH_MULTI_THREAD="multiThread",B.FIREBASE_PARTIAL_PATH_TAG="tag",B.FIREBASE_PARTIAL_PATH_SELECTION="selection",B.FIREBASE_PARTIAL_PATH_AUDIO_HUDDLE="audioHuddle",B.FIREBASE_PARTIAL_PATH_HUDDLE="huddle",B.FIREBASE_PARTIAL_PATH_CONTACTS="contacts",B.FIREBASE_PARTIAL_PATH_GROUPS="groups",B.FIREBASE_PARTIAL_PATH_NOTIFICATION_DOCS="notificationsDocs",B.FIREBASE_PARTIAL_PATH_NOTIFICATION_USERS="notificationsUsers",B.FIREBASE_PARTIAL_PATH_DOC_NOTIFICATION="notificationsDocs__notification",B.FIREBASE_PARTIAL_PATH_USER_NOTIFICATION="notificationsUsers__notification",B.FIREBASE_PARTIAL_PATH_USER_NOTIFICATION_INDEX="userNotificationIndex",B.FIREBASE_PARTIAL_PATH_GLOBAL="global",B.FIREBASE_PARTIAL_PATH_LOGINS="logins",B.FIREBASE_PARTIAL_PATH_METADATA="metadata",B.FIREBASE_PARTIAL_PATH_ORGANIZATION_METADATA="metadata",B.FIREBASE_PARTIAL_PATH_ORGANIZATION_GROUPS="groups",B.FIREBASE_PARTIAL_PATH_LOCATIONS="locations",B.FIREBASE_PARTIAL_PATH_RECORDER="recorder",B.FIREBASE_PARTIAL_PATH_FOLLOW_ALONG="flock",B.FIREBASE_PARTIAL_PATH_SYNC_VIDEO_PLAYER="syncVideoPlayer",B.FIREBASE_PARTIAL_PATH_LIVE_STATE="liveState",B.FIREBASE_PARTIAL_PATH_IAM="iam",B.FIREBASE_PARTIAL_PATH_REACTION="reaction",B.FIREBASE_PARTIAL_PATH_CRDT="crdt",B.FIREBASE_PARTIAL_PATH_VIEWS="views",B.FIREBASE_PARTIAL_PATH_NOTIFICATION_VIEWS="notificationViews",B.FIREBASE_PARTIAL_PATH_DOCUMENT_VIEWS="documentViews",B.FIREBASE_PARTIAL_PATH_LOCATION_VIEWS="locationViews",B.FIREBASE_PARTIAL_PATH_NOTIFICATIONS="notifications",B.FIREBASE_PARTIAL_PATH_ORGANIZATION_NOTIFICATIONS="notifications",B.FIREBASE_PARTIAL_PATH_LAST_NOTIFICATION_TIMESTAMP="lastNotificationTimestamp",B.FIREBASE_PARTIAL_PATH_ACTIVITIES="activities",B.FIREBASE_PARTIAL_PATH_LAST_ACTIVITY_TIMESTAMP="lastActivityTimestamp",B.FIREBASE_PARTIAL_PATH_HEARTBEAT="heartbeat",B.FIREBASE_PARTIAL_PATH_HEARTBEAT_BY_DOCUMENT="heartbeatByDocument",B.FIREBASE_PARTIAL_PATH_USERS="users",B.FIREBASE_PARTIAL_PATH_PERMISSIONS_USERS="permissions",B.FIREBASE_PARTIAL_PATH_USER_REQUESTS="userRequests",B.FIREBASE_PARTIAL_PATH_FEEDBACK="feedback",B.FIREBASE_PARTIAL_PATH_BUGS="bugs",B.FIREBASE_PARTIAL_PATH_CONTACT_US="contactUs",B.FIREBASE_PARTIAL_PATH_CUSTOMER_METADATA="metadata",B.PRESENCE_STATUS_ONLINE="online",B.PRESENCE_STATUS_OFFLINE="offline",B.PRESENCE_STATUS_AWAY="away",B.IMG_URL_NOT_FOUND="https://snippyly.com/assets/icons/anon-user.svg",B.IMG_CLASS_NOT_FOUND="presence-avatar-image-small",B.AVATAR_COLOR_LIST=["#a259fe","#9746ff","#19bcfe","#FE8947","#2c83fc","#0dcf82","#ffcb00","#ff7162","#FFD600","#A5A7FE","#67DBF4","#FDA192"],B.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"},B.UNREAD_COMMENTS_CHECK_FROM_DATE="2024-02-05",B.DEFAULT_ANNOTATION_COLOR="#a259fe",B.REGEX_EMAIL=/(\+|@)+([a-zA-Z0-9._+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi,B.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,B.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,B.REGEX_SPECIAL_CHARS=/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,B.SNIPPYLY_HIGHLIGHT="snippyly-highlight",B.SNIPPYLY_HIGHLIGHT_PREVIEW="snippyly-highlight-preview",B.SNIPPYLY_HIGHLIGHT_USER="snippyly-highlight-user",B.SNIPPYLY_HIGHLIGHT_USER_NAME="snippyly-highlight-user-name",B.SNIPPYLY_HIGHLIGHT_USER_TEXT="snippyly-highlight-user-text",B.VELT_LIVE_SELECTION_ON_ELEMENT="velt-live-selection-on-element",B.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT="velt-live-selection-on-element-default",B.VELT_LIVE_SELECTION_ON_TEXT="velt-live-selection-on-text",B.VELT_LIVE_SELECTION_ON_TEXT_DEFAULT="velt-live-selection-on-text-default",B.VELT_IGNORE_CHANGE_DETECTION="velt-ignore-change-detection",B.VELT_CUSTOM_CSS="velt-custom-css",B.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"},B.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"},B.INJECTION_STYLE_PROPS={VELT_AVATAR_COLOR:"data-velt-avatar-color",VELT_COMMENT_PRIORITY_COLOR:"data-velt-priority-color"},B.BODY_CLASSES={VELT_PIN_DRAGGING:"velt-pin-dragging"},B.INJECTION_ATTRIBUTES={VELT_AVATAR_IMG:"data-velt-avatar-img",VELT_COMMENT_LENGTH:"data-velt-comment-thread-length"},B.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"},B.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"},B.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},B.INGNORE_MUTATION_OBSERVER_CHANGE_TAGS={svg:!0},B.SELECTION_ENABLED_ELEMENTS={input:!0,textarea:!0,select:!0,button:!0},B.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"},B.VELT_BASE_REM_UNIT="--velt-base-rem-unit",B.VELT_VIEWPORT_WIDTH="--legacy-velt-viewport-width",B.VELT_VIEWPORT_HEIGHT="--legacy-velt-viewport-height",B.VELT_SELECTION_COLOR="--velt-selection-color",B.VELT_MIN_ARROW_LENGTH=100,B.VELT_ARROW_VIEWPORT_PADDING=20,B.LIVE_STATE_REQUEST_EDITOR_ACCESS_WAIT_TIME=5,B.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"},B.VIDEO_POSTER_DEFAULT_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADIAQMAAABoEU4WAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAGUExURQAAAAEAAKSl0/gAAAAxSURBVFjD7dBBDQAgCABARjKjGZUofi0Ac+4uwkUAAAAAAMCIpYD/bQVNSsEtFfCaA8vLAaMbkVUtAAAAAElFTkSuQmCC",B.HUDDLE_TYPE_CONFIGS={audio:{audio:!0,video:!1,presentation:!1},video:{audio:!0,video:!0,presentation:!1},presentation:{audio:!1,video:!1,presentation:!0}},B.RecorderModes={VIDEO:"video",AUDIO:"audio",SCREEN:"screen",ALL:"all"},B.CommentAnnotationStatusMap={OPEN:{id:"OPEN",name:"Open",color:"var(--velt-accent, #625DF5)",lightColor:"var(--velt-accent-light, #E7E8FA)",type:"default",svg:`
|
|
6
|
+
<svg
|
|
7
|
+
width="16"
|
|
8
|
+
height="16"
|
|
9
|
+
viewBox="0 0 16 16"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill-rule="evenodd"
|
|
15
|
+
clip-rule="evenodd"
|
|
16
|
+
d="M8.00016 13.3333C10.9457 13.3333 13.3335 10.9455 13.3335 8.00001C13.3335 5.05449 10.9457 2.66668 8.00016 2.66668C5.05464 2.66668 2.66683 5.05449 2.66683 8.00001C2.66683 10.9455 5.05464 13.3333 8.00016 13.3333ZM8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8.00001C14.6668 4.31811 11.6821 1.33334 8.00016 1.33334C4.31826 1.33334 1.3335 4.31811 1.3335 8.00001C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
`},IN_PROGRESS:{id:"IN_PROGRESS",name:"In Progress",color:"var(--velt-warning, #ECB000)",lightColor:"var(--velt-warning-light, #FEFCEA)",type:"ongoing",svg:`
|
|
21
|
+
<svg
|
|
22
|
+
width="16"
|
|
23
|
+
height="16"
|
|
24
|
+
viewBox="0 0 16 16"
|
|
25
|
+
fill="none"
|
|
26
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
27
|
+
>
|
|
28
|
+
<path
|
|
29
|
+
fill-rule="evenodd"
|
|
30
|
+
clip-rule="evenodd"
|
|
31
|
+
d="M8.00016 13.3333C10.9457 13.3333 13.3335 10.9455 13.3335 8.00001C13.3335 5.05449 10.9457 2.66668 8.00016 2.66668C5.05464 2.66668 2.66683 5.05449 2.66683 8.00001C2.66683 10.9455 5.05464 13.3333 8.00016 13.3333ZM8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8.00001C14.6668 4.31811 11.6821 1.33334 8.00016 1.33334C4.31826 1.33334 1.3335 4.31811 1.3335 8.00001C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z"
|
|
32
|
+
fill="currentColor"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
fill-rule="evenodd"
|
|
36
|
+
clip-rule="evenodd"
|
|
37
|
+
d="M8.00016 4C8.36835 4 8.66683 4.29848 8.66683 4.66667V7.72386L10.1382 9.19526C10.3986 9.45561 10.3986 9.87772 10.1382 10.1381C9.87788 10.3984 9.45577 10.3984 9.19542 10.1381L7.52876 8.4714C7.40373 8.34638 7.3335 8.17681 7.3335 8V4.66667C7.3335 4.29848 7.63197 4 8.00016 4Z"
|
|
38
|
+
fill="currentColor"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
`},RESOLVED:{id:"RESOLVED",name:"Resolved",color:"var(--velt-success, #00C48C)",lightColor:"var(--velt-success-light, #E7FAF2)",type:"terminal",svg:`
|
|
42
|
+
<svg
|
|
43
|
+
width="17"
|
|
44
|
+
height="16"
|
|
45
|
+
viewBox="0 0 17 16"
|
|
46
|
+
fill="none"
|
|
47
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
48
|
+
>
|
|
49
|
+
<path
|
|
50
|
+
fill-rule="evenodd"
|
|
51
|
+
clip-rule="evenodd"
|
|
52
|
+
d="M8.50016 13.3333C11.4457 13.3333 13.8335 10.9455 13.8335 8.00001C13.8335 5.05449 11.4457 2.66668 8.50016 2.66668C5.55464 2.66668 3.16683 5.05449 3.16683 8.00001C3.16683 10.9455 5.55464 13.3333 8.50016 13.3333ZM8.50016 14.6667C12.1821 14.6667 15.1668 11.6819 15.1668 8.00001C15.1668 4.31811 12.1821 1.33334 8.50016 1.33334C4.81826 1.33334 1.8335 4.31811 1.8335 8.00001C1.8335 11.6819 4.81826 14.6667 8.50016 14.6667Z"
|
|
53
|
+
fill="currentColor"
|
|
54
|
+
/>
|
|
55
|
+
<path
|
|
56
|
+
d="M5.8335 8L7.8335 10L11.8335 6"
|
|
57
|
+
class="checkmark"
|
|
58
|
+
stroke="currentColor"
|
|
59
|
+
stroke-width="1.2"
|
|
60
|
+
stroke-miterlimit="10"
|
|
61
|
+
stroke-linecap="round"
|
|
62
|
+
stroke-linejoin="round"
|
|
63
|
+
/>
|
|
64
|
+
</svg>
|
|
65
|
+
`}},B.CommentAcceptStatus={id:"ACCEPTED",name:"Accepted",color:"var(--velt-success, #00C48C)",lightColor:"var(--velt-success-light, #E7FAF2)",type:"terminal",svg:`
|
|
66
|
+
<svg
|
|
67
|
+
width="17"
|
|
68
|
+
height="16"
|
|
69
|
+
viewBox="0 0 17 16"
|
|
70
|
+
fill="none"
|
|
71
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
72
|
+
>
|
|
73
|
+
<path
|
|
74
|
+
fill-rule="evenodd"
|
|
75
|
+
clip-rule="evenodd"
|
|
76
|
+
d="M8.50016 13.3333C11.4457 13.3333 13.8335 10.9455 13.8335 8.00001C13.8335 5.05449 11.4457 2.66668 8.50016 2.66668C5.55464 2.66668 3.16683 5.05449 3.16683 8.00001C3.16683 10.9455 5.55464 13.3333 8.50016 13.3333ZM8.50016 14.6667C12.1821 14.6667 15.1668 11.6819 15.1668 8.00001C15.1668 4.31811 12.1821 1.33334 8.50016 1.33334C4.81826 1.33334 1.8335 4.31811 1.8335 8.00001C1.8335 11.6819 4.81826 14.6667 8.50016 14.6667Z"
|
|
77
|
+
fill="currentColor"
|
|
78
|
+
/>
|
|
79
|
+
<path
|
|
80
|
+
d="M5.8335 8L7.8335 10L11.8335 6"
|
|
81
|
+
class="checkmark"
|
|
82
|
+
stroke="currentColor"
|
|
83
|
+
stroke-width="1.2"
|
|
84
|
+
stroke-miterlimit="10"
|
|
85
|
+
stroke-linecap="round"
|
|
86
|
+
stroke-linejoin="round"
|
|
87
|
+
/>
|
|
88
|
+
</svg>
|
|
89
|
+
`},B.CommentRejectStatus={id:"REJECTED",name:"Rejected",color:"var(--velt-error, #ff0000)",lightColor:"var(--velt-error-light, #f7e7e7)",type:"terminal",svg:`
|
|
90
|
+
<svg
|
|
91
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
92
|
+
width="16" height="16"
|
|
93
|
+
fill="currentColor"
|
|
94
|
+
class="bi bi-x-circle"
|
|
95
|
+
viewBox="0 0 16 16"
|
|
96
|
+
>
|
|
97
|
+
<path
|
|
98
|
+
d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"
|
|
99
|
+
/>
|
|
100
|
+
<path
|
|
101
|
+
d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"
|
|
102
|
+
/>
|
|
103
|
+
</svg>
|
|
104
|
+
`},B.CommentAnnotationPriorityMap={P0:{id:"P0",name:"P0",color:"var(--velt-error, #FF7162)",lightColor:"var(--velt-error-light, #F7E7E7)",svg:`<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
105
|
+
<g>
|
|
106
|
+
<path d="M3.33301 1.33333C3.33301 0.873096 3.7061 0.5 4.16634 0.5C4.62658 0.5 4.99967 0.873096 4.99967 1.33333V19.6667C4.99967 20.1269 4.62658 20.5 4.16634 20.5C3.7061 20.5 3.33301 20.1269 3.33301 19.6667V1.33333Z" fill="currentColor"/>
|
|
107
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.3086 12.167H3.33301V2.16699H8.33301C9.42152 2.16699 10.3476 2.86267 10.6908 3.83366H14.803C16.0419 3.83366 16.8477 5.13751 16.2937 6.24568L14.9997 8.83366L16.2937 11.4216C16.8477 12.5298 16.0419 13.8337 14.803 13.8337H11.6663C10.5778 13.8337 9.65179 13.138 9.3086 12.167ZM4.99967 3.83366H8.33301C8.79324 3.83366 9.16634 4.20675 9.16634 4.66699V10.5003H4.99967V3.83366ZM10.833 11.3337C10.833 11.7939 11.2061 12.167 11.6663 12.167H14.803L13.1363 8.83366L14.803 5.50033H10.833V11.3337Z" fill="currentColor"/>
|
|
108
|
+
</g>
|
|
109
|
+
</svg>`},P1:{id:"P1",name:"P1",color:"var(--velt-warning, #ECB000)",lightColor:"var(--velt-warning-light, #FEFCEA)",svg:`<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
110
|
+
<g>
|
|
111
|
+
<path d="M3.33301 1.33333C3.33301 0.873096 3.7061 0.5 4.16634 0.5C4.62658 0.5 4.99967 0.873096 4.99967 1.33333V19.6667C4.99967 20.1269 4.62658 20.5 4.16634 20.5C3.7061 20.5 3.33301 20.1269 3.33301 19.6667V1.33333Z" fill="currentColor"/>
|
|
112
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.3086 12.167H3.33301V2.16699H8.33301C9.42152 2.16699 10.3476 2.86267 10.6908 3.83366H14.803C16.0419 3.83366 16.8477 5.13751 16.2937 6.24568L14.9997 8.83366L16.2937 11.4216C16.8477 12.5298 16.0419 13.8337 14.803 13.8337H11.6663C10.5778 13.8337 9.65179 13.138 9.3086 12.167ZM4.99967 3.83366H8.33301C8.79324 3.83366 9.16634 4.20675 9.16634 4.66699V10.5003H4.99967V3.83366ZM10.833 11.3337C10.833 11.7939 11.2061 12.167 11.6663 12.167H14.803L13.1363 8.83366L14.803 5.50033H10.833V11.3337Z" fill="currentColor"/>
|
|
113
|
+
</g>
|
|
114
|
+
</svg>`},P2:{id:"P2",name:"P2",color:"var(--velt-text-7, #777E91)",lightColor:"var(--velt-background-1, #F3F3F5)",svg:`<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
115
|
+
<g>
|
|
116
|
+
<path d="M3.33301 1.33333C3.33301 0.873096 3.7061 0.5 4.16634 0.5C4.62658 0.5 4.99967 0.873096 4.99967 1.33333V19.6667C4.99967 20.1269 4.62658 20.5 4.16634 20.5C3.7061 20.5 3.33301 20.1269 3.33301 19.6667V1.33333Z" fill="currentColor"/>
|
|
117
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.3086 12.167H3.33301V2.16699H8.33301C9.42152 2.16699 10.3476 2.86267 10.6908 3.83366H14.803C16.0419 3.83366 16.8477 5.13751 16.2937 6.24568L14.9997 8.83366L16.2937 11.4216C16.8477 12.5298 16.0419 13.8337 14.803 13.8337H11.6663C10.5778 13.8337 9.65179 13.138 9.3086 12.167ZM4.99967 3.83366H8.33301C8.79324 3.83366 9.16634 4.20675 9.16634 4.66699V10.5003H4.99967V3.83366ZM10.833 11.3337C10.833 11.7939 11.2061 12.167 11.6663 12.167H14.803L13.1363 8.83366L14.803 5.50033H10.833V11.3337Z" fill="currentColor"/>
|
|
118
|
+
</g>
|
|
119
|
+
</svg>`}},B.WorkspaceRoles=[{id:id.COMMENTER?.toLowerCase(),name:id.COMMENTER,description:"Can comment on this project",permissions:[]},{id:id.ADMIN?.toLowerCase(),name:id.ADMIN,description:"Can comment on all projects and has access to the portal",permissions:[]}],B.DocumentAccessTypeMap={[Fn.PUBLIC]:{id:Fn.PUBLIC,name:Fn.PUBLIC,description:"Anyone with link can view"},[Fn.RESTRICTED]:{id:Fn.RESTRICTED,name:Fn.RESTRICTED,description:"Only people with access can view"}},B.DocumentAccessTypeMapSF={[Fn.PUBLIC]:{id:Fn.PUBLIC,name:Fn.PUBLIC,description:"Anyone with the link can comment after logging in."},[Fn.RESTRICTED]:{id:Fn.RESTRICTED,name:Fn.RESTRICTED,description:"Only people added to this project can comment."}},B.CommentCategoryMap={bug:{id:"bug",name:"Bug",color:"#FF7162"},feedback:{id:"feedback",name:"Feedback",color:"#00C48C"},question:{id:"question",name:"Question",color:"#FFD166"}},B.OVERLAY_POSITIONS=[{originX:"end",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"end",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"end",overlayY:"bottom"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}],B.OVERLAY_POSITIONS_FOR_POPOVER_MODE=[{originX:"end",originY:"top",overlayX:"start",overlayY:"top"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"},{originX:"end",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"end",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"start",originY:"bottom",overlayX:"end",overlayY:"bottom"}],B.VIDEO_EDITOR={ZOOM_IN_DURATION:500,ZOOM_OUT_DURATION:500,DEFAULT_ZOOM_FACTOR:1.5,MAX_ZOOM_FACTOR:3,ZOOM_FACTOR_OPTIONS:[{value:2,label:"2x"},{value:1.7,label:"1.7x"},{value:1.5,label:"1.5x"},{value:1.2,label:"1.2x"}],MIN_DRAG_AREA_MULTIPLIER:.015,PREFERRED_SECTION_DURATION_MULTIPLIER:.15,SELECTION_MIN_DRAG_DISTANCE:2,MIN_DURATION_THRESHOLD:.01,TIME_BUFFER:.1,SHORT_VIDEO_THRESHOLD:3,SMALL_VIDEO_THRESHOLD:5,MILLISECOND_PRECISION_MULTIPLIER:1e3,TENTH_SECOND_PRECISION_MULTIPLIER:10,DEBOUNCE_DELAY:200,DECIMAL_PRECISION:2,MAX_MARKER_COUNT:10,MARKER_INTERVAL:5,FAST_TIMEOUT:50,STANDARD_TIMEOUT:100,RECTANGLE_POSITIONING:{FULL_PERCENT:100,HALF_PERCENT:50,QUARTER_PERCENT:25},EASING:{QUAD_IN_OUT_MULTIPLIER:2,QUAD_IN_OUT_POWER:2,HALF_THRESHOLD:.5},PERCENTAGE:{HALF:50,FULL:100},MILLISECONDS_TO_SECONDS:1e3};var k=B;var GRe=new K("arrow-utils"),jRe=new K("notification-service"),HRe=new K("notifications-actions"),$Re=new K("notification-utils"),WRe=new K("cursor-service"),zRe=new K("cursor-utils"),qRe=new K("presence-service"),KRe=new K("presence-actions"),YRe=new K("presence-utils"),XRe=new K("huddle-service"),QRe=new K("huddle-utils"),JRe=new K("recorder-service"),AT=new K("recorder-annotation-service"),ZRe=new K("recorder-actions"),eNe=new K("recorder-utils"),tNe=new K("recorder-pin-portal"),CT=new K("comment-service"),nNe=new K("comment-actions"),rNe=new K("comment-dialog-core"),iNe=new K("comment-dialog-action"),oNe=new K("comment-text-service"),sNe=new K("comment-text-portal"),aNe=new K("comment-pin-portal"),cNe=new K("comment-views"),DT=new K("reaction-service"),lNe=new K("rewriter-service"),uNe=new K("rewriter-actions"),RT=new K("area-service"),KU=new K("activity-service"),YU=new K("views-service"),XU=new K("crdt-service"),QU=new K("live-state-service");var NT=(()=>{let e=class e{constructor(){this.subjects=new Map,O.log("%c[WB] Creating CLASS: ServiceBook","color: blue;")}set(r,i){try{O.log(`%c[WB] ServiceBook.set: ${r.toString()}`,"color: green;"),this.getOrCreateSubject(r).next(i)}catch(o){O.catch("Error in ServiceBook set: ",o)}}get(r){return this.subjects.get(r)?.value??null}observe(r){return this.getOrCreateSubject(r).asObservable()}getOrCreateSubject(r){let i=this.subjects.get(r);return i||(i=new de(null),this.subjects.set(r,i)),i}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var yt=(()=>{let e=class e{};e.Events={Core:{IDENTIFY:"identify",SDK_VALIDATE_CLIENT_TRIGGERED:"sdkValidateClientTriggered",SDK_VALIDATE_CLIENT_SUCCESS:"sdkValidateClientSuccess",SDK_VALIDATE_CLIENT_FAILED:"sdkValidateClientFailed",SDK_USER_AUTH_SUCCESS:"sdkUserAuthSuccess",SDK_USER_AUTH_FAILED:"sdkUserAuthFailed",SDK_USER_SIGN_OUT:"sdkUserSignOut",SDK_PLAN_EXPIRED:"sdkPlanExpired",SDK_ERROR:"error",SDK_UNCAUGHT_ERROR:"uncaughtError",SDK_SESSION_RE_LOGIN_TRIGGERED:"sdkSessionReLoginTriggered",SDK_SESSION_TOKEN_EXPIRED:"sdkSessionTokenExpired",SDK_SESSION_RE_LOGIN_COUNT_EXCEEDED:"sdkSessionReLoginCountExceeded",SDK_JWT_EXPIRED_RETRY_EXCEEDED:"sdkJwtExpiredRetryExceeded",SDK_EVENT_RATE_LIMIT_EXCEEDED:"sdkEventRateLimitExceeded",SET_PERMISSION_PROVIDER_TRIGGERED:"setPermissionProviderTriggered",SIGN_OUT_USER_TRIGGERED:"signOutUserTriggered",SET_DOCUMENTS_TRIGGERED:"setDocumentsTriggered",SET_ROOT_LOCATION_TRIGGERED:"setRootLocationTriggered",SET_ROOT_DOCUMENT_TRIGGERED:"setRootDocumentTriggered",UNSET_DOCUMENTS_TRIGGERED:"unsetDocumentsTriggered",FETCH_DOCUMENTS_TRIGGERED:"fetchDocumentsTriggered",UPDATE_DOCUMENTS_TRIGGERED:"updateDocumentsTriggered",UPDATE_LOCATIONS_TRIGGERED:"updateLocationsTriggered",FETCH_FOLDERS_TRIGGERED:"fetchFoldersTriggered",SET_USER_DATA_PROVIDER_TRIGGERED:"setUserDataProviderTriggered",SET_ANONYMOUS_USER_DATA_PROVIDER_TRIGGERED:"setAnonymousUserDataProviderTriggered",SET_DATA_PROVIDERS_TRIGGERED:"setDataProvidersTriggered",SET_ENCRYPTION_PROVIDER_TRIGGERED:"setEncryptionProviderTriggered",SET_VELT_AUTH_PROVIDER_TRIGGERED:"setVeltAuthProviderTriggered",GET_DOCUMENT_ID_TRIGGERED:"getDocumentIdTriggered",SET_LOCATIONS_TRIGGERED:"setLocationsTriggered",SET_SCROLLABLE_ELEMENTS_IDS_TRIGGERED:"setScrollableElementsIdsTriggered",REMOVE_LOCATIONS_TRIGGERED:"removeLocationsTriggered",UNSET_LOCATIONS_TRIGGERED:"unsetLocationsTriggered",EXCLUDE_LOCATION_IDS_TRIGGERED:"excludeLocationIdsTriggered",UPDATE_CONTACT_LIST_TRIGGERED:"updateContactListTriggered",UPDATE_ORG_LIST_TRIGGERED:"updateOrgListTriggered",REMOVE_SCROLLABLE_ELEMENTS_IDS_TRIGGERED:"removeScrollableElementsIdsTriggered",GET_PRESENCE_ELEMENT_TRIGGERED:"getPresenceElementTriggered",GET_CURSOR_ELEMENT_TRIGGERED:"getCursorElementTriggered",GET_COMMENT_ELEMENT_TRIGGERED:"getCommentElementTriggered",GET_TAG_ELEMENT_TRIGGERED:"getTagElementTriggered",GET_SELECTION_ELEMENT_TRIGGERED:"getSelectionElementTriggered",GET_RECORDER_ELEMENT_TRIGGERED:"getRecorderElementTriggered",GET_CONTACT_ELEMENT_TRIGGERED:"getContactElementTriggered",GET_REWRITER_ELEMENT_TRIGGERED:"getRewriterElementTriggered",GET_HUDDLE_ELEMENT_TRIGGERED:"getHuddleElementTriggered",GET_LIVE_STATE_SYNC_ELEMENT_TRIGGERED:"getLiveStateSyncElementTriggered",GET_ARROW_ELEMENT_TRIGGERED:"getArrowElementTriggered",GET_VIEWS_ELEMENT_TRIGGERED:"getViewsElementTriggered",GET_NOTIFICATION_ELEMENT_TRIGGERED:"getNotificationElementTriggered",GET_AUTOCOMPLETE_ELEMENT_TRIGGERED:"getAutocompleteElementTriggered",GET_DOC_ELEMENT_TRIGGERED:"getDocElementTriggered",GET_AREA_ELEMENT_TRIGGERED:"getAreaElementTriggered",GET_REACTION_ELEMENT_TRIGGERED:"getReactionElementTriggered",GET_METADATA_TRIGGERED:"getMetadataTriggered",FETCH_DEBUG_INFO_TRIGGERED:"fetchDebugInfoTriggered",GET_DEBUG_INFO_TRIGGERED:"getDebugInfoTriggered",DISABLE_FEATURES_TRIGGERED:"disableFeaturesTriggered",SET_DARK_MODE_TRIGGERED:"setDarkModeTriggered",SET_UNSTYLED_MODE_TRIGGERED:"setUnstyledModeTriggered",ENABLE_LOGS_TRIGGERED:"enableLogsTriggered",DISABLE_LOGS_TRIGGERED:"disableLogsTriggered",IS_USER_ALLOWED_TRIGGERED:"isUserAllowedTriggered",GET_USER_TRIGGERED:"getUserTriggered",GET_CURRENT_USER_TRIGGERED:"getCurrentUserTriggered",GET_HEARTBEAT_TRIGGERED:"getHeartbeatTriggered",GET_USER_ROLE_TRIGGERED:"getUserRoleTriggered",GET_USER_PERMISSIONS_TRIGGERED:"getUserPermissionsTriggered",GET_CURRENT_USER_PERMISSIONS_TRIGGERED:"getCurrentUserPermissionsTriggered",GET_FEATURES_ACCESS_LEVEL_IAM_TRIGGERED:"getFeaturesAccessLevelIamTriggered",IS_PLAN_EXPIRED_TRIGGERED:"isPlanExpiredTriggered",GET_CUSTOMER_METADATA_TRIGGERED:"getCustomerMetadataTriggered",GET_DOCUMENT_METADATA_TRIGGERED:"getDocumentMetadataTriggered",REMOVE_VELT_CONTENT_TRIGGERED:"removeVeltContentTriggered",INJECT_CUSTOM_CSS_TRIGGERED:"injectCustomCssTriggered",SET_LANGUAGE_TRIGGERED:"setLanguageTriggered",SET_TRANSLATIONS_TRIGGERED:"setTranslationsTriggered",ENABLE_AUTO_TRANSLATION_TRIGGERED:"enableAutoTranslationTriggered",DISABLE_AUTO_TRANSLATION_TRIGGERED:"disableAutoTranslationTriggered",SF_TRIGGERED:"sfTriggered",SET_UI_STATE_TRIGGERED:"setUiStateTriggered",GET_UI_STATE_TRIGGERED:"getUiStateTriggered",ENABLE_SAFE_EVAL_TRIGGERED:"enableSafeEvalTriggered",DISABLE_SAFE_EVAL_TRIGGERED:"disableSafeEvalTriggered",ENABLE_FIRESTORE_PERSISTENT_CACHE_TRIGGERED:"enableFirestorePersistentCacheTriggered",DISABLE_FIRESTORE_PERSISTENT_CACHE_TRIGGERED:"disableFirestorePersistentCacheTriggered",RESET_VELT_BUTTON_STATE_TRIGGERED:"resetVeltButtonStateTriggered"},PermissionProvider:{RESOURCE_ACCESS_REQUEST_FORMED:"resourceAccessRequestFormed",RESOURCE_ACCESS_REQUEST_TRIGGERED:"resourceAccessRequestTriggered",REVOKE_ACCESS_ON_DOCUMENT_UNSET_TRIGGERED:"revokeAccessOnDocumentUnsetTriggered",REVOKE_ACCESS_ON_DOCUMENT_UNSET_FORMED:"revokeAccessOnDocumentUnsetFormed",REVOKE_ACCESS_ON_DOCUMENT_UNSET_RESULT:"revokeAccessOnDocumentUnsetResult",REVOKE_ACCESS_ON_USER_LOGOUT_TRIGGERED:"revokeAccessOnUserLogoutTriggered",REVOKE_ACCESS_ON_USER_LOGOUT_FORMED:"revokeAccessOnUserLogoutFormed",REVOKE_ACCESS_ON_USER_LOGOUT_RESULT:"revokeAccessOnUserLogoutResult",RESOURCE_ACCESS_RESULT:"resourceAccessResult",RESOURCE_ACCESS_ERROR:"resourceAccessError",RESOURCE_ACCESS_RESULT_FROM_CACHE:"resourceAccessResultFromCache",REVOKE_ACCESS_ON_DOCUMENT_UNSET_ERROR:"revokeAccessOnDocumentUnsetError",REVOKE_ACCESS_ON_USER_LOGOUT_ERROR:"revokeAccessOnUserLogoutError"},Resolver:{COMMENT_RESOLVER_GET:"comment_resolver_get",COMMENT_RESOLVER_SAVE:"comment_resolver_save",COMMENT_RESOLVER_DELETE:"comment_resolver_delete",COMMENT_RESOLUTION_REQUEST_FORMED:"commentResolutionRequestFormed",COMMENT_RESOLUTION_REQUEST_TRIGGERED:"commentResolutionRequestTriggered",COMMENT_RESOLUTION_RESULT:"commentResolutionResult",COMMENT_RESOLUTION_ERROR:"commentResolutionError",COMMENT_RESOLUTION_RESULT_FROM_CACHE:"commentResolutionResultFromCache",COMMENT_SAVE_REQUEST_FORMED:"commentSaveRequestFormed",COMMENT_SAVE_REQUEST_TRIGGERED:"commentSaveRequestTriggered",COMMENT_SAVE_RESULT:"commentSaveResult",COMMENT_SAVE_ERROR:"commentSaveError",COMMENT_DELETE_REQUEST_FORMED:"commentDeleteRequestFormed",COMMENT_DELETE_REQUEST_TRIGGERED:"commentDeleteRequestTriggered",COMMENT_DELETE_RESULT:"commentDeleteResult",COMMENT_DELETE_ERROR:"commentDeleteError",REACTION_RESOLVER_GET:"reaction_resolver_get",REACTION_RESOLVER_SAVE:"reaction_resolver_save",REACTION_RESOLVER_DELETE:"reaction_resolver_delete",REACTION_RESOLUTION_REQUEST_FORMED:"reactionResolutionRequestFormed",REACTION_RESOLUTION_REQUEST_TRIGGERED:"reactionResolutionRequestTriggered",REACTION_RESOLUTION_RESULT:"reactionResolutionResult",REACTION_RESOLUTION_ERROR:"reactionResolutionError",REACTION_RESOLUTION_RESULT_FROM_CACHE:"reactionResolutionResultFromCache",REACTION_SAVE_REQUEST_FORMED:"reactionSaveRequestFormed",REACTION_SAVE_REQUEST_TRIGGERED:"reactionSaveRequestTriggered",REACTION_SAVE_RESULT:"reactionSaveResult",REACTION_SAVE_ERROR:"reactionSaveError",REACTION_DELETE_REQUEST_FORMED:"reactionDeleteRequestFormed",REACTION_DELETE_REQUEST_TRIGGERED:"reactionDeleteRequestTriggered",REACTION_DELETE_RESULT:"reactionDeleteResult",REACTION_DELETE_ERROR:"reactionDeleteError",NOTIFICATION_RESOLVER_GET:"notification_resolver_get",NOTIFICATION_RESOLVER_DELETE:"notification_resolver_delete",NOTIFICATION_RESOLUTION_REQUEST_FORMED:"notificationResolutionRequestFormed",NOTIFICATION_RESOLUTION_REQUEST_TRIGGERED:"notificationResolutionRequestTriggered",NOTIFICATION_RESOLUTION_RESULT:"notificationResolutionResult",NOTIFICATION_RESOLUTION_ERROR:"notificationResolutionError",NOTIFICATION_DELETE_REQUEST_FORMED:"notificationDeleteRequestFormed",NOTIFICATION_DELETE_REQUEST_TRIGGERED:"notificationDeleteRequestTriggered",NOTIFICATION_DELETE_RESULT:"notificationDeleteResult",NOTIFICATION_DELETE_ERROR:"notificationDeleteError",USER_RESOLVER_GET:"user_resolver_get",USER_RESOLUTION_REQUEST_FORMED:"userResolutionRequestFormed",USER_RESOLUTION_REQUEST_TRIGGERED:"userResolutionRequestTriggered",USER_RESOLUTION_RESULT:"userResolutionResult",USER_RESOLUTION_ERROR:"userResolutionError",USER_RESOLUTION_RESULT_FROM_CACHE:"userResolutionResultFromCache",EMAIL_USER_ID_RESOLUTION_REQUEST_FORMED:"emailUserIdResolutionRequestFormed",EMAIL_USER_ID_RESOLUTION_REQUEST_TRIGGERED:"emailUserIdResolutionRequestTriggered",EMAIL_USER_ID_RESOLUTION_RESULT:"emailUserIdResolutionResult",EMAIL_USER_ID_RESOLUTION_ERROR:"emailUserIdResolutionError",ATTACHMENT_RESOLVER_SAVE:"attachment_resolver_save",ATTACHMENT_RESOLVER_DELETE:"attachment_resolver_delete",ATTACHMENT_SAVE_REQUEST_FORMED:"attachmentSaveRequestFormed",ATTACHMENT_SAVE_REQUEST_TRIGGERED:"attachmentSaveRequestTriggered",ATTACHMENT_SAVE_RESULT:"attachmentSaveResult",ATTACHMENT_SAVE_ERROR:"attachmentSaveError",ATTACHMENT_DELETE_REQUEST_FORMED:"attachmentDeleteRequestFormed",ATTACHMENT_DELETE_REQUEST_TRIGGERED:"attachmentDeleteRequestTriggered",ATTACHMENT_DELETE_RESULT:"attachmentDeleteResult",ATTACHMENT_DELETE_ERROR:"attachmentDeleteError",RECORDER_RESOLVER_GET:"recorder_resolver_get",RECORDER_RESOLVER_SAVE:"recorder_resolver_save",RECORDER_RESOLVER_DELETE:"recorder_resolver_delete",RECORDER_RESOLUTION_REQUEST_FORMED:"recorderResolutionRequestFormed",RECORDER_RESOLUTION_REQUEST_TRIGGERED:"recorderResolutionRequestTriggered",RECORDER_RESOLUTION_RESULT:"recorderResolutionResult",RECORDER_RESOLUTION_ERROR:"recorderResolutionError",RECORDER_RESOLUTION_RESULT_FROM_CACHE:"recorderResolutionResultFromCache",RECORDER_SAVE_REQUEST_FORMED:"recorderSaveRequestFormed",RECORDER_SAVE_REQUEST_TRIGGERED:"recorderSaveRequestTriggered",RECORDER_SAVE_RESULT:"recorderSaveResult",RECORDER_SAVE_ERROR:"recorderSaveError",RECORDER_DELETE_REQUEST_FORMED:"recorderDeleteRequestFormed",RECORDER_DELETE_REQUEST_TRIGGERED:"recorderDeleteRequestTriggered",RECORDER_DELETE_RESULT:"recorderDeleteResult",RECORDER_DELETE_ERROR:"recorderDeleteError",ACTIVITY_RESOLVER_GET:"activity_resolver_get",ACTIVITY_RESOLVER_SAVE:"activity_resolver_save",ACTIVITY_RESOLUTION_REQUEST_FORMED:"activityResolutionRequestFormed",ACTIVITY_RESOLUTION_REQUEST_TRIGGERED:"activityResolutionRequestTriggered",ACTIVITY_RESOLUTION_RESULT:"activityResolutionResult",ACTIVITY_RESOLUTION_ERROR:"activityResolutionError",ACTIVITY_RESOLUTION_RESULT_FROM_CACHE:"activityResolutionResultFromCache",ACTIVITY_SAVE_REQUEST_FORMED:"activitySaveRequestFormed",ACTIVITY_SAVE_REQUEST_TRIGGERED:"activitySaveRequestTriggered",ACTIVITY_SAVE_RESULT:"activitySaveResult",ACTIVITY_SAVE_ERROR:"activitySaveError"},Autocomplete:{CREATE_TRIGGERED:"createTriggered",ON_AUTOCOMPLETE_CHIP_CLICK_TRIGGERED:"onAutocompleteChipClickTriggered"},Comments:{COMMENT_TOOL_CLICKED:"commentToolClicked",COMMENT_DRAFT_ADDED:"commentDraftAdded",COMMENT_ADD_CONTEXT_TRIGGERED:"commentAddContextTriggered",COMMENT_UPDATE_CONTEXT_TRIGGERED:"commentUpdateContextTriggered",COMMENT_UPDATE_CONTEXT_SUCCESS:"commentUpdateContextSuccess",COMMENT_UPDATE_CONTEXT_FAILED:"commentUpdateContextFailed",COMMENT_ADDED:"commentAdded",COMMENT_READ:"commentRead",COMMENT_STATUS_CHANGED:"commentStatusChanged",COMMENT_PRIORITY_CHANGED:"commentPriorityChanged",COMMENT_CUSTOM_CHIPS_CHANGED:"commentCustomChipsChanged",COMMENT_APPROVED:"commentApproved",COMMENT_ACCEPTED:"commentAccepted",COMMENT_REJECTED:"commentRejected",COMMENT_ASSIGNED:"commentAssigned",COMMENT_DELETE_TRIGGERED:"commentDeleteTriggered",COMMENT_DELETED:"commentDeleted",COMMENT_THREAD_DELETED:"commentThreadDeleted",COMMENT_LINK_COPIED:"commentLinkCopied",COMMENT_EDIT_BUTTON_CLICKED:"commentEditButtonClicked",COMMENT_EDITED:"commentEdited",COMMENT_SIDEBAR_OPENED:"commentSidebarOpened",COMMENT_SIDEBAR_CLOSED:"commentSidebarClosed",COMMENT_SIDEBAR_TOGGLED:"commentSidebarToggled",COMMENT_TAG_BUTTON_CLICKED:"commentTagButtonClicked",COMMENT_TAG_ADDED:"commentTagAdded",COMMENT_PIN_DRAGGED:"commentPinDragged",COMMENT_ADD_MODE_ENABLED:"commentAddModeEnabled",COMMENT_ADD_MODE_DISABLED:"commentAddModeDisabled",COMMENT_TEXT_MODE_ENABLED:"commentTextModeEnabled",COMMENT_TEXT_MODE_DISABLED:"commentTextModeDisabled",COMMENT_POPOVER_MODE_ENABLED:"commentPopoverModeEnabled",COMMENT_POPOVER_MODE_DISABLED:"commentPopoverModeDisabled",COMMENT_STREAM_MODE_ENABLED:"commentStreamModeEnabled",COMMENT_STREAM_MODE_DISABLED:"commentStreamModeDisabled",COMMENT_SIDEBAR_EMBED_MODE_ENABLED:"commentSidebarEmbedModeEnabled",COMMENT_SIDEBAR_FLOATING_MODE_ENABLED:"commentSidebarFloatingModeEnabled",COMMENT_ATTACHMENT_SET_ALLOWED_FILE_TYPES_TRIGGERED:"commentAttachmentSetAllowedFileTypesTriggered",ENABLE_FORCE_CLOSE_ALL_ON_ESC_TRIGGERED:"enableForceCloseAllOnEscTriggered",DISABLE_FORCE_CLOSE_ALL_ON_ESC_TRIGGERED:"disableForceCloseAllOnEscTriggered",COMMENT_ATTACHMENT_BUTTON_CLICKED:"commentAttachmentButtonClicked",COMMENT_ATTACHMENT_ADDED:"commentAttachmentAdded",COMMENT_ATTACHMENT_DOWNLOADED:"commentAttachmentDownloaded",COMMENT_ATTACHMENT_DELETED:"commentAttachmentDeleted",COMMENT_ATTACHMENT_SIZE_EXCEEDED:"commentAttachmentSizeExceeded",COMMENT_ATTACHMENT_TYPE_NOT_ALLOWED:"commentAttachmentTypeNotAllowed",COMMENT_SUBMIT_TRIGGERED:"commentSubmitTriggered",COMMENT_APPROVE_BUTTON_CLICKED:"commentApproveButtonClicked",COMMENT_ACCEPT_BUTTON_CLICKED:"commentAcceptButtonClicked",COMMENT_REJECT_BUTTON_CLICKED:"commentRejectButtonClicked",SUGGESTION_ACCEPTED:"suggestionAccepted",SUGGESTION_REJECTED:"suggestionRejected",COMMENT_SIGN_IN_BUTTON_CLICKED:"commentSignInButtonClicked",COMMENT_UPGRADE_BUTTON_CLICKED:"commentUpgradeButtonClicked",COMMENT_RECORDING_TOOL_CLICKED:"commentRecordingToolClicked",COMMENT_RECORDING_ADDED:"commentRecordingAdded",COMMENT_RECORDING_DELETED:"commentRecordingDeleted",COMMENT_MORE_REPLY_OPTION_CLICKED:"commentMoreReplyOptionClicked",COMMENT_PRIVATE_COMMENT_MODE_ENABLED:"commentPrivateCommentModeEnabled",COMMENT_PRIVATE_COMMENT_MODE_DISABLED:"commentPrivateCommentModeDisabled",COMMENT_ACCESS_MODE_CHANGED:"commentAccessModeChanged",SET_COMPOSER_FILE_ATTACHMENTS_TRIGGERED:"setComposerFileAttachmentsTriggered",GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED_INTERNAL:"getAllCommentAnnotationsTriggered_internal",GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED:"getAllCommentAnnotationsTriggered",DELETE_SELECTED_COMMENT_TRIGGERED:"deleteSelectedCommentTriggered",ENABLE_TEXT_COMMENTS_TRIGGERED:"enableTextCommentsTriggered",DISABLE_TEXT_COMMENTS_TRIGGERED:"disableTextCommentsTriggered",ALLOWED_ELEMENT_IDS_TRIGGERED:"allowedElementIdsTriggered",ALLOWED_ELEMENT_CLASS_NAMES_TRIGGERED:"allowedElementClassNamesTriggered",ALLOWED_ELEMENT_QUERY_SELECTORS_TRIGGERED:"allowedElementQuerySelectorsTriggered",ENABLE_FLOATING_COMMENT_DIALOG_TRIGGERED:"enableFloatingCommentDialogTriggered",DISABLE_FLOATING_COMMENT_DIALOG_TRIGGERED:"disableFloatingCommentDialogTriggered",ATTACH_COMMENT_TRIGGERED:"attachCommentTriggered",OPEN_COMMENT_SIDEBAR_TRIGGERED:"openCommentSidebarTriggered",CLOSE_COMMENT_SIDEBAR_TRIGGERED:"closeCommentSidebarTriggered",TOGGLE_COMMENT_SIDEBAR_TRIGGERED:"toggleCommentSidebarTriggered",SET_ASSIGN_TO_TYPE_TRIGGERED:"setAssignToTypeTriggered",ENABLE_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED:"enableContextInPageModeComposerTriggered",DISABLE_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED:"disableContextInPageModeComposerTriggered",CLEAR_PAGE_MODE_COMPOSER_CONTEXT_TRIGGERED:"clearPageModeComposerContextTriggered",SET_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED:"setContextInPageModeComposerTriggered",FOCUS_PAGE_MODE_COMPOSER_TRIGGERED:"focusPageModeComposerTriggered",ENABLE_MODERATOR_MODE_TRIGGERED:"enableModeratorModeTriggered",DISABLE_MODERATOR_MODE_TRIGGERED:"disableModeratorModeTriggered",ENABLE_STREAM_MODE_TRIGGERED:"enableStreamModeTriggered",DISABLE_STREAM_MODE_TRIGGERED:"disableStreamModeTriggered",ENABLE_SIGN_IN_BUTTON_TRIGGERED:"enableSignInButtonTriggered",DISABLE_SIGN_IN_BUTTON_TRIGGERED:"disableSignInButtonTriggered",ENABLE_UPGRADE_BUTTON_TRIGGERED:"enableUpgradeButtonTriggered",DISABLE_UPGRADE_BUTTON_TRIGGERED:"disableUpgradeButtonTriggered",ON_COMMENT_MODE_CHANGE_TRIGGERED:"onCommentModeChangeTriggered",ENABLE_ATTACHMENTS_TRIGGERED:"enableAttachmentsTriggered",DISABLE_ATTACHMENTS_TRIGGERED:"disableAttachmentsTriggered",ENABLE_ATTACHMENT_DOWNLOAD_TRIGGERED:"enableAttachmentDownloadTriggered",DISABLE_ATTACHMENT_DOWNLOAD_TRIGGERED:"disableAttachmentDownloadTriggered",IS_USER_GLOBAL_CONTACT_TRIGGERED:"isUserGlobalContactTriggered",ENABLE_DEVICE_INFO_TRIGGERED:"enableDeviceInfoTriggered",DISABLE_DEVICE_INFO_TRIGGERED:"disableDeviceInfoTriggered",ENABLE_COMMENT_MODE_TRIGGERED:"enableCommentModeTriggered",DISABLE_COMMENT_MODE_TRIGGERED:"disableCommentModeTriggered",ENABLE_PERSISTENT_COMMENT_MODE_TRIGGERED:"enablePersistentCommentModeTriggered",DISABLE_PERSISTENT_COMMENT_MODE_TRIGGERED:"disablePersistentCommentModeTriggered",SHOW_COMMENT_INDEX_TRIGGERED:"showCommentIndexTriggered",ENABLE_COMMENT_INDEX_TRIGGERED:"enableCommentIndexTriggered",DISABLE_COMMENT_INDEX_TRIGGERED:"disableCommentIndexTriggered",ENABLE_POPOVER_MODE_TRIGGERED:"enablePopoverModeTriggered",DISABLE_POPOVER_MODE_TRIGGERED:"disablePopoverModeTriggered",ENABLE_POPOVER_TRIANGLE_COMPONENT_TRIGGERED:"enablePopoverTriangleComponentTriggered",DISABLE_POPOVER_TRIANGLE_COMPONENT_TRIGGERED:"disablePopoverTriangleComponentTriggered",ENABLE_DIALOG_ON_HOVER_TRIGGERED:"enableDialogOnHoverTriggered",DISABLE_DIALOG_ON_HOVER_TRIGGERED:"disableDialogOnHoverTriggered",ENABLE_DIALOG_ON_TARGET_ELEMENT_CLICK_TRIGGERED:"enableDialogOnTargetElementClickTriggered",DISABLE_DIALOG_ON_TARGET_ELEMENT_CLICK_TRIGGERED:"disableDialogOnTargetElementClickTriggered",ENABLE_PRIORITY_TRIGGERED:"enablePriorityTriggered",DISABLE_PRIORITY_TRIGGERED:"disablePriorityTriggered",ENABLE_STATUS_TRIGGERED:"enableStatusTriggered",DISABLE_STATUS_TRIGGERED:"disableStatusTriggered",ENABLE_VISIBILITY_OPTIONS_TRIGGERED:"enableVisibilityOptionsTriggered",DISABLE_VISIBILITY_OPTIONS_TRIGGERED:"disableVisibilityOptionsTriggered",ENABLE_RESOLVE_BUTTON_TRIGGERED:"enableResolveButtonTriggered",DISABLE_RESOLVE_BUTTON_TRIGGERED:"disableResolveButtonTriggered",ENABLE_GHOST_COMMENTS_TRIGGERED:"enableGhostCommentsTriggered",DISABLE_GHOST_COMMENTS_TRIGGERED:"disableGhostCommentsTriggered",ENABLE_GHOST_COMMENTS_INDICATOR_TRIGGERED:"enableGhostCommentsIndicatorTriggered",DISABLE_GHOST_COMMENTS_INDICATOR_TRIGGERED:"disableGhostCommentsIndicatorTriggered",SET_CUSTOM_STATUS_TRIGGERED:"setCustomStatusTriggered",SET_CUSTOM_PRIORITY_TRIGGERED:"setCustomPriorityTriggered",SET_CUSTOM_CATEGORY_TRIGGERED:"setCustomCategoryTriggered",ENABLE_INBOX_MODE_TRIGGERED:"enableInboxModeTriggered",DISABLE_INBOX_MODE_TRIGGERED:"disableInboxModeTriggered",ENABLE_AUTO_CATEGORIZE_TRIGGERED:"enableAutoCategorizeTriggered",DISABLE_AUTO_CATEGORIZE_TRIGGERED:"disableAutoCategorizeTriggered",ENABLE_DARK_MODE_TRIGGERED:"enableDarkModeTriggered",DISABLE_DARK_MODE_TRIGGERED:"disableDarkModeTriggered",SET_CONTEXT_PROVIDER_TRIGGERED:"setContextProviderTriggered",ENABLE_SUGGESTION_MODE_TRIGGERED:"enableSuggestionModeTriggered",DISABLE_SUGGESTION_MODE_TRIGGERED:"disableSuggestionModeTriggered",ENABLE_MOBILE_MODE_TRIGGERED:"enableMobileModeTriggered",DISABLE_MOBILE_MODE_TRIGGERED:"disableMobileModeTriggered",ENABLE_INLINE_COMMENT_MODE_TRIGGERED:"enableInlineCommentModeTriggered",DISABLE_INLINE_COMMENT_MODE_TRIGGERED:"disableInlineCommentModeTriggered",ENABLE_MINIMAP_TRIGGERED:"enableMinimapTriggered",DISABLE_MINIMAP_TRIGGERED:"disableMinimapTriggered",SHOW_COMMENTS_ON_DOM_TRIGGERED:"showCommentsOnDomTriggered",HIDE_COMMENTS_ON_DOM_TRIGGERED:"hideCommentsOnDomTriggered",ENABLE_COMMENT_TOOL_TRIGGERED:"enableCommentToolTriggered",DISABLE_COMMENT_TOOL_TRIGGERED:"disableCommentToolTriggered",SET_TOTAL_MEDIA_LENGTH_TRIGGERED:"setTotalMediaLengthTriggered",ON_COMMENT_ADD_TRIGGERED:"onCommentAddTriggered",ON_COMMENT_UPDATE_TRIGGERED:"onCommentUpdateTriggered",ADD_COMMENT_ON_SELECTED_TEXT_TRIGGERED:"addCommentOnSelectedTextTriggered",ENABLE_SIDEBAR_URL_NAVIGATION_TRIGGERED:"enableSidebarUrlNavigationTriggered",DISABLE_SIDEBAR_URL_NAVIGATION_TRIGGERED:"disableSidebarUrlNavigationTriggered",SET_D_STRATEGY_TRIGGERED:"setDStrategyTriggered",ENABLE_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_TRIGGERED:"enableSidebarButtonOnCommentDialogTriggered",DISABLE_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_TRIGGERED:"disableSidebarButtonOnCommentDialogTriggered",ON_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_CLICK_TRIGGERED:"onSidebarButtonOnCommentDialogClickTriggered",ENABLE_REACTIONS_TRIGGERED:"enableReactionsTriggered",DISABLE_REACTIONS_TRIGGERED:"disableReactionsTriggered",ENABLE_ANONYMOUS_EMAIL_TRIGGERED:"enableAnonymousEmailTriggered",DISABLE_ANONYMOUS_EMAIL_TRIGGERED:"disableAnonymousEmailTriggered",SET_RECORDINGS_TRIGGERED:"setRecordingsTriggered",ADD_COMMENT_ON_ELEMENT_TRIGGERED:"addCommentOnElementTriggered",ENABLE_PRIVATE_COMMENT_MODE_TRIGGERED:"enablePrivateCommentModeTriggered",DISABLE_PRIVATE_COMMENT_MODE_TRIGGERED:"disablePrivateCommentModeTriggered",ENABLE_PRIVATE_MODE_TRIGGERED:"enablePrivateModeTriggered",DISABLE_PRIVATE_MODE_TRIGGERED:"disablePrivateModeTriggered",ENABLE_SCROLL_TO_COMMENT_TRIGGERED:"enableScrollToCommentTriggered",DISABLE_SCROLL_TO_COMMENT_TRIGGERED:"disableScrollToCommentTriggered",ENABLE_USER_MENTIONS_TRIGGERED:"enableUserMentionsTriggered",DISABLE_USER_MENTIONS_TRIGGERED:"disableUserMentionsTriggered",SET_COMMENT_SIDEBAR_FILTERS_TRIGGERED:"setCommentSidebarFiltersTriggered",SET_SYSTEM_FILTERS_OPERATOR_TRIGGERED:"setSystemFiltersOperatorTriggered",ENABLE_COMMENT_PIN_HIGHLIGHTER_TRIGGERED:"enableCommentPinHighlighterTriggered",DISABLE_COMMENT_PIN_HIGHLIGHTER_TRIGGERED:"disableCommentPinHighlighterTriggered",ENABLE_DELETE_ON_BACKSPACE_TRIGGERED:"enableDeleteOnBackspaceTriggered",DISABLE_DELETE_ON_BACKSPACE_TRIGGERED:"disableDeleteOnBackspaceTriggered",ENABLE_HOTKEY_TRIGGERED:"enableHotkeyTriggered",DISABLE_HOTKEY_TRIGGERED:"disableHotkeyTriggered",ENABLE_DEVICE_INDICATOR_ON_COMMENT_PINS_TRIGGERED:"enableDeviceIndicatorOnCommentPinsTriggered",DISABLE_DEVICE_INDICATOR_ON_COMMENT_PINS_TRIGGERED:"disableDeviceIndicatorOnCommentPinsTriggered",GET_ELEMENT_REF_BY_ANNOTATION_ID_TRIGGERED:"getElementRefByAnnotationIdTriggered",SCROLL_TO_COMMENT_BY_ANNOTATION_ID_TRIGGERED:"scrollToCommentByAnnotationIdTriggered",SELECT_COMMENT_BY_ANNOTATION_ID_TRIGGERED:"selectCommentByAnnotationIdTriggered",ENABLE_RECORDING_SUMMARY_TRIGGERED:"enableRecordingSummaryTriggered",DISABLE_RECORDING_SUMMARY_TRIGGERED:"disableRecordingSummaryTriggered",ENABLE_RECORDING_TRANSCRIPTION_TRIGGERED:"enableRecordingTranscriptionTriggered",DISABLE_RECORDING_TRANSCRIPTION_TRIGGERED:"disableRecordingTranscriptionTriggered",ENABLE_RECORDING_COUNTDOWN_TRIGGERED:"enableRecordingCountdownTriggered",DISABLE_RECORDING_COUNTDOWN_TRIGGERED:"disableRecordingCountdownTriggered",SET_UNREAD_INDICATOR_MODE_TRIGGERED:"setUnreadIndicatorModeTriggered",ENABLE_ENTER_KEY_TO_SUBMIT_TRIGGERED:"enableEnterKeyToSubmitTriggered",DISABLE_ENTER_KEY_TO_SUBMIT_TRIGGERED:"disableEnterKeyToSubmitTriggered",ENABLE_PIN_SHADOW_DOM_TRIGGERED:"enablePinShadowDOMTriggered",DISABLE_PIN_SHADOW_DOM_TRIGGERED:"disablePinShadowDOMTriggered",ENABLE_DIALOG_SHADOW_DOM_TRIGGERED:"enableDialogShadowDOMTriggered",DISABLE_DIALOG_SHADOW_DOM_TRIGGERED:"disableDialogShadowDOMTriggered",ENABLE_SIDEBAR_SHADOW_DOM_TRIGGERED:"enableSidebarShadowDOMTriggered",DISABLE_SIDEBAR_SHADOW_DOM_TRIGGERED:"disableSidebarShadowDOMTriggered",ENABLE_CHANGE_DETECTION_IN_COMMENT_MODE_TRIGGERED:"enableChangeDetectionInCommentModeTriggered",DISABLE_CHANGE_DETECTION_IN_COMMENT_MODE_TRIGGERED:"disableChangeDetectionInCommentModeTriggered",SHOW_RESOLVED_COMMENTS_ON_DOM_TRIGGERED:"showResolvedCommentsOnDomTriggered",HIDE_RESOLVED_COMMENTS_ON_DOM_TRIGGERED:"hideResolvedCommentsOnDomTriggered",SET_CUSTOM_REACTIONS_TRIGGERED:"setCustomReactionsTriggered",ON_COMMENT_SELECTION_CHANGE_TRIGGERED:"onCommentSelectionChangeTriggered",GET_UNREAD_COMMENT_COUNT_BY_ANNOTATION_ID_TRIGGERED:"getUnreadCommentCountByAnnotationIdTriggered",GET_UNREAD_COMMENT_ANNOTATION_COUNT_ON_CURRENT_DOCUMENT_TRIGGERED:"getUnreadCommentAnnotationCountOnCurrentDocumentTriggered",GET_UNREAD_COMMENT_COUNT_ON_CURRENT_DOCUMENT_TRIGGERED:"getUnreadCommentCountOnCurrentDocumentTriggered",GET_UNREAD_COMMENT_ANNOTATION_COUNT_BY_LOCATION_ID_TRIGGERED:"getUnreadCommentAnnotationCountByLocationIdTriggered",GET_UNREAD_COMMENT_COUNT_BY_LOCATION_ID_TRIGGERED:"getUnreadCommentCountByLocationIdTriggered",UPDATE_COMMENT_DIALOG_POSITION_TRIGGERED:"updateCommentDialogPositionTriggered",ENABLE_AREA_COMMENT_TRIGGERED:"enableAreaCommentTriggered",DISABLE_AREA_COMMENT_TRIGGERED:"disableAreaCommentTriggered",SET_PIN_CURSOR_IMAGE_TRIGGERED:"setPinCursorImageTriggered",ADD_MANUAL_COMMENT_TRIGGERED:"addManualCommentTriggered",CREATE_CUSTOM_LIST_DATA_ON_ANNOTATION_TRIGGERED:"createCustomListDataOnAnnotationTriggered",CREATE_CUSTOM_LIST_DATA_ON_COMMENT_TRIGGERED:"createCustomListDataOnCommentTriggered",EXCLUDE_LOCATION_IDS_FROM_SIDEBAR_TRIGGERED:"excludeLocationIdsFromSidebarTriggered",ENABLE_BUBBLE_ON_PIN_TRIGGERED:"enableBubbleOnPinTriggered",DISABLE_BUBBLE_ON_PIN_TRIGGERED:"disableBubbleOnPinTriggered",ENABLE_BUBBLE_ON_PIN_HOVER_TRIGGERED:"enableBubbleOnPinHoverTriggered",DISABLE_BUBBLE_ON_PIN_HOVER_TRIGGERED:"disableBubbleOnPinHoverTriggered",ENABLE_PIN_DRAG_TRIGGERED:"enablePinDragTriggered",DISABLE_PIN_DRAG_TRIGGERED:"disablePinDragTriggered",ENABLE_MULTI_THREAD_MODE_TRIGGERED:"enableMultiThreadModeTriggered",DISABLE_MULTI_THREAD_MODE_TRIGGERED:"disableMultiThreadModeTriggered",ENABLE_MULTI_THREAD_TRIGGERED:"enableMultiThreadTriggered",DISABLE_MULTI_THREAD_TRIGGERED:"disableMultiThreadTriggered",ENABLE_GROUP_MATCHED_COMMENTS_TRIGGERED:"enableGroupMatchedCommentsTriggered",DISABLE_GROUP_MATCHED_COMMENTS_TRIGGERED:"disableGroupMatchedCommentsTriggered",ENABLE_RESTRICT_TEXT_SEARCH_TO_ANCHOR_TRIGGERED:"enableRestrictTextSearchToAnchorTriggered",DISABLE_RESTRICT_TEXT_SEARCH_TO_ANCHOR_TRIGGERED:"disableRestrictTextSearchToAnchorTriggered",UPDATE_CONTEXT_TRIGGERED:"updateContextTriggered",UPDATE_VISIBILITY_TRIGGERED:"updateVisibilityTriggered",GET_SELECTED_COMMENTS_TRIGGERED:"getSelectedCommentsTriggered",ENABLE_DELETE_REPLY_CONFIRMATION_TRIGGERED:"enableDeleteReplyConfirmationTriggered",DISABLE_DELETE_REPLY_CONFIRMATION_TRIGGERED:"disableDeleteReplyConfirmationTriggered",ON_COPY_LINK_TRIGGERED:"onCopyLinkTriggered",GET_COMMENT_ANNOTATION_BY_ID_TRIGGERED:"getCommentAnnotationByIdTriggered",ENABLE_COLLAPSED_COMMENTS_TRIGGERED:"enableCollapsedCommentsTriggered",DISABLE_COLLAPSED_COMMENTS_TRIGGERED:"disableCollapsedCommentsTriggered",SET_COMMENT_SIDEBAR_DATA_TRIGGERED:"setCommentSidebarDataTriggered",ON_COMMENT_SIDEBAR_INIT_TRIGGERED:"onCommentSidebarInitTriggered",ON_COMMENT_SIDEBAR_DATA_TRIGGERED:"onCommentSidebarDataTriggered",SET_COMMENT_SIDEBAR_DEFAULT_CUSTOM_ACTIONS_TRIGGERED:"setCommentSidebarDefaultCustomActionsTriggered",ENABLE_SIDEBAR_CUSTOM_ACTIONS_TRIGGERED:"enableSidebarCustomActionsTriggered",DISABLE_SIDEBAR_CUSTOM_ACTIONS_TRIGGERED:"disableSidebarCustomActionsTriggered",ENABLE_QUERY_PARAMS_COMMENTS_TRIGGERED:"enableQueryParamsCommentsTriggered",DISABLE_QUERY_PARAMS_COMMENTS_TRIGGERED:"disableQueryParamsCommentsTriggered",ENABLE_RESOLVE_STATUS_ACCESS_ADMIN_ONLY_TRIGGERED:"enableResolveStatusAccessAdminOnlyTriggered",DISABLE_RESOLVE_STATUS_ACCESS_ADMIN_ONLY_TRIGGERED:"disableResolveStatusAccessAdminOnlyTriggered",ENABLE_LINK_CALLBACK_TRIGGERED:"enableLinkCallbackTriggered",DISABLE_LINK_CALLBACK_TRIGGERED:"disableLinkCallbackTriggered",ENABLE_SEEN_BY_USERS_TRIGGERED:"enableSeenByUsersTriggered",DISABLE_SEEN_BY_USERS_TRIGGERED:"disableSeenByUsersTriggered",ENABLE_SHORT_USER_NAME_TRIGGERED:"enableShortUserNameTriggered",DISABLE_SHORT_USER_NAME_TRIGGERED:"disableShortUserNameTriggered",ENABLE_READ_ONLY_TRIGGERED:"enableReadOnlyTriggered",DISABLE_READ_ONLY_TRIGGERED:"disableReadOnlyTriggered",ADD_COMMENT_ANNOTATION_TRIGGERED:"addCommentAnnotationTriggered",APPROVE_COMMENT_ANNOTATION_TRIGGERED:"approveCommentAnnotationTriggered",ACCEPT_COMMENT_ANNOTATION_TRIGGERED:"acceptCommentAnnotationTriggered",REJECT_COMMENT_ANNOTATION_TRIGGERED:"rejectCommentAnnotationTriggered",ACCEPT_SUGGESTION_TRIGGERED:"acceptSuggestionTriggered",REJECT_SUGGESTION_TRIGGERED:"rejectSuggestionTriggered",SUBSCRIBE_COMMENT_ANNOTATION_TRIGGERED:"subscribeCommentAnnotationTriggered",UNSUBSCRIBE_COMMENT_ANNOTATION_TRIGGERED:"unsubscribeCommentAnnotationTriggered",DELETE_COMMENT_ANNOTATION_TRIGGERED:"deleteCommentAnnotationTriggered",GET_COMMENT_ANNOTATIONS_TRIGGERED:"getCommentAnnotationsTriggered",GET_COMMENT_ANNOTATIONS_COUNT_TRIGGERED:"getCommentAnnotationsCountTriggered",ASSIGN_USER_TRIGGERED:"assignUserTriggered",UPDATE_PRIORITY_TRIGGERED:"updatePriorityTriggered",UPDATE_STATUS_TRIGGERED:"updateStatusTriggered",UPDATE_ACCESS_TRIGGERED:"updateAccessTriggered",RESOLVE_COMMENT_ANNOTATION_TRIGGERED:"resolveCommentAnnotationTriggered",GET_LINK_TRIGGERED:"getLinkTriggered",COPY_LINK_TRIGGERED:"copyLinkTriggered",ADD_COMMENT_TRIGGERED:"addCommentTriggered",UPDATE_COMMENT_TRIGGERED:"updateCommentTriggered",DELETE_COMMENT_TRIGGERED:"deleteCommentTriggered",GET_COMMENT_TRIGGERED:"getCommentTriggered",MARK_AS_READ_TRIGGERED:"markAsReadTriggered",MARK_AS_UNREAD_TRIGGERED:"markAsUnreadTriggered",ENABLE_SCREENSHOT_TRIGGERED:"enableScreenshotTriggered",DISABLE_SCREENSHOT_TRIGGERED:"disableScreenshotTriggered",ENABLE_PAGINATED_CONTACT_LIST_TRIGGERED:"enablePaginatedContactListTriggered",DISABLE_PAGINATED_CONTACT_LIST_TRIGGERED:"disablePaginatedContactListTriggered",SUBMIT_COMMENT_TRIGGERED:"submitCommentTriggered",CLEAR_COMPOSER_TRIGGERED:"clearComposerTriggered",GET_COMPOSER_DATA_TRIGGERED:"getComposerDataTriggered",ENABLE_FORMAT_OPTIONS_TRIGGERED:"enableFormatOptionsTriggered",DISABLE_FORMAT_OPTIONS_TRIGGERED:"disableFormatOptionsTriggered",SET_FORMAT_CONFIG_TRIGGERED:"setFormatConfigTriggered",ADD_ATTACHMENT_TRIGGERED:"addAttachmentTriggered",DELETE_ATTACHMENT_TRIGGERED:"deleteAttachmentTriggered",GET_ATTACHMENT_TRIGGERED:"getAttachmentTriggered",DELETE_RECORDING_TRIGGERED:"deleteRecordingTriggered",GET_RECORDING_TRIGGERED:"getRecordingTriggered",REACTION_ADDED:"reactionAdded",REACTION_DELETED:"reactionDeleted",ADD_REACTION_TRIGGERED:"addReactionTriggered",DELETE_REACTION_TRIGGERED:"deleteReactionTriggered",TOGGLE_REACTION_TRIGGERED:"toggleReactionTriggered",ENABLE_CUSTOM_AUTOCOMPLETE_SEARCH_TRIGGERED:"enableCustomAutocompleteSearchTriggered",DISABLE_CUSTOM_AUTOCOMPLETE_SEARCH_TRIGGERED:"disableCustomAutocompleteSearchTriggered",FETCH_COMMENT_ANNOTATIONS_TRIGGERED:"fetchCommentAnnotationsTriggered",SET_TRANSFORM_CONTEXT_TRIGGERED:"setTransformContextTriggered",ENABLE_SVG_AS_IMG_TRIGGERED:"enableSvgAsImgTriggered",DISABLE_SVG_AS_IMG_TRIGGERED:"disableSvgAsImgTriggered",ENABLE_FULL_EXPANDED_TRIGGERED:"enableFullExpandedTriggered",DISABLE_FULL_EXPANDED_TRIGGERED:"disableFullExpandedTriggered",ENABLE_COMMENT_TO_NEAREST_ALLOWED_ELEMENT_TRIGGERED:"enableCommentToNearestAllowedElementTriggered",DISABLE_COMMENT_TO_NEAREST_ALLOWED_ELEMENT_TRIGGERED:"disableCommentToNearestAllowedElementTriggered",ENABLE_DRAFT_MODE_TRIGGERED:"enableDraftModeTriggered",DISABLE_DRAFT_MODE_TRIGGERED:"disableDraftModeTriggered",ENABLE_DRAFT_CONFIRMATION_TRIGGERED:"enableDraftConfirmationTriggered",DISABLE_DRAFT_CONFIRMATION_TRIGGERED:"disableDraftConfirmationTriggered",ENABLE_ID_SCOPED_ANCHORING_TRIGGERED:"enableIdScopedAnchoringTriggered",DISABLE_ID_SCOPED_ANCHORING_TRIGGERED:"disableIdScopedAnchoringTriggered",ENABLE_FILTER_COMMENTS_ON_DOM_TRIGGERED:"enableFilterCommentsOnDomTriggered",DISABLE_FILTER_COMMENTS_ON_DOM_TRIGGERED:"disableFilterCommentsOnDomTriggered",ENABLE_REPLY_AVATARS_TRIGGERED:"enableReplyAvatarsTriggered",DISABLE_REPLY_AVATARS_TRIGGERED:"disableReplyAvatarsTriggered",SET_MAX_REPLY_AVATARS_TRIGGERED:"setMaxReplyAvatarsTriggered",SET_SIDEBAR_BUTTON_COUNT_TYPE_TRIGGERED:"setSidebarButtonCountTypeTriggered",ENABLE_FILTER_GHOST_COMMENTS_IN_SIDEBAR_TRIGGERED:"enableFilterGhostCommentsInSidebarTriggered",DISABLE_FILTER_GHOST_COMMENTS_IN_SIDEBAR_TRIGGERED:"disableFilterGhostCommentsInSidebarTriggered",ENABLE_FULL_SCREEN_IN_SIDEBAR_TRIGGERED:"enableFullScreenInSidebarTriggered",DISABLE_FULL_SCREEN_IN_SIDEBAR_TRIGGERED:"disableFullScreenInSidebarTriggered"},Recording:{RECORDING_TOOL_CLICKED:"recordingToolClicked",RECORDING_ADDED:"recordingAdded",RECORDING_PANEL_SAVE_BUTTON_CLICKED:"recordingPanelSaveButtonClicked",RECORDING_PANEL_CANCEL_BUTTON_CLICKED:"recordingPanelCancelButtonClicked",RECORDING_PANEL_PAUSE_BUTTON_CLICKED:"recordingPanelPauseButtonClicked",RECORDING_PANEL_RESUME_BUTTON_CLICKED:"recordingPanelResumeButtonClicked",RECORDING_PANEL_VIDEO_ON_BUTTON_CLICKED:"recordingPanelVideoOnButtonClicked",RECORDING_PANEL_VIDEO_OFF_BUTTON_CLICKED:"recordingPanelVideoOffButtonClicked",RECORDING_PANEL_AUDIO_ON_BUTTON_CLICKED:"recordingPanelAudioOnButtonClicked",RECORDING_PANEL_AUDIO_OFF_BUTTON_CLICKED:"recordingPanelAudioOffButtonClicked",RECORDING_PANEL_START_BUTTON_CLICKED:"recordingPanelStartButtonClicked",RECORDING_PANEL_PIP_BUTTON_CLICKED:"recordingPanelPipButtonClicked",RECORDING_PLAYED:"recordingPlayed",RECORDING_PAUSED:"recordingPaused",RECORDING_DELETE_TRIGGERED:"recordingDeleteTriggered",RECORDING_DELETED:"recordingDeleted",RECORDING_DRAGGED:"recordingDragged",RECORDING_DRAFT_DRAGGED:"recordingDraftDragged",TRANSCRIPTION_CLICKED:"transcriptionClicked",SUBTITLES_CLICKED:"subtitlesClicked",VIEW_TRANSCRIPTION_SUMMARY_CLICKED:"viewTranscriptionSummaryClicked",TRANSCRIPTION_SUMMARY_COPIED:"transcriptionSummaryCopied",TRANSCRIPTION_TIMESTAMP_CLICKED:"transcriptionTimestampClicked",TRANSCRIPTION_PANEL_DRAGGED:"transcriptionPanelDragged",SUBTITLES_PANEL_DRAGGED:"subtitlesPanelDragged",ENABLE_PLAYBACK_ON_PREVIEW_CLICK_TRIGGERED:"enablePlaybackOnPreviewClickTriggered",DISABLE_PLAYBACK_ON_PREVIEW_CLICK_TRIGGERED:"disablePlaybackOnPreviewClickTriggered",REQUEST_SCREEN_PERMISSION_TRIGGERED:"requestScreenPermissionTriggered",INIT_RECORDING_TRIGGERED:"initRecordingTriggered",ON_RECORDED_DATA_TRIGGERED:"onRecordedDataTriggered",ENABLE_DARK_MODE_TRIGGERED:"enableDarkModeTriggered",DISABLE_DARK_MODE_TRIGGERED:"disableDarkModeTriggered",ENABLE_RECORDING_COUNTDOWN_TRIGGERED:"enableRecordingCountdownTriggered",DISABLE_RECORDING_COUNTDOWN_TRIGGERED:"disableRecordingCountdownTriggered",GET_RECORDING_DATA_BY_RECORDER_ID_TRIGGERED:"getRecordingDataByRecorderIdTriggered",GET_RECORDINGS_TRIGGERED:"getRecordingsTriggered",ENABLE_RECORDING_TRANSCRIPTION_TRIGGERED:"enableRecordingTranscriptionTriggered",DISABLE_RECORDING_TRANSCRIPTION_TRIGGERED:"disableRecordingTranscriptionTriggered",GET_RECORDING_DATA_TRIGGERED:"getRecordingDataTriggered",FETCH_RECORDINGS_TRIGGERED:"fetchRecordingsTriggered",DELETE_RECORDING_TRIGGERED:"deleteRecordingTriggered",ENABLE_VIDEO_EDITOR_TRIGGERED:"enableVideoEditorTriggered",DISABLE_VIDEO_EDITOR_TRIGGERED:"disableVideoEditorTriggered",SET_RECORDING_QUALITY_CONSTRAINTS_TRIGGERED:"setRecordingQualityConstraintsTriggered",SET_RECORDING_ENCODING_OPTIONS_TRIGGERED:"setRecordingEncodingOptionsTriggered",DOWNLOAD_LATEST_VIDEO_TRIGGERED:"downloadLatestVideoTriggered",ENABLE_RECORDING_MIC_TRIGGERED:"enableRecordingMicTriggered",DISABLE_RECORDING_MIC_TRIGGERED:"disableRecordingMicTriggered",ENABLE_RETAKE_ON_VIDEO_EDITOR_TRIGGERED:"enableRetakeOnVideoEditorTriggered",DISABLE_RETAKE_ON_VIDEO_EDITOR_TRIGGERED:"disableRetakeOnVideoEditorTriggered",ASK_DEVICE_PERMISSION_TRIGGERED:"askDevicePermissionTriggered",ENABLE_ONBOARDING_TOOLTIP_TRIGGERED:"enableOnboardingTooltipTriggered",DISABLE_ONBOARDING_TOOLTIP_TRIGGERED:"disableOnboardingTooltipTriggered",SET_MAX_LENGTH_TRIGGERED:"setMaxLengthTriggered",OPEN_PICTURE_IN_PICTURE_TRIGGERED:"openPictureInPictureTriggered",EXIT_PICTURE_IN_PICTURE_TRIGGERED:"exitPictureInPictureTriggered",ENABLE_PICTURE_IN_PICTURE_TRIGGERED:"enablePictureInPictureTriggered",DISABLE_PICTURE_IN_PICTURE_TRIGGERED:"disablePictureInPictureTriggered"},Huddle:{HUDDLE_TOOL_CLICKED:"huddleToolClicked",HUDDLE_CREATED:"huddleCreated",HUDDLE_JOIN_BUTTON_CLICKED:"huddleJoinButtonClicked",HUDDLE_JOINED:"huddleJoined",HUDDLE_LEFT:"huddleLeft",HUDDLE_AUDIO_BUTTON_CLICKED:"huddleAudioButtonClicked",HUDDLE_AUDIO_MUTED:"huddleAudioMuted",HUDDLE_AUDIO_UNMUTED:"huddleAudioUnmuted",HUDDLE_VIDEO_BUTTON_CLICKED:"huddleVideoButtonClicked",HUDDLE_VIDEO_TURNED_ON:"huddleVideoTurnedOn",HUDDLE_VIDEO_TURNED_OFF:"huddleVideoTurnedOff",HUDDLE_SCREENSHARING_BUTTON_CLICKED:"huddleScreensharingButtonClicked",HUDDLE_SCREENSHARING_STARTED:"huddleScreensharingStarted",HUDDLE_SCREENSHARING_STOPPED:"huddleScreensharingStopped",ENABLE_HUDDLE_ON_CURSOR_MODE_TRIGGERED:"enableHuddleOnCursorModeTriggered",DISABLE_HUDDLE_ON_CURSOR_MODE_TRIGGERED:"disableHuddleOnCursorModeTriggered",ENABLE_CHAT_TRIGGERED:"enableChatTriggered",DISABLE_CHAT_TRIGGERED:"disableChatTriggered",ENABLE_FLOCK_MODE_ON_AVATAR_CLICK_TRIGGERED:"enableFlockModeOnAvatarClickTriggered",DISABLE_FLOCK_MODE_ON_AVATAR_CLICK_TRIGGERED:"disableFlockModeOnAvatarClickTriggered"},Presence:{PRESENCE_MULTIPLE_USERS_DETECTED:"presenceMultipleUsersDetected",PRESENCE_USER_STATUS_CHANGED:"presenceUserStatusChanged",PRESENCE_USER_CLICKED:"presenceUserClicked",PRESENCE_SET_CUSTOM_INACTIVITY_TIMER:"presenceSetCustomInactivityTimer",PRESENCE_SET_CUSTOM_OFFLINE_INACTIVITY_TIMER:"presenceSetCustomOfflineInactivityTimer",PRESENCE_SET_CUSTOM_MAX_USERS:"presenceSetCustomMaxUsers",MULTIPLE_USERS_ONLINE:"multipleUsersOnline",ON_USER_STATE_CHANGE:"onUserStateChange",GET_PRESENCE_DATA_TRIGGERED:"getPresenceDataTriggered",GET_ONLINE_USERS_ON_CURRENT_DOCUMENT_TRIGGERED:"getOnlineUsersOnCurrentDocumentTriggered",SET_INACTIVITY_TIME_TRIGGERED:"setInactivityTimeTriggered",ENABLE_FLOCK_MODE_TRIGGERED:"enableFlockModeTriggered",DISABLE_FLOCK_MODE_TRIGGERED:"disableFlockModeTriggered",START_FOLLOWING_USER_TRIGGERED:"startFollowingUserTriggered",STOP_FOLLOWING_USER_TRIGGERED:"stopFollowingUserTriggered",ENABLE_SELF_TRIGGERED:"enableSelfTriggered",DISABLE_SELF_TRIGGERED:"disableSelfTriggered",ADD_USER_TRIGGERED:"addUserTriggered",REMOVE_USER_TRIGGERED:"removeUserTriggered"},Cursor:{CURSOR_MULTIPLE_USERS_DETECTED:"cursorMultipleUsersDetected",CURSOR_SET_CUSTOM_INACTIVITY_TIMER:"cursorSetCustomInactivityTimer",GET_LIVE_CURSORS_ON_CURRENT_DOCUMENT_TRIGGERED:"getLiveCursorsOnCurrentDocumentTriggered",SET_INACTIVITY_TIME_TRIGGERED:"setInactivityTimeTriggered",ALLOWED_ELEMENT_IDS_TRIGGERED:"allowedElementIdsTriggered"},Selection:{SELECTION_CREATED_WHEN_MULTIPLE_USERS_DETECTED:"selectionCreatedWhenMultipleUsersDetected",SELECTION_SET_CUSTOM_INACTIVITY_TIMER:"selectionSetCustomInactivityTimer",ENABLE_LIVE_SELECTION_TRIGGERED:"enableLiveSelectionTriggered",DISABLE_LIVE_SELECTION_TRIGGERED:"disableLiveSelectionTriggered",ENABLE_USER_INDICATOR_TRIGGERED:"enableUserIndicatorTriggered",DISABLE_USER_INDICATOR_TRIGGERED:"disableUserIndicatorTriggered",SET_USER_INDICATOR_POSITION_TRIGGERED:"setUserIndicatorPositionTriggered",SET_USER_INDICATOR_TYPE_TRIGGERED:"setUserIndicatorTypeTriggered",ENABLE_DEFAULT_ELEMENTS_TRACKING_TRIGGERED:"enableDefaultElementsTrackingTriggered",DISABLE_DEFAULT_ELEMENTS_TRACKING_TRIGGERED:"disableDefaultElementsTrackingTriggered",ENABLE_DEFAULT_STYLING_TRIGGERED:"enableDefaultStylingTriggered",DISABLE_DEFAULT_STYLING_TRIGGERED:"disableDefaultStylingTriggered",GET_LIVE_SELECTION_DATA_TRIGGERED:"getLiveSelectionDataTriggered",SET_INACTIVITY_TIME_TRIGGERED:"setInactivityTimeTriggered"},LiveStateSync:{SET_USER_AS_EDITOR_TRIGGERED:"setUserAsEditorTriggered",SET_USER_AS_EDITOR_ERROR:"setUserAsEditorError",REQUEST_EDITOR_ACCESS_TRIGGERED:"requestEditorAccessTriggered",ACCEPT_EDITOR_ACCESS_REQUEST_TRIGGERED:"acceptEditorAccessRequestTriggered",REJECT_EDITOR_ACCESS_REQUEST_TRIGGERED:"rejectEditorAccessRequestTriggered",CANCEL_EDITOR_ACCESS_REQUEST_TRIGGERED:"cancelEditorAccessRequestTriggered",EDIT_CURRENT_TAB_TRIGGERED:"editCurrentTabTriggered",SEM_ACCESS_REQUESTED:"semAccessRequested",SEM_ACCESS_REQUEST_CANCELED:"semAccessRequestCanceled",SEM_ACCESS_ACCEPTED:"semAccessAccepted",SEM_ACCESS_REJECTED:"semAccessRejected",SEM_EDITOR_ASSIGNED:"semEditorAssigned",SEM_VIEWER_ASSIGNED:"semViewerAssigned",SEM_EDITOR_ON_DIFFERENT_TAB_DETECTED:"semEditorOnDifferentTabDetected",SEM_MAKE_EDITOR_TRIGGERED:"semMakeEditorTriggered",SEM_MAKE_READER_TRIGGERED:"semMakeReaderTriggered",SEM_SINGLE_EDITOR_LIVE_STATE_DATA_STATS:"semSingleEditorLiveStateDataStats",SEM_SINGLE_EDITOR_LIVE_STATE_EMPTY_DATA_STATS:"semSingleEditorLiveStateEmptyDataStats",SEM_SINGLE_EDITOR_DETERMINE_EDITOR_STATUS:"semSingleEditorDetermineEditorStatus",SEM_SINGLE_EDITOR_LIVE_STATE_DATA_MISMATCH:"semSingleEditorLiveStateDataMismatch",SEM_SINGLE_EDITOR_DATA_MISMATCH_WITH_EXTERNAL:"semSingleEditorLiveStateDataMismatchWithExternal",SEM_USER_EDITOR_STATS:"semUserEditorStats",REMOVE_EDITOR_ACCESS:"removeEditorAccess",REMOVE_EDITOR_ACCESS_ERROR:"removeEditorAccessError",SEM_SINGLE_EDITOR_LIVE_STATE_DATA_ON_MAKE_EDITOR:"semSingleEditorLiveStateDataOnMakeEditor",SEM_SINGLE_EDITOR_LIVE_STATE_DATA_ON_MAKE_READER:"semSingleEditorLiveStateDataOnMakeReader",GET_LIVE_STATE_DATA_TRIGGERED:"getLiveStateDataTriggered",FETCH_LIVE_STATE_DATA_TRIGGERED:"fetchLiveStateDataTriggered",ENABLE_SINGLE_EDITOR_MODE_TRIGGERED:"enableSingleEditorModeTriggered",DISABLE_SINGLE_EDITOR_MODE_TRIGGERED:"disableSingleEditorModeTriggered",IS_USER_EDITOR_TRIGGERED:"isUserEditorTriggered",GET_EDITOR_TRIGGERED:"getEditorTriggered",RESET_USER_ACCESS_TRIGGERED:"resetUserAccessTriggered",SINGLE_EDITOR_MODE_CONTAINER_IDS_TRIGGERED:"singleEditorModeContainerIdsTriggered",ENABLE_AUTO_SYNC_STATE_TRIGGERED:"enableAutoSyncStateTriggered",DISABLE_AUTO_SYNC_STATE_TRIGGERED:"disableAutoSyncStateTriggered",IS_EDITOR_ACCESS_REQUESTED_TRIGGERED:"isEditorAccessRequestedTriggered",EDITOR_ACCESS_REQUESTED_BY_TRIGGERED:"editorAccessRequestedByTriggered",EDITOR_ACCESS_TRANSFER_ON_TIMEOUT_TRIGGERED:"editorAccessTransferOnTimeoutTriggered",SET_EDITOR_ACCESS_TIMEOUT_TRIGGERED:"setEditorAccessTimeoutTriggered",ENABLE_EDITOR_ACCESS_TRANSFER_ON_TIMEOUT_TRIGGERED:"enableEditorAccessTransferOnTimeoutTriggered",DISABLE_EDITOR_ACCESS_TRANSFER_ON_TIMEOUT_TRIGGERED:"disableEditorAccessTransferOnTimeoutTriggered",ENABLE_DEFAULT_SINGLE_EDITOR_UI_TRIGGERED:"enableDefaultSingleEditorUiTriggered",DISABLE_DEFAULT_SINGLE_EDITOR_UI_TRIGGERED:"disableDefaultSingleEditorUiTriggered",GET_EDITOR_ACCESS_TIMER_TRIGGERED:"getEditorAccessTimerTriggered",ON_SERVER_CONNECTION_STATE_CHANGE_TRIGGERED:"onServerConnectionStateChangeTriggered",UPDATE_USER_PRESENCE_TRIGGERED:"updateUserPresenceTriggered",ENABLE_HEARTBEAT_TRIGGERED:"enableHeartbeatTriggered",DISABLE_HEARTBEAT_TRIGGERED:"disableHeartbeatTriggered"},Tag:{TAG_TOOL_CLICKED:"tagToolClicked",TAG_DRAFT_ADDED:"tagDraftAdded",TAG_ADDED:"tagAdded",TAG_READ:"tagRead",TAG_RESOLVED:"tagResolved",TAG_DRAGGED:"tagDragged",TAG_LINK_COPIED:"tagLinkCopied",TAG_ADD_MODE_ENABLED:"tagAddModeEnabled",TAG_ADD_MODE_DISABLED:"tagAddModeDisabled",TAG_DELETE_TRIGGERED:"tagDeleteTriggered",TAG_DELETED:"tagDeleted",GET_ALL_TAG_ANNOTATIONS_TRIGGERED:"getAllTagAnnotationsTriggered",DELETE_TAG_TRIGGERED:"deleteTagTriggered",ALLOWED_ELEMENT_IDS_TRIGGERED:"allowedElementIdsTriggered",ATTACH_TAG_TRIGGERED:"attachTagTriggered",ADD_TAG_MODE_CHANGE_TRIGGERED:"addTagModeChangeTriggered"},Rewriter:{REWRITER_ENABLED:"rewriterEnabled",REWRITER_MIN_CHARACTER_NOT_MET:"rewriterMinCharacterNotMet",REWRITER_MAX_CHARACTER_NOT_MET:"rewriterMaxCharacterNotMet",REWRITE_BUTTON_CLICKED:"rewriteButtonClicked",REWRITE_PROMPT_BUTTON_CLICKED:"rewritePromptButtonClicked",REWRITE_REFRESH_BUTTON_CLICKED:"rewriteRefreshButtonClicked",REWRITE_OPTION_SELECTED:"rewriteOptionSelected",REWRITE_TASK_CREATED:"rewriteTaskCreated",REWRITE_DIALOG_DRAGGED:"rewriteDialogDragged",REWRITE_SHOW_ORIGINAL_TEXT_CLICKED:"rewriteShowOriginalTextClicked",REWRITE_CLOSE_BUTTON_CLICKED:"rewriteCloseButtonClicked",REWRITE_PROMPT_SUBMITTED:"rewritePromptSubmitted",ENABLE_REWRITER_TRIGGERED:"enableRewriterTriggered",DISABLE_REWRITER_TRIGGERED:"disableRewriterTriggered",ON_TEXT_SELECTED_SUBSCRIBED:"onTextSelectedSubscribed",ASK_AI_TRIGGERED:"askAiTriggered",REPLACE_TEXT_TRIGGERED:"replaceTextTriggered",ADD_COMMENT_FROM_AI_TRIGGERED:"addCommentFromAITriggered"},Feedback:{FEEDBACK_BUTTON_CLICKED:"feedbackButtonClicked",FEEDBACK_SUBMITTED:"feedbackSubmitted"},Contact:{UPDATE_CONTACT_LIST_TRIGGERED:"updateContactListTriggered",UPDATE_ORG_LIST_TRIGGERED:"updateOrgListTriggered",IS_USER_GLOBAL_CONTACT_TRIGGERED:"isUserGlobalContactTriggered",ON_CONTACT_SELECTED_TRIGGERED:"onContactSelectedTriggered",ENABLE_AT_HERE_TRIGGERED:"enableAtHereTriggered",DISABLE_AT_HERE_TRIGGERED:"disableAtHereTriggered",SET_AT_HERE_LABEL_TRIGGERED:"setAtHereLabelTriggered",SET_AT_HERE_DESCRIPTION_TRIGGERED:"setAtHereDescriptionTriggered",UPDATE_CONTACT_LIST_SCOPE_FOR_ORGANIZATION_USERS_TRIGGERED:"updateContactListScopeForOrganizationUsersTriggered",GET_CONTACT_LIST_TRIGGERED:"getContactListTriggered"},ContactUs:{CONTACT_BUTTON_CLICKED:"contactButtonClicked",CONTACT_SUBMITTED:"contactSubmitted"},Bug:{BUG_BUTTON_CLICKED:"bugButtonClicked",BUG_SUBMITTED:"bugSubmitted"},ShareDialog:{SHARE_BUTTON_CLICKED:"shareButtonClicked",DOCUMENT_ACCESS_CHANGED:"documentAccessChanged",DOCUMENT_USER_ACCESS_ADDED:"documentUserAccessAdded",DOCUMENT_USER_ACCESS_REMOVED:"documentUserAccessRemoved",SHARE_LINK_COPIED:"shareLinkCopied"},InviteDialog:{USER_INVITED:"userInvited",INVITE_LINK_COPIED:"inviteLinkCopied"},Iam:{USER_ACCESS_DENIED:"userAccessDenied"},Arrow:{ARROW_TOOL_CLICKED:"arrowToolClicked",ARROW_DRAFT_ADDED:"arrowDraftAdded",ARROW_ADDED:"arrowAdded",ARROW_READ:"arrowRead",ARROW_RESOLVED:"arrowResolved",ARROW_DRAGGED:"arrowDragged",ARROW_LINK_COPIED:"arrowLinkCopied",ARROW_ADD_MODE_ENABLED:"arrowAddModeEnabled",ARROW_ADD_MODE_DISABLED:"arrowAddModeDisabled",ARROW_DELETE_TRIGGERED:"arrowDeleteTriggered",ARROW_DELETED:"arrowDeleted",ALLOWED_ELEMENT_IDS_TRIGGERED:"allowedElementIdsTriggered"},Area:{AREA_TOOL_CLICKED:"areaToolClicked",AREA_ADDED:"areaAdded",AREA_DRAGGED:"areaDragged",AREA_LINK_COPIED:"areaLinkCopied",AREA_ADD_MODE_ENABLED:"areaAddModeEnabled",AREA_ADD_MODE_DISABLED:"areaAddModeDisabled",AREA_DELETE_TRIGGERED:"areaDeleteTriggered",AREA_DELETED:"areaDeleted",ENABLE_AREA_COMMENT_TRIGGERED:"enableAreaCommentTriggered",DISABLE_AREA_COMMENT_TRIGGERED:"disableAreaCommentTriggered"},Doc:{DOCUMENT_ID_SET_TRIGGERED:"documentIdSetTriggered",SET_DOCUMENTS_SUCCESS:"setDocumentsSuccess",SET_LOCATIONS_SUCCESS:"setLocationsSuccess",REMOVE_LOCATIONS_SUCCESS:"removeLocationsSuccess",UNSET_LOCATIONS_SUCCESS:"unsetLocationsSuccess",DOCUMENT_SET_TRIGGERED:"documentSetTriggered",UNSET_DOCUMENTS_TRIGGERED:"unsetDocumentsTriggered",UNSET_DOCUMENTS_SUCCESS:"unsetDocumentsSuccess",DOCUMENTS_SET_TRIGGERED:"documentsSetTriggered",GET_DOCUMENT_METADATA_TRIGGERED:"getDocumentMetadataTriggered"},Reactions:{ENABLE_DARK_MODE_TRIGGERED:"enableDarkModeTriggered",DISABLE_DARK_MODE_TRIGGERED:"disableDarkModeTriggered",SET_CUSTOM_REACTIONS_TRIGGERED:"setCustomReactionsTriggered"},Views:{GET_UNIQUE_VIEWS_BY_USER_TRIGGERED:"getUniqueViewsByUserTriggered",GET_UNIQUE_VIEWS_BY_DATE_TRIGGERED:"getUniqueViewsByDateTriggered"},Notifications:{NOTIFICATION_HISTORY_PANEL_OPENED:"notificationHistoryPanelOpened",ENABLE_SETTINGS_AT_ORGANIZATION_LEVEL_TRIGGERED:"enableSettingsAtOrganizationLevelTriggered",DISABLE_SETTINGS_AT_ORGANIZATION_LEVEL_TRIGGERED:"disableSettingsAtOrganizationLevelTriggered",NOTIFICATION_HISTORY_PANEL_CLOSED:"notificationHistoryPanelClosed",NOTIFICATION_HISTORY_PANEL_TOGGLED:"notificationHistoryPanelToggled",NOTIFICATION_MARK_ALL_AS_READ_CLICKED:"notificationMarkAllAsReadClicked",NOTIFICATION_CLICKED:"notificationClicked",NOTIFICATION_TAB_CLICKED:"notificationTabClicked",NOTIFICATION_READ:"notificationRead",GET_NOTIFICATIONS_FOR_YOU$_TRIGGERED_INTERNAL:"getNotificationsForYou$Triggered_internal",GET_NOTIFICATIONS_BY_DOCUMENT_ID$_TRIGGERED_INTERNAL:"getNotificationsByDocumentId$Triggered_internal",GET_ALL_NOTIFICATIONS$_TRIGGERED_INTERNAL:"getAllNotifications$Triggered_internal",GET_NOTIFICATIONS$_TRIGGERED_INTERNAL:"getNotifications$Triggered_internal",OPEN_HISTORY_PANEL_TRIGGERED:"openHistoryPanelTriggered",CLOSE_HISTORY_PANEL_TRIGGERED:"closeHistoryPanelTriggered",TOGGLE_HISTORY_PANEL_TRIGGERED:"toggleHistoryPanelTriggered",GET_NOTIFICATIONS_DATA_TRIGGERED:"getNotificationsDataTriggered",SET_MAX_DAYS_TRIGGERED:"setMaxDaysTriggered",SET_TAB_CONFIG_TRIGGERED:"setTabConfigTriggered",ENABLE_READ_NOTIFICATIONS_ON_FOR_YOU_TAB_TRIGGERED:"enableReadNotificationsOnForYouTabTriggered",DISABLE_READ_NOTIFICATIONS_ON_FOR_YOU_TAB_TRIGGERED:"disableReadNotificationsOnForYouTabTriggered",SET_ALL_NOTIFICATIONS_AS_READ_TRIGGERED:"setAllNotificationsAsReadTriggered",GET_UNREAD_NOTIFICATIONS_COUNT_TRIGGERED:"getUnreadNotificationsCountTriggered",MARK_NOTIFICATION_AS_READ_BY_ID_TRIGGERED:"markNotificationAsReadByIdTriggered",SET_SETTINGS_TRIGGERED:"setSettingsTriggered",GET_SETTINGS_TRIGGERED:"getSettingsTriggered",MUTE_ALL_NOTIFICATIONS_TRIGGERED:"muteAllNotificationsTriggered",ENABLE_SETTINGS_TRIGGERED:"enableSettingsTriggered",ENABLE_SELF_NOTIFICATIONS_TRIGGERED:"enableSelfNotificationsTriggered",DISABLE_SELF_NOTIFICATIONS_TRIGGERED:"disableSelfNotificationsTriggered",ENABLE_USER_SCOPED_NOTIFICATIONS_TRIGGERED:"enableUserScopedNotificationsTriggered",DISABLE_USER_SCOPED_NOTIFICATIONS_TRIGGERED:"disableUserScopedNotificationsTriggered",DISABLE_SETTINGS_TRIGGERED:"disableSettingsTriggered",SET_SETTINGS_INITIAL_CONFIG_TRIGGERED:"setSettingsInitialConfigTriggered",OPEN_NOTIFICATIONS_PANEL_TRIGGERED:"openNotificationsPanelTriggered",CLOSE_NOTIFICATIONS_PANEL_TRIGGERED:"closeNotificationsPanelTriggered",ENABLE_CURRENT_DOCUMENT_ONLY_TRIGGERED:"enableCurrentDocumentOnlyTriggered",DISABLE_CURRENT_DOCUMENT_ONLY_TRIGGERED:"disableCurrentDocumentOnlyTriggered"},Crdt:{CRDT_DATA_UPDATED:"crdtDataUpdated"},Suggestions:{ENABLE_SUGGESTION_MODE_TRIGGERED:"suggestionsEnableSuggestionModeTriggered",DISABLE_SUGGESTION_MODE_TRIGGERED:"suggestionsDisableSuggestionModeTriggered",IS_SUGGESTION_MODE_ENABLED_TRIGGERED:"suggestionsIsSuggestionModeEnabledTriggered",IS_SUGGESTION_MODE_ENABLED_STREAM_TRIGGERED:"suggestionsIsSuggestionModeEnabledStreamTriggered",ENABLE_INLINE_SUGGESTIONS_TRIGGERED:"suggestionsEnableInlineSuggestionsTriggered",DISABLE_INLINE_SUGGESTIONS_TRIGGERED:"suggestionsDisableInlineSuggestionsTriggered",REGISTER_TARGET_TRIGGERED:"suggestionsRegisterTargetTriggered",UNREGISTER_TARGET_TRIGGERED:"suggestionsUnregisterTargetTriggered",START_SUGGESTION_TRIGGERED:"suggestionsStartSuggestionTriggered",COMMIT_SUGGESTION_TRIGGERED:"suggestionsCommitSuggestionTriggered",GET_SUGGESTIONS_TRIGGERED:"suggestionsGetSuggestionsTriggered",GET_SUGGESTIONS_STREAM_TRIGGERED:"suggestionsGetSuggestionsStreamTriggered",GET_PENDING_SUGGESTION_TRIGGERED:"suggestionsGetPendingSuggestionTriggered",GET_PENDING_SUGGESTION_STREAM_TRIGGERED:"suggestionsGetPendingSuggestionStreamTriggered",ON_TRIGGERED:"suggestionsOnTriggered"}};let t=e;return t})(),ZU=[yt.Events.Rewriter.REWRITER_ENABLED];var eV=class{constructor(){this.attachmentId=Math.floor(1e5+Math.random()*9e5)}};var _Ne={ANNOTATION_ADD:"comment_annotation.add",ANNOTATION_DELETE:"comment_annotation.delete",COMMENT_ADD:"comment.add",COMMENT_UPDATE:"comment.update",COMMENT_DELETE:"comment.delete",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"},TNe={RECORDING_ADD:"recording.add",RECORDING_DELETE:"recording.delete"},yNe={REACTION_ADD:"reaction.add",REACTION_DELETE:"reaction.delete"},INe={EDITOR_EDIT:"crdt.editor_edit"};var od=class{};var AR,bT=new Map,tV,wT=t=>t!=null?String(t):void 0,eQ=t=>{if(t.url)try{let e=new URL(t.url);t.baseUrl===void 0&&(t.baseUrl=e.origin),t.path===void 0&&(t.path=e.pathname),t.queryParams===void 0&&(t.queryParams=e.search)}catch{}},CNe=t=>{tV=t},DNe=(t,e)=>{try{if(!t||typeof t!="object")return;let n=JSON.parse(JSON.stringify(t));eQ(n);let r=wT(e);r?bT.set(r,n):AR=n}catch(n){O.catch("Error in setClientPageInfo: ",n)}},RNe=t=>{try{let e=wT(t);e?bT.delete(e):AR=void 0}catch(e){O.catch("Error in clearClientPageInfo: ",e)}},OT=t=>{try{let e=wT(t)??wT(tV?.());return e&&bT.has(e)?bT.get(e):AR}catch(e){O.catch("Error in getClientPageInfo: ",e);return}};var CR;try{CR=typeof Intl<"u"&&Intl.v8BreakIterator}catch{CR=!1}var nV=(()=>{class t{_platformId=Y(Go);isBrowser=this._platformId?AU(this._platformId):typeof document=="object"&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||CR)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function DR(t){return Array.isArray(t)?t:[t]}var rV=new Set,Gc,oV=(()=>{class t{_platform=Y(nV);_nonce=Y(Qu,{optional:!0});_matchMedia;constructor(){this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):nQ}matchMedia(n){return(this._platform.WEBKIT||this._platform.BLINK)&&tQ(n,this._nonce),this._matchMedia(n)}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function tQ(t,e){if(!rV.has(t))try{Gc||(Gc=document.createElement("style"),e&&Gc.setAttribute("nonce",e),Gc.setAttribute("type","text/css"),document.head.appendChild(Gc)),Gc.sheet&&(Gc.sheet.insertRule(`@media ${t} {body{ }}`,0),rV.add(t))}catch(n){console.error(n)}}function nQ(t){return{matches:t==="all"||t==="",media:t,addListener:()=>{},removeListener:()=>{}}}var rQ=(()=>{class t{_mediaMatcher=Y(oV);_zone=Y(De);_queries=new Map;_destroySubject=new Ue;constructor(){}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(n){return iV(DR(n)).some(i=>this._registerQuery(i).mql.matches)}observe(n){let i=iV(DR(n)).map(s=>this._registerQuery(s).observable),o=ac(i);return o=Cs(o.pipe(yn(1)),o.pipe(dE(1),lE(0))),o.pipe(Ce(s=>{let a={matches:!1,breakpoints:{}};return s.forEach(({matches:c,query:l})=>{a.matches=a.matches||c,a.breakpoints[l]=c}),a}))}_registerQuery(n){if(this._queries.has(n))return this._queries.get(n);let r=this._mediaMatcher.matchMedia(n),o={observable:new he(s=>{let a=c=>this._zone.run(()=>s.next(c));return r.addListener(a),()=>{r.removeListener(a)}}).pipe(cn(r),Ce(({matches:s})=>({query:n,matches:s})),Ds(this._destroySubject)),mql:r};return this._queries.set(n,o),o}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function iV(t){return t.map(e=>e.split(",")).reduce((e,n)=>e.concat(n)).map(e=>e.trim())}var lp={XSmall:"(max-width: 599.98px)",Small:"(min-width: 600px) and (max-width: 959.98px)",Medium:"(min-width: 960px) and (max-width: 1279.98px)",Large:"(min-width: 1280px) and (max-width: 1919.98px)",XLarge:"(min-width: 1920px)",Handset:"(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)",Tablet:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), (min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",Web:"(min-width: 840px) and (orientation: portrait), (min-width: 1280px) and (orientation: landscape)",HandsetPortrait:"(max-width: 599.98px) and (orientation: portrait)",TabletPortrait:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)",WebPortrait:"(min-width: 840px) and (orientation: portrait)",HandsetLandscape:"(max-width: 959.98px) and (orientation: landscape)",TabletLandscape:"(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",WebLandscape:"(min-width: 1280px) and (orientation: landscape)"};var Br=(()=>{let e=class e{constructor(){try{this.userAgent=navigator.userAgent,this.browserName=this.getBrowserName(),this.browserVersion=this.getBrowserVersion(),this.deviceType=this.getDeviceType(),this.orientation=this.getOrientation(),this.osName=this.getOSName(),this.osVersion=this.getOSVersion(),this.screenWidth=this.getScreenWidth(),this.screenHeight=this.getScreenHeight()}catch{}}getBrowserName(){try{return(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))!=-1?"Opera":navigator.userAgent.indexOf("Chrome")!=-1?"Chrome":navigator.userAgent.indexOf("Safari")!=-1?"Safari":navigator.userAgent.indexOf("Firefox")!=-1?"Firefox":navigator.userAgent.indexOf("MSIE")!=-1||document?.documentMode?"IE":"Unknown"}catch{return"Unknown"}}getDeviceType(){try{return e.Breakpoints[lp.Handset]?Ir.MOBILE:e.Breakpoints[lp.Tablet]?Ir.TABLET:e.Breakpoints[lp.XLarge]?Ir.MONITOR:e.Breakpoints[lp.Web]?Ir.DESKTOP:Ir.UNKNOWN}catch{return Ir.UNKNOWN}}getOrientation(){try{return e.Orientations[vT.Portrait]?rd.PORTRAIT:e.Orientations[vT.Landscape]?rd.LANDSCAPE:rd.UNKNOWN}catch{return rd.UNKNOWN}}getOSName(){try{return navigator.userAgent.indexOf("Windows")!=-1?"Windows":navigator.userAgent.indexOf("Macintosh")!=-1?"Macintosh":navigator.userAgent.indexOf("Linux")!=-1?"Linux":"Unknown"}catch{return"Unknown"}}getOSVersion(){try{let s=navigator?.userAgent,a="Unknown";if(s.indexOf("Windows")!==-1)s.indexOf("Windows NT 5.1")!==-1?a="Windows XP":s.indexOf("Windows NT 6.0")!==-1?a="Windows Vista":s.indexOf("Windows NT 6.1")!==-1?a="Windows 7":s.indexOf("Windows NT 6.2")!==-1?a="Windows 8":s.indexOf("Windows NT 6.3")!==-1?a="Windows 8.1":s.indexOf("Windows NT 10.0")!==-1&&(a="Windows 10");else if(s.indexOf("Mac OS X")!==-1)a=s.match(/Mac OS X ([0-9_.]+)/)[1],a=a.replace(/_/g,".");else if(s.indexOf("iOS")!==-1)a=s.match(/OS ([0-9_.]+) like Mac OS X/)[1],a=a.replace(/_/g,".");else if(s.indexOf("Firefox")!==-1){var r=/\(([^)]+)\)/,i=r.exec(s)[1],o=i.split("; ");a=o[2]}return a||"Unknown"}catch{return"Unknown"}}getBrowserVersion(){try{return this.browserName=="Opera"?this.getOperaVersion():this.browserName=="Chrome"?this.getChromeVersion():this.browserName=="Safari"?this.getSafariVersion():this.browserName=="Firefox"?this.getFirefoxVersion():this.browserName=="IE"?this.getIEVersion():"Unknown"}catch{return"Unknown"}}getOperaVersion(){try{var r=navigator.userAgent.match(/(?:Opera|OPR)\/(\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getChromeVersion(){try{var r=navigator.userAgent.match(/(?:Chrome|Chromium)\/(\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getSafariVersion(){try{var r=navigator.userAgent.match(/Version\/(\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getFirefoxVersion(){try{var r=navigator.userAgent.match(/Firefox\/(\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getIEVersion(){try{var r=navigator.userAgent.match(/MSIE (\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getScreenWidth(){try{return window.screen.width}catch{return 0}}getScreenHeight(){try{return window.screen.height}catch{return 0}}getDeviceInfo(){try{return this.userAgent=navigator.userAgent,this.browserName=this.getBrowserName(),this.browserVersion=this.getBrowserVersion(),this.deviceType=this.getDeviceType(),this.orientation=this.getOrientation(),this.osName=this.getOSName(),this.osVersion=this.getOSVersion(),this.screenWidth=this.getScreenWidth(),this.screenHeight=this.getScreenHeight(),JSON.parse(JSON.stringify(this))}catch{return{browserName:"Unknown",browserVersion:"Unknown",deviceType:"Unknown",osName:"Unknown",osVersion:"Unknown",screenWidth:0,screenHeight:0,userAgent:"Unknown"}}}};e.Breakpoints={},e.Orientations={};let t=e;return t})();var mt=class{constructor(e=!0){this.deviceInfo=new Br().getDeviceInfo();try{if(e){let n=OT();n&&Object.assign(this,n)}}catch{}}};var sV=class{constructor(){this.targetElements=[],this.type="area",this.props=new od,this.pageInfo=new mt,this.targetAnnotations=[]}};var aV=class{constructor(){this.type="arrow",this.props=new od,this.pageInfo=new mt}};var nbe={COPY_LINK:"copy-link",DELETE:"delete"},rbe={COPY_LINK:"Copy link",LINK_COPIED:"Link copied!",DELETE_THREAD:"Delete thread"};var cV=class{constructor(){this.comments=[],this.commentCategories=[],this.type="comment",this.status=k.CommentAnnotationStatusMap.OPEN,this.pageInfo=new mt,this.iam=new RR,this.customList=[],this.subscribedUsers={},this.unsubscribedUsers={},this.subscribedGroups={}}};var RR=class{constructor(){this.accessMode=ST.PUBLIC}};var lV=class{constructor(){this.commentId=Math.floor(1e5+Math.random()*9e5),this.type="text",this.to=[],this.status="added",this.attachments=[],this.recorders=[],this.reactionAnnotationIds=[],this.taggedUserContacts=[],this.customList=[],this.toOrganizationUserGroup=[],this.reactionAnnotations=[]}};var LT=class{constructor(){this.urlAllowList=[],this.featureAllowList=[],this.userPlanAllowList=[],this.userIdAllowList=[],this.userGroupIdAllowList=[],this.debugMode=!1,this.usePrefersColorScheme=!1,this.advancedQueriesDisabled=!1,this.globalStyles=!0}},uV=["core","rest-api","recorder-media","ai","agents","huddle-webrtc","integrations-workflow","superflow","billing-stripe","migrations","legacy-v1","velt-internal"];var NR=(function(t){return t.RESOLVE_USERS="resolveUsers",t.FORMAT_RESPONSE="formatResponse",t.MERGE_USER_WITH_PROVIDED_USER_DATA="mergeUserWithProvidedUserData",t.GET_TEMPORARY_USERS="getTemporaryUsers",t.SET_SINGLE_EDITOR_MODE_LIVE_STATE_DATA_FOR_DIFFERENT_USER_PRESENT_ON_TAB="setSingleEditorModeLiveStateDataForDifferentUserPresentOnTab",t.RESOLVE_AND_MERGE_SINGLE_EDITOR_LIVE_STATE_DATA_WITH_USER="resolveAndMergeSingleEditorLiveStateDataWithUser",t.GET_SINGLE_EDITOR_MODE_DATA="getSingleEditorModeData",t.RESOLVE_USERS_FROM_HUDDLE_MESSAGES="resolveUsersFromHuddleMessages",t.RESOLVE_USER_IDS_BY_EMAIL="resolveUserIdsByEmail",t})(NR||{}),MT=(function(t){return t.IDENTIFY="identify/authProvider",t.GET_TEMPORARY_USERS="getTemporaryUsers",t.GET_USERS="getUsers",t.GET_HUDDLE_USERS="getHuddleUsers",t.GET_SINGLE_EDITOR_USERS="getSingleEditorUsers",t})(MT||{}),iQ=(function(t){return t.RESOLVE_COMMENT_ANNOTATIONS="resolveCommentAnnotations",t.SAVE_COMMENT_ANNOTATION="saveCommentAnnotation",t.DELETE_COMMENT_ANNOTATION="deleteCommentAnnotation",t.FORMAT_RESPONSE="formatResponse",t.INIT_DOCUMENTS="initDocuments",t.SET_DATA="setData",t.UPDATE_DATA="updateData",t.DELETE_DATA="deleteData",t})(iQ||{}),oQ=(function(t){return t.SAVE_ATTACHMENT="saveAttachment",t.DELETE_ATTACHMENT="deleteAttachment",t.UPLOAD_TO_RESOLVER="uploadToResolver",t})(oQ||{}),sQ=(function(t){return t.RESOLVE_REACTION_ANNOTATIONS="resolveReactionAnnotations",t.SAVE_REACTION_ANNOTATION="saveReactionAnnotation",t.DELETE_REACTION_ANNOTATION="deleteReactionAnnotation",t.FORMAT_RESPONSE="formatResponse",t.INIT_DOCUMENTS="initDocuments",t.SET_DATA="setData",t.UPDATE_DATA="updateData",t.DELETE_DATA="deleteData",t})(sQ||{}),dV;dV||(dV={});var aQ=(function(t){return t.SET_DOCUMENTS="setDocuments",t.GET_COMMENT_ANNOTATIONS="getCommentAnnotations",t.GET_NOTIFICATIONS="getNotifications",t})(aQ||{}),hV;hV||(hV={});var cQ=(function(t){return t.SET_DOCUMENTS="setDocuments",t.GET_REACTION_ANNOTATIONS="getReactionAnnotations",t})(cQ||{}),lQ=(function(t){return t.RESOLVE_RECORDER_ANNOTATIONS="resolveRecorderAnnotations",t.SAVE_RECORDER_ANNOTATION="saveRecorderAnnotation",t.DELETE_RECORDER_ANNOTATION="deleteRecorderAnnotation",t.FORMAT_RESPONSE="formatResponse",t.INIT_DOCUMENTS="initDocuments",t.SET_DATA="setData",t.UPDATE_DATA="updateData",t.DELETE_DATA="deleteData",t})(lQ||{}),uQ=(function(t){return t.GET_RECORDER_ANNOTATIONS="getRecorderAnnotations",t})(uQ||{}),dQ=(function(t){return t.RESOLVE_NOTIFICATIONS="resolveNotifications",t.DELETE_NOTIFICATION="deleteNotification",t.DELETE_DATA="deleteData",t.FORMAT_RESPONSE="formatResponse",t})(dQ||{}),hQ=(function(t){return t.GET_NOTIFICATIONS="getNotifications",t})(hQ||{}),fQ=(function(t){return t.RESOLVE_ACTIVITIES="resolveActivities",t.SAVE_ACTIVITY="saveActivity",t.FORMAT_RESPONSE="formatResponse",t})(fQ||{}),pQ=(function(t){return t.GET_ACTIVITIES="getActivities",t})(pQ||{}),gQ=(function(t){return t.SET_DOCUMENTS="setDocuments",t.SET_ROOT_DOCUMENT="setRootDocument",t.SET_DOCUMENT_ID="setDocumentId",t.UNSET_DOCUMENT_ID="unsetDocumentId",t.UNSET_DOCUMENTS="unsetDocuments",t.SET_LOCATION="setLocation",t.SET_LOCATIONS="setLocations",t.SET_ROOT_LOCATION="setRootLocation",t.ADD_LOCATION="addLocation",t.REMOVE_LOCATION="removeLocation",t.REMOVE_LOCATIONS="removeLocations",t.UNSET_LOCATION_IDS="unsetLocationIds",t.REMOVE_LOCATIONS_SUCCESS="removeLocationsSuccess",t})(gQ||{});var fV=class{constructor(){this.pageInfo=new mt}};var pV=class{constructor(){this.documentAccessType=Fn.PUBLIC,this.accessType=Fn.PUBLIC,this.disabled=!1,this.features={},this.users={}}};var gV=class{};var mV=class{};var EV=class{};var io=class{constructor(){this.contacts=[]}};var Nbe={DOCUMENT_UNSET:"document_unset",USER_LOGOUT:"user_logout"},PT={SET_DOCUMENTS:"setDocuments",IDENTIFY:"identify",GET_NOTIFICATIONS:"getNotifications",SET_NOTIFICATIONS:"setNotifications",REVOKE_ACCESS_ON_USER_LOGOUT:"revokeAccessOnUserLogout",REVOKE_ACCESS_ON_DOCUMENT_UNSET:"revokeAccessOnDocumentUnset"},_V={FOLDER:"folder",DOCUMENT:"document",ORGANIZATION:"organization",CONTEXT:"context"};var TV=class{constructor(){this.id=Math.floor(1e5+Math.random()*9e5)}};var yV=class{constructor(){this.singleTabEditor=!0}};var IV=class{constructor(){this.state="idle"}};var jc=class{};var vV=class{};var SV=class{constructor(){this.type="multiThread"}};var AV=class{constructor(){this.pageInfo=new mt}};var CV=class{constructor(){this.type="audio"}},DV=class{constructor(){this.type="audio"}},RV=class{constructor(){this.getThumbnailTag=e=>`
|
|
120
|
+
<a href="${this.videoPlayerUrl}" target="_blank">
|
|
121
|
+
<img src="${e||this.thumbnailWithPlayIconUrl||this.thumbnailUrl}" />
|
|
122
|
+
</a>
|
|
123
|
+
`}};var NV=class{constructor(){this.type="recorder",this.recordingType="audio",this.mode="floating",this.attachment=null,this.attachments=[],this.pageInfo=new mt}};var bV=class{constructor(){this.type="rewriter",this.rewriterType="copywriter",this.pageInfo=new mt}};var up=class{constructor(){this.screenWidth=0,this.screenHeight=0,this.screenScrollHeight=0}};var wV=class{constructor(){this.pageInfo=new mt}},uwe={Start:"start",End:"end"},dwe={Avatar:"avatar",Label:"label"};var OV=class{constructor(){this.sources=[],this.playerState=new bR}},bR=class{constructor(){this.volume=1}};var LV=class{constructor(){this.to=[],this.resolved=!1,this.type="tag",this.pageInfo=new mt}};var MV=class{constructor(){this.visibility="private"}};var xV=class{constructor(){this.reactions=[],this.type="reaction",this.pageInfo=new mt,this.isReactionResolverUsed=!1}};var kV=class{};var $we={EDITOR:"editor",VIEWER:"viewer"},Wwe={DOES_NOT_EXIST:"does_not_exist",PERMISSION_DENIED:"permission_denied",SOMETHING_WENT_WRONG:"something_went_wrong"};var mQ=(function(t){return t.INTERNAL="internal",t.EXTERNAL="external",t})(mQ||{}),EQ=(function(t){return t.UPDATE_DATA="updateData",t})(EQ||{});var vn=class t{constructor(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(e,n=!1){return this.onePassHasher.start().appendStr(e).end(n)}static hashAsciiStr(e,n=!1){return this.onePassHasher.start().appendAsciiStr(e).end(n)}static _hex(e){let n=t.hexChars,r=t.hexOut,i,o,s,a;for(a=0;a<4;a+=1)for(o=a*8,i=e[a],s=0;s<8;s+=2)r[o+1+s]=n.charAt(i&15),i>>>=4,r[o+0+s]=n.charAt(i&15),i>>>=4;return r.join("")}static _md5cycle(e,n){let r=e[0],i=e[1],o=e[2],s=e[3];r+=(i&o|~i&s)+n[0]-680876936|0,r=(r<<7|r>>>25)+i|0,s+=(r&i|~r&o)+n[1]-389564586|0,s=(s<<12|s>>>20)+r|0,o+=(s&r|~s&i)+n[2]+606105819|0,o=(o<<17|o>>>15)+s|0,i+=(o&s|~o&r)+n[3]-1044525330|0,i=(i<<22|i>>>10)+o|0,r+=(i&o|~i&s)+n[4]-176418897|0,r=(r<<7|r>>>25)+i|0,s+=(r&i|~r&o)+n[5]+1200080426|0,s=(s<<12|s>>>20)+r|0,o+=(s&r|~s&i)+n[6]-1473231341|0,o=(o<<17|o>>>15)+s|0,i+=(o&s|~o&r)+n[7]-45705983|0,i=(i<<22|i>>>10)+o|0,r+=(i&o|~i&s)+n[8]+1770035416|0,r=(r<<7|r>>>25)+i|0,s+=(r&i|~r&o)+n[9]-1958414417|0,s=(s<<12|s>>>20)+r|0,o+=(s&r|~s&i)+n[10]-42063|0,o=(o<<17|o>>>15)+s|0,i+=(o&s|~o&r)+n[11]-1990404162|0,i=(i<<22|i>>>10)+o|0,r+=(i&o|~i&s)+n[12]+1804603682|0,r=(r<<7|r>>>25)+i|0,s+=(r&i|~r&o)+n[13]-40341101|0,s=(s<<12|s>>>20)+r|0,o+=(s&r|~s&i)+n[14]-1502002290|0,o=(o<<17|o>>>15)+s|0,i+=(o&s|~o&r)+n[15]+1236535329|0,i=(i<<22|i>>>10)+o|0,r+=(i&s|o&~s)+n[1]-165796510|0,r=(r<<5|r>>>27)+i|0,s+=(r&o|i&~o)+n[6]-1069501632|0,s=(s<<9|s>>>23)+r|0,o+=(s&i|r&~i)+n[11]+643717713|0,o=(o<<14|o>>>18)+s|0,i+=(o&r|s&~r)+n[0]-373897302|0,i=(i<<20|i>>>12)+o|0,r+=(i&s|o&~s)+n[5]-701558691|0,r=(r<<5|r>>>27)+i|0,s+=(r&o|i&~o)+n[10]+38016083|0,s=(s<<9|s>>>23)+r|0,o+=(s&i|r&~i)+n[15]-660478335|0,o=(o<<14|o>>>18)+s|0,i+=(o&r|s&~r)+n[4]-405537848|0,i=(i<<20|i>>>12)+o|0,r+=(i&s|o&~s)+n[9]+568446438|0,r=(r<<5|r>>>27)+i|0,s+=(r&o|i&~o)+n[14]-1019803690|0,s=(s<<9|s>>>23)+r|0,o+=(s&i|r&~i)+n[3]-187363961|0,o=(o<<14|o>>>18)+s|0,i+=(o&r|s&~r)+n[8]+1163531501|0,i=(i<<20|i>>>12)+o|0,r+=(i&s|o&~s)+n[13]-1444681467|0,r=(r<<5|r>>>27)+i|0,s+=(r&o|i&~o)+n[2]-51403784|0,s=(s<<9|s>>>23)+r|0,o+=(s&i|r&~i)+n[7]+1735328473|0,o=(o<<14|o>>>18)+s|0,i+=(o&r|s&~r)+n[12]-1926607734|0,i=(i<<20|i>>>12)+o|0,r+=(i^o^s)+n[5]-378558|0,r=(r<<4|r>>>28)+i|0,s+=(r^i^o)+n[8]-2022574463|0,s=(s<<11|s>>>21)+r|0,o+=(s^r^i)+n[11]+1839030562|0,o=(o<<16|o>>>16)+s|0,i+=(o^s^r)+n[14]-35309556|0,i=(i<<23|i>>>9)+o|0,r+=(i^o^s)+n[1]-1530992060|0,r=(r<<4|r>>>28)+i|0,s+=(r^i^o)+n[4]+1272893353|0,s=(s<<11|s>>>21)+r|0,o+=(s^r^i)+n[7]-155497632|0,o=(o<<16|o>>>16)+s|0,i+=(o^s^r)+n[10]-1094730640|0,i=(i<<23|i>>>9)+o|0,r+=(i^o^s)+n[13]+681279174|0,r=(r<<4|r>>>28)+i|0,s+=(r^i^o)+n[0]-358537222|0,s=(s<<11|s>>>21)+r|0,o+=(s^r^i)+n[3]-722521979|0,o=(o<<16|o>>>16)+s|0,i+=(o^s^r)+n[6]+76029189|0,i=(i<<23|i>>>9)+o|0,r+=(i^o^s)+n[9]-640364487|0,r=(r<<4|r>>>28)+i|0,s+=(r^i^o)+n[12]-421815835|0,s=(s<<11|s>>>21)+r|0,o+=(s^r^i)+n[15]+530742520|0,o=(o<<16|o>>>16)+s|0,i+=(o^s^r)+n[2]-995338651|0,i=(i<<23|i>>>9)+o|0,r+=(o^(i|~s))+n[0]-198630844|0,r=(r<<6|r>>>26)+i|0,s+=(i^(r|~o))+n[7]+1126891415|0,s=(s<<10|s>>>22)+r|0,o+=(r^(s|~i))+n[14]-1416354905|0,o=(o<<15|o>>>17)+s|0,i+=(s^(o|~r))+n[5]-57434055|0,i=(i<<21|i>>>11)+o|0,r+=(o^(i|~s))+n[12]+1700485571|0,r=(r<<6|r>>>26)+i|0,s+=(i^(r|~o))+n[3]-1894986606|0,s=(s<<10|s>>>22)+r|0,o+=(r^(s|~i))+n[10]-1051523|0,o=(o<<15|o>>>17)+s|0,i+=(s^(o|~r))+n[1]-2054922799|0,i=(i<<21|i>>>11)+o|0,r+=(o^(i|~s))+n[8]+1873313359|0,r=(r<<6|r>>>26)+i|0,s+=(i^(r|~o))+n[15]-30611744|0,s=(s<<10|s>>>22)+r|0,o+=(r^(s|~i))+n[6]-1560198380|0,o=(o<<15|o>>>17)+s|0,i+=(s^(o|~r))+n[13]+1309151649|0,i=(i<<21|i>>>11)+o|0,r+=(o^(i|~s))+n[4]-145523070|0,r=(r<<6|r>>>26)+i|0,s+=(i^(r|~o))+n[11]-1120210379|0,s=(s<<10|s>>>22)+r|0,o+=(r^(s|~i))+n[2]+718787259|0,o=(o<<15|o>>>17)+s|0,i+=(s^(o|~r))+n[9]-343485551|0,i=(i<<21|i>>>11)+o|0,e[0]=r+e[0]|0,e[1]=i+e[1]|0,e[2]=o+e[2]|0,e[3]=s+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(t.stateIdentity),this}appendStr(e){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,o,s;for(s=0;s<e.length;s+=1){if(o=e.charCodeAt(s),o<128)n[i++]=o;else if(o<2048)n[i++]=(o>>>6)+192,n[i++]=o&63|128;else if(o<55296||o>56319)n[i++]=(o>>>12)+224,n[i++]=o>>>6&63|128,n[i++]=o&63|128;else{if(o=(o-55296)*1024+(e.charCodeAt(++s)-56320)+65536,o>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");n[i++]=(o>>>18)+240,n[i++]=o>>>12&63|128,n[i++]=o>>>6&63|128,n[i++]=o&63|128}i>=64&&(this._dataLength+=64,t._md5cycle(this._state,r),i-=64,r[0]=r[16])}return this._bufferLength=i,this}appendAsciiStr(e){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,o,s=0;for(;;){for(o=Math.min(e.length-s,64-i);o--;)n[i++]=e.charCodeAt(s++);if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}appendByteArray(e){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,o,s=0;for(;;){for(o=Math.min(e.length-s,64-i);o--;)n[i++]=e[s++];if(i<64)break;this._dataLength+=64,t._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let n=e.buffer,r=e.state,i=this._state,o;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],o=0;o<n.length;o+=1)this._buffer8[o]=n.charCodeAt(o)}end(e=!1){let n=this._bufferLength,r=this._buffer8,i=this._buffer32,o=(n>>2)+1;this._dataLength+=n;let s=this._dataLength*8;if(r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(t.buffer32Identity.subarray(o),o),n>55&&(t._md5cycle(this._state,i),i.set(t.buffer32Identity)),s<=4294967295)i[14]=s;else{let a=s.toString(16).match(/(.*?)(.{0,8})$/);if(a===null)return;let c=parseInt(a[2],16),l=parseInt(a[1],16)||0;i[14]=c,i[15]=l}return t._md5cycle(this._state,i),e?this._state:t._hex(this._state)}};vn.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]);vn.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);vn.hexChars="0123456789abcdef";vn.hexOut=[];vn.onePassHasher=new vn;if(vn.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592")throw new Error("Md5 self test failed.");var FV=["annotationId","annotationNumber","visibilityConfig","actions","comments","commentCategories","from","color","resolved","inProgress","lastUpdated","createdAt","positionX","positionY","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","taggedElementPath","taggedElementRect","targetElement","targetElementId","position","documentParamsId","documentParams","locationId","location","type","commentType","sourceType","metadata","targetTextRange","selectAllContent","approved","status","statusUpdatedByUserId","annotationIndex","pageInfo","assignedTo","priority","ghostComment","areaAnnotationId","context","contextId","iam","isPageAnnotation","isDocumentLevel","targetInlineCommentElementId","inlineCommentSectionConfig","customList","subscribedUsers","unsubscribedUsers","subscribedGroups","resolvedByUserId","resolvedByUser","multiThreadAnnotationId","isDraft","sourceId","views","viewedByUserIds","viewedBy","unread","suggestion","agent","involvedUserIds","mentionedUserIds"],UV=["commentId","context","type","commentText","isCommentTextAvailable","isCommentResolverUsed","commentHtml","replaceContentHtml","replaceContentText","commentVoiceUrl","from","to","lastUpdated","createdAt","status","attachments","recorders","reactionAnnotationIds","taggedUserContacts","customList","toOrganizationUserGroup","isDraft","editedAt","isEdited","reactionAnnotations","sourceType","agent","metadata","actions","progress"],wR=["commentId","context","type","isCommentTextAvailable","isCommentResolverUsed","replaceContentHtml","replaceContentText","commentVoiceUrl","from","to","lastUpdated","createdAt","status","attachments","recorders","reactionAnnotationIds","taggedUserContacts","customList","toOrganizationUserGroup","isDraft","editedAt","isEdited","reactionAnnotations","sourceType","agent","metadata","actions","progress"];var VV=["annotationId","context","commentAnnotationId","reactions","lastUpdated","targetElement","targetElementId","position","locationId","location","type","annotationIndex","pageInfo","from","isReactionResolverUsed","iconUrl","iconEmoji","metadata","involvedUserIds"];var BV=["context","annotationId","commentAnnotationId","from","color","lastUpdated","positionX","positionY","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","recorderedElementPath","recorderedElementRect","targetElement","position","locationId","location","type","recordingType","mode","approved","attachment","attachments","annotationIndex","pageInfo","recordedTime","waveformData","displayName","metadata","latestVersion","recordingEditVersions","chunkUrls","isRecorderResolverUsed","isUrlAvailable"];var YLe=["id","featureType","actionType","eventType","actionUser","timestamp","metadata","targetEntityId","targetSubEntityId","changes","entityData","entityTargetData","displayMessageTemplate","displayMessageTemplateData","displayMessage","actionIcon","immutable","isActivityResolverUsed"];var xT=["userId"];var OR=["commonAncestorContainer","commonAncestorContainerFXpath","commonAncestorContainerCFXpath","commonAncestorContainerAnchor","occurrence"],LR=["attachmentId","isAttachmentResolverUsed","name","bucketPath","size","type","url","thumbnail","thumbnailWithPlayIconUrl","metadata","mimeType","previewImages","clientOrganizationId","clientDocumentId"],MR=["attachmentId","isAttachmentResolverUsed","bucketPath","size","type","thumbnail","thumbnailWithPlayIconUrl","metadata","mimeType","previewImages","clientOrganizationId","clientDocumentId"];var GV=["id","tag","type","thumbnailUrl","thumbnailWithPlayIconUrl","videoUrl","audioUrl","videoPlayerUrl","chunkUrls"],PR=["status","targetId","targetType","oldValue","newValue","summary","driftDetected","rejectReason","resolvedBy","resolvedAt","metadata","textChange"],xR=["status","targetId","targetType","driftDetected","resolvedBy","resolvedAt"];var $c="velt://self-hosted-disabled/",ad=t=>typeof t=="string"&&t.startsWith($c),eB=(t,e)=>{try{if(ad(t))return t;let n=new URL(t),r=n.hostname.split("."),i=r.length>=3?r[0]:"",o=t.replace(n.host,e);if(i){let s=o.includes("?")?"&":"?";o+=`${s}ns=${i}`}return o}catch(n){return O.catch("Error in getProxiedDatabaseUrl: ",n),t}},s0e=t=>{try{let e=localStorage.getItem(k.LOCAL_STORAGE.VELT_AUTH_PROXY_HOST);if(!e)return;let n=atob(e),r=t?.config;n&&r&&(r.apiHost=n,r.tokenApiHost=n)}catch(e){O.catch("Error in applyCachedAuthProxyHost: ",e)}},Hc=(t,e=0)=>{try{let n=3735928559^e,r=1103547991^e;for(let i=0,o;i<t.length;i++)o=t.charCodeAt(i),n=Math.imul(n^o,2654435761),r=Math.imul(r^o,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)}catch(n){return O.catch("Error in cyrb53: ",n),0}},_Q=()=>{try{return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4).toString(16))}catch(t){return O.catch("Error in uuidv4: ",t),""}},Yo=t=>{try{return vn.hashStr(t)}catch(e){return O.catch("Error in hashStr: ",e),t}},tB=t=>{try{return!t||t.trim().length===0?void 0:vn.hashStr(t)}catch(e){O.catch("Error in hashForAnchor: ",e);return}};function a0e(t,e){let n=[],r=e>=1?Math.floor(e):1;for(let i=0;i<t.length;i+=r)n.push(t.slice(i,i+r));return n}var c0e=t=>Hc(t).toString(),l0e=t=>Yo(t),nB=t=>Yo(t).toString(),u0e=t=>Yo(t).toString(),d0e=(t,e)=>{try{let n=t.userIds?.length?[...t.userIds]:[];return n.includes(e)||n.push(e),le(V({},t),{userIds:n})}catch(n){return O.catch("Error in ensureUserIdInVisibility: ",n),t}},h0e=t=>{try{if(!t)return!1;if(t.iam?.accessMode===ST.PRIVATE)return!0;let e=t.visibilityConfig?.type;return e==="restricted"||e==="organizationPrivate"}catch(e){return O.catch("Error in isAnnotationPrivate: ",e),!1}},f0e=(t,e)=>{let n=[];switch(t.type){case"public":return n.push(k.DEFAULT_VELT_CONTEXT),n;case"organizationPrivate":{let r=[...t.organizationId?[t.organizationId]:[],...t.organizationIds??[]].filter((i,o,s)=>!!i&&s.indexOf(i)===o);if(!r.length)throw new Error("organizationId is required for organizationPrivate visibility type");r.forEach(i=>{let o=nB(i);n.push(`${k.VISIBILITY_ORG_PREFIX}${o}`)});break}case"restricted":{if(!t.userIds?.length)throw new Error("userIds is required for restricted visibility type");t.userIds.filter((i,o,s)=>!!i&&s.indexOf(i)===o).forEach(i=>{let o=Yo(i).toString();n.push(`${k.VISIBILITY_SELF_PREFIX}${o}`)});break}default:throw new Error(`Invalid visibility type: ${t.type}`)}if(e){let r=`${k.VISIBILITY_SELF_PREFIX}${Yo(e).toString()}`;n.includes(r)||n.push(r)}return n},p0e=(t,e)=>{let n={type:t.type};try{if(t.type==="public")return n;t.organizationId&&(n.organizationId=t.organizationId),t.organizationIds?.length&&(n.organizationIds=t.organizationIds);let r=[...t.userIds??[],...e?[e]:[]].filter((i,o,s)=>!!i&&s.indexOf(i)===o);r.length&&(n.userIds=r)}catch(r){O.catch("Error in buildStoredVisibilityConfig: ",r)}return n},g0e=t=>{let e=[k.DEFAULT_VELT_CONTEXT];try{t?.userId&&e.push(`${k.VISIBILITY_SELF_PREFIX}${Yo(t.userId).toString()}`),t?.clientOrganizationId?e.push(`${k.VISIBILITY_ORG_PREFIX}${nB(t.clientOrganizationId)}`):t?.fallbackServerOrganizationId&&e.push(`${k.VISIBILITY_ORG_PREFIX}${t.fallbackServerOrganizationId}`)}catch(n){O.catch("Error in buildViewerVisibilityTokens: ",n)}return e},m0e=(t,e)=>{try{if(!t?.length)return t??[];let n=new Set(e?.tokens??[]);return t.filter(r=>{try{let i=r?.context?.accessFields,o=iB(i),s=r?.visibilityConfig?.type,a=s==="organizationPrivate"||s==="restricted",c=o.length>0&&!i?.includes(k.DEFAULT_VELT_CONTEXT);return!!(!a&&!c||!i?.length||e?.userId&&r?.from?.userId===e.userId||o.some(l=>n.has(l))||e?.userId&&r?.visibilityConfig?.userIds?.includes(e.userId))}catch(i){return O.catch("Error filtering annotation visibility: ",i),!0}})}catch(n){return O.catch("Error in filterAnnotationsVisibleToUser: ",n),t}},rB=t=>{try{return typeof t=="string"&&(t.startsWith(k.VISIBILITY_SELF_PREFIX)||t.startsWith(k.VISIBILITY_ORG_PREFIX))}catch(e){return O.catch("Error in isVisibilityAccessToken: ",e),!1}},iB=t=>{try{return(t||[]).filter(e=>rB(e))}catch(e){return O.catch("Error in extractVisibilityAccessTokens: ",e),[]}},E0e=t=>{try{return!!t&&typeof t=="object"&&Object.keys(t).some(e=>!(e==="default"&&t[e]==="velt"))}catch(e){return O.catch("Error in isCustomerContextAccess: ",e),!1}},_0e=(t,e)=>{try{let n=Array.isArray(e)?e:[],r=n.length>0&&!n.includes(k.DEFAULT_VELT_CONTEXT),i=t;if(r&&t?.access&&typeof t.access=="object"&&t.access.default==="velt"){let s=V({},t.access);delete s.default,i=le(V({},t),{access:s})}let o=jQ(i);return r&&(o=o.filter(s=>s!==k.DEFAULT_VELT_CONTEXT)),r?[...new Set([...n,...o])]:o}catch(n){return O.catch("Error in mergeAccessFieldTokenFamilies: ",n),Array.isArray(e)?e:[]}},TQ=t=>{try{if(!t)return null;let e=t?.context?.accessFields??[];if(!e?.length)return null;let n=iB(e),r=t?.visibilityConfig?.type,i=r==="restricted"||r==="organizationPrivate",o=n.length>0&&!e.includes(k.DEFAULT_VELT_CONTEXT);if(!i&&!o)return null;let s=n.some(h=>h.startsWith(k.VISIBILITY_ORG_PREFIX)),c={type:i?r:s?"organizationPrivate":"restricted",accessTokens:n},l=t?.visibilityConfig?.userIds;l?.length&&(c.userIds=[...l]);let d=[...t?.visibilityConfig?.organizationId?[t.visibilityConfig.organizationId]:[],...t?.visibilityConfig?.organizationIds??[]].filter((h,f,g)=>!!h&&g.indexOf(h)===f);return d.length&&(c.organizationIds=d),c}catch(e){O.catch("Error in buildNotificationVisibilityStamp: ",e);try{let n=t?.visibilityConfig?.type;if(n==="restricted"||n==="organizationPrivate")return{type:n,accessTokens:[]}}catch{}return null}},T0e=(t,e)=>{try{if(!e?.length)return[];let n=TQ(t);if(!n||n.type!=="restricted")return[];let r=new Set([...n.userIds??[],...t?.from?.userId?[t.from.userId]:[]]),i=new Set(n.accessTokens??[]);return e.filter(o=>!o||r.has(o)?!1:!i.has(`${k.VISIBILITY_SELF_PREFIX}${Yo(o).toString()}`))}catch(n){return O.catch("Error in getVisibilityDeniedUserIds: ",n),[]}},y0e=(t,e)=>{try{if(!t?.length)return t??[];let n=new Set([k.DEFAULT_VELT_CONTEXT,...e||[]]);return t.filter(r=>{try{let i=r?.context?.accessFields;if(!i?.length)return!0;let o=i.filter(s=>!rB(s));return o.length?o.some(s=>n.has(s)):!0}catch(i){return O.catch("Error filtering annotation doc-context match: ",i),!0}})}catch(n){return O.catch("Error in filterAnnotationsMatchingDocContext: ",n),t}},I0e=(t,e)=>{try{if(!t?.length)return t??[];let n=e?.statusIds?.filter(a=>a!=null),r=e?.locationIds?.filter(a=>a!=null),i=n?.length?new Set(n):null,o=r?.length?new Set(r):null,s=e?.veltFolderId||null;return!i&&!o&&!s?t:t.filter(a=>{try{return!(i&&!i.has(a?.status?.id)||s&&a?.metadata?.veltFolderId!==s||o&&!o.has(a?.location?.id))}catch(c){return O.catch("Error filtering annotation query scope: ",c),!0}})}catch(n){return O.catch("Error in filterAnnotationsMatchingQueryScope: ",n),t}},v0e=(t,e)=>{if(!e||!t?.length)return t;let n=new Set(e);return t.filter(r=>{let i=r?.context?.accessFields;return Array.isArray(i)&&i.some(o=>n.has(o))})},S0e=t=>{try{if(t)return typeof t=="string"?vn.hashStr(t):Array.isArray(t)?vn.hashStr(t.join("-")):"";{let e=_Q();return vn.hashStr(e)}}catch(e){return O.catch("Error in getMultiThreadAnnotationId: ",e),""}},oB=(t,e,n)=>{try{if(t&&e){if(t.featureAllowList&&t.featureAllowList.length&&!t.featureAllowList.includes(n)||t.userIdAllowList&&t.userIdAllowList.length&&!t.userIdAllowList.includes(e.userId)||t.userGroupIdAllowList&&t.userGroupIdAllowList.length&&!t.userGroupIdAllowList.includes(e.groupId||"")||t.userPlanAllowList&&t.userPlanAllowList.length&&!t.userPlanAllowList.includes(e.plan||""))return!1;if(t.urlAllowList){let r=window.location.href;if(t.urlAllowList.length&&!t.urlAllowList.filter(i=>r.includes(i)).length)return!1}return!0}return!1}catch(r){return O.catch("Error in isFeatureAllowed: ",r),!1}},Wc=()=>{try{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<20;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}catch(t){return O.catch("Error in utils generateId: ",t),""}},A0e=t=>{try{let e=0;if(t){let n=new Date().getTime();e=Math.abs(n-t)}return e}catch(e){return O.catch("Error in utils getFirebaseTimeDiffInMins: ",e),0}};var sB=()=>{try{return Xt.debugMode||!!sessionStorage.getItem("debugMode")||!!sessionStorage.getItem("forceDebugMode")}catch(t){return O.catch("Error in showLogs: ",t),!1}},aB=()=>{try{return!!sessionStorage.getItem("debugContextMode")}catch(t){return O.catch("Error in showContextLogs: ",t),!1}},cB=t=>{try{return typeof t!="object"?Object.assign({},...Object.keys(t).sort().map(e=>({[e]:t[e]&&typeof t[e]=="object"?cB(t[e]):t[e]}))):t}catch(e){return O.catch("Error in sortObjectByKeys: ",e),t}},kR=t=>{try{return t!==null&&typeof t=="object"&&!Array.isArray(t)}catch{return!1}},jV=t=>{try{return kR(t)?Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,kR(n)?jV(n):Array.isArray(n)?n.map(r=>kR(r)?jV(r):r):n])):t}catch{return t}},HV=(t,e)=>{try{return typeof e!="object"||e===null?t===e:typeof t!="object"||t===null?!1:Array.isArray(e)?Array.isArray(t)?e.every(n=>t.some(r=>HV(r,n))):!1:Object.keys(e).every(n=>Object.prototype.hasOwnProperty.call(t,n)?HV(t[n],e[n]):!1)}catch{return!1}},yQ=(t,e,n)=>y(null,null,function*(){try{let r=yield SQ(e),i=new Uint8Array(new TextEncoder().encode(n)).slice(0,16),o=new TextEncoder().encode(t),s=yield window.crypto.subtle.encrypt({name:"AES-CBC",iv:i},r,o);return btoa(String.fromCharCode(...new Uint8Array(s)))}catch(r){return O.catch("Error in encrypt: ",r),t}}),IQ=(t,e,n)=>y(null,null,function*(){try{let r=yield vQ(e),i=new Uint8Array(new TextEncoder().encode(n)).slice(0,16),o=new Uint8Array(atob(t).split("").map(a=>a.charCodeAt(0))),s=yield window.crypto.subtle.decrypt({name:"AES-CBC",iv:i},r,o);return new TextDecoder().decode(s)}catch(r){return O.catch("Error in decrypt: ",r),t}}),vQ=t=>y(null,null,function*(){try{let e=new TextEncoder().encode(t),n=new Uint8Array(32);return n.fill(0),n.set(e.slice(0,32)),yield window.crypto.subtle.importKey("raw",n,"AES-CBC",!1,["decrypt"])}catch(e){throw O.catch("Error in importDecryptKey:",e),e}}),GT=(t,e)=>y(null,null,function*(){try{let n="Velt"+e;return yield yQ(JSON.stringify(t),n,Yo(n))}catch(n){return O.catch("Error in encryptData: ",n),t}}),fp=(t,e)=>y(null,null,function*(){try{let n="Velt"+e,r=yield IQ(t,n,Yo(n));return JSON.parse(r)}catch(n){return O.catch("Error in decryptData: ",n),null}}),C0e=t=>{try{switch(t?.region){case"asiaSouthEast1":return"asiaSouthEast1";case"asiaNorthEast1":return"asiaNorthEast1";case"europeWest1":return"europeWest1";case"australiaSouthEast1":return"australiaSouthEast1";default:return"usCentral1"}}catch(e){return O.catch("Error in getRegion: ",e),"usCentral1"}},SQ=t=>y(null,null,function*(){try{let e=new TextEncoder().encode(t),n=new Uint8Array(32);return n.fill(0),n.set(e.slice(0,32)),yield window.crypto.subtle.importKey("raw",n,"AES-CBC",!1,["encrypt"])}catch(e){throw O.catch("Error in importKey:",e),e}}),D0e=t=>{try{if(t&&typeof t=="object"){let e=cB(t);return Hc(JSON.stringify(e))}else return null}catch(e){return O.catch("Error in utils generateLocationId: ",e),null}},oo=(t,e=[])=>(t?.tagName?.toLowerCase().indexOf("velt-")>=0&&![k.TAGS.VELT_VIDEO_PLAYER.toLowerCase()].includes(t?.tagName?.toLowerCase())||t?.tagName?.toLowerCase().indexOf("snippyly-")>=0||t?.className?.split&&(t?.className?.split(" ")?.indexOf("snippyly-overlay-panel")>=0||t?.className?.split(" ")?.indexOf("cdk-overlay-container")>=0))&&!e?.includes(t?.tagName?.toLowerCase())?!0:t?.parentNode&&oo(t?.parentNode,e),R0e=(t,e=[])=>{try{let n=typeof t.composedPath=="function"?t.composedPath():[],r=n.length>0?n:[t?.target];for(let i of r){let o=i;if(!(!o||typeof o.tagName!="string")&&oo(o,e))return!0}}catch(n){O.catch("Error in utils isSnippylyEventTarget: ",n)}return!1},cd=t=>{try{return!!document?.body?.contains(t)}catch(e){return O.catch("Error in utils isElementInsideBody: ",e),!1}};var AQ=(t,e)=>{try{return Object.prototype.toString.call(t)===Object.prototype.toString.call(e)?Object.prototype.toString.call(t)==="[object Object]"||Object.prototype.toString.call(t)==="[object Array]"?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>AQ(t[n],e[n])):t===e:!1}catch(n){return O.catch("Error in utils deepCompare: ",n),!1}},N0e=(t,e,n=1)=>{try{if(e){let r=$V(e.textContent,t,n);if(r>=0){let i=e.querySelector("script")!==null,o=(e?.ownerDocument).createNodeIterator(e,NodeFilter.SHOW_TEXT,i?{acceptNode:g=>g.parentElement?.tagName==="SCRIPT"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}:null),s,a=[];for(;s=o.nextNode();)a.push(s);let c=r;if(i){let g=a.reduce((I,S)=>I+(S.textContent||""),""),E=$V(g,t,n);if(E<0)return[];c=E}let l=[],d=t.length,h=c+d,f=0;for(let g=0;g<a.length;g++){let E=a[g],I=f;if(f+=E.textContent?.length,f>c&&!l.length?l.push({textNode:E,startOffset:c-I}):l.length&&f<h&&l.push({textNode:E}),f>=h){if(l.length===1&&l[0].textNode===E){l.push({textNode:E,endOffset:c-I+t.length});break}let S=d;l.forEach(R=>{S-=R.textNode.textContent?.length-(R.startOffset||0)}),l.push({textNode:E,endOffset:S});break}}return l}}return[]}catch(r){return O.catch("Error in utils calculateNodes: ",r),[]}},$V=(t,e,n=1)=>{try{if(t?.includes(e)){let r=t.split(e,n);return r.length===n?r.join(e).length:-1}else return-1}catch(r){return O.catch("Error in utils getTextPosition: ",r),-1}},GR=(t,e,n,r,i)=>{try{let o=new Range;o.setStart(t,e),o.setEnd(n,r);let s=o.commonAncestorContainer,c=(s.nodeType===Node.ELEMENT_NODE?s:s.parentElement)?.querySelector("script")!==null,l;if(c){let h=o.cloneContents();h.querySelectorAll("script").forEach(f=>f.remove()),l=h.textContent||""}else l=o.toString();let d=0;if(t.nodeType===Node.TEXT_NODE){let h=t,f="";if(h)for(;h=h.previousSibling;)if(c){if(h.nodeType===Node.ELEMENT_NODE&&h.tagName==="SCRIPT")continue;if(h.nodeType===Node.ELEMENT_NODE){let g=h;if(g.querySelector("script")){let E=g.cloneNode(!0);E.querySelectorAll("script").forEach(I=>I.remove()),f=(E.textContent||"")+f}else f=(h.textContent||"")+f}else h.parentElement?.tagName!=="SCRIPT"&&(f=(h.textContent||"")+f)}else f=(h.textContent||"")+f;if(f){let g=new RegExp(WV(i),"g");d=(f.match(g)||[]).length}}if(l){let h=new RegExp(WV(i),"g");return(l.match(h)||[]).length+d}else return d}catch(o){return O.catch("Error in utils getSelectedTextOccurrenceInRange: ",o),0}},WV=t=>{try{return t&&typeof t=="string"?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t}catch(e){return O.catch("Error in utils escapeRegExp: ",e),t}},CQ=t=>{try{return t==null?null:t.scrollHeight>t.clientHeight?t:CQ(t?.parentNode)}catch(e){return O.catch("Error in utils getScrollableParent: ",e),null}},UT=t=>{try{return t==null?[]:t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth?[t,...UT(t?.parentNode)]:UT(t?.parentNode)}catch(e){return O.catch("Error in utils getScrollableParents: ",e),[]}};function b0e(t){try{if(!t)return[];let e=UT(t),n=t;for(;n;){let r=n.getRootNode();if(r instanceof ShadowRoot)e.push(...UT(r.host)),n=r.host;else break}return e}catch(e){return O.catch("Error in utils getScrollableParentsCrossingShadowBoundary: ",e),[]}}var w0e=(t,e)=>{try{if(t&&e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.top-r.top+(e.tagName?.toLowerCase()==="html"?0:e.scrollTop),o=n.left-r.left;return{top:i,left:o}}else return null}catch(n){return O.catch("Error in utils getRelativeTopLeftPosition: ",n),null}},lB=(t,e)=>`${Hc(t+"_"+e)}`,uB=t=>{try{let e=OT(t),n=new mt(!1);return e&&Object.assign(n,e),n.url=e?.url??window.location.href,n.path=e?.path??window.location.pathname,n.queryParams=e?.queryParams??window.location.search,n.baseUrl=e?.baseUrl??window.location.origin,n.title=e?.title??document.title,n}catch(e){O.catch("Error in utils getPageInfo: ",e);return}},DQ=t=>{try{return t?t?.hasAttribute&&t?.hasAttribute(k.ATTRIBUTES.VELT_COMMENT_DISABLED)?!0:DQ(t?.parentElement):!1}catch(e){return O.catch("Error in utils isCommentDisabledOnElement: ",e),!1}},pp=".ProseMirror[contenteditable]",zV=new Set,ld=(t,e)=>{try{if(zV.has(t))return;zV.add(t),O.catch(`Error in utils ${t} (treated as "not editor content"): `,e)}catch{}};var zs=t=>{try{return!t||!t.isConnected?!1:!!(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest?.(pp)}catch(e){return ld("isNodeInsideRichTextEditor",e),!1}},qV=t=>{if(!t||!t.isConnected)return null;let e=null,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;for(;n=n?.closest?.(pp)??null;)e=n,n=n.parentElement;return e},RQ=t=>{try{return!!t?.querySelector?.(pp)}catch(e){return ld("containsRichTextEditor",e),!1}},dB=(t,e)=>{let n=e.ownerDocument.createRange();return n.selectNodeContents(e),t.compareBoundaryPoints(Range.START_TO_START,n)>0&&n.setStart(t.startContainer,t.startOffset),t.compareBoundaryPoints(Range.END_TO_END,n)<0&&n.setEnd(t.endContainer,t.endOffset),n},NQ=(t,e)=>{let n=t;for(;n&&n!==e;){if(n.nextSibling)return n.nextSibling;n=n.parentNode}return null},bQ=(t,e)=>{let n=dB(t,e);if(n.collapsed)return!1;let{startContainer:r,startOffset:i,endContainer:o,endOffset:s}=n,a=d=>{let h=d===r?i:0;return(d===o?s:d.length)>h},c=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),l;for(r.nodeType===Node.TEXT_NODE?l=r:(l=r.childNodes[i]??NQ(r,e),l&&l.nodeType!==Node.TEXT_NODE&&(c.currentNode=l,l=c.nextNode()));l;){if(n.comparePoint(l,0)>0)return!1;if(a(l))return!0;c.currentNode=l,l=c.nextNode()}return!1},hB=t=>{let e=new Set,n=qV(t.startContainer),r=qV(t.endContainer);n&&e.add(n),r&&e.add(r);let i=t.commonAncestorContainer,s=(i?.nodeType===Node.TEXT_NODE?i.parentElement:i)?.querySelectorAll?.(pp)??[];for(let a=0;a<s.length;a++)t.intersectsNode(s[a])&&e.add(s[a]);return e},KV=(t,e)=>{let n=e.parentNode;if(!n)return!1;let r=Array.prototype.indexOf.call(n.childNodes,e);return t.comparePoint(n,r)===0&&t.comparePoint(n,r+1)===0},wQ=t=>{try{if(!t||t.collapsed)return!1;for(let e of hB(t))if(bQ(t,e))return!0;return!1}catch(e){return ld("doesRangeTouchRichTextEditor",e),!1}},O0e=t=>{try{if(!t||t.collapsed)return!1;if(wQ(t))return!0;for(let e of hB(t)){if(KV(t,e))return!0;let n=dB(t,e);if(n.collapsed)continue;let r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;r.nextNode();)if(KV(n,r.currentNode))return!0}return!1}catch(e){return ld("doesRangeIntersectRichTextEditorNode",e),!1}},fB=t=>{try{if(!t||zs(t))return;if(!RQ(t)){t.normalize();return}Array.from(t.childNodes).forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&!e.matches(pp)&&fB(e)})}catch(e){ld("normalizeOutsideRichTextEditors",e)}},L0e=t=>{try{if(t?.querySelector?.(`${k.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}, ${k.TAGS.SNIPPYLY_HIGHLIGHT_USER_TEXT}`))return;fB(t)}catch(e){O.catch("Error in normalizeUnlessHighlightsRemain: ",e)}},M0e=t=>{try{let e=zs(t.startContainer),n=zs(t.endContainer);if(!e&&!n)return!0;let r=t.commonAncestorContainer,i=r.nodeType===Node.ELEMENT_NODE?r:r.parentNode;if(!i)return!1;let o=(i.ownerDocument||document).createTreeWalker(i,NodeFilter.SHOW_TEXT),s=null,a=null;for(;o.nextNode();){let c=o.currentNode;c.length&&t.intersectsNode(c)&&!zs(c)&&(s=s||c,a=c)}return!s||!a?!1:(e&&t.setStart(s,0),n&&t.setEnd(a,a.length),!0)}catch(e){return ld("moveRangeBoundariesOutOfRichTextEditors",e),!1}},OQ=t=>{try{return t?t?.hasAttribute&&t?.hasAttribute(k.ATTRIBUTES.VELT_TAG_DISABLED)?!0:OQ(t?.parentElement):!1}catch(e){return O.catch("Error in utils isTagDisabledOnElement: ",e),!1}},LQ=t=>{try{return t?t?.hasAttribute&&t?.hasAttribute(k.ATTRIBUTES.VELT_ARROW_DISABLED)?!0:LQ(t?.parentElement):!1}catch(e){return O.catch("Error in utils isArrowDisabledOnElement: ",e),!1}},MQ=t=>{try{return t?t?.hasAttribute&&t?.hasAttribute(k.ATTRIBUTES.VELT_AREA_DISABLED)?!0:MQ(t?.parentElement):!1}catch(e){return O.catch("Error in utils isAreaDisabledOnElement: ",e),!1}},PQ=t=>{try{return t?t?.hasAttribute&&t?.hasAttribute(k.ATTRIBUTES.VELT_RECORDER_DISABLED)?!0:PQ(t?.parentElement):!1}catch(e){return O.catch("Error in utils isRecorderDisabledOnElement: ",e),!1}};var zc=()=>{try{return window?.Snippyly?.version}catch(t){return O.catch("Error in utils getSdkVersion: ",t),null}},P0e=t=>{try{return Object.fromEntries(Object.entries(t).filter(([e,n])=>n!==void 0))}catch(e){return O.catch("Error in utils removeUndefinedKeys: ",e),t}},x0e=t=>{try{let e=new URL(t);return Object.values(k.URL_PARAMS).forEach(n=>{e.searchParams.delete(n)}),e.href}catch(e){return O.catch("Error in utils excludeSnippylyParamsFromUrl: ",e),t}},k0e=t=>{try{navigator.clipboard.writeText(t)}catch(e){O.catch("Error in copyToClipboard: ",e)}},FR=t=>{try{let e=pB(t);return e&&typeof e=="string"&&e.includes("/svg")&&(e=e.split("/svg")[0]+"/*[name()='svg']"),e}catch(e){O.catch("Error in utils getXPath:",e)}},pB=t=>{try{if(t){if(typeof t=="string")return document.evaluate(t,document,null,0,null);if(!t||t.nodeType!=1)return"";if(t.id&&t?.tagName?.toLowerCase()!=="svg"&&document.querySelectorAll(`[id='${t.id}']`)?.length===1)return"//*[@id='"+t.id+"']";let e=[].filter.call(t.parentNode?.children?t.parentNode?.children:[],function(n){return n.tagName==t.tagName});return pB(t.parentNode)+"/"+t.tagName.toLowerCase()+(e.length>1?"["+([].indexOf.call(e,t)+1)+"]":"")}}catch(e){O.catch("Error in utils calculateXPath:",e)}},F0e=t=>{try{let e=[];return t.forEach(n=>{let r={};r.commonAncestorContainer=xQ(n.commonAncestorContainer),r.text=n.toString(),r.occurrence=GR(n.commonAncestorContainer,0,n.startContainer,n.startOffset,n.toString())+1,e.push(r)}),e}catch{return[]}},xQ=t=>{try{if(t.nodeType===Node.TEXT_NODE){let e=1,n=t.previousSibling;for(;n;)n.nodeType===Node.TEXT_NODE&&e++,n=n.previousSibling;return FR(t.parentElement)}else return FR(t)}catch(e){return O.catch("Error in utils getXPathForText: ",e),FR(t)}},kQ=(t,e)=>{try{return t?t?.hasAttribute&&(e&&t.hasAttribute("contenteditable")||t?.getAttribute(k.ATTRIBUTES.VELT_LIVE_SELECTION_ENABLED)==="true")?t:kQ(t?.parentElement,e):null}catch(n){return O.catch("Error in utils getSelectionEnabledElement: ",n),null}},U0e=t=>{try{let e,n=[],r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);for(;e=r.nextNode();)n.push(e);return n}catch(e){return O.catch("Error in utils getTextNodesInsideElement: ",e),[]}},V0e=t=>{try{return t<576||t>=576&&t<767?"Mobile":t>=768&&t<992?"Tablet":t>=992&&t<1520?"Desktop":"Monitor"}catch(e){return O.catch("Error in utils getDeviceTypeFromDeviceWidth: ",e),""}},gB=t=>new Promise(e=>setTimeout(e,t)),B0e=(t,e=0)=>new Promise((n,r)=>{let i=document.createElement("video"),o=navigator.userAgent.includes("Firefox");o&&(i.preload="auto"),i.setAttribute("src",URL.createObjectURL(t)),i.load(),i.addEventListener("error",s=>{r("error when loading video file: "+s)}),i.addEventListener("loadedmetadata",()=>{let s=()=>{if(i.duration<e){r("video is too short.");return}setTimeout(()=>{i.currentTime=e},200),i.addEventListener("seeked",()=>{let a=document.createElement("canvas");a.width=i.videoWidth,a.height=i.videoHeight;let c=a.getContext("2d");c.drawImage(i,0,0,a.width,a.height),c.canvas.toBlob(l=>{i.remove(),n(l)},"image/jpeg",.75)})};if(o&&i.duration>0&&i.duration<10&&t.size>1e6){setTimeout(()=>{i.duration<e&&(e=Math.max(.1,i.duration/2)),s()},1e3);return}s()})}),G0e=t=>{try{return new Promise((e,n)=>{let r=new FileReader;r.onloadend=()=>e(r.result),r.readAsDataURL(t)})}catch(e){return O.catch("Error in utils blobToBase64: ",e),Promise.resolve("")}},j0e=(t,e="image/jpeg")=>{try{let n=atob(t.split(",")[1]),r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return new Blob([r],{type:e})}catch(n){return O.catch("Error in utils base64ToBlob: ",n),null}},H0e=(t,e,n=20)=>new Promise((r,i)=>{let o=new Image;o.crossOrigin="Anonymous",o.onload=()=>{let s=o.width,a=o.height,c=600,l=a/s*c,d="http://www.w3.org/2000/svg",h=document.createElementNS(d,"svg");h.setAttribute("xmlns",d),h.setAttribute("width",c.toString()),h.setAttribute("height",l.toString()),h.setAttribute("viewBox",`0 0 ${c} ${l}`);let f=document.createElementNS(d,"circle"),g=document.createElementNS(d,"polygon"),E=16,I=E+16,S=c/2,R=l/2;if(f.setAttribute("cx",S.toString()),f.setAttribute("cy",R.toString()),f.setAttribute("r",I.toString()),f.setAttribute("fill","lightgrey"),g.setAttribute("points",`${S-E/2},${R-E} ${S-E/2},${R+E} ${S+E},${R}`),g.setAttribute("fill","#ffffff"),h.appendChild(f),h.appendChild(g),e){let A=e.length*16-10,v=16*1.5,C=(c-A)/2,w=l-v-10,N=document.createElementNS(d,"rect");N.setAttribute("x",C.toString()),N.setAttribute("y",w.toString()),N.setAttribute("width",A.toString()),N.setAttribute("height",v.toString()),N.setAttribute("fill","#353945b3"),N.setAttribute("rx","12"),h.appendChild(N);let L=document.createElementNS(d,"text");L.textContent=e,L.setAttribute("x",(c/2).toString()),L.setAttribute("y",(w+16).toString()),L.setAttribute("font-size","16"),L.setAttribute("text-anchor","middle"),L.setAttribute("fill","white"),h.appendChild(L)}let U=new XMLSerializer().serializeToString(h),H=new Image,Q=new Blob([U],{type:"image/svg+xml;charset=utf-8"}),ae=URL.createObjectURL(Q);H.onload=()=>{let ne=document.createElement("canvas");ne.width=c,ne.height=l;let A=ne.getContext("2d");A.beginPath(),A.moveTo(n,0),A.lineTo(c-n,0),A.quadraticCurveTo(c,0,c,n),A.lineTo(c,l-n),A.quadraticCurveTo(c,l,c-n,l),A.lineTo(n,l),A.quadraticCurveTo(0,l,0,l-n),A.lineTo(0,n),A.quadraticCurveTo(0,0,n,0),A.closePath(),A.clip(),A.drawImage(o,0,0,c,l),A.drawImage(H,0,0,c,l);let v=ne.toDataURL("image/png");r(v)},H.onerror=i,H.src=ae},o.onerror=i,o.src=t});var $0e=t=>{try{return t?.replace(/[\n\t\u200D]/g,"")?.split(/\s+/)?.filter(r=>r?.trim()?.length)||[]}catch(e){return O.catch("Error in utils getWords: ",e),[]}},W0e=(t,e=[])=>{try{let n=e.map(r=>`[${r}="${t}"]`).join(",");return document.querySelector(n)}catch(n){return O.catch("Error in utils getElementByAttributes: ",n),null}},z0e=(t,e=[])=>{try{let n=e.map(r=>`[${r}="${t}"]`).join(",");return document.querySelectorAll(n)}catch(n){return O.catch("Error in utils getElementsByAttributes: ",n),[]}},kT=t=>{try{let e=Math.floor(t/3600),n=Math.floor((t-e*3600)/60),r=Math.floor(t-e*3600-n*60);return e&&e<10&&(e="0"+e),n<10&&(n="0"+n),r<10&&(r="0"+r),(e?e+":":"")+n+":"+r}catch{return""}},FQ=10,q0e=t=>{try{if(typeof t!="number"||!isFinite(t))return 0;let e=1e3/FQ;return Math.round(t*e)/e}catch{return t}},K0e=t=>{try{if(!t||typeof t!="object")return;let e={videoPlayerId:t.videoPlayerId,currentMediaPosition:t.currentMediaPosition,locationName:t.locationName};return t.version?.id&&t.version?.name&&(e.version={id:t.version.id,name:t.version.name}),e}catch{return}},Y0e=(t,e=10)=>{try{if(!t||!t.currentTime)throw new Error("Invalid video element reference provided");let n=t.currentTime,r=Math.floor(n/e)*e,i=r+e;return{startSlot:kT(r),endSlot:kT(i),timeSlot:kT(r)+" - "+kT(i)}}catch{return null}},UQ=t=>{try{return t?typeof ShadowRoot<"u"&&t instanceof ShadowRoot?!0:Object.prototype.toString.call(t)==="[object ShadowRoot]":!1}catch{return!1}},mB=t=>{let e=[];try{let n=t;for(;n;){let r=n?.getRootNode?.();if(!r||r===n||!UQ(r))break;e.push(r),n=r.host}}catch(n){O.catch("Error in utils getShadowRootsForElement: ",n)}return e},UR=(t,e)=>{try{let n=r=>!!r&&(r===t||t.contains(r));return n(e.startContainer)&&n(e.endContainer)}catch{return!1}},YV=new Set,EB=(t,e)=>{try{let n=`${t}|${e}`;if(YV.has(n))return;YV.add(n),O.catch(`Caret resolution failed in ${t} (${e}). Mentions and text replacement may not work in this browser.`)}catch{}};var jR=t=>{try{if(!t)return{status:"failed",reason:"no-element"};let e=mB(t),n=window.getSelection(),r=!1,i=e[0];if(i&&typeof i.getSelection=="function"){let o=i.getSelection();if(o?.rangeCount){r=!0;let s=o.getRangeAt(0);if(UR(t,s))return{status:"resolved",range:s,selection:o}}}if(e.length&&typeof n?.getComposedRanges=="function")try{let s=n.getComposedRanges({shadowRoots:e})?.[0];if(s&&(r=!0,UR(t,s))){let a=document.createRange();return a.setStart(s.startContainer,s.startOffset),a.setEnd(s.endContainer,s.endOffset),{status:"resolved",range:a,selection:n}}}catch{}if(n?.rangeCount){r=!0;let o=n.getRangeAt(0);if(UR(t,o))return{status:"resolved",range:o,selection:n}}return r?{status:"failed",reason:"caret-not-resolvable-in-element"}:{status:"no-caret"}}catch(e){return O.catch("Error in utils resolveCaretRangeInElement: ",e),{status:"failed",reason:"threw"}}},X0e=t=>{try{let e=jR(t);if(e.status==="resolved"&&e.selection)return e.selection;let n=mB(t)[0];return n&&typeof n.getSelection=="function"?n.getSelection():window.getSelection()}catch(e){return O.catch("Error in utils getSelectionForElement: ",e),window.getSelection()}},XV=(t,e)=>{try{return!t||!e?!1:typeof t.setBaseAndExtent=="function"?(t.setBaseAndExtent(e.startContainer,e.startOffset,e.startContainer,e.startOffset),!0):(t.removeAllRanges(),t.addRange(e),!0)}catch(n){return O.catch("Error in utils setCaretToRangeStart: ",n),!1}},Q0e=(t,e=["@"])=>{try{let n="",r=jR(t);if(r.status==="failed")return EB("getWordAtCursor",r.reason),"";if(r.status==="resolved"){let i=r.range,o=i.endOffset,s=i?.commonAncestorContainer?.textContent;s?n=VQ(s,o,e):n=""}return n}catch(n){return O.catch("Error in utils getWordAtCursor: ",n),""}};var VQ=(t,e,n=["@"])=>{try{let r=-1,i=!1;for(let o of n){let s=t.lastIndexOf(o,e),a=s>0?t.lastIndexOf(o,s-1):-1;if(s>r){let c=VT(t,s,e),l=BT(t,s,e);if(c||l){if(a!==-1){let d=VT(t,a,s),h=BT(t,a,s);!d&&!h&&(r=a,i=!0)}}else r=s,i=!0}}return r!==-1&&i?t.substring(r,e):""}catch(r){return O.catch("Error in utils getStringFromLastAtSymbol: ",r),""}},VT=(t,e,n)=>{try{if(e===0)return!1;let r=t.charAt(e-1);return!(r===" "||r==="\xA0"||r===`
|
|
124
|
+
`||r===" "||[",",":",";"].includes(r))}catch(r){return O.catch("Error in utils isHotkeyDisabledForAutocomplete: ",r),!1}},BT=(t,e,n)=>{try{return!!t.substring(e+1,n).startsWith(" ")}catch(r){return O.catch("Error in utils isHotkeyFollowedBySpace: ",r),!1}},J0e=(t,e,n=["@"])=>{try{let r=jR(t);if(r.status==="failed"){EB("replaceWordAtCursor",r.reason);return}if(r.status==="resolved"){let i=r.selection,o=r.range,s=o.startOffset,a=o?.commonAncestorContainer?.textContent;if(a){let c=-1;for(let l of n){let d=a.lastIndexOf(l,s),h=d>0?a.lastIndexOf(l,d-1):-1;if(d>c){let f=VT(a,d,s),g=BT(a,d,s);if(f||g){if(h!==-1){let E=VT(a,h,d),I=BT(a,h,d);!E&&!I&&(c=h)}}else c=d}}if(c!==-1){let l=a.substring(0,c),d=a.substring(o.endOffset),h=document.createElement("span");h.textContent=e,h.style.color="var(--velt-accent)";let f=e.startsWith("@")?e.substring(1):e;h.classList.add("velt-mention"),h.classList.add(f.includes("@")?"velt-mention--email":"velt-mention--name");let g=Date.now()+"_"+Math.random().toString(36).substr(2,9);h.setAttribute("data-recently-added",g),setTimeout(()=>{h.hasAttribute("data-recently-added")&&h.removeAttribute("data-recently-added")},5e3);let E=o.commonAncestorContainer;if(E.nodeType===Node.TEXT_NODE){let I=E.parentNode;if(I){let S=document.createTextNode(l),R=document.createTextNode(d);I.replaceChild(R,E),I.insertBefore(h,R),I.insertBefore(S,h);try{let U=document.createRange();U.setStartAfter(h),U.collapse(!0),XV(i,U)}catch(U){O.catch("Error positioning cursor after span:",U);try{let H=document.createRange();H.selectNodeContents(t),H.collapse(!1),XV(i,H)}catch(H){O.catch("Error with fallback cursor positioning:",H)}}}}}}}}catch(r){O.catch("Error in utils replaceWordAtCursor: ",r)}},Z0e=()=>{try{let e=window.getSelection()?.getRangeAt(0),n=e?.commonAncestorContainer,r=e?.startContainer,i=e?.endContainer,o=[];o.push(n),o.push(r),o.push(i);let s=!1;for(let a of o)if(a&&oo(a,[k.TAGS.SNIPPYLY_TEXT_HIGHLIGHT,k.TAGS.SNIPPYLY_COMMENT_TEXT_PORTAL,k.TAGS.SNIPPYLY_HIGHLIGHT_USER_TEXT,k.TAGS.SNIPPYLY_COMMENT_TEXT])){s=!0;break}return s}catch(t){return O.catch("Error in utils isTextSelectionIncludesSnippylyElement: ",t),!1}},_B=(t,e,n)=>{try{let r=document.querySelector(`[id=${t}]`);if(r)r.name=e,r.content=n;else{let i=document.createElement("meta");i.id=t,i.name=e,i.content=n,document.getElementsByTagName("head")[0].appendChild(i)}}catch{}},TB=t=>{try{if(t){let e=document.querySelector(`[id=${t}]`);e&&e.remove()}}catch{}},yB=()=>{try{let e=new Date().getTimezoneOffset(),n=Math.floor(Math.abs(e)/60),r=Math.abs(e)%60;return`UTC${e>0?"-":"+"}${n?.toString()?.padStart(2,"0")}:${r?.toString()?.padStart(2,"0")}`}catch(t){return O.catch("Error in utils getTimezone: ",t),""}},eMe=()=>{try{let t=[];return document.querySelectorAll("*").forEach(n=>{(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth||["auto","scroll"].includes(getComputedStyle(n).overflow))&&t.push(n)}),t}catch(t){return O.catch("Error in utils getScrollableElements: ",t),[]}},IB=(t,e)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),tMe=(t,e={x:window.innerWidth/2,y:window.innerHeight/2})=>{try{let n=t;for(;n.children.length>0;){let r=null,i=Number.MAX_SAFE_INTEGER;for(let o=0;o<n.children.length;o++){let s=n.children[o],a=s.getBoundingClientRect(),c={x:a.left+a.width/2,y:a.top+a.height/2},l=IB(c,e);(a.top>=0||a.bottom<=window.innerHeight)&&a.width>0&&a.height>0&&l<=i&&(r=s,i=l)}if(r===null)break;n=r}return n}catch(n){return O.catch("Error in utils getInnermostElement: ",n),null}},nMe=t=>{try{let{offsetWidth:e,offsetHeight:n,scrollTop:r}=t,i=t,o={x:e/2,y:r+n/2};for(;i.children.length>0;){let s=null,a=Number.MAX_SAFE_INTEGER;for(let c=0;c<i.children.length;c++){let l=i.children[c],d={x:l.offsetLeft+l.offsetWidth/2,y:l.offsetTop+l.offsetHeight/2},h=IB(d,o);l.offsetTop>=0&&l.offsetWidth>0&&l.offsetHeight>0&&h<=a&&(s=l,a=h)}if(s===null)break;i=s}return i}catch(e){return O.catch("Error in utils getNestedInnermostElement: ",e),null}},rMe=()=>{try{let t=window.innerWidth/2,e=window.innerHeight/2,n=document.elementFromPoint(t,e);for(;n&&n.tagName==="BODY";)e+=2,n=document.elementFromPoint(t,e);return n}catch(t){return O.catch("Error in utils getCenteredBackgroundElement: ",t),null}},iMe=(t,e,n=!1)=>{try{let r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),o=e.offsetTop;n&&(o=o-r.height/2+i.height/2),t.scrollTo({top:o,behavior:"smooth"})}catch(r){O.catch("Error in utils nestedScrollIntoView: ",r)}},oMe=(t,e=!0)=>{try{let n=document.body.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-n.top,o=window.innerHeight,s=i;e&&(s=s-o/2+r.height/2),window.scrollTo({top:s,behavior:"smooth"})}catch(n){O.catch("Error in utils scrollIntoView: ",n)}},sMe=(t=!1)=>{try{let e=!0;return t&&(e=/\sChrome\/[\d.]+ Mobile\s/.test(navigator.userAgent)),"ontouchstart"in window||navigator.maxTouchPoints>0||e}catch(e){return O.catch("Error in utils isTouchDevice: ",e),!1}},aMe=(t,e,n)=>{try{return(1-n)*t+n*e}catch(r){O.catch("Error in utils lerp: ",r)}return 0},cMe=(t,e)=>{try{if(t===void 0)return t;if(t=t.replace("#",""),t.length===6){let n=parseInt(t,16),r=(n>>16)+e;r>255&&(r=255),r<0&&(r=0);let i=(n&255)+e;i>255&&(i=255),i<0&&(i=0);let o=(n>>8&255)+e;return o>255&&(o=255),o<0&&(o=0),`#${(i|o<<8|r<<16).toString(16)}`}else return t}catch(n){O.catch("Error in utils multiplyColor: ",n)}return t},lMe=t=>{try{return t in k.TEXT_COLOR_MAP?k.TEXT_COLOR_MAP[t]:"#141416"}catch(e){return O.catch("Error in generateUserColor:",e),"#141416"}},uMe=()=>{try{let t=localStorage.getItem(k.LOCAL_STORAGE.SNIPPYLY_DEFAULT_MEDIA_SOURCE_OPTIONS);if(t)return JSON.parse(t)}catch(t){return O.catch("Error in getDefaultMediaStreamOptions:",t),{}}},dMe=(t,e)=>{try{let n=e*(Math.PI/180),r=Math.cos(n);return r?t/r:t}catch(n){return O.catch("Error in calculateHypotenuse:",n),0}},hMe=(t,e,n=!0)=>{try{let r=[],i=n?t:t.parentNode;for(;i;)r.push(i),i=i.parentNode;let o=n?e:e.parentNode;for(;o;){if(r.indexOf(o)!==-1)return o;o=o.parentNode}return null}catch(r){return O.catch("Error in utils findCommonParent: ",r),null}},fMe=(t,e,n,r,i=!1)=>{try{let o,s;if(i){let a=n,c=r;if(a===c)o=t,s=e;else{let l=0,d=0,h=a;for(;h&&h!==c;)l+=h.offsetLeft,d+=h.offsetTop,h=h.parentElement;o=l+t,s=d+e}}else{let a=n.getBoundingClientRect(),c=r.getBoundingClientRect(),l=a.left+t,d=a.top+e;o=l-c.left,s=d-c.top}return{x:o,y:s}}catch(o){return O.catch("Error in utils calculateParentCoordinates: ",o),{x:t,y:e}}},pMe=t=>{try{let e={height:0,width:0};if(typeof t?.getBBox=="function"){let n=t?.getBBox(),r=t?.getBoundingClientRect();e.height=parseFloat(r?.height||n.height||0),e.width=parseFloat(r?.width||n.width||0)}else{let n=window.getComputedStyle(t);if(e.height=t?.clientHeight||parseFloat(n.getPropertyValue("height"))||0,e.width=t?.clientWidth||parseFloat(n.getPropertyValue("width"))||0,t?.getBoundingClientRect&&typeof t?.getBoundingClientRect=="function"){let r=t?.getBoundingClientRect();e?.height||(e.height=r?.height||t?.clientHeight||t?.offsetHeight||0),e?.width||(e.width=r?.width||t?.clientWidth||t?.offsetWidth||0)}}return e}catch(e){return O.catch("Error in utils getElementDimensions: ",e),{height:0,width:0}}},gMe=t=>{try{let e=t;for(;e;){if(window?.getComputedStyle(e)?.getPropertyValue("background-clip")=="text")return!0;e=e?.parentElement}return!1}catch(e){return O.catch("Error in utils hasParentWithBackgroundClip: ",e),!1}},mMe=t=>{try{let e=["attachment","attachments","chunkUrls","transcription","color","position","positionX","positionY","resolved","inProgress","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","taggedElementPath","taggedElementRect","targetElement","documentParamsId","documentParams","ghostComment","areaAnnotationId","iam","commentSource"],n=JSON.parse(JSON.stringify(t)),r={};return Object.keys(n).forEach(i=>{e.includes(i)||(r[i]=n[i])}),JSON.parse(JSON.stringify(r))}catch(e){return O.catch("Error in utils getRecorderAnnotationForClient: ",e),null}},EMe=t=>t===null||typeof t>"u",_Me=(t,e)=>{try{return!!t?.closest(`[${e}]`)}catch(n){return O.catch("Error in utils hasParentWithAttribute: ",n),!1}},BQ=(t,e=!0)=>{try{let n=[];if(!t||!(t instanceof HTMLElement))return[];e&&n.push(t);for(let r=0;r<t.children.length;r++){let i=t.children[r];n=n.concat(BQ(i))}return n}catch(n){return O.catch("Error in utils getAllNestedChildren: ",n),[]}},TMe=()=>{try{return document.visibilityState==="hidden"?!1:document.hasFocus()}catch(t){return O.catch("Error in utils isTabActive: ",t),!1}},yMe=t=>{try{let e="",n=t?.getAttribute("src");if(n)e=`${Hc(n)}`;else{let r=t?.querySelectorAll("source");if(r&&r.length>0){let o=r[0]?.getAttribute("src");o&&(e=`${Hc(o)}`)}}return e}catch{return""}},IMe=t=>{try{return!(t&&(t?.children?.length>0||t?.textContent?.trim()?.length>0))}catch(e){return O.catch("Error in utils isTemplateEmpty: ",e),!0}},QV=(t,e)=>{try{if(!t||!e)return;let n=[],r="",i=0;for(let c=0;c<e.length;c++){let l=e[c];l==="["?(i++,i===1&&r&&(n.push(r),r=""),r+=l):l==="]"?(i--,r+=l,i===0&&(n.push(r),r="")):l==="."&&i===0?r&&(n.push(r),r=""):r+=l}r&&n.push(r);let o,s=V({},t),a=n.reduce((c,l)=>{if(c==null)return;Yi(c)&&(o=c,c=c());let d=l.match(/^\[([^\[\]]+|(\[[^\[\]]*\]))\]$/);if(d){let f=d[1];if(/^\d+$/.test(f)){let g=parseInt(f,10);return Array.isArray(c)?c[g]:void 0}if(f.startsWith("'")&&f.endsWith("'")||f.startsWith('"')&&f.endsWith('"')){let g=f.slice(1,-1);return c[g]}if(f.includes(".")||f.includes("[")){let g=QV(s,f);Yi(g)&&(g=g());let E=g?.toString()||"";return c[E]}if(s[f]!==void 0){let g=s[f];return Yi(g)&&(g=g()),c[g]}return c[f]}let h=l;return(l.startsWith("'")&&l.endsWith("'")||l.startsWith('"')&&l.endsWith('"'))&&(h=l.slice(1,-1)),h==="length"&&Array.isArray(c)?c.length:c[h]},t);return o?zf(()=>{try{let c=V({},t);return n.reduce((l,d)=>{if(l==null)return;Yi(l)&&(l=l());let h=d.match(/^\[([^\[\]]+|(\[[^\[\]]*\]))\]$/);if(h){let g=h[1];if(/^\d+$/.test(g)){let E=parseInt(g,10);return Array.isArray(l)?l[E]:void 0}if(g.startsWith("'")&&g.endsWith("'")||g.startsWith('"')&&g.endsWith('"')){let E=g.slice(1,-1);return l[E]}if(g.includes(".")||g.includes("[")){let E=QV(c,g);Yi(E)&&(E=E());let I=E?.toString()||"";return l[I]}if(c[g]!==void 0){let E=c[g];return Yi(E)&&(E=E()),l[E]}return l[g]}let f=d;return(d.startsWith("'")&&d.endsWith("'")||d.startsWith('"')&&d.endsWith('"'))&&(f=d.slice(1,-1)),l[f]},t)}catch{return""}}):a}catch{return""}},vMe=(t,e)=>{try{return!!(t?.locationId&&(t.locationId===e?.locationId||e?.location?.id===String(t.locationId))||t?.location?.id&&(t.location.id===e?.location?.id||t.location.id===String(e?.locationId)))}catch(n){return O.catch("Error in utils isLocationSame: ",n),!1}},SMe=()=>{try{let t=document.activeElement,e=new Set,n=10,r=0;for(;t&&t.shadowRoot&&!(e.has(t)||(e.add(t),t=t.shadowRoot.activeElement,r++,r>n)););return t}catch(t){return O.catch("Error in utils getActiveElement: ",t),null}},gp=(t,e)=>{try{return typeof t=="object"&&typeof e=="object"?JSON.stringify(t)===JSON.stringify(e):t===e}catch{return!1}},GQ=(t,e=0)=>{try{let n=JSON.parse(JSON.stringify(t));return t?.clientDocumentId&&(n.documentId=t.clientDocumentId),t?.clientOrganizationId&&(n.organizationId=t.clientOrganizationId),t?.documentMetadata&&e<5&&(n.documentMetadata=GQ(t.documentMetadata,e+1)),delete n?.clientDocumentId,delete n?.clientOrganizationId,delete n?.veltFolderId,delete n?.parentVeltFolderId,delete n?.pageInfo,n}catch{return t}},AMe=t=>{try{if(!t.some(s=>s?.value?.data))return{};let e=null,n=t.reduce((s,a)=>Math.max(s,a.timestamp),0),r=t.find(s=>s.timestamp===n);if(!r)return{};r?.value?.operation?.type==="removed"&&(e=r?.value?.operation);let o=t.map(s=>s.value).reduce((s,a)=>({data:V(V({},s?.data??{}),a?.data??{})}),{});return o.operation=e,o}catch{return{}}},CMe=(t,e,n)=>y(null,null,function*(){try{let r=0;for(;r<=(n.retryCount||0);)try{let i=yield t();if(!i)return{success:!1,statusCode:400,message:`${e} failed: No response received`};if(i.statusCode===void 0)return{success:!1,statusCode:400,message:`${e} failed: Response missing statusCode`};if(i.statusCode!==200){if(r++,r>(n.retryCount||0))return{success:!1,statusCode:i.statusCode,message:`${e} failed after ${r} attempts with status code ${i.statusCode}`};n.retryDelay&&(yield new Promise(o=>setTimeout(o,n.retryDelay)));continue}return i}catch(i){if(r++,r>(n.retryCount||0))return{success:!1,statusCode:500,message:`${e} failed with error: ${i instanceof Error?i.message:"Unknown error"}`};n.retryDelay&&(yield new Promise(o=>setTimeout(o,n.retryDelay)))}return{success:!1,statusCode:500,message:`${e} failed: Maximum retry attempts exceeded`}}catch(r){return{success:!1,statusCode:500,message:`${e} failed with unexpected error: ${r instanceof Error?r.message:"Unknown error"}`}}}),DMe=(t,e,n,r,i)=>y(null,null,function*(){try{let o=typeof e=="function"?yield e():e||{},a=V(V({},{"Content-Type":"application/json"}),o),c=yield fetch(t,V({method:"POST",headers:a,body:JSON.stringify(n)},i?{credentials:i}:{}));if(!c.ok)return O.catch(`Error in makeConfigBasedRequest: ${c.status} ${c.statusText}`),r?{data:{},success:!1,statusCode:c.status}:{success:!1,statusCode:c.status};let l=yield c.json();return r?{data:l?.data??{},success:!0,statusCode:200}:{success:!0,statusCode:200}}catch(o){return O.catch("Error in makeConfigBasedRequest:",o),r?{data:{},success:!1,statusCode:500}:{success:!1,statusCode:500}}}),RMe=t=>{try{return!t||!t?.access?[]:Object.keys(t.access).sort().map(i=>t.access?.[i]?.map(o=>`${i}:${o}`)??[]).reduce((i,o)=>i.flatMap(s=>o.map(a=>[...s,a])),[[]]).map(i=>i.join("_"))}catch(e){return O.catch("Error in utils generateProcessedContext: ",e),[]}},jQ=t=>{try{if(!t||!t?.access)return[];let e=Object.keys(t.access).sort(),r=(o=>{let s=[],a=Math.pow(2,o.length);for(let c=1;c<a;c++){let l=[];for(let d=0;d<o.length;d++)c&1<<d&&l.push(o[d]);s.push(l)}return s})(e),i=[];for(let o of r){let s=o.map(a=>{let c=t.access?.[a];return c==null?null:`${a}:${c}`}).filter(a=>a!==null);s.length>0&&i.push(s.join("_"))}return[...new Set(i)]}catch(e){return O.catch("Error in utils generateAllContextCombos: ",e),[]}},NMe=({input:t})=>{try{if(!t||!t?.access)return[];let e=t?.access,n=Object.keys(e).sort(),r=[];for(let o of n){let s=e[o];s!=null&&Array.isArray(s)&&s.length>0&&r.push({key:o,values:s})}return r.length===0?[]:r.reduce((o,{key:s,values:a})=>o.length===0?a.map(c=>[{key:s,value:c}]):o.flatMap(c=>a.map(l=>[...c,{key:s,value:l}])),[]).map(o=>{let s={};return o.forEach(({key:a,value:c})=>{s[a]=c}),{access:s}})}catch(e){return O.catch("Error in utils expandContextArraysToSingleValues: ",e),[]}},bMe=({input:t})=>{try{if(!t||t.length===0)return{access:{}};let e=new Set;t.forEach(r=>{r?.access&&Object.keys(r.access).forEach(i=>e.add(i))});let n={};for(let r of Array.from(e).sort()){let i=new Set;t.forEach(o=>{if(o?.access){let s=o.access[r];s!=null&&i.add(s)}}),n[r]=i.size>0?Array.from(i).sort():null}return{access:n}}catch(e){return O.catch("Error in utils combineContextsToArrays: ",e),{access:{}}}},vB=i=>y(null,[i],function*({data:t,getSdkProxy:e,userId:n,methodName:r}){try{let o="sdkproxyencryptionanddecryptiononsdk"+(n??""),s=yield HQ({data:t,key:o}),a=(yield e({veltData:s}))?.data?.data?.veltData||{};return yield fp(a,o)}catch(o){return O.catch("Error in utils sdkProxyEncryptDecrypt: "+(r??""),o),t}}),HQ=n=>y(null,[n],function*({data:t,key:e}){try{return yield GT(t,e)}catch{return t}}),HR=(t,e)=>y(null,null,function*(){try{let n=0;for(;n<=(e.retryCount||0);)try{let r=yield t();if(!r)throw new Error("No response received");return r}catch{if(n++,n>=(e.retryCount||0))return null;e.retryDelay&&(yield new Promise(i=>setTimeout(i,e.retryDelay)))}return null}catch{return null}}),$R=t=>{try{if(t&&typeof t=="object"){let e=JSON.parse(JSON.stringify(t));return e?.clientOrganizationId&&(e.organizationId=e.clientOrganizationId,delete e.clientOrganizationId),e?.clientGroupId&&(e.groupId=e.clientGroupId,delete e.clientGroupId),e?.userSnippylyId&&delete e.userSnippylyId,delete e?.email_lowercase,delete e?.name_lowercase,e}else return null}catch(e){return O.catch("Error in utils getUserForClient: ",e),null}},ud=({url:t,apiProxyDomain:e})=>{try{if(ad(t))return t;if(e){let n=new URL(t);n.origin&&(t=t.replace(n.origin,e))}return t}catch(n){return O.catch("Error in utils getResolvedApiUrl: ",n),t}},wMe=(t,e)=>{try{if(!t||!(t instanceof Element))return!1;let n,r;if(e&&typeof e.x=="number"&&typeof e.y=="number")n=e.x,r=e.y;else{let o=t.getBoundingClientRect();n=o.left+o.width/2,r=o.top+o.height/2}let i=document.elementFromPoint(n,r);return!(!i||i===t||t.contains(i))}catch{return!1}};function hp(t,e){if(t==null||typeof t!="object"||Array.isArray(t))return t;let n={};for(let r of e)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function Jt(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}function qs(t,e){switch(e.kind){case"type":return hp(t,e.safeKeys);case"array":return Array.isArray(t)?t.map(n=>qs(n,e.item)):t;case"record":{if(!Jt(t))return t;let n={};for(let r of Object.keys(t))n[r]=qs(t[r],e.value);return n}case"object":{if(!Jt(t))return t;let n=e.selfKeys?hp(t,e.selfKeys):V({},t);for(let r of Object.keys(e.fields))Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=qs(n[r],e.fields[r]));return n}case"omit":{if(!Jt(t))return t;let n=V({},t);for(let r of e.keys)delete n[r];return n}default:return t}}var Un={kind:"type",safeKeys:xT},$Q={kind:"type",safeKeys:OR},WQ={kind:"type",safeKeys:GV},zQ={kind:"object",selfKeys:xR,fields:{resolvedBy:Un}},jT={kind:"object",selfKeys:PR,fields:{resolvedBy:Un}},Ko="textEditorConfig",sd="text";function OMe(t){let e=Jt(t)?t[Ko]:void 0;if(!(!Jt(e)||!Object.prototype.hasOwnProperty.call(e,sd)))return e[sd]}function LMe(t){let e=Jt(t)?t[Ko]:void 0;Jt(e)&&delete e[sd]}function MMe(t,e,n){if(!t||typeof t!="object")return;if(!Jt(t.context)){if(!n?.createContext)return;t.context={}}let r=t.context[Ko];r!==void 0&&!Jt(r)||(r===void 0&&(t.context[Ko]={}),t.context[Ko][sd]=e)}var qQ=new Set(xR),HT=PR.filter(t=>!qQ.has(t));function VR(t){return t===void 0?void 0:JSON.parse(JSON.stringify(t))}function PMe(t){return Jt(t)&&HT.some(e=>Object.prototype.hasOwnProperty.call(t,e))}function KQ(t){if(Jt(t))for(let e of HT)delete t[e]}function xMe(t,e){let n={};if(Jt(t))for(let r of HT)Object.prototype.hasOwnProperty.call(t,r)&&t[r]!==void 0&&(n[r]=VR(t[r]));if(Jt(e))for(let r of Object.keys(e))e[r]!==void 0&&(n[r]=VR(e[r]));return n}function kMe(t,e){if(!(!t||typeof t!="object")&&!(!Jt(t.suggestion)||!Jt(e)))for(let n of HT)Object.prototype.hasOwnProperty.call(e,n)&&(t.suggestion[n]=VR(e[n]))}var $T={kind:"object",fields:{[Ko]:{kind:"omit",keys:[sd]}}},WT={kind:"object",fields:{}},mp={kind:"type",safeKeys:MR},qo={kind:"type",safeKeys:LR};function WR(t){return{kind:"object",selfKeys:wR,fields:{from:Un,to:{kind:"array",item:Un},attachments:{kind:"array",item:t},recorders:{kind:"array",item:WQ},taggedUserContacts:{kind:"array",item:{kind:"object",fields:{contact:Un}}}}}}function Ks(t,e=$T,n=zQ){return{kind:"object",selfKeys:FV,fields:{from:Un,assignedTo:Un,resolvedByUser:Un,viewedBy:{kind:"array",item:Un},subscribedUsers:{kind:"record",value:{kind:"object",fields:{user:Un}}},unsubscribedUsers:{kind:"record",value:{kind:"object",fields:{user:Un}}},suggestion:n,targetTextRange:$Q,context:e,comments:{kind:"array",item:WR(t)}}}}var YQ=Ks(mp),SB=Ks(qo),XQ=Ks(mp,WT),QQ=Ks(qo,WT),JQ=Ks(mp,$T,jT),ZQ=Ks(qo,$T,jT),eJ=Ks(mp,WT,jT),tJ=Ks(qo,WT,jT),nJ=WR(mp),rJ=WR(qo),iJ={kind:"object",fields:{from:Un,context:$T,commentAnnotationsMap:{kind:"record",value:SB}}},oJ={kind:"object",selfKeys:VV,fields:{from:Un,reactions:{kind:"array",item:{kind:"object",fields:{from:Un}}}}},sJ={kind:"object",selfKeys:BV,fields:{from:Un,attachment:qo,attachments:{kind:"array",item:qo},recordingEditVersions:{kind:"record",value:{kind:"object",fields:{from:Un,attachment:qo,attachments:{kind:"array",item:qo}}}}}};function aJ(t,e){let n=!!e?.stripAttachmentFiles,r;return e?.keepSuggestionContent?r=e?.keepContextText?n?eJ:tJ:n?JQ:ZQ:r=e?.keepContextText?n?XQ:QQ:n?YQ:SB,qs(t,r)}function FMe(t,e){return qs(t,e?.stripAttachmentFiles?nJ:rJ)}function UMe(t){return qs(t,iJ)}var zR=["name","email","photoUrl","clientUserName","initial","name_lowercase","email_lowercase"];function qR(t){if(!Jt(t))return t;let e=V({},t);for(let n of zR)delete e[n];return e}var VMe=["oldCommentText","rejectReason"];function JV(t){return Jt(t)&&typeof t.userId=="string"&&("name"in t||"email"in t||"photoUrl"in t)}var AB=/(text|html)$/i;function BMe(t,e){return typeof e=="string"&&AB.test(t)}function cJ(t,e){if(!AB.test(t))return!1;if(typeof e=="string")return!0;if(!Jt(e))return!1;let n=e;return typeof n.from=="string"||typeof n.to=="string"}function KR(t){return!!t&&!!(t.comment||t.user||t.reaction||t.recorder||t.activity||t.attachment)}var lJ=UV.filter(t=>!wR.includes(t)),uJ=LR.filter(t=>!MR.includes(t)),dJ=64;function CB(t){try{if(t&&typeof t=="object"){let e=t.statusCode;return typeof e=="number"?`statusCode ${e}`:t instanceof Error?`threw ${t.name||"Error"}`:"no statusCode"}return t==null?"no response":"no statusCode"}catch{return"no statusCode"}}function DB(t,e,n){return KR(e)?BR(t,e,0,{pageRoot:n?.kind==="page"}):t}function Ws(t,e){for(let n of e??[])Object.prototype.hasOwnProperty.call(t,n)&&delete t[n]}var Ve=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function hJ(t){return!!(t instanceof Date||t instanceof RegExp||t instanceof Error||t instanceof Promise||t instanceof Map||t instanceof Set||t instanceof WeakMap||t instanceof WeakSet||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof Blob<"u"&&t instanceof Blob||typeof Node<"u"&&t instanceof Node)}function Qt(t){if(!Jt(t)||hJ(t))return!1;let e=Object.getPrototypeOf(t);return!(e!==Object.prototype&&e!==null&&Object.keys(t).length===0)}var fJ=["event","eventTimestamp","apiKey","sessionTabId","traits","properties"];function pJ(t){return fJ.some(e=>Ve(t,e))}var dp=t=>Qt(t)?hp(t,xT):t;function gJ(t){for(let e of["from","assignedTo","resolvedByUser","actionUser"])Ve(t,e)&&(t[e]=dp(t[e]));for(let e of["to","viewedBy"])Array.isArray(t[e])&&(t[e]=t[e].map(dp));for(let e of["subscribedUsers","unsubscribedUsers"])if(Qt(t[e])){let n={};for(let r of Object.keys(t[e])){let i=t[e][r];n[r]=Qt(i)&&Ve(i,"user")?le(V({},i),{user:dp(i.user)}):i}t[e]=n}Array.isArray(t.taggedUserContacts)&&(t.taggedUserContacts=t.taggedUserContacts.map(e=>Qt(e)&&Ve(e,"contact")?le(V({},e),{contact:dp(e.contact)}):e)),Qt(t.suggestion)&&Ve(t.suggestion,"resolvedBy")&&(t.suggestion=le(V({},t.suggestion),{resolvedBy:dp(t.suggestion.resolvedBy)}))}function mJ(t){return Ve(t,"annotationId")&&(Ve(t,"reactions")||Ve(t,"iconEmoji")||Ve(t,"iconUrl"))}function EJ(t){return Ve(t,"annotationId")&&(Ve(t,"recordingType")||Ve(t,"recordedTime")||Ve(t,"attachment")||Ve(t,"transcription"))}function _J(t){return Ve(t,"featureType")&&Ve(t,"actionType")&&(Ve(t,"changes")||Ve(t,"entityData")||Ve(t,"timestamp")||Ve(t,"id"))}var ZV=t=>Array.isArray(t)?t.map(e=>Qt(e)?{attachmentId:e.attachmentId,name:e.name,bucketPath:e.bucketPath}:e):t;function TJ(t){if(Ve(t,"attachment")&&(t.attachment=null),Ve(t,"chunkUrls")&&Qt(t.chunkUrls)&&(t.chunkUrls={}),Ve(t,"attachments")&&(t.attachments=ZV(t.attachments)),Qt(t.recordingEditVersions)){let e={};for(let n of Object.keys(t.recordingEditVersions)){let r=t.recordingEditVersions[n];if(!Qt(r)){e[n]=r;continue}let i=V({},r);Ve(i,"attachment")&&(i.attachment=null),Ve(i,"attachments")&&(i.attachments=ZV(i.attachments)),delete i.transcription,e[n]=i}t.recordingEditVersions=e}}var FT=t=>Qt(t)&&Ve(t,"userId")?{userId:t.userId}:t;function yJ(t){if(Ve(t,"actionUser")&&(t.actionUser=FT(t.actionUser)),Qt(t.changes)){let e={};for(let n of Object.keys(t.changes)){let r=t.changes[n];e[n]=Qt(r)?V(V(V({},r),Ve(r,"from")?{from:FT(r.from)}:{}),Ve(r,"to")?{to:FT(r.to)}:{}):r}t.changes=e}if(Qt(t.displayMessageTemplateData)){let e={};for(let n of Object.keys(t.displayMessageTemplateData))e[n]=FT(t.displayMessageTemplateData[n]);t.displayMessageTemplateData=e}}var IJ=zR.filter(t=>t!=="name");function BR(t,e,n,r={}){if(n>dJ)throw new Error("self-hosting telemetry filter: nesting too deep");let i=r.recorderOwned?{recorderOwned:!0}:{};if(Array.isArray(t))return t.map(g=>BR(g,e,n+1,i));if(!Qt(t))return t;let o=V({},t),s=pJ(o),a=Ve(o,"annotationId"),c=!s&&mJ(o),l=!s&&EJ(o),d=!s&&!c&&!l&&(a||Ve(o,"commentId")),h=!!e.attachment&&!!e.comment;if(e.comment){if(Ws(o,lJ),Qt(o.targetTextRange)&&(o.targetTextRange=hp(o.targetTextRange,OR)),Qt(o.context)&&Qt(o.context[Ko])){let g=V({},o.context[Ko]);delete g[sd],o.context=le(V({},o.context),{[Ko]:g})}if(Qt(o.suggestion)){let g=V({},o.suggestion);KQ(g),o.suggestion=g}d&&(gJ(o),a&&(Array.isArray(o.comments)&&(o=aJ(o,{stripAttachmentFiles:h})),Ws(o,e.comment.fieldsToRemove)))}if(e.activity&&!s&&_J(o)&&(Ws(o,e.activity.fieldsToRemove),yJ(o),Qt(o.changes))){let g=V({},o.changes);for(let E of Object.keys(g))cJ(E,g[E])&&delete g[E];o.changes=g}e.user&&(!s&&JV(o)?o=hp(o,xT):(JV(o)||typeof o.email=="string"||typeof o.photoUrl=="string")&&Ws(o,r.pageRoot?IJ:zR)),h&&!r.recorderOwned&&Ve(o,"attachmentId")&&Ws(o,uJ),e.reaction&&c&&(o=vJ(o),Ws(o,e.reaction.fieldsToRemove)),e.recorder&&(Ws(o,["transcription"]),l&&(o=SJ(o),TJ(o),Ws(o,e.recorder.fieldsToRemove)));let f=l&&e.recorder?{recorderOwned:!0}:i;for(let g of Object.keys(o))o[g]=BR(o[g],e,n+1,f);return o}function vJ(t){return qs(t,oJ)}function SJ(t){return qs(t,sJ)}var RB=()=>{};var XR={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};var X=function(t,e){if(!t)throw qc(e)},qc=function(t){return new Error("Firebase Database ("+XR.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)};var wB=function(t){let e=[],n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},AJ=function(t){let e=[],n=0,r=0;for(;n<t.length;){let i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){let o=t[n++];e[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){let o=t[n++],s=t[n++],a=t[n++],c=((i&7)<<18|(o&63)<<12|(s&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{let o=t[n++],s=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|s&63)}}return e.join("")},fd={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();let n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<t.length;i+=3){let o=t[i],s=i+1<t.length,a=s?t[i+1]:0,c=i+2<t.length,l=c?t[i+2]:0,d=o>>2,h=(o&3)<<4|a>>4,f=(a&15)<<2|l>>6,g=l&63;c||(g=64,s||(f=64)),r.push(n[d],n[h],n[f],n[g])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(wB(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):AJ(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();let n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<t.length;){let o=n[t.charAt(i++)],a=i<t.length?n[t.charAt(i)]:0;++i;let l=i<t.length?n[t.charAt(i)]:64;++i;let h=i<t.length?n[t.charAt(i)]:64;if(++i,o==null||a==null||l==null||h==null)throw new QR;let f=o<<2|a>>4;if(r.push(f),l!==64){let g=a<<4&240|l>>2;if(r.push(g),h!==64){let E=l<<6&192|h;r.push(E)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},QR=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},ZR=function(t){let e=wB(t);return fd.encodeByteArray(e,!0)},_p=function(t){return ZR(t).replace(/\./g,"")},dd=function(t){try{return fd.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function OB(t){return LB(void 0,t)}function LB(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:let n=e;return new Date(n.getTime());case Object:t===void 0&&(t={});break;case Array:t=[];break;default:return e}for(let n in e)!e.hasOwnProperty(n)||!CJ(n)||(t[n]=LB(t[n],e[n]));return t}function CJ(t){return t!=="__proto__"}function qT(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}var DJ=()=>qT().__FIREBASE_DEFAULTS__,RJ=()=>{if(typeof process>"u"||typeof process.env>"u")return;let t=process.env.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},NJ=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=t&&dd(t[1]);return e&&JSON.parse(e)},KT=()=>{try{return RB()||DJ()||RJ()||NJ()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},MB=t=>{var e,n;return(n=(e=KT())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},pd=t=>{let e=MB(t);if(!e)return;let n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);let r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},eN=()=>{var t;return(t=KT())===null||t===void 0?void 0:t.config},PB=t=>{var e;return(e=KT())===null||e===void 0?void 0:e[`_${t}`]};var dn=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}};function vr(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}function Ys(t){return y(this,null,function*(){return(yield fetch(t,{credentials:"include"})).ok})}function YT(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,o=t.sub||t.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");let s=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},t);return[_p(JSON.stringify(n)),_p(JSON.stringify(s)),""].join(".")}var Ep={};function bJ(){let t={prod:[],emulator:[]};for(let e of Object.keys(Ep))Ep[e]?t.emulator.push(e):t.prod.push(e);return t}function wJ(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}var NB=!1;function Kc(t,e){if(typeof window>"u"||typeof document>"u"||!vr(window.location.host)||Ep[t]===e||Ep[t]||NB)return;Ep[t]=e;function n(f){return`__firebase__banner__${f}`}let r="__firebase__banner",o=bJ().prod.length>0;function s(){let f=document.getElementById(r);f&&f.remove()}function a(f){f.style.display="flex",f.style.background="#7faaf0",f.style.position="fixed",f.style.bottom="5px",f.style.left="5px",f.style.padding=".5em",f.style.borderRadius="5px",f.style.alignItems="center"}function c(f,g){f.setAttribute("width","24"),f.setAttribute("id",g),f.setAttribute("height","24"),f.setAttribute("viewBox","0 0 24 24"),f.setAttribute("fill","none"),f.style.marginLeft="-6px"}function l(){let f=document.createElement("span");return f.style.cursor="pointer",f.style.marginLeft="16px",f.style.fontSize="24px",f.innerHTML=" ×",f.onclick=()=>{NB=!0,s()},f}function d(f,g){f.setAttribute("id",g),f.innerText="Learn more",f.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",f.setAttribute("target","__blank"),f.style.paddingLeft="5px",f.style.textDecoration="underline"}function h(){let f=wJ(r),g=n("text"),E=document.getElementById(g)||document.createElement("span"),I=n("learnmore"),S=document.getElementById(I)||document.createElement("a"),R=n("preprendIcon"),U=document.getElementById(R)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.created){let H=f.element;a(H),d(S,I);let Q=l();c(U,R),H.append(U,E,S,Q),document.body.appendChild(H)}o?(E.innerText="Preview backend disconnected.",U.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
125
|
+
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
|
126
|
+
</g>
|
|
127
|
+
<defs>
|
|
128
|
+
<clipPath id="clip0_6013_33858">
|
|
129
|
+
<rect width="24" height="24" fill="white"/>
|
|
130
|
+
</clipPath>
|
|
131
|
+
</defs>`):(U.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
132
|
+
<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
|
|
133
|
+
</g>
|
|
134
|
+
<defs>
|
|
135
|
+
<clipPath id="clip0_6083_34804">
|
|
136
|
+
<rect width="24" height="24" fill="white"/>
|
|
137
|
+
</clipPath>
|
|
138
|
+
</defs>`,E.innerText="Preview backend running in this workspace."),E.setAttribute("id",g)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",h):h()}function Zt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Tp(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Zt())}function xB(){var t;let e=(t=KT())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function kB(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function FB(){let t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function XT(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function UB(){let t=Zt();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function so(){return XR.NODE_CLIENT===!0||XR.NODE_ADMIN===!0}function tN(){return!xB()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function nN(){return!xB()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")}function gd(){try{return typeof indexedDB=="object"}catch{return!1}}function VB(){return new Promise((t,e)=>{try{let n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var o;e(((o=i.error)===null||o===void 0?void 0:o.message)||"")}}catch(n){e(n)}})}var OJ="FirebaseError",rr=class t extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=OJ,Object.setPrototypeOf(this,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,hi.prototype.create)}},hi=class{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){let r=n[0]||{},i=`${this.service}/${e}`,o=this.errors[e],s=o?LJ(o,r):"Error",a=`${this.serviceName}: ${s} (${i}).`;return new rr(i,a,r)}};function LJ(t,e){return t.replace(MJ,(n,r)=>{let i=e[r];return i!=null?String(i):`<${r}?>`})}var MJ=/\{\$([^}]+)}/g;function hd(t){return JSON.parse(t)}function xt(t){return JSON.stringify(t)}var BB=function(t){let e={},n={},r={},i="";try{let o=t.split(".");e=hd(dd(o[0])||""),n=hd(dd(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch{}return{header:e,claims:n,data:r,signature:i}};var GB=function(t){let e=BB(t),n=e.claims;return!!n&&typeof n=="object"&&n.hasOwnProperty("iat")},jB=function(t){let e=BB(t).claims;return typeof e=="object"&&e.admin===!0};function Gr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Xs(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function yp(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Ip(t,e,n){let r={};for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r}function fi(t,e){if(t===e)return!0;let n=Object.keys(t),r=Object.keys(e);for(let i of n){if(!r.includes(i))return!1;let o=t[i],s=e[i];if(bB(o)&&bB(s)){if(!fi(o,s))return!1}else if(o!==s)return!1}for(let i of r)if(!n.includes(i))return!1;return!0}function bB(t){return t!==null&&typeof t=="object"}function vp(t){let e=[];for(let[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}var zT=class{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,n){n||(n=0);let r=this.W_;if(typeof e=="string")for(let h=0;h<16;h++)r[h]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(let h=0;h<16;h++)r[h]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(let h=16;h<80;h++){let f=r[h-3]^r[h-8]^r[h-14]^r[h-16];r[h]=(f<<1|f>>>31)&4294967295}let i=this.chain_[0],o=this.chain_[1],s=this.chain_[2],a=this.chain_[3],c=this.chain_[4],l,d;for(let h=0;h<80;h++){h<40?h<20?(l=a^o&(s^a),d=1518500249):(l=o^s^a,d=1859775393):h<60?(l=o&s|a&(o|s),d=2400959708):(l=o^s^a,d=3395469782);let f=(i<<5|i>>>27)+l+c+d+r[h]&4294967295;c=a,a=s,s=(o<<30|o>>>2)&4294967295,o=i,i=f}this.chain_[0]=this.chain_[0]+i&4294967295,this.chain_[1]=this.chain_[1]+o&4294967295,this.chain_[2]=this.chain_[2]+s&4294967295,this.chain_[3]=this.chain_[3]+a&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(e,n){if(e==null)return;n===void 0&&(n=e.length);let r=n-this.blockSize,i=0,o=this.buf_,s=this.inbuf_;for(;i<n;){if(s===0)for(;i<=r;)this.compress_(e,i),i+=this.blockSize;if(typeof e=="string"){for(;i<n;)if(o[s]=e.charCodeAt(i),++s,++i,s===this.blockSize){this.compress_(o),s=0;break}}else for(;i<n;)if(o[s]=e[i],++s,++i,s===this.blockSize){this.compress_(o),s=0;break}}this.inbuf_=s,this.total_+=n}digest(){let e=[],n=this.total_*8;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let i=this.blockSize-1;i>=56;i--)this.buf_[i]=n&255,n/=256;this.compress_(this.buf_);let r=0;for(let i=0;i<5;i++)for(let o=24;o>=0;o-=8)e[r]=this.chain_[i]>>o&255,++r;return e}};function HB(t,e){let n=new JR(t,e);return n.subscribe.bind(n)}var JR=class{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");PJ(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=YR),i.error===void 0&&(i.error=YR),i.complete===void 0&&(i.complete=YR);let o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),o}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function PJ(t,e){if(typeof t!="object"||t===null)return!1;for(let n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function YR(){}function Qs(t,e){return`${t} failed: ${e} argument `}var $B=function(t){let e=[],n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);if(i>=55296&&i<=56319){let o=i-55296;r++,X(r<t.length,"Surrogate pair missing trail surrogate.");let s=t.charCodeAt(r)-56320;i=65536+(o<<10)+s}i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},Sp=function(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e};var WMe=14400*1e3;function Me(t){return t&&t._delegate?t._delegate:t}var en=class{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var Yc="[DEFAULT]";var QT=class{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){let r=new dn;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{let i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;let r=this.normalizeInstanceIdentifier(e?.identifier),i=(n=e?.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(i)return null;throw o}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(kJ(e))try{this.getOrInitializeService({instanceIdentifier:Yc})}catch{}for(let[n,r]of this.instancesDeferred.entries()){let i=this.normalizeInstanceIdentifier(n);try{let o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(e=Yc){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return y(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=Yc){return this.instances.has(e)}getOptions(e=Yc){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(let[o,s]of this.instancesDeferred.entries()){let a=this.normalizeInstanceIdentifier(o);r===a&&s.resolve(i)}return i}onInit(e,n){var r;let i=this.normalizeInstanceIdentifier(n),o=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;o.add(e),this.onInitCallbacks.set(i,o);let s=this.instances.get(i);return s&&e(s,i),()=>{o.delete(e)}}invokeOnInitCallbacks(e,n){let r=this.onInitCallbacks.get(n);if(r)for(let i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:xJ(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Yc){return this.component?this.component.multipleInstances?e:Yc:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function xJ(t){return t===Yc?void 0:t}function kJ(t){return t.instantiationMode==="EAGER"}var Ap=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let n=new QT(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}};var WB=[],Ne=(function(t){return t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT",t})(Ne||{}),FJ={debug:Ne.DEBUG,verbose:Ne.VERBOSE,info:Ne.INFO,warn:Ne.WARN,error:Ne.ERROR,silent:Ne.SILENT},UJ=Ne.INFO,VJ={[Ne.DEBUG]:"log",[Ne.VERBOSE]:"log",[Ne.INFO]:"info",[Ne.WARN]:"warn",[Ne.ERROR]:"error"},BJ=(t,e,...n)=>{if(e<t.logLevel)return;let r=new Date().toISOString(),i=VJ[e];if(i)console[i](`[${r}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},jr=class{constructor(e){this.name=e,this._logLevel=UJ,this._logHandler=BJ,this._userLogHandler=null,WB.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Ne))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?FJ[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Ne.DEBUG,...e),this._logHandler(this,Ne.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Ne.VERBOSE,...e),this._logHandler(this,Ne.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Ne.INFO,...e),this._logHandler(this,Ne.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Ne.WARN,...e),this._logHandler(this,Ne.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Ne.ERROR,...e),this._logHandler(this,Ne.ERROR,...e)}};function zB(t){WB.forEach(e=>{e.setLogLevel(t)})}var GJ=(t,e)=>e.some(n=>t instanceof n),qB,KB;function jJ(){return qB||(qB=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function HJ(){return KB||(KB=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var YB=new WeakMap,iN=new WeakMap,XB=new WeakMap,rN=new WeakMap,sN=new WeakMap;function $J(t){let e=new Promise((n,r)=>{let i=()=>{t.removeEventListener("success",o),t.removeEventListener("error",s)},o=()=>{n(ao(t.result)),i()},s=()=>{r(t.error),i()};t.addEventListener("success",o),t.addEventListener("error",s)});return e.then(n=>{n instanceof IDBCursor&&YB.set(n,t)}).catch(()=>{}),sN.set(e,t),e}function WJ(t){if(iN.has(t))return;let e=new Promise((n,r)=>{let i=()=>{t.removeEventListener("complete",o),t.removeEventListener("error",s),t.removeEventListener("abort",s)},o=()=>{n(),i()},s=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",o),t.addEventListener("error",s),t.addEventListener("abort",s)});iN.set(t,e)}var oN={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return iN.get(t);if(e==="objectStoreNames")return t.objectStoreNames||XB.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ao(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function QB(t){oN=t(oN)}function zJ(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){let r=t.call(JT(this),e,...n);return XB.set(r,e.sort?e.sort():[e]),ao(r)}:HJ().includes(t)?function(...e){return t.apply(JT(this),e),ao(YB.get(this))}:function(...e){return ao(t.apply(JT(this),e))}}function qJ(t){return typeof t=="function"?zJ(t):(t instanceof IDBTransaction&&WJ(t),GJ(t,jJ())?new Proxy(t,oN):t)}function ao(t){if(t instanceof IDBRequest)return $J(t);if(rN.has(t))return rN.get(t);let e=qJ(t);return e!==t&&(rN.set(t,e),sN.set(e,t)),e}var JT=t=>sN.get(t);function ZB(t,e,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){let s=indexedDB.open(t,e),a=ao(s);return r&&s.addEventListener("upgradeneeded",c=>{r(ao(s.result),c.oldVersion,c.newVersion,ao(s.transaction),c)}),n&&s.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),a.then(c=>{o&&c.addEventListener("close",()=>o()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}var KJ=["get","getKey","getAll","getAllKeys","count"],YJ=["put","add","delete","clear"],aN=new Map;function JB(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(aN.get(e))return aN.get(e);let n=e.replace(/FromIndex$/,""),r=e!==n,i=YJ.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||KJ.includes(n)))return;let o=function(s,...a){return y(this,null,function*(){let c=this.transaction(s,i?"readwrite":"readonly"),l=c.store;return r&&(l=l.index(a.shift())),(yield Promise.all([l[n](...a),i&&c.done]))[0]})};return aN.set(e,o),o}QB(t=>le(V({},t),{get:(e,n,r)=>JB(e,n)||t.get(e,n,r),has:(e,n)=>!!JB(e,n)||t.has(e,n)}));var lN=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(XJ(n)){let r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}};function XJ(t){let e=t.getComponent();return e?.type==="VERSION"}var uN="@firebase/app",eG="0.13.2";var Xo=new jr("@firebase/app"),QJ="@firebase/app-compat",JJ="@firebase/analytics-compat",ZJ="@firebase/analytics",eZ="@firebase/app-check-compat",tZ="@firebase/app-check",nZ="@firebase/auth",rZ="@firebase/auth-compat",iZ="@firebase/database",oZ="@firebase/data-connect",sZ="@firebase/database-compat",aZ="@firebase/functions",cZ="@firebase/functions-compat",lZ="@firebase/installations",uZ="@firebase/installations-compat",dZ="@firebase/messaging",hZ="@firebase/messaging-compat",fZ="@firebase/performance",pZ="@firebase/performance-compat",gZ="@firebase/remote-config",mZ="@firebase/remote-config-compat",EZ="@firebase/storage",_Z="@firebase/storage-compat",TZ="@firebase/firestore",yZ="@firebase/ai",IZ="@firebase/firestore-compat",vZ="firebase",SZ="11.10.0";var dN="[DEFAULT]",AZ={[uN]:"fire-core",[QJ]:"fire-core-compat",[ZJ]:"fire-analytics",[JJ]:"fire-analytics-compat",[tZ]:"fire-app-check",[eZ]:"fire-app-check-compat",[nZ]:"fire-auth",[rZ]:"fire-auth-compat",[iZ]:"fire-rtdb",[oZ]:"fire-data-connect",[sZ]:"fire-rtdb-compat",[aZ]:"fire-fn",[cZ]:"fire-fn-compat",[lZ]:"fire-iid",[uZ]:"fire-iid-compat",[dZ]:"fire-fcm",[hZ]:"fire-fcm-compat",[fZ]:"fire-perf",[pZ]:"fire-perf-compat",[gZ]:"fire-rc",[mZ]:"fire-rc-compat",[EZ]:"fire-gcs",[_Z]:"fire-gcs-compat",[TZ]:"fire-fst",[IZ]:"fire-fst-compat",[yZ]:"fire-vertex","fire-js":"fire-js",[vZ]:"fire-js-all"};var Cp=new Map,CZ=new Map,hN=new Map;function tG(t,e){try{t.container.addComponent(e)}catch(n){Xo.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Kn(t){let e=t.name;if(hN.has(e))return Xo.debug(`There were multiple attempts to register component ${e}.`),!1;hN.set(e,t);for(let n of Cp.values())tG(n,t);for(let n of CZ.values())tG(n,t);return!0}function co(t,e){let n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function ir(t){return t==null?!1:t.settings!==void 0}var DZ={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Js=new hi("app","Firebase",DZ);var fN=class{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new en("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Js.create("app-deleted",{appName:this._name})}};var Zs=SZ;function mN(t,e={}){let n=t;typeof e!="object"&&(e={name:e});let r=Object.assign({name:dN,automaticDataCollectionEnabled:!0},e),i=r.name;if(typeof i!="string"||!i)throw Js.create("bad-app-name",{appName:String(i)});if(n||(n=eN()),!n)throw Js.create("no-options");let o=Cp.get(i);if(o){if(fi(n,o.options)&&fi(r,o.config))return o;throw Js.create("duplicate-app",{appName:i})}let s=new Ap(i);for(let c of hN.values())s.addComponent(c);let a=new fN(n,r,s);return Cp.set(i,a),a}function or(t=dN){let e=Cp.get(t);if(!e&&t===dN&&eN())return mN();if(!e)throw Js.create("no-app",{appName:t});return e}function ZT(){return Array.from(Cp.values())}function je(t,e,n){var r;let i=(r=AZ[t])!==null&&r!==void 0?r:t;n&&(i+=`-${n}`);let o=i.match(/\s|\//),s=e.match(/\s|\//);if(o||s){let a=[`Unable to register library "${i}" with version "${e}":`];o&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Xo.warn(a.join(" "));return}Kn(new en(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}function RZ(t){zB(t)}var NZ="firebase-heartbeat-database",bZ=1,Dp="firebase-heartbeat-store",cN=null;function oG(){return cN||(cN=ZB(NZ,bZ,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(Dp)}catch(n){console.warn(n)}}}}).catch(t=>{throw Js.create("idb-open",{originalErrorMessage:t.message})})),cN}function wZ(t){return y(this,null,function*(){try{let n=(yield oG()).transaction(Dp),r=yield n.objectStore(Dp).get(sG(t));return yield n.done,r}catch(e){if(e instanceof rr)Xo.warn(e.message);else{let n=Js.create("idb-get",{originalErrorMessage:e?.message});Xo.warn(n.message)}}})}function nG(t,e){return y(this,null,function*(){try{let r=(yield oG()).transaction(Dp,"readwrite");yield r.objectStore(Dp).put(e,sG(t)),yield r.done}catch(n){if(n instanceof rr)Xo.warn(n.message);else{let r=Js.create("idb-set",{originalErrorMessage:n?.message});Xo.warn(r.message)}}})}function sG(t){return`${t.name}!${t.options.appId}`}var OZ=1024,LZ=30,pN=class{constructor(e){this.container=e,this._heartbeatsCache=null;let n=this.container.getProvider("app").getImmediate();this._storage=new gN(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}triggerHeartbeat(){return y(this,null,function*(){var e,n;try{let i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=rG();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(s=>s.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats.length>LZ){let s=PZ(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Xo.warn(r)}})}getHeartbeatsHeader(){return y(this,null,function*(){var e;try{if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let n=rG(),{heartbeatsToSend:r,unsentEntries:i}=MZ(this._heartbeatsCache.heartbeats),o=_p(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return Xo.warn(n),""}})}};function rG(){return new Date().toISOString().substring(0,10)}function MZ(t,e=OZ){let n=[],r=t.slice();for(let i of t){let o=n.find(s=>s.agent===i.agent);if(o){if(o.dates.push(i.date),iG(n)>e){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),iG(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}var gN=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return y(this,null,function*(){return gd()?VB().then(()=>!0).catch(()=>!1):!1})}read(){return y(this,null,function*(){if(yield this._canUseIndexedDBPromise){let n=yield wZ(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return y(this,null,function*(){var n;if(yield this._canUseIndexedDBPromise){let i=yield this.read();return nG(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return y(this,null,function*(){var n;if(yield this._canUseIndexedDBPromise){let i=yield this.read();return nG(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return})}};function iG(t){return _p(JSON.stringify({version:2,heartbeats:t})).length}function PZ(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}function xZ(t){Kn(new en("platform-logger",e=>new lN(e),"PRIVATE")),Kn(new en("heartbeat",e=>new pN(e),"PRIVATE")),je(uN,eG,t),je(uN,eG,"esm2017"),je("fire-js","")}xZ("");var kZ="firebase",FZ="11.10.0";je(kZ,FZ,"app");function vPe(t){t||(t=Y(qn));let e=new he(n=>{if(t.destroyed){n.next();return}return t.onDestroy(n.next.bind(n))});return n=>n.pipe(Ds(e))}function SPe(t,e){let n=e?.injector??Y(Ke),r=new lc(1),i=WD(()=>{let o;try{o=t()}catch(s){Wf(()=>r.error(s));return}Wf(()=>r.next(o))},{injector:n,manualCleanup:!0});return n.get(qn).onDestroy(()=>{i.destroy(),r.complete()}),r.asObservable()}function APe(t,e){let r=!e?.manualCleanup?e?.injector?.get(qn)??Y(qn):null,i=UZ(e?.equal),o;e?.requireSync?o=bc({kind:0},{equal:i}):o=bc({kind:1,value:e?.initialValue},{equal:i});let s,a=t.subscribe({next:c=>o.set({kind:1,value:c}),error:c=>{o.set({kind:2,error:c}),s?.()},complete:()=>{s?.()}});if(e?.requireSync&&o().kind===0)throw new ee(601,!1);return s=r?.onDestroy(a.unsubscribe.bind(a)),zf(()=>{let c=o();switch(c.kind){case 1:return c.value;case 2:throw c.error;case 0:throw new ee(601,!1)}},{equal:e?.equal})}function UZ(t=Object.is){return(e,n)=>e.kind===1&&n.kind===1&&t(e.value,n.value)}function aG(t){t===void 0&&(t=Y(Ke));let e=t.get(Xi);return n=>new he(r=>{let i=e.add(),o=!1;function s(){o||(i(),o=!0)}let a=n.subscribe({next:c=>{r.next(c),s()},complete:()=>{r.complete(),s()},error:c=>{r.error(c),s()}});return a.add(()=>{r.unsubscribe(),s()}),a})}var pi=new pc("ANGULARFIRE2_VERSION");function ea(t,e,n){if(e){if(e.length===1)return e[0];let o=e.filter(s=>s.app===n);if(o.length===1)return o[0]}return n.container.getProvider(t).getImmediate({optional:!0})}var Qo=(t,e)=>{let n=e?[e]:ZT(),r=[];return n.forEach(i=>{i.container.getProvider(t).instances.forEach(s=>{r.includes(s)||r.push(s)})}),r},md=(function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t})(md||{}),cG=nR()&&typeof Zone<"u"?md.WARN:md.SILENT;var ey=class{zone;delegate;constructor(e,n=XS){this.zone=e,this.delegate=n}now(){return this.delegate.now()}schedule(e,n,r){let i=this.zone,o=function(s){i?i.runGuarded(()=>{e.apply(this,[s])}):e.apply(this,[s])};return this.delegate.schedule(o,n,r)}},gi=(()=>{class t{outsideAngular;insideAngular;constructor(){let n=Y(De);this.outsideAngular=n.runOutsideAngular(()=>new ey(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=n.run(()=>new ey(typeof Zone>"u"?void 0:Zone.current,bn))}static \u0275fac=function(r){return new(r||t)};static \u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),lG=!1;function VZ(t,e){!lG&&(cG>md.SILENT||nR())&&(lG=!0,console.warn("Calling Firebase APIs outside of an Injection context may destabilize your application leading to subtle change-detection and hydration bugs. Find more at https://github.com/angular/angularfire/blob/main/docs/zones.md")),cG>=e&&console.warn(`Firebase API called outside injection context: ${t.name}`)}function BZ(t){let e=Y(De,{optional:!0});return e?e.runOutsideAngular(()=>t()):t()}function Xc(t){let e=Y(De,{optional:!0});return e?e.run(()=>t()):t()}var GZ=(t,e,n)=>(...r)=>(e&&setTimeout(e,0),Hi(n,()=>Xc(()=>t.apply(void 0,r)))),fe=(t,e,n)=>(n||=e?md.WARN:md.VERBOSE,function(){let r,i=arguments,o,s,a;try{o=Y(gi),s=Y(Xi),a=Y(Mn)}catch{return VZ(t,n),t.apply(this,i)}for(let l=0;l<arguments.length;l++)typeof i[l]=="function"&&(e&&(r||=Xc(()=>s.add())),i[l]=GZ(i[l],r,a));let c=BZ(()=>t.apply(this,i));return e?c instanceof he?c.pipe(As(o.outsideAngular),Ss(o.insideAngular),aG(a)):c instanceof Promise?Xc(()=>{let l=s.add();return new Promise((d,h)=>{c.then(f=>Hi(a,()=>Xc(()=>d(f))),f=>Hi(a,()=>Xc(()=>h(f)))).finally(l)})}):typeof c=="function"&&r?function(){return setTimeout(r,0),c.apply(this,arguments)}:Xc(()=>c):c instanceof he?c.pipe(As(o.outsideAngular),Ss(o.insideAngular)):Xc(()=>c)});var mi=class{constructor(e){return e}},Jo=class{constructor(){return ZT()}};function jZ(t){return t&&t.length===1?t[0]:new mi(or())}var EN=new K("angularfire2._apps"),HZ={provide:mi,useFactory:jZ,deps:[[new Yt,EN]]},$Z={provide:Jo,deps:[[new Yt,EN]]};function WZ(t){return(e,n)=>{let r=n.get(Go);je("angularfire",pi.full,"core"),je("angularfire",pi.full,"app"),je("angular",cA.full,r.toString());let i=e.runOutsideAngular(()=>t(n));return new mi(i)}}function jPe(t,...e){return tr([HZ,$Z,{provide:EN,useFactory:WZ(t),multi:!0,deps:[De,Ke,gi,...e]}])}var HPe=fe(or,!0);var $Pe=fe(mN,!0);var zZ=new Map,qZ={activated:!1,tokenObservers:[]},KZ={initialized:!1,enabled:!1};function Ei(t){return zZ.get(t)||Object.assign({},qZ)}function fG(){return KZ}var YZ="https://content-firebaseappcheck.googleapis.com/v1";var XZ="exchangeDebugToken",uG={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},ZPe=1440*60*1e3;var yN=class{constructor(e,n,r,i,o){if(this.operation=e,this.retryPolicy=n,this.getWaitDuration=r,this.lowerBound=i,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=i,i>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(e){return y(this,null,function*(){this.stop();try{this.pending=new dn,this.pending.promise.catch(n=>{}),yield QZ(this.getNextRun(e)),this.pending.resolve(),yield this.pending.promise,this.pending=new dn,this.pending.promise.catch(n=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(n){this.retryPolicy(n)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let n=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),n}}};function QZ(t){return new Promise(e=>{setTimeout(e,t)})}var JZ={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},ta=new hi("appCheck","AppCheck",JZ);function pG(t){if(!Ei(t).activated)throw ta.create("use-before-activation",{appName:t.name})}function gG(r,i){return y(this,arguments,function*({url:t,body:e},n){let o={"Content-Type":"application/json"},s=n.getImmediate({optional:!0});if(s){let g=yield s.getHeartbeatsHeader();g&&(o["X-Firebase-Client"]=g)}let a={method:"POST",body:JSON.stringify(e),headers:o},c;try{c=yield fetch(t,a)}catch(g){throw ta.create("fetch-network-error",{originalErrorMessage:g?.message})}if(c.status!==200)throw ta.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(g){throw ta.create("fetch-parse-error",{originalErrorMessage:g?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw ta.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let h=Number(d[1])*1e3,f=Date.now();return{token:l.token,expireTimeMillis:f+h,issuedAtTimeMillis:f}})}function mG(t,e){let{projectId:n,appId:r,apiKey:i}=t.options;return{url:`${YZ}/projects/${n}/apps/${r}:${XZ}?key=${i}`,body:{debug_token:e}}}var ZZ="firebase-app-check-database",eee=1,IN="firebase-app-check-store";var ty=null;function tee(){return ty||(ty=new Promise((t,e)=>{try{let n=indexedDB.open(ZZ,eee);n.onsuccess=r=>{t(r.target.result)},n.onerror=r=>{var i;e(ta.create("storage-open",{originalErrorMessage:(i=r.target.error)===null||i===void 0?void 0:i.message}))},n.onupgradeneeded=r=>{let i=r.target.result;r.oldVersion===0&&i.createObjectStore(IN,{keyPath:"compositeKey"})}}catch(n){e(ta.create("storage-open",{originalErrorMessage:n?.message}))}}),ty)}function nee(t,e){return ree(iee(t),e)}function ree(t,e){return y(this,null,function*(){let r=(yield tee()).transaction(IN,"readwrite"),o=r.objectStore(IN).put({compositeKey:t,value:e});return new Promise((s,a)=>{o.onsuccess=c=>{s()},r.onerror=c=>{var l;a(ta.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function iee(t){return`${t.options.appId}-${t.name}`}var Rp=new jr("@firebase/app-check");function _N(t,e){return gd()?nee(t,e).catch(n=>{Rp.warn(`Failed to write token to IndexedDB. Error: ${n}`)}):Promise.resolve()}function EG(){return fG().enabled}function _G(){return y(this,null,function*(){let t=fG();if(t.enabled&&t.token)return t.token.promise;throw Error(`
|
|
139
|
+
Can't get debug token in production mode.
|
|
140
|
+
`)})}var oee={error:"UNKNOWN_ERROR"};function see(t){return fd.encodeString(JSON.stringify(t),!1)}function vN(t,e=!1,n=!1){return y(this,null,function*(){let r=t.app;pG(r);let i=Ei(r),o=i.token,s;if(o&&!Np(o)&&(i.token=void 0,o=void 0),!o){let l=yield i.cachedTokenPromise;l&&(Np(l)?o=l:yield _N(r,void 0))}if(!e&&o&&Np(o))return{token:o.token};let a=!1;if(EG())try{i.exchangeTokenPromise||(i.exchangeTokenPromise=gG(mG(r,yield _G()),t.heartbeatServiceProvider).finally(()=>{i.exchangeTokenPromise=void 0}),a=!0);let l=yield i.exchangeTokenPromise;return yield _N(r,l),i.token=l,{token:l.token}}catch(l){return l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?Rp.warn(l.message):n&&Rp.error(l),TN(l)}try{i.exchangeTokenPromise||(i.exchangeTokenPromise=i.provider.getToken().finally(()=>{i.exchangeTokenPromise=void 0}),a=!0),o=yield Ei(r).exchangeTokenPromise}catch(l){l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?Rp.warn(l.message):n&&Rp.error(l),s=l}let c;return o?s?Np(o)?c={token:o.token,internalError:s}:c=TN(s):(c={token:o.token},i.token=o,yield _N(r,o)):c=TN(s),a&&uee(r,c),c})}function aee(t){return y(this,null,function*(){let e=t.app;pG(e);let{provider:n}=Ei(e);if(EG()){let r=yield _G(),{token:i}=yield gG(mG(e,r),t.heartbeatServiceProvider);return{token:i}}else{let{token:r}=yield n.getToken();return{token:r}}})}function cee(t,e,n,r){let{app:i}=t,o=Ei(i),s={next:n,error:r,type:e};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&Np(o.token)){let a=o.token;Promise.resolve().then(()=>{n({token:a.token}),dG(t)}).catch(()=>{})}o.cachedTokenPromise.then(()=>dG(t))}function TG(t,e){let n=Ei(t),r=n.tokenObservers.filter(i=>i.next!==e);r.length===0&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=r}function dG(t){let{app:e}=t,n=Ei(e),r=n.tokenRefresher;r||(r=lee(t),n.tokenRefresher=r),!r.isRunning()&&n.isTokenAutoRefreshEnabled&&r.start()}function lee(t){let{app:e}=t;return new yN(()=>y(null,null,function*(){let n=Ei(e),r;if(n.token?r=yield vN(t,!0):r=yield vN(t),r.error)throw r.error;if(r.internalError)throw r.internalError}),()=>!0,()=>{let n=Ei(e);if(n.token){let r=n.token.issuedAtTimeMillis+(n.token.expireTimeMillis-n.token.issuedAtTimeMillis)*.5+3e5,i=n.token.expireTimeMillis-300*1e3;return r=Math.min(r,i),Math.max(0,r-Date.now())}else return 0},uG.RETRIAL_MIN_WAIT,uG.RETRIAL_MAX_WAIT)}function uee(t,e){let n=Ei(t).tokenObservers;for(let r of n)try{r.type==="EXTERNAL"&&e.error!=null?r.error(e.error):r.next(e)}catch{}}function Np(t){return t.expireTimeMillis-Date.now()>0}function TN(t){return{token:see(oee),error:t}}var SN=class{constructor(e,n){this.app=e,this.heartbeatServiceProvider=n}_delete(){let{tokenObservers:e}=Ei(this.app);for(let n of e)TG(this.app,n.next);return Promise.resolve()}};function dee(t,e){return new SN(t,e)}function hee(t){return{getToken:e=>vN(t,e),getLimitedUseToken:()=>aee(t),addTokenListener:e=>cee(t,"INTERNAL",e),removeTokenListener:e=>TG(t.app,e)}}var fee="@firebase/app-check",pee="0.10.1";var gee="app-check",hG="app-check-internal";function mee(){Kn(new en(gee,t=>{let e=t.getProvider("app").getImmediate(),n=t.getProvider("heartbeat");return dee(e,n)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,e,n)=>{t.getProvider(hG).initialize()})),Kn(new en(hG,t=>{let e=t.getProvider("app-check").getImmediate();return hee(e)},"PUBLIC").setInstantiationMode("EXPLICIT")),je(fee,pee)}mee();var Eee="app-check";var na=class{constructor(){return Qo(Eee)}};var _ee=["localhost","0.0.0.0","127.0.0.1"],hxe=typeof window<"u"&&_ee.includes(window.location.hostname);function wG(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}var OG=wG,LG=new hi("auth","Firebase",wG());var iy=new jr("@firebase/auth");function Tee(t,...e){iy.logLevel<=Ne.WARN&&iy.warn(`Auth (${Zs}): ${t}`,...e)}function ry(t,...e){iy.logLevel<=Ne.ERROR&&iy.error(`Auth (${Zs}): ${t}`,...e)}function oy(t,...e){throw UN(t,...e)}function FN(t,...e){return UN(t,...e)}function MG(t,e,n){let r=Object.assign(Object.assign({},OG()),{[e]:n});return new hi("auth","Firebase",r).create(e,{appName:t.name})}function bp(t){return MG(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function UN(t,...e){if(typeof t!="string"){let n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return LG.create(t,...e)}function He(t,e,...n){if(!t)throw UN(e,...n)}function wp(t){let e="INTERNAL ASSERTION FAILED: "+t;throw ry(e),new Error(e)}function sy(t,e){t||wp(e)}function yee(){return yG()==="http:"||yG()==="https:"}function yG(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}function Iee(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(yee()||FB()||"connection"in navigator)?navigator.onLine:!0}function vee(){if(typeof navigator>"u")return null;let t=navigator;return t.languages&&t.languages[0]||t.language||null}var Jc=class{constructor(e,n){this.shortDelay=e,this.longDelay=n,sy(n>e,"Short delay should be less than long delay!"),this.isMobile=Tp()||XT()}get(){return Iee()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};function See(t,e){sy(t.emulator,"Emulator should always be set here");let{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}var ay=class{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;wp("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;wp("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;wp("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};var Aee={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};var Cee=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Dee=new Jc(3e4,6e4);function VN(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}function Pp(o,s,a,c){return y(this,arguments,function*(t,e,n,r,i={}){return PG(t,i,()=>y(null,null,function*(){let l={},d={};r&&(e==="GET"?d=r:l={body:JSON.stringify(r)});let h=vp(Object.assign({key:t.config.apiKey},d)).slice(1),f=yield t._getAdditionalHeaders();f["Content-Type"]="application/json",t.languageCode&&(f["X-Firebase-Locale"]=t.languageCode);let g=Object.assign({method:e,headers:f},l);return kB()||(g.referrerPolicy="no-referrer"),t.emulatorConfig&&vr(t.emulatorConfig.host)&&(g.credentials="include"),ay.fetch()(yield xG(t,t.config.apiHost,n,h),g)}))})}function PG(t,e,n){return y(this,null,function*(){t._canInitEmulator=!1;let r=Object.assign(Object.assign({},Aee),e);try{let i=new DN(t),o=yield Promise.race([n(),i.promise]);i.clearNetworkTimeout();let s=yield o.json();if("needConfirmation"in s)throw ny(t,"account-exists-with-different-credential",s);if(o.ok&&!("errorMessage"in s))return s;{let a=o.ok?s.errorMessage:s.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw ny(t,"credential-already-in-use",s);if(c==="EMAIL_EXISTS")throw ny(t,"email-already-in-use",s);if(c==="USER_DISABLED")throw ny(t,"user-disabled",s);let d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw MG(t,d,l);oy(t,d)}}catch(i){if(i instanceof rr)throw i;oy(t,"network-request-failed",{message:String(i)})}})}function Ree(o,s,a,c){return y(this,arguments,function*(t,e,n,r,i={}){let l=yield Pp(t,e,n,r,i);return"mfaPendingCredential"in l&&oy(t,"multi-factor-auth-required",{_serverResponse:l}),l})}function xG(t,e,n,r){return y(this,null,function*(){let i=`${e}${n}?${r}`,o=t,s=o.config.emulator?See(t.config,i):`${t.config.apiScheme}://${i}`;return Cee.includes(n)&&(yield o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(s).toString():s})}var DN=class{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(FN(this.auth,"network-request-failed")),Dee.get())})}};function ny(t,e,n){let r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);let i=FN(t,e,r);return i.customData._tokenResponse=n,i}function Nee(t,e){return y(this,null,function*(){return Pp(t,"POST","/v1/accounts:delete",e)})}function cy(t,e){return y(this,null,function*(){return Pp(t,"POST","/v1/accounts:lookup",e)})}function Op(t){if(t)try{let e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function gy(t,e=!1){return y(this,null,function*(){let n=Me(t),r=yield n.getIdToken(e),i=kG(r);He(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");let o=typeof i.firebase=="object"?i.firebase:void 0,s=o?.sign_in_provider;return{claims:i,token:r,authTime:Op(AN(i.auth_time)),issuedAtTime:Op(AN(i.iat)),expirationTime:Op(AN(i.exp)),signInProvider:s||null,signInSecondFactor:o?.sign_in_second_factor||null}})}function AN(t){return Number(t)*1e3}function kG(t){let[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return ry("JWT malformed, contained fewer than 3 sections"),null;try{let i=dd(n);return i?JSON.parse(i):(ry("Failed to decode base64 JWT payload"),null)}catch(i){return ry("Caught error parsing JWT payload as JSON",i?.toString()),null}}function IG(t){let e=kG(t);return He(e,"internal-error"),He(typeof e.exp<"u","internal-error"),He(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}function RN(t,e,n=!1){return y(this,null,function*(){if(n)return e;try{return yield e}catch(r){throw r instanceof rr&&bee(r)&&t.auth.currentUser===t&&(yield t.auth.signOut()),r}})}function bee({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}var NN=class{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){let r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;let i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;let n=this.getInterval(e);this.timerId=setTimeout(()=>y(this,null,function*(){yield this.iteration()}),n)}iteration(){return y(this,null,function*(){try{yield this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()})}};var Mp=class{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Op(this.lastLoginAt),this.creationTime=Op(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};function ly(t){return y(this,null,function*(){var e;let n=t.auth,r=yield t.getIdToken(),i=yield RN(t,cy(n,{idToken:r}));He(i?.users.length,n,"internal-error");let o=i.users[0];t._notifyReloadListener(o);let s=!((e=o.providerUserInfo)===null||e===void 0)&&e.length?FG(o.providerUserInfo):[],a=wee(t.providerData,s),c=t.isAnonymous,l=!(t.email&&o.passwordHash)&&!a?.length,d=c?l:!1,h={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:a,metadata:new Mp(o.createdAt,o.lastLoginAt),isAnonymous:d};Object.assign(t,h)})}function BN(t){return y(this,null,function*(){let e=Me(t);yield ly(e),yield e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)})}function wee(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function FG(t){return t.map(e=>{var{providerId:n}=e,r=wS(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}function Oee(t,e){return y(this,null,function*(){let n=yield PG(t,{},()=>y(null,null,function*(){let r=vp({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:o}=t.config,s=yield xG(t,i,"/v1/token",`key=${o}`),a=yield t._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";let c={method:"POST",headers:a,body:r};return t.emulatorConfig&&vr(t.emulatorConfig.host)&&(c.credentials="include"),ay.fetch()(s,c)}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}})}function Lee(t,e){return y(this,null,function*(){return Pp(t,"POST","/v2/accounts:revokeToken",VN(t,e))})}var Lp=class t{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){He(e.idToken,"internal-error"),He(typeof e.idToken<"u","internal-error"),He(typeof e.refreshToken<"u","internal-error");let n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):IG(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){He(e.length!==0,"internal-error");let n=IG(e);this.updateTokensAndExpiration(e,null,n)}getToken(e,n=!1){return y(this,null,function*(){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(He(this.refreshToken,e,"user-token-expired"),this.refreshToken?(yield this.refresh(e,this.refreshToken),this.accessToken):null)})}clearRefreshToken(){this.refreshToken=null}refresh(e,n){return y(this,null,function*(){let{accessToken:r,refreshToken:i,expiresIn:o}=yield Oee(e,n);this.updateTokensAndExpiration(r,i,Number(o))})}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){let{refreshToken:r,accessToken:i,expirationTime:o}=n,s=new t;return r&&(He(typeof r=="string","internal-error",{appName:e}),s.refreshToken=r),i&&(He(typeof i=="string","internal-error",{appName:e}),s.accessToken=i),o&&(He(typeof o=="number","internal-error",{appName:e}),s.expirationTime=o),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new t,this.toJSON())}_performRefresh(){return wp("not implemented")}};function ra(t,e){He(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}var ia=class t{constructor(e){var{uid:n,auth:r,stsTokenManager:i}=e,o=wS(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new NN(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new Mp(o.createdAt||void 0,o.lastLoginAt||void 0)}getIdToken(e){return y(this,null,function*(){let n=yield RN(this,this.stsTokenManager.getToken(this.auth,e));return He(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,yield this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n})}getIdTokenResult(e){return gy(this,e)}reload(){return BN(this)}_assign(e){this!==e&&(He(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let n=new t(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){He(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}_updateTokensIfNecessary(e,n=!1){return y(this,null,function*(){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&(yield ly(this)),yield this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)})}delete(){return y(this,null,function*(){if(ir(this.auth.app))return Promise.reject(bp(this.auth));let e=yield this.getIdToken();return yield RN(this,Nee(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()})}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var r,i,o,s,a,c,l,d;let h=(r=n.displayName)!==null&&r!==void 0?r:void 0,f=(i=n.email)!==null&&i!==void 0?i:void 0,g=(o=n.phoneNumber)!==null&&o!==void 0?o:void 0,E=(s=n.photoURL)!==null&&s!==void 0?s:void 0,I=(a=n.tenantId)!==null&&a!==void 0?a:void 0,S=(c=n._redirectEventId)!==null&&c!==void 0?c:void 0,R=(l=n.createdAt)!==null&&l!==void 0?l:void 0,U=(d=n.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:H,emailVerified:Q,isAnonymous:ae,providerData:ne,stsTokenManager:A}=n;He(H&&A,e,"internal-error");let v=Lp.fromJSON(this.name,A);He(typeof H=="string",e,"internal-error"),ra(h,e.name),ra(f,e.name),He(typeof Q=="boolean",e,"internal-error"),He(typeof ae=="boolean",e,"internal-error"),ra(g,e.name),ra(E,e.name),ra(I,e.name),ra(S,e.name),ra(R,e.name),ra(U,e.name);let C=new t({uid:H,auth:e,email:f,emailVerified:Q,displayName:h,isAnonymous:ae,photoURL:E,phoneNumber:g,tenantId:I,stsTokenManager:v,createdAt:R,lastLoginAt:U});return ne&&Array.isArray(ne)&&(C.providerData=ne.map(w=>Object.assign({},w))),S&&(C._redirectEventId=S),C}static _fromIdTokenResponse(e,n,r=!1){return y(this,null,function*(){let i=new Lp;i.updateFromServerResponse(n);let o=new t({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return yield ly(o),o})}static _fromGetAccountInfoResponse(e,n,r){return y(this,null,function*(){let i=n.users[0];He(i.localId!==void 0,"internal-error");let o=i.providerUserInfo!==void 0?FG(i.providerUserInfo):[],s=!(i.email&&i.passwordHash)&&!o?.length,a=new Lp;a.updateFromIdToken(r);let c=new t({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:s}),l={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new Mp(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!o?.length};return Object.assign(c,l),c})}};var vG=new Map;function Qc(t){sy(t instanceof Function,"Expected a class definition");let e=vG.get(t);return e?(sy(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,vG.set(t,e),e)}var Mee=(()=>{class t{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return y(this,null,function*(){return!0})}_set(n,r){return y(this,null,function*(){this.storage[n]=r})}_get(n){return y(this,null,function*(){let r=this.storage[n];return r===void 0?null:r})}_remove(n){return y(this,null,function*(){delete this.storage[n]})}_addListener(n,r){}_removeListener(n,r){}}return t.type="NONE",t})(),bN=Mee;function CN(t,e,n){return`firebase:${t}:${e}:${n}`}var uy=class t{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;let{config:i,name:o}=this.auth;this.fullUserKey=CN(this.userKey,i.apiKey,o),this.fullPersistenceKey=CN("persistence",i.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}getCurrentUser(){return y(this,null,function*(){let e=yield this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){let n=yield cy(this.auth,{idToken:e}).catch(()=>{});return n?ia._fromGetAccountInfoResponse(this.auth,n,e):null}return ia._fromJSON(this.auth,e)})}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(e){return y(this,null,function*(){if(this.persistence===e)return;let n=yield this.getCurrentUser();if(yield this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)})}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(e,n,r="authUser"){return y(this,null,function*(){if(!n.length)return new t(Qc(bN),e,r);let i=(yield Promise.all(n.map(l=>y(null,null,function*(){if(yield l._isAvailable())return l})))).filter(l=>l),o=i[0]||Qc(bN),s=CN(r,e.config.apiKey,e.name),a=null;for(let l of n)try{let d=yield l._get(s);if(d){let h;if(typeof d=="string"){let f=yield cy(e,{idToken:d}).catch(()=>{});if(!f)break;h=yield ia._fromGetAccountInfoResponse(e,f,d)}else h=ia._fromJSON(e,d);l!==o&&(a=h),o=l;break}}catch{}let c=i.filter(l=>l._shouldAllowMigration);return!o._shouldAllowMigration||!c.length?new t(o,e,r):(o=c[0],a&&(yield o._set(s,a.toJSON())),yield Promise.all(n.map(l=>y(null,null,function*(){if(l!==o)try{yield l._remove(s)}catch{}}))),new t(o,e,r))})}};function SG(t){let e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(UG(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Pee(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(BG(e))return"Blackberry";if(GG(e))return"Webos";if(xee(e))return"Safari";if((e.includes("chrome/")||kee(e))&&!e.includes("edge/"))return"Chrome";if(VG(e))return"Android";{let n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if(r?.length===2)return r[1]}return"Other"}function Pee(t=Zt()){return/firefox\//i.test(t)}function xee(t=Zt()){let e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function kee(t=Zt()){return/crios\//i.test(t)}function UG(t=Zt()){return/iemobile/i.test(t)}function VG(t=Zt()){return/android/i.test(t)}function BG(t=Zt()){return/blackberry/i.test(t)}function GG(t=Zt()){return/webos/i.test(t)}function Fee(t=Zt()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Uee(){return UB()&&document.documentMode===10}function Vee(t=Zt()){return Fee(t)||VG(t)||GG(t)||BG(t)||/windows phone/i.test(t)||UG(t)}function jG(t,e=[]){let n;switch(t){case"Browser":n=SG(Zt());break;case"Worker":n=`${SG(Zt())}-${t}`;break;default:n=t}let r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Zs}/${r}`}var wN=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){let r=o=>new Promise((s,a)=>{try{let c=e(o);s(c)}catch(c){a(c)}});r.onAbort=n,this.queue.push(r);let i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}runMiddleware(e){return y(this,null,function*(){if(this.auth.currentUser===e)return;let n=[];try{for(let r of this.queue)yield r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(let i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}})}};function Bee(n){return y(this,arguments,function*(t,e={}){return Pp(t,"GET","/v2/passwordPolicy",VN(t,e))})}var Gee=6,ON=class{constructor(e){var n,r,i,o;let s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=s.minPasswordLength)!==null&&n!==void 0?n:Gee,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),s.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),s.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),s.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),s.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(o=e.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,i,o,s,a;let c={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,c),this.validatePasswordCharacterOptions(e,c),c.isValid&&(c.isValid=(n=c.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),c.isValid&&(c.isValid=(r=c.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),c.isValid&&(c.isValid=(i=c.containsLowercaseLetter)!==null&&i!==void 0?i:!0),c.isValid&&(c.isValid=(o=c.containsUppercaseLetter)!==null&&o!==void 0?o:!0),c.isValid&&(c.isValid=(s=c.containsNumericCharacter)!==null&&s!==void 0?s:!0),c.isValid&&(c.isValid=(a=c.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),c}validatePasswordLengthOptions(e,n){let r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}};var LN=class{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new dy(this),this.idTokenSubscription=new dy(this),this.beforeStateQueue=new wN(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=LG,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Qc(n)),this._initializationPromise=this.queue(()=>y(this,null,function*(){var r,i,o;if(!this._deleted&&(this.persistenceManager=yield uy.create(this,e),(r=this._resolvePersistenceManagerAvailable)===null||r===void 0||r.call(this),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{yield this._popupRedirectResolver._initialize(this)}catch{}yield this.initializeCurrentUser(n),this.lastNotifiedUid=((o=this.currentUser)===null||o===void 0?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){return y(this,null,function*(){if(this._deleted)return;let e=yield this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),yield this.currentUser.getIdToken();return}yield this._updateCurrentUser(e,!0)}})}initializeCurrentUserFromIdToken(e){return y(this,null,function*(){try{let n=yield cy(this,{idToken:e}),r=yield ia._fromGetAccountInfoResponse(this,n,e);yield this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),yield this.directlySetCurrentUser(null)}})}initializeCurrentUser(e){return y(this,null,function*(){var n;if(ir(this.app)){let s=this.app.settings.authIdToken;return s?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(a,a))}):this.directlySetCurrentUser(null)}let r=yield this.assertedPersistence.getCurrentUser(),i=r,o=!1;if(e&&this.config.authDomain){yield this.getOrInitRedirectPersistenceManager();let s=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i?._redirectEventId,c=yield this.tryRedirectSignIn(e);(!s||s===a)&&c?.user&&(i=c.user,o=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(o)try{yield this.beforeStateQueue.runMiddleware(i)}catch(s){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return He(this._popupRedirectResolver,this,"argument-error"),yield this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)})}tryRedirectSignIn(e){return y(this,null,function*(){let n=null;try{n=yield this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{yield this._setRedirectUser(null)}return n})}reloadAndSetCurrentUserOrClear(e){return y(this,null,function*(){try{yield ly(e)}catch(n){if(n?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)})}useDeviceLanguage(){this.languageCode=vee()}_delete(){return y(this,null,function*(){this._deleted=!0})}updateCurrentUser(e){return y(this,null,function*(){if(ir(this.app))return Promise.reject(bp(this));let n=e?Me(e):null;return n&&He(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))})}_updateCurrentUser(e,n=!1){return y(this,null,function*(){if(!this._deleted)return e&&He(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||(yield this.beforeStateQueue.runMiddleware(e)),this.queue(()=>y(this,null,function*(){yield this.directlySetCurrentUser(e),this.notifyAuthListeners()}))})}signOut(){return y(this,null,function*(){return ir(this.app)?Promise.reject(bp(this)):(yield this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&(yield this._setRedirectUser(null)),this._updateCurrentUser(null,!0))})}setPersistence(e){return ir(this.app)?Promise.reject(bp(this)):this.queue(()=>y(this,null,function*(){yield this.assertedPersistence.setPersistence(Qc(e))}))}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(e){return y(this,null,function*(){this._getPasswordPolicyInternal()||(yield this._updatePasswordPolicy());let n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)})}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){return y(this,null,function*(){let e=yield Bee(this),n=new ON(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n})}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new hi("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},n)}})}revokeAccessToken(e){return y(this,null,function*(){if(this.currentUser){let n=yield this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),yield Lee(this,r)}})}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}_setRedirectUser(e,n){return y(this,null,function*(){let r=yield this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)})}getOrInitRedirectPersistenceManager(e){return y(this,null,function*(){if(!this.redirectPersistenceManager){let n=e&&Qc(e)||this._popupRedirectResolver;He(n,this,"argument-error"),this.redirectPersistenceManager=yield uy.create(this,[Qc(n._redirectPersistence)],"redirectUser"),this.redirectUser=yield this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager})}_redirectUserForId(e){return y(this,null,function*(){var n,r;return this._isInitialized&&(yield this.queue(()=>y(this,null,function*(){}))),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null})}_persistUserIfCurrent(e){return y(this,null,function*(){if(e===this.currentUser)return this.queue(()=>y(this,null,function*(){return this.directlySetCurrentUser(e)}))})}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};let o=typeof n=="function"?n:n.next.bind(n),s=!1,a=this._isInitialized?Promise.resolve():this._initializationPromise;if(He(a,this,"internal-error"),a.then(()=>{s||o(this.currentUser)}),typeof n=="function"){let c=e.addObserver(n,r,i);return()=>{s=!0,c()}}else{let c=e.addObserver(n);return()=>{s=!0,c()}}}directlySetCurrentUser(e){return y(this,null,function*(){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?yield this.assertedPersistence.setCurrentUser(e):yield this.assertedPersistence.removeCurrentUser()})}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return He(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=jG(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){return y(this,null,function*(){var e;let n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);let r=yield(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader();r&&(n["X-Firebase-Client"]=r);let i=yield this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n})}_getAppCheckToken(){return y(this,null,function*(){var e;if(ir(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let n=yield(e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken();return n?.error&&Tee(`Error while retrieving App Check token: ${n.error}`),n?.token})}};function HG(t){return Me(t)}var dy=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=HB(n=>this.observer=n)}get next(){return He(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};var jee={loadJS(){return y(this,null,function*(){throw new Error("Unable to load external scripts")})},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Hee(t){jee=t}function $ee(t){return`__${t}${Math.floor(Math.random()*1e6)}`}function GN(t,e){let n=co(t,"auth");if(n.isInitialized()){let i=n.getImmediate(),o=n.getOptions();if(fi(o,e??{}))return i;oy(i,"already-initialized")}return n.initialize({options:e})}function Wee(t,e){let n=e?.persistence||[],r=(Array.isArray(n)?n:[n]).map(Qc);e?.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e?.popupRedirectResolver)}var MN=class t{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static _fromIdTokenResponse(e,n,r,i=!1){return y(this,null,function*(){let o=yield ia._fromIdTokenResponse(e,r,i),s=AG(r);return new t({user:o,providerId:s,_tokenResponse:r,operationType:n})})}static _forOperation(e,n,r){return y(this,null,function*(){yield e._updateTokensIfNecessary(r,!0);let i=AG(r);return new t({user:e,providerId:i,_tokenResponse:r,operationType:n})})}};function AG(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}function zee(t,e){return y(this,null,function*(){return Ree(t,"POST","/v1/accounts:signInWithCustomToken",VN(t,e))})}function jN(t,e){return y(this,null,function*(){if(ir(t.app))return Promise.reject(bp(t));let n=HG(t),r=yield zee(n,{token:e,returnSecureToken:!0}),i=yield MN._fromIdTokenResponse(n,"signIn",r);return yield n._updateCurrentUser(i.user),i})}function my(t,e,n,r){return Me(t).onAuthStateChanged(e,n,r)}function HN(t){return Me(t).signOut()}var hy="__sak";var fy=class{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(hy,"1"),this.storage.removeItem(hy),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){let n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}};var qee=1e3,Kee=10,Yee=(()=>{class t extends fy{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(n,r)=>this.onStorageEvent(n,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Vee(),this._shouldAllowMigration=!0}forAllChangedKeys(n){for(let r of Object.keys(this.listeners)){let i=this.storage.getItem(r),o=this.localCache[r];i!==o&&n(r,o,i)}}onStorageEvent(n,r=!1){if(!n.key){this.forAllChangedKeys((a,c,l)=>{this.notifyListeners(a,l)});return}let i=n.key;r?this.detachListener():this.stopPolling();let o=()=>{let a=this.storage.getItem(i);!r&&this.localCache[i]===a||this.notifyListeners(i,a)},s=this.storage.getItem(i);Uee()&&s!==n.newValue&&n.newValue!==n.oldValue?setTimeout(o,Kee):o()}notifyListeners(n,r){this.localCache[n]=r;let i=this.listeners[n];if(i)for(let o of Array.from(i))o(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((n,r,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:n,oldValue:r,newValue:i}),!0)})},qee)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(n,r){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[n]||(this.listeners[n]=new Set,this.localCache[n]=this.storage.getItem(n)),this.listeners[n].add(r)}_removeListener(n,r){this.listeners[n]&&(this.listeners[n].delete(r),this.listeners[n].size===0&&delete this.listeners[n]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}_set(n,r){return y(this,null,function*(){yield ec(t.prototype,this,"_set").call(this,n,r),this.localCache[n]=JSON.stringify(r)})}_get(n){return y(this,null,function*(){let r=yield ec(t.prototype,this,"_get").call(this,n);return this.localCache[n]=JSON.stringify(r),r})}_remove(n){return y(this,null,function*(){yield ec(t.prototype,this,"_remove").call(this,n),delete this.localCache[n]})}}return t.type="LOCAL",t})(),Xee=Yee;var Qee=(()=>{class t extends fy{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(n,r){}_removeListener(n,r){}}return t.type="SESSION",t})(),Jee=Qee;function Zee(t){return Promise.all(t.map(e=>y(null,null,function*(){try{return{fulfilled:!0,value:yield e}}catch(n){return{fulfilled:!1,reason:n}}})))}var ete=(()=>{class t{constructor(n){this.eventTarget=n,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(n){let r=this.receivers.find(o=>o.isListeningto(n));if(r)return r;let i=new t(n);return this.receivers.push(i),i}isListeningto(n){return this.eventTarget===n}handleEvent(n){return y(this,null,function*(){let r=n,{eventId:i,eventType:o,data:s}=r.data,a=this.handlersMap[o];if(!a?.size)return;r.ports[0].postMessage({status:"ack",eventId:i,eventType:o});let c=Array.from(a).map(d=>y(this,null,function*(){return d(r.origin,s)})),l=yield Zee(c);r.ports[0].postMessage({status:"done",eventId:i,eventType:o,response:l})})}_subscribe(n,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[n]||(this.handlersMap[n]=new Set),this.handlersMap[n].add(r)}_unsubscribe(n,r){this.handlersMap[n]&&r&&this.handlersMap[n].delete(r),(!r||this.handlersMap[n].size===0)&&delete this.handlersMap[n],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}t.receivers=[];return t})();function tte(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}var PN=class{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}_send(e,n,r=50){return y(this,null,function*(){let i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let o,s;return new Promise((a,c)=>{let l=tte("",20);i.port1.start();let d=setTimeout(()=>{c(new Error("unsupported_event"))},r);s={messageChannel:i,onMessage(h){let f=h;if(f.data.eventId===l)switch(f.data.status){case"ack":clearTimeout(d),o=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(f.data.response);break;default:clearTimeout(d),clearTimeout(o),c(new Error("invalid_response"));break}}},this.handlers.add(s),i.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:l,data:n},[i.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})})}};function CG(){return window}function $G(){return typeof CG().WorkerGlobalScope<"u"&&typeof CG().importScripts=="function"}function nte(){return y(this,null,function*(){if(!navigator?.serviceWorker)return null;try{return(yield navigator.serviceWorker.ready).active}catch{return null}})}function rte(){var t;return((t=navigator?.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function ite(){return $G()?self:null}var WG="firebaseLocalStorageDb",ote=1,py="firebaseLocalStorage",zG="fbase_key",Zc=class{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}};function Ey(t,e){return t.transaction([py],e?"readwrite":"readonly").objectStore(py)}function ste(){let t=indexedDB.deleteDatabase(WG);return new Zc(t).toPromise()}function xN(){let t=indexedDB.open(WG,ote);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{let r=t.result;try{r.createObjectStore(py,{keyPath:zG})}catch(i){n(i)}}),t.addEventListener("success",()=>y(null,null,function*(){let r=t.result;r.objectStoreNames.contains(py)?e(r):(r.close(),yield ste(),e(yield xN()))}))})}function DG(t,e,n){return y(this,null,function*(){let r=Ey(t,!0).put({[zG]:e,value:n});return new Zc(r).toPromise()})}function ate(t,e){return y(this,null,function*(){let n=Ey(t,!1).get(e),r=yield new Zc(n).toPromise();return r===void 0?null:r.value})}function RG(t,e){let n=Ey(t,!0).delete(e);return new Zc(n).toPromise()}var cte=800,lte=3,ute=(()=>{class t{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}_openDb(){return y(this,null,function*(){return this.db?this.db:(this.db=yield xN(),this.db)})}_withRetries(n){return y(this,null,function*(){let r=0;for(;;)try{let i=yield this._openDb();return yield n(i)}catch(i){if(r++>lte)throw i;this.db&&(this.db.close(),this.db=void 0)}})}initializeServiceWorkerMessaging(){return y(this,null,function*(){return $G()?this.initializeReceiver():this.initializeSender()})}initializeReceiver(){return y(this,null,function*(){this.receiver=ete._getInstance(ite()),this.receiver._subscribe("keyChanged",(n,r)=>y(this,null,function*(){return{keyProcessed:(yield this._poll()).includes(r.key)}})),this.receiver._subscribe("ping",(n,r)=>y(this,null,function*(){return["keyChanged"]}))})}initializeSender(){return y(this,null,function*(){var n,r;if(this.activeServiceWorker=yield nte(),!this.activeServiceWorker)return;this.sender=new PN(this.activeServiceWorker);let i=yield this.sender._send("ping",{},800);i&&!((n=i[0])===null||n===void 0)&&n.fulfilled&&!((r=i[0])===null||r===void 0)&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)})}notifyServiceWorker(n){return y(this,null,function*(){if(!(!this.sender||!this.activeServiceWorker||rte()!==this.activeServiceWorker))try{yield this.sender._send("keyChanged",{key:n},this.serviceWorkerReceiverAvailable?800:50)}catch{}})}_isAvailable(){return y(this,null,function*(){try{if(!indexedDB)return!1;let n=yield xN();return yield DG(n,hy,"1"),yield RG(n,hy),!0}catch{}return!1})}_withPendingWrite(n){return y(this,null,function*(){this.pendingWrites++;try{yield n()}finally{this.pendingWrites--}})}_set(n,r){return y(this,null,function*(){return this._withPendingWrite(()=>y(this,null,function*(){return yield this._withRetries(i=>DG(i,n,r)),this.localCache[n]=r,this.notifyServiceWorker(n)}))})}_get(n){return y(this,null,function*(){let r=yield this._withRetries(i=>ate(i,n));return this.localCache[n]=r,r})}_remove(n){return y(this,null,function*(){return this._withPendingWrite(()=>y(this,null,function*(){return yield this._withRetries(r=>RG(r,n)),delete this.localCache[n],this.notifyServiceWorker(n)}))})}_poll(){return y(this,null,function*(){let n=yield this._withRetries(o=>{let s=Ey(o,!1).getAll();return new Zc(s).toPromise()});if(!n)return[];if(this.pendingWrites!==0)return[];let r=[],i=new Set;if(n.length!==0)for(let{fbase_key:o,value:s}of n)i.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(s)&&(this.notifyListeners(o,s),r.push(o));for(let o of Object.keys(this.localCache))this.localCache[o]&&!i.has(o)&&(this.notifyListeners(o,null),r.push(o));return r})}notifyListeners(n,r){this.localCache[n]=r;let i=this.listeners[n];if(i)for(let o of Array.from(i))o(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>y(this,null,function*(){return this._poll()}),cte)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(n,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[n]||(this.listeners[n]=new Set,this._get(n)),this.listeners[n].add(r)}_removeListener(n,r){this.listeners[n]&&(this.listeners[n].delete(r),this.listeners[n].size===0&&delete this.listeners[n]),Object.keys(this.listeners).length===0&&this.stopPolling()}}return t.type="LOCAL",t})(),dte=ute;var vxe=$ee("rcb"),Sxe=new Jc(3e4,6e4);var Axe=new Jc(2e3,1e4);var Cxe=600*1e3;var Dxe=new Jc(3e4,6e4);var Rxe=new Jc(5e3,15e3);var Nxe=encodeURIComponent("fac");var NG="@firebase/auth",bG="1.10.8";var kN=class{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}getToken(e){return y(this,null,function*(){return this.assertAuthConfigured(),yield this.auth._initializationPromise,this.auth.currentUser?{accessToken:yield this.auth.currentUser.getIdToken(e)}:null})}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let n=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){He(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};function hte(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function fte(t){Kn(new en("auth",(e,{options:n})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:s,authDomain:a}=r.options;He(s&&!s.includes(":"),"invalid-api-key",{appName:r.name});let c={apiKey:s,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:jG(t)},l=new LN(r,i,o,c);return Wee(l,n),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Kn(new en("auth-internal",e=>{let n=HG(e.getProvider("auth").getImmediate());return(r=>new kN(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),je(NG,bG,hte(t)),je(NG,bG,"esm2017")}var pte=300,bxe=PB("authIdTokenMaxAge")||pte;function gte(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}Hee({loadJS(t){return new Promise((e,n)=>{let r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{let o=FN("internal-error");o.customData=i,n(o)},r.type="text/javascript",r.charset="UTF-8",gte().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});fte("Browser");function YG(t){return new he(function(e){var n=my(t,e.next.bind(e),e.error.bind(e),e.complete.bind(e));return{unsubscribe:n}})}var XG="auth",el=class{constructor(e){return e}},tl=class{constructor(){return Qo(XG)}};var $N=new K("angularfire2.auth-instances");function ane(t,e){let n=ea(XG,t,e);return n&&new el(n)}function cne(t){return(e,n)=>{let r=e.runOutsideAngular(()=>t(n));return new el(r)}}var lne={provide:tl,deps:[[new Yt,$N]]},une={provide:el,useFactory:ane,deps:[[new Yt,$N],mi]};function Dke(t,...e){return je("angularfire",pi.full,"auth"),tr([une,lne,{provide:$N,useFactory:cne(t),multi:!0,deps:[De,Ke,gi,Jo,[new Yt,na],...e]}])}var Ed=fe(YG,!0);var xp=fe(gy,!0);var Rke=fe(GN,!0);var QG=fe(jN,!0,2);var JG=fe(HN,!0,2);var hne="type.googleapis.com/google.protobuf.Int64Value",fne="type.googleapis.com/google.protobuf.UInt64Value";function n2(t,e){let n={};for(let r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}function _y(t){if(t==null)return null;if(t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&isFinite(t)||t===!0||t===!1||Object.prototype.toString.call(t)==="[object String]")return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map(e=>_y(e));if(typeof t=="function"||typeof t=="object")return n2(t,e=>_y(e));throw new Error("Data cannot be encoded in JSON: "+t)}function _d(t){if(t==null)return t;if(t["@type"])switch(t["@type"]){case hne:case fne:{let e=Number(t.value);if(isNaN(e))throw new Error("Data cannot be decoded from JSON: "+t);return e}default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map(e=>_d(e)):typeof t=="function"||typeof t=="object"?n2(t,e=>_d(e)):t}var KN="functions";var ZG={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},sr=class t extends rr{constructor(e,n,r){super(`${KN}/${e}`,n||""),this.details=r,Object.setPrototypeOf(this,t.prototype)}};function pne(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}function Ty(t,e){let n=pne(t),r=n,i;try{let o=e&&e.error;if(o){let s=o.status;if(typeof s=="string"){if(!ZG[s])return new sr("internal","internal");n=ZG[s],r=s}let a=o.message;typeof a=="string"&&(r=a),i=o.details,i!==void 0&&(i=_d(i))}}catch{}return n==="ok"?null:new sr(n,r,i)}var WN=class{constructor(e,n,r,i){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,ir(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=n.getImmediate({optional:!0}),this.messaging=r.getImmediate({optional:!0}),this.auth||n.get().then(o=>this.auth=o,()=>{}),this.messaging||r.get().then(o=>this.messaging=o,()=>{}),this.appCheck||i?.get().then(o=>this.appCheck=o,()=>{})}getAuthToken(){return y(this,null,function*(){if(this.auth)try{let e=yield this.auth.getToken();return e?.accessToken}catch{return}})}getMessagingToken(){return y(this,null,function*(){if(!(!this.messaging||!("Notification"in self)||Notification.permission!=="granted"))try{return yield this.messaging.getToken()}catch{return}})}getAppCheckToken(e){return y(this,null,function*(){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){let n=e?yield this.appCheck.getLimitedUseToken():yield this.appCheck.getToken();return n.error?null:n.token}return null})}getContext(e){return y(this,null,function*(){let n=yield this.getAuthToken(),r=yield this.getMessagingToken(),i=yield this.getAppCheckToken(e);return{authToken:n,messagingToken:r,appCheckToken:i}})}};var zN="us-central1",gne=/^data: (.*?)(?:\n|$)/;function mne(t){let e=null;return{promise:new Promise((n,r)=>{e=setTimeout(()=>{r(new sr("deadline-exceeded","deadline-exceeded"))},t)}),cancel:()=>{e&&clearTimeout(e)}}}var qN=class{constructor(e,n,r,i,o=zN,s=(...a)=>fetch(...a)){this.app=e,this.fetchImpl=s,this.emulatorOrigin=null,this.contextProvider=new WN(e,n,r,i),this.cancelAllRequests=new Promise(a=>{this.deleteService=()=>Promise.resolve(a())});try{let a=new URL(o);this.customDomain=a.origin+(a.pathname==="/"?"":a.pathname),this.region=zN}catch{this.customDomain=null,this.region=o}}_delete(){return this.deleteService()}_url(e){let n=this.app.options.projectId;return this.emulatorOrigin!==null?`${this.emulatorOrigin}/${n}/${this.region}/${e}`:this.customDomain!==null?`${this.customDomain}/${e}`:`https://${this.region}-${n}.cloudfunctions.net/${e}`}};function Ene(t,e,n){let r=vr(e);t.emulatorOrigin=`http${r?"s":""}://${e}:${n}`,r&&(Ys(t.emulatorOrigin),Kc("Functions",!0))}function _ne(t,e,n){let r=i=>yne(t,e,i,n||{});return r.stream=(i,o)=>Ine(t,e,i,o||{}),r}function Tne(t,e,n,r){return y(this,null,function*(){n["Content-Type"]="application/json";let i;try{i=yield r(t,{method:"POST",body:JSON.stringify(e),headers:n})}catch{return{status:0,json:null}}let o=null;try{o=yield i.json()}catch{}return{status:i.status,json:o}})}function r2(t,e){return y(this,null,function*(){let n={},r=yield t.contextProvider.getContext(e.limitedUseAppCheckTokens);return r.authToken&&(n.Authorization="Bearer "+r.authToken),r.messagingToken&&(n["Firebase-Instance-ID-Token"]=r.messagingToken),r.appCheckToken!==null&&(n["X-Firebase-AppCheck"]=r.appCheckToken),n})}function yne(t,e,n,r){return y(this,null,function*(){n=_y(n);let i={data:n},o=yield r2(t,r),s=r.timeout||7e4,a=mne(s),c=yield Promise.race([Tne(e,i,o,t.fetchImpl),a.promise,t.cancelAllRequests]);if(a.cancel(),!c)throw new sr("cancelled","Firebase Functions instance was deleted.");let l=Ty(c.status,c.json);if(l)throw l;if(!c.json)throw new sr("internal","Response is not valid JSON object.");let d=c.json.data;if(typeof d>"u"&&(d=c.json.result),typeof d>"u")throw new sr("internal","Response is missing data field.");return{data:_d(d)}})}function Ine(t,e,n,r){return y(this,null,function*(){var i;n=_y(n);let o={data:n},s=yield r2(t,r);s["Content-Type"]="application/json",s.Accept="text/event-stream";let a;try{a=yield t.fetchImpl(e,{method:"POST",body:JSON.stringify(o),headers:s,signal:r?.signal})}catch(g){if(g instanceof Error&&g.name==="AbortError"){let I=new sr("cancelled","Request was cancelled.");return{data:Promise.reject(I),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(I)}}}}}}let E=Ty(0,null);return{data:Promise.reject(E),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(E)}}}}}}let c,l,d=new Promise((g,E)=>{c=g,l=E});(i=r?.signal)===null||i===void 0||i.addEventListener("abort",()=>{let g=new sr("cancelled","Request was cancelled.");l(g)});let h=a.body.getReader(),f=vne(h,c,l,r?.signal);return{stream:{[Symbol.asyncIterator](){let g=f.getReader();return{next(){return y(this,null,function*(){let{value:I,done:S}=yield g.read();return{value:I,done:S}})},return(){return y(this,null,function*(){return yield g.cancel(),{done:!0,value:void 0}})}}}},data:d}})}function vne(t,e,n,r){let i=(s,a)=>{let c=s.match(gne);if(!c)return;let l=c[1];try{let d=JSON.parse(l);if("result"in d){e(_d(d.result));return}if("message"in d){a.enqueue(_d(d.message));return}if("error"in d){let h=Ty(0,d);a.error(h),n(h);return}}catch(d){if(d instanceof sr){a.error(d),n(d);return}}},o=new TextDecoder;return new ReadableStream({start(s){let a="";return c();function c(){return y(this,null,function*(){if(r?.aborted){let l=new sr("cancelled","Request was cancelled");return s.error(l),n(l),Promise.resolve()}try{let{value:l,done:d}=yield t.read();if(d){a.trim()&&i(a.trim(),s),s.close();return}if(r?.aborted){let f=new sr("cancelled","Request was cancelled");s.error(f),n(f),yield t.cancel();return}a+=o.decode(l,{stream:!0});let h=a.split(`
|
|
141
|
+
`);a=h.pop()||"";for(let f of h)f.trim()&&i(f.trim(),s);return c()}catch(l){let d=l instanceof sr?l:Ty(0,null);s.error(d),n(d)}})}},cancel(){return t.cancel()}})}var e2="@firebase/functions",t2="0.12.9";var Sne="auth-internal",Ane="app-check-internal",Cne="messaging-internal";function Dne(t){let e=(n,{instanceIdentifier:r})=>{let i=n.getProvider("app").getImmediate(),o=n.getProvider(Sne),s=n.getProvider(Cne),a=n.getProvider(Ane);return new qN(i,o,s,a,r)};Kn(new en(KN,e,"PUBLIC").setMultipleInstances(!0)),je(e2,t2,t),je(e2,t2,"esm2017")}function i2(t=or(),e=zN){let r=co(Me(t),KN).getImmediate({identifier:e}),i=pd("functions");return i&&YN(r,...i),r}function YN(t,e,n){Ene(Me(t),e,n)}function o2(t,e,n){return _ne(Me(t),e,n)}Dne();var Zo=class{constructor(e){return e}},s2="functions",XN=class{constructor(){return Qo(s2)}};var QN=new K("angularfire2.functions-instances");function Rne(t,e){let n=ea(s2,t,e);return n&&new Zo(n)}function Nne(t){return(e,n)=>{let r=e.runOutsideAngular(()=>t(n));return new Zo(r)}}var bne={provide:XN,deps:[[new Yt,QN]]},wne={provide:Zo,useFactory:Rne,deps:[[new Yt,QN],mi]};function Wke(t,...e){return je("angularfire",pi.full,"fn"),tr([wne,bne,{provide:QN,useFactory:Nne(t),multi:!0,deps:[De,Ke,gi,Jo,[new Yt,tl],[new Yt,na],...e]}])}var zke=fe(YN,!0),qke=fe(i2,!0);var a2=fe(o2,!0);var l2={httpsCallableFromURL:a2};function Td(t,e,n){return n?l2.httpsCallableFromURL(t,e,n):l2.httpsCallableFromURL(t,e)}var uo=(()=>{let e=class e{constructor(r,i){this.loggingService=r,this.analyticsService=i,this.config$=new de(null),this.disableLogsConfig$=new de({warnings:!0,suppressAll:!1}),this.apiKey$=new de(""),this.baseFeatureAllowList=[],this.runtimeDisabledFeatures=new Set,this.sf$=new de(!1),this.sdkType$=new de("core"),this.logsEnabled$=new de(!0),this.safeEval$=new de(!1),this.firestorePersistentCacheEnabled$=new de(!1),this.encryptionProvider$=new de(null);try{this.analyticsService.setConfigService(this),this.sdkType$.subscribe(o=>{this.analyticsService.updateDefaultProperties({sdkType:o})},o=>{this.loggingService.catch("Error in ConfigService sdkType$: ",o)}),this.logsEnabled$.subscribe(o=>{o?this.loggingService.enableLogs():this.loggingService.disableLogs(),O.logsEnabled=o},o=>{this.loggingService.catch("Error in ConfigService logsEnabled$: ",o)})}catch(o){this.loggingService.catch("Error in ConfigService constructor: ",o)}}initConfig(r){try{r.featureAllowList?.length||(r.featureAllowList=Object.values(SR)),this.baseFeatureAllowList=r.featureAllowList?.slice();try{r.proxyConfig?.authHost?localStorage.setItem(k.LOCAL_STORAGE.VELT_AUTH_PROXY_HOST,btoa(r.proxyConfig.authHost)):localStorage.removeItem(k.LOCAL_STORAGE.VELT_AUTH_PROXY_HOST)}catch{}this.config$.next(r)}catch(i){this.loggingService.catch("Error in ConfigService initConfig: ",i)}}setApiKey(r){this.apiKey$.next(r)}getApiKey(){return this.apiKey$.value}getApiKey$(){return this.apiKey$.asObservable()}getConfig(){return this.config$.value}getConfig$(){return this.config$.asObservable()}disableFeatures(r){try{let i=this.config$.value;this.runtimeDisabledFeatures=new Set(r??[]),i&&(r?.length?i.featureAllowList=this.baseFeatureAllowList.filter(o=>!r.includes(o)):i.featureAllowList=this.baseFeatureAllowList.slice()),this.config$.next(i)}catch(i){this.loggingService.catch("Error in ConfigService disableFeatures: ",i)}}enableFeatures(r){try{if(!r?.length)return;let i=this.config$.value;if(!i)return;let o=i.featureAllowList??[],s=r.filter(a=>!o.includes(a)&&!this.runtimeDisabledFeatures.has(a));if(s.length===0)return;i.featureAllowList=[...o,...s],this.baseFeatureAllowList=[...this.baseFeatureAllowList,...s.filter(a=>!this.baseFeatureAllowList.includes(a))],this.config$.next(i)}catch(i){this.loggingService.catch("Error in ConfigService enableFeatures: ",i)}}setSF(r){try{this.sf$.next(r),this.analyticsService.setSF(r)}catch(i){this.loggingService.catch("Error in ConfigService setSF: ",i)}}getSF(){try{return this.sf$.value}catch(r){return this.loggingService.catch("Error in ConfigService getSF: ",r),!1}}getSF$(){try{return this.sf$.asObservable().pipe(ri(gp))}catch(r){return this.loggingService.catch("Error in ConfigService getSF$: ",r),it(!1)}}setSdkType(r){try{this.sdkType$.next(r)}catch(i){this.loggingService.catch("Error in ConfigService setSdkType: ",i)}}getSdkType(){try{return this.sdkType$.value}catch(r){return this.loggingService.catch("Error in ConfigService getSdkType: ",r),"core"}}getSdkType$(){try{return this.sdkType$.asObservable()}catch(r){return this.loggingService.catch("Error in ConfigService getSdkType$: ",r),it("core")}}enableLogs(){try{if(this.logsEnabled$.value===!0)return;this.logsEnabled$.next(!0)}catch(r){this.loggingService.catch("Error in ConfigService enableLogs: ",r)}}disableLogs(r){try{r&&this.disableLogsConfig$.next({warnings:r.warnings??!0,suppressAll:r.suppressAll??!1}),r?.warnings!==!1&&this.logsEnabled$.next(!1)}catch(i){this.loggingService.catch("Error in ConfigService disableLogs: ",i)}}getDisableLogsConfig(){return this.disableLogsConfig$.value}getDisableLogsConfig$(){return this.disableLogsConfig$.asObservable()}getProxyConfig(){try{return this.config$.value?.proxyConfig}catch(r){this.loggingService.catch("Error in ConfigService getProxyConfig: ",r);return}}getAuthProxyHost(){try{let r=this.config$.value?.proxyConfig?.authHost;if(r)return r;let i=localStorage.getItem(k.LOCAL_STORAGE.VELT_AUTH_PROXY_HOST);return i?atob(i):void 0}catch(r){this.loggingService.catch("Error in ConfigService getAuthProxyHost: ",r);return}}getApiHost(){try{return this.getProxyConfig()?.apiHost||this.config$.value?.apiProxyDomain}catch(r){this.loggingService.catch("Error in ConfigService getApiHost: ",r);return}}getApiProxyDomain(){return this.getApiHost()}getSelfHostedConfig(){try{return this.config$.value?.selfHosted}catch(r){this.loggingService.catch("Error in ConfigService getSelfHostedConfig: ",r);return}}getEnablePortableBackend(){try{return this.config$.value?.selfHosted?.enablePortableBackend===!0}catch(r){return this.loggingService.catch("Error in ConfigService getEnablePortableBackend: ",r),!1}}enableSafeEval(){try{this.safeEval$.next(!0)}catch(r){this.loggingService.catch("Error in ConfigService enableSafeEval: ",r)}}disableSafeEval(){try{this.safeEval$.next(!1)}catch(r){this.loggingService.catch("Error in ConfigService disableSafeEval: ",r)}}getSafeEval(){try{return this.safeEval$.value}catch(r){return this.loggingService.catch("Error in ConfigService getSafeEval: ",r),!1}}getSafeEval$(){try{return this.safeEval$.asObservable()}catch(r){return this.loggingService.catch("Error in ConfigService getSafeEval$: ",r),it(!1)}}enableFirestorePersistentCache(){try{this.firestorePersistentCacheEnabled$.next(!0)}catch(r){this.loggingService.catch("Error in ConfigService enableFirestorePersistentCache: ",r)}}disableFirestorePersistentCache(){try{this.firestorePersistentCacheEnabled$.next(!1)}catch(r){this.loggingService.catch("Error in ConfigService disableFirestorePersistentCache: ",r)}}isFirestorePersistentCacheEnabled(){try{return this.firestorePersistentCacheEnabled$.value}catch(r){return this.loggingService.catch("Error in ConfigService isFirestorePersistentCacheEnabled: ",r),!1}}getFirestorePersistentCacheEnabled$(){try{return this.firestorePersistentCacheEnabled$.asObservable()}catch(r){return this.loggingService.catch("Error in ConfigService getFirestorePersistentCacheEnabled$: ",r),it(!1)}}setEncryptionProvider(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setEncryptionProvider","color: green;"),this.encryptionProvider$.next(r)}catch(i){this.loggingService.catch("Error in ConfigService setEncryptionProvider: ",i)}}getEncryptionProvider(){try{return this.encryptionProvider$.value}catch(r){return this.loggingService.catch("Error in ConfigService getEncryptionProvider: ",r),null}}getEncryptionProvider$(){try{return this.encryptionProvider$.asObservable()}catch(r){return this.loggingService.catch("Error in ConfigService getEncryptionProvider$: ",r),it(null)}}};e.\u0275fac=function(i){return new(i||e)(q(Rt),q(oa))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var nl={fetch:(t,e)=>fetch(t,e),timeoutMs:12e5,renewalTimeoutMs:3e4,renewalOfflineTimeoutMs:5e3,isOnline:()=>typeof navigator>"u"||navigator.onLine!==!1};function d2(){try{return nl.isOnline()?nl.renewalTimeoutMs:nl.renewalOfflineTimeoutMs}catch{return nl.renewalTimeoutMs}}var n1e=nl.timeoutMs,u2=Symbol("identify-timed-out");function rl(t){return Lne(t,{secure:"https:",loopback:"http:"})}var One=["localhost","127.0.0.1","[::1]"];function Lne(t,e){if(!t)return!1;try{let n=new URL(t);return n.protocol===e.secure?!0:n.protocol===e.loopback&&One.includes(n.hostname)}catch{return!1}}function h2(t){return`${t.replace(/\/+$/,"")}/identify`}function Mne(t,e="identify"){let n="Could not reach the self-hosted backend for "+e+" ("+t+"). If the SDK is running cross-origin, a likely cause is the gateway's CORS origin allowlist not including this origin (fail-closed deny-by-default) \u2014 verify the operator configured it. This is distinct from a server-side denial, which carries a specific error code.";return Iy(n)}function Iy(t){return{error:t,code:"network_error",message:t,source:"identify"}}function f2(t){return y(this,null,function*(){let e={apiKey:t.apiKey,originDomain:typeof window<"u"?window.location.origin:"",version:t.version,user:t.user};return t.authToken!=null&&(e.authToken=t.authToken),p2({url:t.url,body:e,timeoutMs:nl.timeoutMs,label:"identify"})})}function p2(t){return y(this,null,function*(){let e,n=t.timeoutMs,r=typeof AbortController<"u"?new AbortController:null,i,o=new Promise(a=>{i=setTimeout(()=>{try{r?.abort()}catch{}a(u2)},n)}),s=()=>y(null,null,function*(){let a=yield nl.fetch(t.url,V({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.body)},r?{signal:r.signal}:{}));try{return{body:yield a.json()}}catch{return{detail:`unreadable response (HTTP ${a.status}, non-JSON body)`}}});try{let a=yield Promise.race([s(),o]);if(a===u2)e=`no answer within ${n} ms (request timed out and was aborted)`;else{if("body"in a)return a.body;e=a.detail}}catch(a){e=`fetch failed: ${a?.message??a}`}finally{i!==void 0&&clearTimeout(i)}return console.error(`Velt [selfHosted.portableBackendUrl]: ${t.label} ${e} \u2014 ${t.url}`),Mne(e,t.label)})}var ZN="refresh_token_invalid",kp=new Set(["domain_not_whitelisted","identify_not_configured","invalid-argument"]);function g2(t,e){return`${t.replace(/\/+$/,"")}/${e}`}function m2(t){let e={apiKey:t.apiKey,refreshToken:t.refreshToken};return p2({url:t.url,body:e,timeoutMs:t.timeoutMs,label:"identify/refresh"})}var es={validateClient:{endpointClass:"core",module:"core"},sdkProxy:{endpointClass:"core",module:"core"},getNotificationsForDocuments:{endpointClass:"core",module:"core"},getPlanDetails:{endpointClass:"advisory",module:"core"},sa:{endpointClass:"telemetry",module:"core"},getIceServers:{endpointClass:"optional",module:"huddle-webrtc"},chatgptCompletion:{endpointClass:"optional",module:"ai"},rewriterAskAi:{endpointClass:"optional",module:"ai"},whisperTranscription:{endpointClass:"optional",module:"recorder-media"},getAllowedDocuments:{endpointClass:"optional",module:"core"},videoBackend:{endpointClass:"optional",module:"recorder-media"},convertRecording:{endpointClass:"optional",module:"recorder-media"},processRecording:{endpointClass:"optional",module:"recorder-media"},screenshot:{endpointClass:"optional",module:"recorder-media"},setEncryptedData:{endpointClass:"core",module:"core"},firebaseNotificationsDatabaseURL:{endpointClass:"core",module:"core"},firebaseConfig:{endpointClass:"core",module:"core"}},Pne=Object.keys(es).filter(t=>t!=="setEncryptedData"&&t!=="firebaseNotificationsDatabaseURL"&&t!=="firebaseConfig"&&es[t].endpointClass==="core"),xne=["notifications","analytics-telemetry","console"],E2=new Set;function kne(t){try{let e=t.filter(o=>!uV.includes(o));if(!e.length)return;let n=[...e].sort().join(",");if(E2.has(n))return;E2.add(n);let r=e.filter(o=>xne.includes(o)),i=`Velt [selfHosted.deploymentProfile]: unknown module id(s) ignored: ${e.join(", ")}. Unknown ids enable nothing (fail-closed).`;r.length&&(i+=` Note: ${r.join(", ")} `+(r.length>1?"were":"was")+" absorbed into 'core' by the 2026-07-10 manifest restructure \u2014 the endpoints they used to gate (notifications hub, getNotificationsForDocuments, sa telemetry, console CFs) now follow 'core' and are ENABLED whenever core is. If you relied on omitting one of these ids to disable those endpoints, that opt-out no longer applies \u2014 regenerate your velt-deployment-profile.json."),console.warn(i)}catch{}}function il(t,e){let n=t?.deploymentProfile;return!Array.isArray(n)||n.length===0?!0:(kne(n),n.includes(e))}var _2={usCentral1:"us-central1",europeWest1:"europe-west1",asiaSouthEast1:"asia-southeast1",australiaSouthEast1:"australia-southeast1",asiaNorthEast1:"asia-northeast1"};function Fne(t,e){let n=t?.dataRegions;if(!Array.isArray(n)||e==="usCentral1")return e;let r=_2[e];return r&&n.includes(r)?e:"usCentral1"}function Une(t){let e=t.cloudFunction;if(e?.setEncryptedData)return!0;let n=t.dataRegions;if(!Array.isArray(n))return Object.values(e?.regions??{}).some(i=>!!i?.setEncryptedData);let r=i=>!!e?.regions?.[i]?.setEncryptedData;return r("usCentral1")?Object.entries(_2).filter(([i,o])=>i!=="usCentral1"&&n.includes(o)).every(([i])=>r(i)):!1}var Vne="__VELT_PRE_BOOTSTRAP_SELF_HOSTED__";function Bne(t){let e=t?.firebaseConfig;return e?V(V({},Xt.firebaseConfig),e):Xt.firebaseConfig}function d1e(){try{if(typeof window>"u")return;let t=window[Vne];return t&&typeof t=="object"?t:void 0}catch{return}}var vy=(()=>{let e=class e{constructor(r){this.injector=r,this.strictCoreValidationReported=!1,this.portableUnservedProxyReported=!1,this.portableWithoutStrictReported=!1,this.portableIdentifyFlagMisconfigReported=!1,this.portableIdentifyInsecureUrlReported=!1}get configService(){return this._configService??=this.injector.get(uo)}get loggingService(){return this._loggingService??=this.injector.get(Rt)}getSelfHosted(){try{let r=this.configService.getSelfHostedConfig();return this.reportPortableWithoutStrictOnce(r),r}catch(r){this.loggingService.catch("Error in EndpointsService getSelfHosted: ",r);return}}resolveStrictMiss(r,i){return this.reportStrictCoreMisconfigurationOnce(r),`${$c}${i}`}resolveProfileDisabled(r,i){return`${$c}module.${r}/${i}`}isPortableBackendConfigured(r){let i=r?.portableBackendUrl;return r?.enablePortableBackend===!0&&!!i&&rl(i)}reportPortableWithoutStrictOnce(r){if(!this.portableWithoutStrictReported&&!(!this.isPortableBackendConfigured(r)||r?.strict)){this.portableWithoutStrictReported=!0;try{console.warn("Velt [selfHosted.portableBackendUrl]: portable backend configured WITHOUT `strict: true`. Velt-hosted endpoints (analytics `sa`, `sdkProxy`) still egress to Velt cloud, so this deployment is NOT air-gapped. The Tier B recipe pairs them: { enablePortableBackend: true, portableBackendUrl, strict: true }.")}catch{}}}reportStrictCoreMisconfigurationOnce(r){if(!this.strictCoreValidationReported&&!this.isPortableBackendConfigured(r)){this.strictCoreValidationReported=!0;try{let i=this.getMissingStrictCoreEndpoints(r);i.length&&console.error(`Velt [selfHosted.strict]: missing CORE endpoint config: ${i.join(", ")}. The SDK cannot function without these in strict self-hosted mode \u2014 there is no fallback to Velt infrastructure. Provide them via config.selfHosted, or unset \`strict\` for hybrid mode.`)}catch(i){this.loggingService.catch("Error in EndpointsService reportStrictCoreMisconfigurationOnce: ",i,void 0,!0)}}}getMissingStrictCoreEndpoints(r){let i=[];for(let o of Pne)il(r,es[o].module)&&(r.cloudFunction?.[o]||i.push(`cloudFunction.${o}`));return il(r,es.setEncryptedData.module)&&!Une(r)&&i.push("cloudFunction.setEncryptedData"),il(r,es.firebaseNotificationsDatabaseURL.module)&&!r.firebaseNotificationsDatabaseURL&&i.push("firebaseNotificationsDatabaseURL"),il(r,es.firebaseConfig.module)&&!r.firebaseConfig&&i.push("firebaseConfig"),i}getCloudFunctionUrl(r){let i=this.getSelfHosted(),o=es[r].module;if(!il(i,o))return this.resolveProfileDisabled(o,`cloudFunction.${r}`);let s=i?.cloudFunction?.[r];return s||(i?.strict?(r==="sdkProxy"&&this.reportPortableUnservedProxyOnce(i),this.resolveStrictMiss(i,`cloudFunction.${r}`)):Xt.cloudFunction?.[r])}reportPortableUnservedProxyOnce(r){if(!this.portableUnservedProxyReported&&this.isPortableBackendConfigured(r)){this.portableUnservedProxyReported=!0;try{console.warn("Velt [Tier B]: a Velt-hosted `sdkProxy` call was blocked (strict self-hosting \u2014 zero egress, no fallback). The portable gateway does not serve this operation class, so any feature that still calls it is unavailable on this deployment: today that is the AI rewriter (rewriterAskAi); a routed operation reaches it only if its portable activation wait expired. This warning fires once per session, on the first blocked call.")}catch{}}}getPortableIdentifyUrl(){try{let r=this.getSelfHosted(),i=r?.portableBackendUrl;return i?r?.enablePortableBackend!==!0?(this.portableIdentifyFlagMisconfigReported||(this.portableIdentifyFlagMisconfigReported=!0,console.error("Velt [selfHosted.portableBackendUrl]: set without `enablePortableBackend: true` \u2014 ignored. Identify will use the Velt-hosted endpoint. Set both options to route identify to your self-hosted backend.")),null):rl(i)?h2(i):(this.portableIdentifyInsecureUrlReported||(this.portableIdentifyInsecureUrlReported=!0,console.error(`Velt [selfHosted.portableBackendUrl]: insecure URL "${i}" \u2014 https:// is required (plain http:// is allowed for loopback hosts only). Identify is DISABLED (fail-closed): the SDK will not fall back to Velt infrastructure for a Tier B deployment.`)),`${$c}portableBackendUrl/identify`):null}catch(r){return this.loggingService.catch("Error in EndpointsService getPortableIdentifyUrl: ",r),null}}getFirebaseConfig(){let r=this.getSelfHosted();return!r?.firebaseConfig&&r?.strict&&this.reportStrictCoreMisconfigurationOnce(r),Bne(r)}getNotificationsDbUrl(){let r=this.getSelfHosted(),i=es.firebaseNotificationsDatabaseURL.module;if(!il(r,i))return this.resolveProfileDisabled(i,"firebaseNotificationsDatabaseURL");let o=r?.firebaseNotificationsDatabaseURL;return o||(r?.strict?this.resolveStrictMiss(r,"firebaseNotificationsDatabaseURL"):Xt.firebaseNotificationsDatabaseURL)}getSetEncryptedDataUrl(r){let i=this.getSelfHosted(),o=es.setEncryptedData.module;if(!il(i,o))return this.resolveProfileDisabled(o,`cloudFunction.setEncryptedData (region: ${r})`);r=Fne(i,r);let s=i?.cloudFunction;if(s?.setEncryptedData)return s.setEncryptedData;let a=s?.regions?.[r]?.setEncryptedData;return a||(i?.strict?this.resolveStrictMiss(i,`cloudFunction.setEncryptedData (region: ${r})`):Xt.cloudFunction?.[r]?.setEncryptedData)}};e.\u0275fac=function(i){return new(i||e)(q(Ke))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var oa=(()=>{let e=class e{constructor(r,i){this.functions=r,this.serviceBook=i,this.endpointsService=Y(vy),this.sf=!1,this.defaultProperties={},this.draftEvents=[],this.liveStateSyncEvents=Object.values(yt.Events.LiveStateSync||{}),this.eventRateLimitCache={},this.EVENT_LIMIT=50,this.TIME_WINDOW_MS=60*1e3,this.analyticsQueue=[],this.selfHostedAnalyticsSkipReported=!1,this.selfHostingTelemetrySources={},this.selfHostingTelemetryDropReported=!1,this.batchTimer=null,this.BATCH_WINDOW_MS=5*1e3,this.MAX_BATCH_SIZE=50,this.liveStateService=null;try{this.updateDefaultProperties({sdkVersion:zc()}),window?.location?.href&&(this.defaultProperties.pageUrl=window.location.href),this.serviceBook.observe(CT).subscribe(o=>{this.commentService=o??void 0}),this.serviceBook.observe(DT).subscribe(o=>{this.reactionService=o??void 0}),this.serviceBook.observe(RT).subscribe(o=>{this.areaService=o??void 0}),this.serviceBook.observe(QU).subscribe(o=>{this.liveStateService=o??null})}catch(o){O.catch("Error in AnalyticsService constructor: ",o)}}updateDefaultProperties(r={}){this.defaultProperties=V(V({},this.defaultProperties),r)}setInstalledFeature(r){try{this.defaultProperties?.installedFeatures||(this.defaultProperties.installedFeatures=[]),this.defaultProperties.installedFeatures.includes(r)||this.defaultProperties.installedFeatures.push(r)}catch(i){O.catch("Error in AnalyticsService setInstalledFeature: ",i)}}setFeatureConfig({feature:r,config:i}){try{this.defaultProperties.featureConfigs||(this.defaultProperties.featureConfigs={}),this.defaultProperties.featureConfigs[r]||(this.defaultProperties.featureConfigs[r]={}),this.defaultProperties.featureConfigs[r]=V(V({},this.defaultProperties.featureConfigs[r]),i)}catch(o){O.catch("Error in AnalyticsService setFeatureConfig: ",o)}}setSF(r){try{this.sf=r}catch(i){O.catch("Error in AnalyticsService setSF: ",i)}}setAuthService(r){try{this.authService=r}catch(i){O.catch("Error in AnalyticsService setAuthService: ",i)}}setCommentService(r){try{this.commentService=r}catch(i){O.catch("Error in AnalyticsService setCommentService: ",i)}}setConfigService(r){try{this.configService=r}catch(i){O.catch("Error in AnalyticsService setConfigService: ",i)}}setDomService(r){try{this.domService=r}catch(i){O.catch("Error in AnalyticsService setDomService: ",i)}}registerSelfHostingTelemetrySource(r,i){try{this.selfHostingTelemetrySources||(this.selfHostingTelemetrySources={}),this.selfHostingTelemetrySources[r]=i}catch(o){O.catch("Error in AnalyticsService registerSelfHostingTelemetrySource: ",o)}}resolveSelfHostingTelemetryState(){let r=this.selfHostingTelemetrySources??{},i={},o=a=>{let c=r[a];if(!c)return!1;try{return!!c.configured()}catch{return!0}},s=a=>{let c=r[a]?.fieldsToRemove?.();return Array.isArray(c)?c:void 0};return o("comment")&&(i.comment={fieldsToRemove:s("comment")}),o("user")&&(i.user=!0),o("reaction")&&(i.reaction={fieldsToRemove:s("reaction")}),o("recorder")&&(i.recorder={fieldsToRemove:s("recorder")}),o("activity")&&(i.activity={fieldsToRemove:s("activity")}),o("attachment")&&(i.attachment=!0),KR(i)?i:null}applySelfHostingTelemetryRule(r,i){try{let o=this.resolveSelfHostingTelemetryState();return o?DB(r,o,{kind:i}):r}catch(o){return this.selfHostingTelemetryDropReported||(this.selfHostingTelemetryDropReported=!0,console.warn("Velt [selfHosted]: an analytics event was dropped because the self-hosting telemetry filter failed (reported once per session). ",o)),null}}setUserService(r){try{this.userService=r}catch(i){O.catch("Error in AnalyticsService setUserService: ",i)}}identifyUser(r,i,o={}){try{this.userId=r;let s=typeof i=="object"?JSON.parse(JSON.stringify(i)):i;this.userService?.userResolverConfigured?.()&&s?.userId&&(s={userId:s.userId}),this.user=s;let a=this.defaultProperties?this.defaultProperties.apiKey:null;if(Xt.production||Xt.staging){let c=Date.now(),l={userId:r,clientUserId:this.user?.userId,traits:le(V({},s),{apiKey:a,forceReset:o?.forceReset,eventTimestamp:c}),properties:le(V({},this.defaultProperties),{eventTimestamp:c}),sf:this.sf,context:this.getContext(),eventTimestamp:c};this.setAnalytics("identify",l)}if(this.userId&&this.draftEvents?.length){let c=this.draftEvents?.slice();this.draftEvents=[],c?.forEach(l=>{l.type==="track"&&l?.data?.eventName&&this.trackEvent(l.data.eventName,l.data.properties,l.data.mergeDefaultProperties,l.data.userId,l.data.clientUserId)})}}catch(s){O.catch("Error in AnalyticsService identifyUser: ",s)}}trackPage(r,i="",o={}){try{if((Xt.production||Xt.staging)&&this.userId){let s={userId:this.userId,clientUserId:this.user?.userId,name:r,properties:o,sf:this.sf,context:this.getContext()};this.setAnalytics("page",s)}}catch(s){O.catch("Error in AnalyticsService trackPage: ",s)}}trackEvent(c){return y(this,arguments,function*(r,i={},o=!0,s,a){try{if(this.sf&&ZU.includes(r))return Promise.resolve();if(Xt.production||Xt.staging)if(this.userId||s){if(this.eventRateLimitCache[r]?.blockedForSession)return Promise.resolve();let l=Date.now();if(this.eventRateLimitCache[r]&&l-this.eventRateLimitCache[r].timestamp<this.TIME_WINDOW_MS){if(this.eventRateLimitCache[r].count>=this.EVENT_LIMIT){if(!this.eventRateLimitCache[r].rateLimitExceededEventTriggered){this.eventRateLimitCache[r].rateLimitExceededEventTriggered=!0,this.eventRateLimitCache[r].blockedForSession=!0;let d=V({eventName:r},i||{});this.triggerTrackEvent(yt.Events.Core.SDK_EVENT_RATE_LIMIT_EXCEEDED,d,o,s,a)}return Promise.resolve()}this.eventRateLimitCache[r].count++}else this.eventRateLimitCache[r]={count:1,timestamp:l,rateLimitExceededEventTriggered:!1,blockedForSession:!1};return this.triggerTrackEvent(r,i,o,s,a)}else return i?.eventTimestamp||(i.eventTimestamp=Date.now()),this.draftEvents.push({type:"track",data:{eventName:r,properties:i,mergeDefaultProperties:o,userId:s,clientUserId:a}}),Promise.resolve();return Promise.resolve()}catch(l){return O.catch("Error in AnalyticsService trackEvent: ",l),Promise.resolve()}})}triggerTrackEvent(c){return y(this,arguments,function*(r,i={},o=!0,s,a){try{o&&(i||(i={}),i=V(V({},i),this.defaultProperties));let l;if(i?.annotationId){let h=i.annotationId;if(!l&&this.commentService){let f=this.commentService.getAnnotationById(h);f?.metadata&&(l=f.metadata),f?.targetElementId&&(i.targetElementId=f.targetElementId);let g=this.commentService.getMultiThreadAnnotationById(h);g?.metadata&&(l=g.metadata),g?.targetElementId&&(i.targetElementId=g.targetElementId)}if(!l){let f=this.serviceBook.get(AT)?.getAnnotationById(h);f?.metadata&&(l=f.metadata)}if(!l&&this.reactionService){let f=this.reactionService.getAnnotationById(h);f?.metadata&&(l=f.metadata),f?.targetElementId&&(i.targetElementId=f.targetElementId)}if(!l&&this.areaService){let f=this.areaService.getAnnotationById(h);f?.metadata&&(l=f.metadata)}}if(l&&typeof l=="object"&&(i=V(V({},i),l)),i&&typeof i=="object"&&(i=le(V({},i),{userId:this.userId||s,clientUserId:this.user?.userId||a}),i?.eventTimestamp||(i.eventTimestamp=Date.now()),i?.sessionTabId||(i.sessionTabId=this.domService?.getTabId()),this.liveStateSyncEvents.includes(r))){let h=this.liveStateService?.getSemStats();h&&!i?.semStats&&(i.semStats=h)}let d={userId:this.userId||s,clientUserId:this.user?.userId||a,event:r,properties:i,sf:this.sf,context:this.getContext(),eventTimestamp:i?.eventTimestamp};return this.setAnalytics("track",d)}catch(l){return O.catch("Error in AnalyticsService triggerTrackEvent: ",l),Promise.resolve()}})}setAnalytics(r,i){return y(this,null,function*(){try{let o=this.applySelfHostingTelemetryRule(i,r);return o===null?Promise.resolve():(i=o,navigator.onLine?new Promise((a,c)=>{this.analyticsQueue.push({type:r,body:i,resolve:a,reject:c}),this.analyticsQueue.length>=this.MAX_BATCH_SIZE?this.flushAnalyticsQueue():this.scheduleBatchFlush()}).catch(()=>{}):void 0)}catch(o){return O.catch("Error in AnalyticsService setAnalytics: ",o),Promise.resolve()}})}scheduleBatchFlush(){try{this.batchTimer||(this.batchTimer=setTimeout(()=>{this.batchTimer=null,this.flushAnalyticsQueue()},this.BATCH_WINDOW_MS))}catch(r){O.catch("Error in AnalyticsService scheduleBatchFlush: ",r)}}flushAnalyticsQueue(){return y(this,null,function*(){try{if(this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null),this.analyticsQueue.length===0||!navigator.onLine)return;let r=[...this.analyticsQueue];this.analyticsQueue=[];try{let i=ud({url:this.endpointsService.getCloudFunctionUrl("sa"),apiProxyDomain:this.configService?.getApiProxyDomain()});if(ad(i)){this.selfHostedAnalyticsSkipReported||(this.selfHostedAnalyticsSkipReported=!0,O.log("Velt [selfHosted]: analytics telemetry is disabled on this deployment (the `sa` endpoint resolves to the inert self-hosted sentinel). Events are dropped locally with zero egress.")),r.forEach(a=>{try{a.resolve&&a.resolve()}catch(c){O.warn("Error resolving analytics promise: ",c)}});return}let o=Td(this.functions,i,{timeout:1200*1e3}),s=r.map(a=>({type:a.type,data:a.body}));try{yield o({type:"batch",data:s}),r.forEach(a=>{try{a.resolve&&a.resolve()}catch(c){O.warn("Error resolving analytics promise: ",c)}})}catch(a){O.warn("Error in AnalyticsService batch flush: ",a),r.forEach(c=>{try{c.reject&&c.reject(a)}catch(l){O.warn("Error rejecting analytics promise: ",l)}})}}catch(i){O.catch("Error in AnalyticsService flushAnalyticsQueue: ",i),r.forEach(o=>{try{o.reject&&o.reject(i)}catch(s){O.warn("Error rejecting analytics promise: ",s)}})}}catch(r){O.catch("Error in AnalyticsService flushAnalyticsQueue: ",r)}})}trackAuthenticatedEvent(r,i={},o=!0){try{this.authService?.getUser$&&typeof this.authService?.getUser$()?.subscribe=="function"&&(this.authService.getUser()?this.trackEvent(r,i,o):((!i||typeof i!="object")&&(i={}),i?.eventTimestamp||(i.eventTimestamp=Date.now()),this.authService?.getUser$()?.pipe(Tn(s=>!!s),yn(1))?.subscribe(()=>{this.trackEvent(r,i,o)})))}catch(s){O.catch("Error in AnalyticsService trackAuthenticatedEvent: ",s)}}getContext(){try{let r={},i=uB();return r.os={name:i?.deviceInfo?.osName,version:i?.deviceInfo?.osVersion},r.page={path:i?.path,title:i?.title,url:i?.url},r.screen={height:i?.deviceInfo?.screenHeight,width:i?.deviceInfo?.screenWidth},r.app={name:i?.deviceInfo?.browserName,version:i?.deviceInfo?.browserVersion},r.device={type:i?.deviceInfo?.deviceType},r.timezone=yB(),r.userAgent=i?.deviceInfo?.userAgent,r}catch(r){O.catch("Error in AnalyticsService getContext: ",r)}}};e.\u0275fac=function(i){return new(i||e)(q(Zo),q(NT))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Rt=(()=>{let e=class e{get debugMode(){return sB()}get debugContextMode(){return aB()}get logsEnabled(){return this.logsEnabled$.value}constructor(r){this.analyticsService=r,this.logsEnabled$=new de(!0),this.log("%c[WB] Creating SERVICE LoggingService","color: blue;")}enableLogs(){try{if(this.logsEnabled$.value===!0)return;this.logsEnabled$.next(!0)}catch(r){this.catch("Error in LoggingService enableLogs: ",r)}}disableLogs(){try{if(this.logsEnabled$.value===!1)return;this.logsEnabled$.next(!1)}catch(r){this.catch("Error in LoggingService disableLogs: ",r)}}log(r,...i){this.debugMode&&console.log(r,...i)}logContext(r,...i){this.debugContextMode&&console.log(r,...i)}warn(r,...i){this.debugMode&&console.warn(r,...i)}error(r,...i){this.debugMode&&console.error(r,...i)}debug(r,...i){this.debugMode&&console.debug(r,...i)}info(r,...i){this.debugMode&&console.info(r,...i)}catch(r,i,o,s=!1){try{let a=i?.message;this.logsEnabled$.value&&(a?.toLowerCase()?.includes("permission denied")||a?.toLowerCase()?.includes("permission_denied")||(i!==void 0?console.warn("Velt: ",r,i):console.warn("Velt: ",r))),s||this.reportToAnalytics(r,i,o)}catch{}}reportToAnalytics(r,i,o){try{let s=typeof i?.message=="string"?i.message:typeof i=="string"?i:void 0;this.analyticsService.trackEvent(yt.Events.Core.SDK_ERROR,V({sourceMethod:r,message:s||r,clientUserId:this.analyticsService?.user?.userId,snippylyUserId:this.analyticsService?.user?.userSnippylyId,source:"sdk"},o||{}))}catch{}}catchResolverFailure(r,i,o){try{this.logsEnabled$.value&&(i!==void 0?console.warn("Velt: ",r,i):console.warn("Velt: ",r));let s=typeof i?.statusCode=="number"?i.statusCode:void 0;this.analyticsService.trackEvent(yt.Events.Core.SDK_ERROR,V(le(V({sourceMethod:r,message:`${r} ${CB(i)}`},s!==void 0?{statusCode:s}:{}),{clientUserId:this.analyticsService?.user?.userId,snippylyUserId:this.analyticsService?.user?.userSnippylyId,source:"sdk"}),o||{}))}catch{}}};e.\u0275fac=function(i){return new(i||e)(q(oa))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Gne=.2,eb=3e4,jne=5*6e4,T2=1e3,Hne=5e3;function y2(t){try{if(typeof t!="string"||!t)return null;let e=t.split(".");if(e.length!==3||!e[1])return null;let n=e[1].replace(/-/g,"+").replace(/_/g,"/");n+="=".repeat((4-n.length%4)%4);let r=atob(n),i=new Uint8Array(r.length);for(let s=0;s<r.length;s++)i[s]=r.charCodeAt(s);let o=JSON.parse(new TextDecoder().decode(i));return o&&typeof o=="object"&&!Array.isArray(o)?o:null}catch{return null}}function I2(t){let e=y2(t)?.isAdmin;return e!==void 0&&typeof e!="boolean"&&O.log(`Velt [portable backend]: the session token's isAdmin claim is a ${e===null?"null":typeof e}, not a boolean; treating the user as not an admin.`),e===!0}function Up(t){try{let e=y2(t)?.exp;return typeof e!="number"||!Number.isFinite(e)||e<=0?null:e*1e3}catch{return null}}function v2(t,e){try{if(t===null||!Number.isFinite(e))return null;let n=t-e;if(n<=0)return null;if(n<=Hne)return T2;let r=Math.min(Math.max(n*Gne,eb),jne);return Math.max(n-r,T2)}catch{return null}}var Fp=3e4,$ne=16*6e4;function S2(t,e,n){if(t!==null&&Number.isFinite(e)&&t>e)return Fp;let r=Number.isFinite(n)&&n>=1?Math.floor(n):1;return Math.min(Fp*2**Math.min(r-1,30),$ne)}function tb(t,e){let n=Up(t);return n===null?!0:n-e<=0}var Sy=[],A2=new Set,sa={pings:0,pongs:0,lastPongAtMs:0};function L1e(t){try{t==="ping"?sa.pings++:(sa.pongs++,sa.lastPongAtMs=Date.now())}catch{}}function $e(t,e){try{for(Sy.push({t:Date.now(),kind:t,detail:e});Sy.length>60;)Sy.shift()}catch{}}function C2(t){return!Number.isFinite(t)||t<0?"?":t<1e3?`${Math.round(t)}ms`:t<6e4?`${Math.round(t/1e3)}s`:`${Math.floor(t/6e4)}m${String(Math.round(t%6e4/1e3)).padStart(2,"0")}s`}function M1e(t,e,n){try{let r=n??t;if(A2.has(r))return;A2.add(r);let i=Date.now(),o=Sy.map(a=>` -${C2(i-a.t).padStart(7)} ${a.kind}${a.detail?" "+a.detail:""}`),s=sa.pings?` Heartbeat: ${sa.pings} sent, ${sa.pongs} answered${sa.lastPongAtMs?`, last answer ${C2(i-sa.lastPongAtMs)} ago`:", NONE answered"}
|
|
142
|
+
`:` Heartbeat: never ran
|
|
143
|
+
`;console.warn(`Velt [portable backend] SESSION DIAGNOSTIC \u2014 ${t}
|
|
144
|
+
`+(e?` ${e}
|
|
145
|
+
`:"")+s+` Recent session events (most recent last, times relative to now):
|
|
146
|
+
`+(o.length?o.join(`
|
|
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 R2="license_terminated",nb=5*6e4,N2=.2,Vp="internal-licenseRetry",b2=Math.round(nb*(1+N2)),Wne={unlicensed:!0,valid:!0,"expiring-soon":!0,"in-grace":!0,terminated:!0},zne=new Set(Object.keys(Wne)),qne=64,Kne=300;function ol(t){try{if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;if(typeof e.state!="string"||!zne.has(e.state))return null;let n=D2(e.expiresAt),r=D2(e.terminatesAt);return V(V({state:e.state},n?{expiresAt:n}:{}),r?{terminatesAt:r}:{})}catch{return null}}var Yne=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?(Z|[+-]\d{2}:\d{2})?)?$/;function D2(t){return typeof t=="string"&&t.length<=qne&&Yne.test(t)&&Number.isFinite(Date.parse(t))?t:void 0}function rb(t){return typeof t=="string"&&t?t.slice(0,Kne):void 0}function Dy(t){try{return t?.code===R2}catch{return!1}}function F1e(t){try{let e=t;return!e||typeof e!="object"||e.ok===!0?!1:e.reasonCode===R2}catch{return!1}}function ib(t){let e=Number.isFinite(t)?Math.min(Math.max(t,0),1):0;return Math.round(nb*(1+N2*e))}var Xne=new Set(["internal","unavailable","deadline-exceeded","resource-exhausted","cancelled","aborted","unknown"]);function w2(t){try{let e=t?.code;return typeof e!="string"||e===""?!0:Xne.has(e.startsWith("functions/")?e.slice(10):e)}catch{return!0}}function U1e(t,e){let n=e&&typeof e=="object"?e:{},r=rb(n.message);return V({source:t,license:ol(n.license)},r?{message:r}:{})}var O2=null;function L2(t){O2=t}function V1e(t){try{O2?.(t)}catch(e){O.catch("Error in the portable license refusal listener: ",e)}}var Ay={gateway:{prefix:"Velt [portable backend]",refuses:"its gateway refuses new sessions",stops:"its gateway stops accepting new sessions",open:"Connections that are already open keep working.",asks:"it asks the gateway again",label:"Gateway"},"hosted-callable":{prefix:"Velt [self-hosted]",refuses:"it refuses new sign-ins",stops:"it stops accepting new sign-ins",open:"Users who are already signed in stay signed in.",asks:"it asks again",label:"Backend"}},Cy=class{constructor(e){this.emit=e,this.refusedState=null,this.namedRefusedState=null,this.servedState=null,this.dates={},this.warned=new Set}refused(e,n,r="gateway"){try{let i=e&&(e.state==="terminated"||e.state==="unlicensed")?e.state:null;i&&(this.namedRefusedState=i),this.rememberDates(e);let o=i??this.namedRefusedState??"terminated";if(this.refusedState===o)return;this.refusedState=o;let s=Ay[r]??Ay.gateway,a=o==="unlicensed"?`This self-hosted Velt deployment has no license installed, so ${s.refuses} until the operator uploads one.`:`This self-hosted Velt deployment's license has been terminated${this.dates.terminatesAt?` (since ${this.dates.terminatesAt})`:""}, so ${s.refuses} until the operator uploads a renewal.`;this.emit(le(V({code:"license_terminated",state:o},this.dates),{message:a}));let c=Math.round(nb/6e4);this.warnOnce("refused",`${s.prefix}: ${a} ${s.open} The SDK does not retry in a loop: ${s.asks} after ${c} minutes or more, and on the next identify() or page load. The app gets one 'error' event per state change (code 'license_terminated'), and 'license_restored' once a session is granted again.`,n,s.label)}catch{}}served(e,n,r="gateway"){try{let i=this.refusedState!==null;this.refusedState=null,this.namedRefusedState=null,this.rememberDates(e);let o=e?.state??null;i&&this.emit(le(V(V({code:"license_restored"},o?{state:o}:{}),this.dates),{message:"This self-hosted Velt deployment accepts new sessions again."}));let s=o!==this.servedState;if(this.servedState=o,o!=="in-grace"&&o!=="expiring-soon"||n==="renewal"&&!s)return;let a=this.dates,c=Ay[r]??Ay.gateway;if(o==="in-grace"){let l=`This self-hosted Velt deployment's license expired${a.expiresAt?` on ${a.expiresAt}`:""} and is in its grace period: everything keeps working until ${a.terminatesAt??"the grace period ends"}, when ${c.stops}.`;this.emit(le(V({code:"license_in_grace",state:o},a),{message:l})),this.warnOnce("in-grace",`${c.prefix}: ${l} Ask the operator to upload a renewal.`);return}this.emit(le(V({code:"license_expiring_soon",state:o},a),{message:`This self-hosted Velt deployment's license expires${a.expiresAt?` on ${a.expiresAt}`:" soon"}.`}))}catch{}}rememberDates(e){e&&(this.dates=V(V({},e.expiresAt?{expiresAt:e.expiresAt}:{}),e.terminatesAt?{terminatesAt:e.terminatesAt}:{}))}warnOnce(e,n,r,i="Gateway"){this.warned.has(e)||(this.warned.add(e),r?console.warn(n,`${i}: ${r}`):console.warn(n))}};var Qne="api_key_disabled";function H1e(t){try{let e=t;return!e||typeof e!="object"||e.ok===!0?!1:e.reasonCode===Qne}catch{return!1}}var M2=null;function P2(t){M2=t}function $1e(){try{M2?.()}catch(t){O.catch("Error in the portable API-key refusal listener: ",t)}}var Jne={fetch:(t,e)=>fetch(t,e)},Zne=5e3;function ere(t){return`${t.replace(/\/+$/,"")}/operations/getProjectConfig`}function tre(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)},Zne)});try{return yield Promise.race([Jne.fetch(t,n?le(V({},e),{signal:n.signal}):e),i])}finally{r!==void 0&&clearTimeout(r)}})}function ob(t){return y(this,null,function*(){let{apiEndpoint:e,token:n}=t;if(!e||!n)return null;if(!rl(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 tre(ere(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}})}function sb(t,e,n){return t.userSnippylyId!==e?.userSnippylyId||e?.groupId!==t.groupId||e?.organizationId!==t.organizationId||!!n?.forceReset}function ab(t,e){let{provided:n,resolved:r}=e;return t.name=r?r?.name:n?.name||t.name,t.clientUserName=r?r?.clientUserName:n?.clientUserName||t.clientUserName,t.photoUrl=r?r?.photoUrl:n?.photoUrl||t.photoUrl,t?.photoUrl===void 0&&(t.photoUrl=null),t.email=r?r?.email:n?.email||t.email,t.color=r?.color||n?.color||e.avatarColor(t.userId),t.textColor=r?.textColor||n?.textColor||e.textColor(t.userId),t.initial=r?.initial||n?.initial||t.initial||t.name?.charAt(0).toUpperCase()||t.email?.charAt(0).toUpperCase(),t.contacts=n?.contacts||t.contacts,t.plan=n?.plan||t.plan,t.groupId=n?.groupId||t.groupId,t.clientGroupId=n?.clientGroupId||t.clientGroupId,t.clientOrganizationId=n?.clientOrganizationId||t.clientOrganizationId,t.organizationId=n?.organizationId||t.organizationId,t.isAdmin=n?.isAdmin,t.isReadOnly=n?.isReadOnly,t.isAnonymous=n?.isAnonymous,t.isGuest=n?.isGuest,t}var nre=["unauthenticated","permission-denied","not-found","invalid-argument","failed-precondition","resource-exhausted"],x2=[...nre,"unimplemented"];function k2(t){return!!t&&t.backend==="portable"&&typeof t.wsEndpoint=="string"&&typeof t.apiEndpoint=="string"}var Q1e="getaccess-any-user",J1e="ordered-deltas",Z1e="doc-notification-views",eFe="fetch-folders-include-children",tFe="notification-timestamp-by-document",nFe="per-editor-crdt-fold",rFe="attachments",iFe="comment-views-updated-at",oFe="organization-user-config",sFe="organization-directory",aFe="customer-metadata",cFe="multi-thread",lFe="organization-user-search";var Ry={import:()=>import("./velt-portable.js")},Sr=null,Bp=!1;function F2(t){if(Sr)Sr=Sr.then(()=>Ry.import().then(e=>{Bp=!0,e.default(t)})).catch(e=>{O.catch("Error re-establishing portable session after re-identify: ",e)});else{let e=Ry.import().then(n=>{Bp=!0,n.default(t)}).catch(n=>{Sr===e&&(Sr=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)});Sr=e}return Sr}function U2(){Sr&&(Sr=Sr.then(()=>Bp?Ry.import().then(t=>{t.teardownPortableBackend()}):void 0).catch(t=>{O.catch("Error tearing down portable backend session: ",t)}))}function V2(){Sr&&(Sr=Sr.then(()=>Bp?Ry.import().then(t=>{t.checkPortableBackendLiveness?.()}):void 0).catch(t=>{O.catch("Error checking portable backend liveness: ",t)}))}var B2=(()=>{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(k.LOCALSTORAGE_DATA_ID);if(r)return JSON.parse(r);{let i=new jc;return this.setLocalStorageData(i),i}}catch(r){return this.loggingService.catch("Error in getLocalStorageData:",r),new jc}}setLocalStorageData(r){this.loggingService.log("%c[WB] Calling FUNCTION: setLocalStorageData","color: green;");try{if(r){let i=JSON.stringify(r);localStorage?.setItem(k.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(k.LOCALSTORAGE_DATA_ID)}getSessionStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: getSessionStorageData","color: green;");try{let r=sessionStorage?.getItem(k.LOCALSTORAGE_DATA_ID);if(r)return JSON.parse(r);{let i=new jc;return this.setSessionStorageData(i),i}}catch(r){return this.loggingService.catch("Error in getSessionStorageData:",r),new jc}}setSessionStorageData(r){this.loggingService.log("%c[WB] Calling FUNCTION: setSessionStorageData","color: green;");try{if(r){let i=JSON.stringify(r);sessionStorage?.setItem(k.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(k.LOCALSTORAGE_DATA_ID)}catch(r){this.loggingService.catch("Error in deleteSessionStorageData:",r)}}};e.\u0275fac=function(i){return new(i||e)(q(Rt))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var G2=(()=>{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 io,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 io}}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 k.AVATAR_COLOR_LIST[r%k.AVATAR_COLOR_LIST.length];let i=Math.floor(Math.random()*k.AVATAR_COLOR_LIST.length);return k.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)(q(B2),q(Rt))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var j2=(()=>{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 Ue),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 Ue);let i=this.actionSubjects.get(r);return i?i.asObservable():it(null)}catch(i){return this.loggingService.catch("Error in CoreActionsService onAction: ",i),it(null)}}};e.\u0275fac=function(i){return new(i||e)(q(Rt))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function sre(t,e){this.v=t,this.k=e}function H2(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 are(t){if(Array.isArray(t))return t}function cre(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){if(Object(n)!==n)return;c=!1}else 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 lre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
149
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ure(t,e){return are(t)||cre(t,e)||dre(t,e)||lre()}function dre(t,e){if(t){if(typeof t=="string")return H2(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)?H2(t,e):void 0}}function Ny(t){var e,n;function r(o,s){try{var a=t[o](s),c=a.value,l=c instanceof sre;Promise.resolve(l?c.v:c).then(function(d){if(l){var h=o==="return"&&c.k?o:"next";if(!c.k||d.done)return r(h,d);d=t[h](d).value}i(!!a.done,d)},function(d){r("throw",d)})}catch(d){i(2,d)}}function i(o,s){o===2?e.reject(s):e.resolve({value:s,done:o}),(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(o,s){return new Promise(function(a,c){var l={key:o,arg:s,resolve:a,reject:c,next:null};n?n=n.next=l:(e=n=l,r(o,s))})},typeof t.return!="function"&&(this.return=void 0)}Ny.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Ny.prototype.next=function(t){return this._invoke("next",t)},Ny.prototype.throw=function(t){return this._invoke("throw",t)},Ny.prototype.return=function(t){return this._invoke("return",t)};var nj=Object.entries,hre=Object.keys,$2=Object.setPrototypeOf,fre=Object.isFrozen,rj=Object.getPrototypeOf,ij=Object.getOwnPropertyDescriptor,fn=Object.freeze,kt=Object.seal,ca=Object.create,oj=typeof Reflect<"u"&&Reflect,Oy=oj.apply,_b=oj.construct;fn||(fn=function(e){return e});kt||(kt=function(e){return e});Oy||(Oy=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)});_b||(_b=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 ts=It(Array.prototype.forEach),pre=It(Array.prototype.lastIndexOf),W2=It(Array.prototype.pop),Gp=It(Array.prototype.push),gre=It(Array.prototype.slice),mre=It(Array.prototype.splice),yd=Array.isArray,cb=sj(Set),lb=It(Set.prototype.add),jp=It(Set.prototype.has),sl=It(String.prototype.toLowerCase),ub=It(String.prototype.toString),Ere=It(String.prototype.match),by=It(String.prototype.replace),db=It(String.prototype.indexOf),_re=It(String.prototype.trim),Tre=It(Number.prototype.toString),yre=It(Boolean.prototype.toString),z2=typeof BigInt>"u"?null:It(BigInt.prototype.toString),q2=typeof Symbol>"u"?null:It(Symbol.prototype.toString),Vn=It(Object.prototype.hasOwnProperty),Hp=It(Object.prototype.toString),Ire=RegExp.prototype.test,hn=function(e,n){return e instanceof RegExp&&(e.lastIndex=0),Oy(Ire,e,[n])},ns=sj(TypeError);function It(t){return 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 Oy(t,e,r)}}function sj(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return _b(t,n)}}function qe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sl;if($2&&$2(t,null),!yd(e))return t;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){let o=n(i);o!==i&&(fre(e)||(e[r]=o),i=o)}t[i]=!0}return t}function vre(t){for(let e=0;e<t.length;e++)Vn(t,e)||(t[e]=null);return t}function Ly(t){let e=ca(null);for(let r of nj(t)){var n=ure(r,2);let i=n[0],o=n[1];Vn(t,i)&&(yd(o)?e[i]=vre(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=Ly(o):e[i]=o)}return e}function $p(t){let e=ca(null),n=hre(t),r=n.length;for(;r--;)e[n[r]]=t[n[r]];return e}function Sre(t){switch(typeof t){case"string":return t;case"number":return Tre(t);case"boolean":return yre(t);case"bigint":return z2?z2(t):"0";case"symbol":return q2?q2(t):"Symbol()";case"undefined":return Hp(t);case"function":case"object":{if(t===null)return Hp(t);let e=t,n=Hr(e,"toString");if(typeof n=="function"){let r=n(e);return typeof r=="string"?r:Hp(r)}return Hp(t)}default:return Hp(t)}}function Hr(t,e){for(;t!==null;){let r=ij(t,e);if(r){if(r.get)return It(r.get);if(typeof r.value=="function")return It(r.value)}t=rj(t)}function n(){return null}return n}function Are(t,e){for(;t!==null;){let n=ij(t,e);if(n)return n.get?It(n.get):null;t=rj(t)}return null}function Cre(t){if(!t)return!1;try{return hn(t,""),!0}catch{return!1}}var K2=fn(["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"]),hb=fn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fb=fn(["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"]),Dre=fn(["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"]),pb=fn(["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"]),Rre=fn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Y2=fn(["#text"]),X2=fn(["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"]),gb=fn(["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"]),Q2=fn(["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"]),wy=fn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Nre=kt(/{{[\w\W]*|^[\w\W]*}}/g),bre=kt(/<%[\w\W]*|^[\w\W]*%>/g),wre=kt(/\${[\w\W]*/g),Ore=kt(/{{|}}|\${|<%|%>|<%|%>/),Lre=kt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mre=kt(/^aria-[\-\w]+$/),J2=kt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pre=kt(/^(?:\w+script|data):/i),xre=kt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kre=kt(/^html$/i),Fre=kt(/^[a-z][.\w]*(-[.\w]+)+$/i),mb=kt(/<[/\w!]/g),Z2=kt(/<[/\w]/g),Ure=kt(/<\/no(script|embed|frames)/i),ej=kt(/\/>/i),Vre=kt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),Bre=kt(/^[\r\n\t ]+/),bt={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},Gre=fn(qe({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),jre=function(){return typeof window>"u"?null:window},Hre=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}},tj=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},aa=function(e,n,r,i){return Vn(e,n)&&yd(e[n])?qe(i.base?$p(i.base):{},e[n],i.transform):r},Eb=function(e,n,r){let i=Vn(e,n)?e[n]:void 0;return i&&typeof i=="object"?Ly(i):r};function aj(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jre(),e=$=>aj($);if(e.version="3.4.18",e.removed=[],!t||!t.document||t.document.nodeType!==bt.document||!t.Element)return e.isSupported=!1,e;let n=t.document,r=n,i=r.currentScript,o=t.HTMLTemplateElement,s=t.Node,a=t.Element,c=t.NodeFilter,l=t.DOMParser,d=t.trustedTypes,h=a.prototype,f=Hr(h,"cloneNode"),g=Hr(h,"remove"),E=Hr(h,"removeAttributeNode"),I=Hr(h,"nextSibling"),S=Hr(h,"childNodes"),R=Hr(h,"parentNode"),U=Hr(h,"shadowRoot"),H=Hr(h,"attributes"),Q=s&&s.prototype?Hr(s.prototype,"nodeType"):null,ae=s&&s.prototype?Hr(s.prototype,"nodeName"):null,ne=s&&s.prototype?Hr(s.prototype,"ownerDocument"):null,A=function(T){return Q?Q(T):T.nodeType},v=function(T){return ae?ae(T):T.nodeName},C=Are(h,"namespaceURI"),w=function(T){return C?C(T):T.namespaceURI};if(typeof o=="function"){let $=n.createElement("template");$.content&&$.content.ownerDocument&&(n=$.content.ownerDocument)}let N,L="",D,Or=!1,qr=0,Sm=function(){if(qr>0)throw ns('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.')},Kr=function(T){Sm(),qr++;try{return N.createHTML(T)}finally{qr--}},hs=function(T){return N&&Bh?Kr(T):T},Lh=function(T){Sm(),qr++;try{return N.createScriptURL(T)}finally{qr--}},Am=function(){return Or||(D=Hre(d,i),Or=!0),D},Kl=n,Lr=Kl.implementation,sn=Kl.createNodeIterator,iS=Kl.createDocumentFragment,Ga=Kl.getElementsByTagName,oS=r.importNode,et=tj();e.isSupported=typeof nj=="function"&&typeof R=="function"&&Lr&&Lr.createHTMLDocument!==void 0;let sS=Nre,aS=bre,Yl=wre,Xl=Lre,Mh=Mre,Ph=Pre,xh=xre,kh=Fre,Fh=J2,lt=null,Uh=qe({},[...K2,...hb,...fb,...pb,...Y2]),ut=null,Ql=qe({},[...X2,...gb,...Q2,...wy]),Qn=null,fs=null,Cm=null,Mr=Object.seal(ca(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Jl=!0,ja=!0,jt=!1,Ht=!0,Jn=!1,Di=!0,Ri=!1,Vh=!1,Ni=null,Ha=null,Zl=!1,bi=!1,eu=!1,Bh=!1,tu=!0,Gh=!1,jh="user-content-",Io=!0,$a=!1,Yr=null,Zn=!1,wi=null,Wa=qe({},["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"]),Hh=null,ps=qe({},["audio","video","img","source","image","track"]),$h=null,an=qe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),za="http://www.w3.org/1998/Math/MathML",Oi="http://www.w3.org/2000/svg",An="http://www.w3.org/1999/xhtml",gs=An,Wh=!1,vo=null,cS=qe({},[za,Oi,An],ub),lS=fn(qe({},["mi","mo","mn","ms","mtext"])),ms=null,Dm=fn(qe({},["annotation-xml"])),qa=null,nu=fn(ca(null)),Li=qe({},["title","style","font","a","script"]),Es=null,Rm=["application/xhtml+xml","text/html"],zh="text/html",dt=null,Ka=null,Nm=n.createElement("form"),bm=function(T){return T instanceof RegExp||T instanceof Function},_s=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(!T||typeof T!="object")&&(T={}),T=Ly(T),Es=Rm.indexOf(T.PARSER_MEDIA_TYPE)===-1?zh:T.PARSER_MEDIA_TYPE,dt=Es==="application/xhtml+xml"?ub:sl,lt=aa(T,"ALLOWED_TAGS",Uh,{transform:dt}),ut=aa(T,"ALLOWED_ATTR",Ql,{transform:dt}),vo=aa(T,"ALLOWED_NAMESPACES",cS,{transform:ub}),$h=aa(T,"ADD_URI_SAFE_ATTR",an,{transform:dt,base:an}),Hh=aa(T,"ADD_DATA_URI_TAGS",ps,{transform:dt,base:ps}),wi=aa(T,"FORBID_CONTENTS",Wa,{transform:dt}),fs=aa(T,"FORBID_TAGS",ca(null),{transform:dt}),Cm=aa(T,"FORBID_ATTR",ca(null),{transform:dt}),Zn=Vn(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?Ly(T.USE_PROFILES):T.USE_PROFILES:!1,Jl=T.ALLOW_ARIA_ATTR!==!1,ja=T.ALLOW_DATA_ATTR!==!1,jt=T.ALLOW_UNKNOWN_PROTOCOLS||!1,Ht=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Jn=T.SAFE_FOR_TEMPLATES||!1,Di=T.SAFE_FOR_XML!==!1,Ri=T.WHOLE_DOCUMENT||!1,bi=T.RETURN_DOM||!1,eu=T.RETURN_DOM_FRAGMENT||!1,Bh=T.RETURN_TRUSTED_TYPE||!1,Zl=T.FORCE_BODY||!1,tu=T.SANITIZE_DOM!==!1,Gh=T.SANITIZE_NAMED_PROPS||!1,Io=T.KEEP_CONTENT!==!1,$a=T.IN_PLACE||!1,Fh=Cre(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:J2,gs=typeof T.NAMESPACE=="string"?T.NAMESPACE:An,ms=Eb(T,"MATHML_TEXT_INTEGRATION_POINTS",lS),qa=Eb(T,"HTML_INTEGRATION_POINTS",Dm);let b=Eb(T,"CUSTOM_ELEMENT_HANDLING",nu);if(Qn=ca(null),Vn(b,"tagNameCheck")&&bm(b.tagNameCheck)&&(Qn.tagNameCheck=b.tagNameCheck),Vn(b,"attributeNameCheck")&&bm(b.attributeNameCheck)&&(Qn.attributeNameCheck=b.attributeNameCheck),Vn(b,"allowCustomizedBuiltInElements")&&typeof b.allowCustomizedBuiltInElements=="boolean"&&(Qn.allowCustomizedBuiltInElements=b.allowCustomizedBuiltInElements),kt(Qn),Jn&&(ja=!1),eu&&(bi=!0),Zn&&((Vn(T,"ALLOWED_TAGS")||Vn(T,"ALLOWED_ATTR"))&&typeof console<"u"&&typeof console.warn=="function"&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),lt=qe({},Y2),ut=ca(null),Zn.html===!0&&(qe(lt,K2),qe(ut,X2)),Zn.svg===!0&&(qe(lt,hb),qe(ut,gb),qe(ut,wy)),Zn.svgFilters===!0&&(qe(lt,fb),qe(ut,gb),qe(ut,wy)),Zn.mathMl===!0&&(qe(lt,pb),qe(ut,Q2),qe(ut,wy))),Mr.tagCheck=null,Mr.attributeCheck=null,Vn(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?Mr.tagCheck=T.ADD_TAGS:yd(T.ADD_TAGS)&&(lt===Uh&&(lt=$p(lt)),qe(lt,T.ADD_TAGS,dt))),Vn(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?Mr.attributeCheck=T.ADD_ATTR:yd(T.ADD_ATTR)&&(ut===Ql&&(ut=$p(ut)),qe(ut,T.ADD_ATTR,dt))),Vn(T,"ADD_FORBID_CONTENTS")&&yd(T.ADD_FORBID_CONTENTS)&&(wi===Wa&&(wi=$p(wi)),qe(wi,T.ADD_FORBID_CONTENTS,dt)),Io&&(lt["#text"]=!0),Ri&&qe(lt,["html","head","body"]),lt.table&&(lt.tbody=!0,delete fs.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw ns('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ns('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let G=N;N=T.TRUSTED_TYPES_POLICY;try{L=Kr("")}catch(j){throw N=G,j}}else T.TRUSTED_TYPES_POLICY===null?(N=void 0,L=""):(N===void 0&&(N=Am()),N&&typeof L=="string"&&(L=Kr("")));Ka=fn(T)},qh=qe({},[...hb,...fb,...Dre]),ru=qe({},[...pb,...Rre]),Ya=function(T,b,G){return b===An?T==="svg":b===za?T==="svg"&&(G==="annotation-xml"||ms[G]):!!qh[T]},So=function(T,b,G){return b===An?T==="math":b===Oi?T==="math"&&qa[G]:!!ru[T]},Kh=function(T,b,G){return b===Oi&&!qa[G]||b===za&&!ms[G]?!1:!ru[T]&&(Li[T]||!qh[T])},uS=function(T){let b=w(T),G=sl(v(T)),j=R(T),ce=gs,me="template";return j&&A(j)===bt.element&&(ce=w(j),me=sl(v(j))),vo[b]?b===Oi?Ya(G,ce,me):b===za?So(G,ce,me):b===An?Kh(G,ce,me):Es==="application/xhtml+xml":!1},Xr=function(T){Gp(e.removed,{element:T});try{R(T).removeChild(T)}catch{if(g(T),!R(T))throw ns("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Yh=function(T,b,G){try{E(T,b)}catch{try{T.removeAttribute(G)}catch{}}},iu=function(T){su(T);let b=S(T);b&&ts(gre(b),G=>{try{g(G)}catch{}}),A(T)===bt.element&&Xa(T,!1)},Mi=function(T,b,G){if(!G)try{G=b.getAttributeNode(T)}catch{G=null}if(Gp(e.removed,{attribute:G||null,from:b}),G)Yh(b,G,T);else try{b.removeAttribute(T)}catch{}if(T==="is")if(bi||eu)try{Xr(b)}catch{}else try{b.setAttribute(T,"")}catch{}},Xa=function(T,b){let G=H(T);if(G)for(let j=G.length-1;j>=0;--j){let ce=G[j],me=ce&&ce.name;typeof me=="string"&&!(b&&ut[dt(me)])&&Yh(T,ce,me)}},ou=function(T,b){let G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,j=[T];for(;j.length>0;){let ce=j.pop();if(b(ce)===!1)continue;if(G&&A(ce)===bt.element){let Ae=U(ce);ys(Ae)&&j.push(Ae)}let me=S(ce);if(me)for(let Ae=me.length-1;Ae>=0;--Ae)j.push(me[Ae])}},su=function(T){ou(T,b=>{A(b)===bt.element&&Xa(b,!0)})},Xh=function(T){let b=[];return ou(T,G=>{b.push(G)},!0),b},dS=function(T,b){let G=cb();ts(Xh(T),j=>{A(j)===bt.element&&lb(G,j)}),ts(b,j=>{A(j)===bt.element&&!jp(G,j)&&Xa(j,!0)})},Qh=function(T,b){let G=!1;return ts(e.removed,j=>{j.element&&(G=G||j.element===T,su(j.element))}),dS(T,b),G},wm=8,hS=function(T,b){let G=Yr,j=null,ce=()=>(j||(j=cb(),ts(b,me=>{lb(j,me)})),j);for(let me=0;;me++){let Ae=Xh(T),At=[T],Pr=!1;if(ts(Ae,Cn=>{A(Cn)===bt.documentFragment?Gp(At,Cn):!Pr&&!jp(G,Cn)&&(Pr=jp(ce(),Cn))}),!Pr)return;if(me>=wm)throw ns("the tree kept changing during in-place sanitization; refusing to return it");ts(At,(Cn,Dn)=>{Ao(Cn,Dn>0,T,ce())})}},Ao=function(T,b,G,j){let ce=We(T),me;for(;me=ce.nextNode();)!jp(j,me)||jp(Yr,me)||(b&&ur(et.uponSanitizeShadowNode,me,null),bo(me,G))},Qr=function(T){Yr&&lb(Yr,T)},Qa=function(T,b){return Di?T==="patchsrc"?!0:T==="for"&&b!=="label"&&b!=="output":!1},au=function(T){Di&&ou(T,b=>{let G=A(b);if(G===bt.processingInstruction||G===bt.comment&&hn(Z2,b.data)){try{g(b)}catch{}return!1}if(G===bt.element){let j=b,ce=dt(v(b));try{j.hasAttribute&&j.hasAttribute("patchsrc")&&j.removeAttribute("patchsrc"),j.hasAttribute&&j.hasAttribute("for")&&Qa("for",ce)&&j.removeAttribute("for")}catch{}}return!0})},Jh=function(T){let b=null,G=null;if(Zl)T="<remove></remove>"+T;else{let me=Ere(T,Bre);G=me&&me[0]}Es==="application/xhtml+xml"&&gs===An&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");let j=N?Kr(T):T;if(gs===An)try{b=new l().parseFromString(j,Es)}catch{}if(!b||!b.documentElement){b=Lr.createDocument(gs,"template",null);try{b.documentElement.innerHTML=Wh?L:j}catch{}}let ce=b.body||b.documentElement;return T&&G&&ce.insertBefore(n.createTextNode(G),ce.childNodes[0]||null),gs===An?Ga.call(b,Ri?"html":"body")[0]:Ri?b.documentElement:ce},We=function(T){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,G=ne?ne(T):T.ownerDocument;return sn.call(G||T,T,(b?0:c.SHOW_ELEMENT)|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ts=function(T){return T=by(T,sS," "),T=by(T,aS," "),T=by(T,Yl," "),T},Co=function(T){var b;Do(T);let G=(b=T.querySelectorAll)===null||b===void 0?void 0:b.call(T,"template");G&&ts(G,j=>{ys(j.content)&&Co(j.content)})},Do=function(T){T.normalize();let b=We(T,!0),G=b.nextNode();for(;G;)G.data=Ts(G.data),G=b.nextNode()},cu=function(T){let b=ae?ae(T):null;return typeof b!="string"||dt(b)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==H(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!==Q(T)||T.childNodes!==S(T)},Zh=function(T){if(!Q||typeof T!="object"||T===null)return null;try{let b=Q(T);return typeof b=="number"?b:null}catch{return null}},ys=function(T){return Zh(T)===bt.documentFragment},Ja=function(T){return Zh(T)!==null};function ur($,T,b){$.length!==0&&ts($,G=>{G.call(e,T,b,Ka)})}let fS=function(T,b,G){return!!(Di&&G===bt.element&&T.hasChildNodes()&&!Ja(T.firstElementChild)&&hn(mb,T.textContent)&&hn(mb,T.innerHTML)||Di&&Gre[b]&&G===bt.element&&w(T)===An&&(Ja(T.firstElementChild)||typeof T.textContent=="string"&&hn(mb,T.textContent))||G===bt.processingInstruction||Di&&G===bt.comment&&hn(Z2,T.data))},Pi=function(T,b){if(T instanceof RegExp)return hn(T,b);if(T instanceof Function){for(var G=arguments.length,j=new Array(G>2?G-2:0),ce=2;ce<G;ce++)j[ce-2]=arguments[ce];return!!T(b,...j)}return!1},xi=function(T,b,G){if(!fs[b]&&Lm(b)&&Pi(Qn.tagNameCheck,b))return!1;if(Io&&!wi[b]&&!wi[sl(b)]){let j=R(T),ce=S(T);if(ce&&j){let me=ce.length;for(let Ae=me-1;Ae>=0;--Ae){let At=T===G?f(ce[Ae],!0):ce[Ae];j.insertBefore(At,I(T))}}}return Xr(T),!0},ef=function(T,b,G,j){return T.length===0?b:b===G||b===j?$p(b):b},Ro=function(T,b){return T===b||R(T)!==null?!1:($a&&su(T),!0)},Om=function(T,b){if(Qr(T),ur(et.beforeSanitizeElements,T,null),Ro(T,b))return!0;if(cu(T))return Xr(T),!0;let G=dt(v(T)),j=A(T);if(lt=ef(et.uponSanitizeElement,lt,Uh,Ni),ur(et.uponSanitizeElement,T,{tagName:G,allowedTags:lt}),Ro(T,b))return!0;if(fS(T,G,j))return Xr(T),!0;if(fs[G]||!(Mr.tagCheck instanceof Function&&Mr.tagCheck(G))&&!lt[G]){let ce=xi(T,G,b);return ce===!1&&(ur(et.afterSanitizeElements,T,null),Ro(T,b))?!0:ce}if(j===bt.element&&!uS(T)||(G==="noscript"||G==="noembed"||G==="noframes")&&hn(Ure,T.innerHTML))return Xr(T),!0;if(Jn&&j===bt.text){let ce=T.textContent,me=Ts(ce);ce!==me&&(Gp(e.removed,{element:T.cloneNode()}),T.textContent=me)}return ur(et.afterSanitizeElements,T,null),Ro(T,b)},No=function(T,b,G){if(Cm[b]||Qa(b,T)||tu&&(b==="id"||b==="name")&&(G in n||G in Nm))return!1;let j=ut[b]||Mr.attributeCheck instanceof Function&&Mr.attributeCheck(b,T);if(ja&&hn(Xl,b)||Jl&&hn(Mh,b))return!0;if(!j)return Lm(T)&&Pi(Qn.tagNameCheck,T)&&Pi(Qn.attributeNameCheck,b,T)||b==="is"&&Qn.allowCustomizedBuiltInElements&&Pi(Qn.tagNameCheck,G);if($h[b])return!0;let ce=by(G,xh,"");return hn(Fh,ce)||(b==="src"||b==="xlink:href"||b==="href")&&T!=="script"&&db(G,"data:")===0&&Hh[T]||jt&&!hn(Ph,ce)?!0:!G},pS=qe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Lm=function(T){return!pS[sl(T)]&&hn(kh,T)},gS=function(T,b,G,j){if(N&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!G)switch(d.getAttributeType(T,b)){case"TrustedHTML":return Kr(j);case"TrustedScriptURL":return Lh(j)}return j},ki=function(T,b,G,j){try{return G?T.setAttributeNS(G,b,j):T.setAttribute(b,j),cu(T)?(Xr(T),!1):!0}catch{return Mi(b,T),!1}},Mm=function(T,b){return Di&&hn(Vre,b)?!0:sl(T)==="attributename"&&db(b,"href")!==-1},mS=function(T,b){if(ur(et.beforeSanitizeAttributes,T,null),Ro(T,b))return;let G=T.attributes;if(!G||cu(T))return;ut=ef(et.uponSanitizeAttribute,ut,Ql,Ha);let j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ut,forceKeepAttr:void 0},ce=G.length,me=dt(v(T));for(;ce--;){let Ae=G[ce],At=Ae.name,Pr=Ae.namespaceURI,Cn=Ae.value,Dn=dt(At),Ot=Cn,Lt=At==="value"?Ot:_re(Ot),Pm=!1;if(j.attrName=Dn,j.attrValue=Lt,j.keepAttr=!0,j.forceKeepAttr=void 0,ur(et.uponSanitizeAttribute,T,j),Lt=j.attrValue,Gh&&(Dn==="id"||Dn==="name")&&db(Lt,jh)!==0&&(Mi(At,T,Ae),Lt=jh+Lt,Pm=!0),Mm(At,Lt)){Mi(At,T,Ae);continue}if(!j.forceKeepAttr){if(!j.keepAttr){Mi(At,T,Ae);continue}if(!Ht&&hn(ej,Lt)){Mi(At,T,Ae);continue}if(Jn&&(Lt=Ts(Lt)),!No(me,Dn,Lt)){Mi(At,T,Ae);continue}Lt=gS(me,Dn,Pr,Lt),Lt!==Ot&&ki(T,At,Pr,Lt)&&Pm&&W2(e.removed)}}ur(et.afterSanitizeAttributes,T,null),Ro(T,b)},bo=function(T,b){Om(T,b),mS(T,b),ys(T.content)&&Is(T.content)},Is=function(T){let b=null,G=We(T);for(ur(et.beforeSanitizeShadowDOM,T,null);b=G.nextNode();)if(ur(et.uponSanitizeShadowNode,b,null),bo(b,T),A(b)===bt.element){let j=U(b);ys(j)&&(lu(j),Is(j))}Jn&&Do(T),ur(et.afterSanitizeShadowDOM,T,null)},lu=function(T){let b=[{node:T,shadow:null}];for(;b.length>0;){let G=b.pop();if(G.shadow){Is(G.shadow);continue}let j=G.node,ce=A(j)===bt.element,me=S(j);if(me)for(let Ae=me.length-1;Ae>=0;--Ae)b.push({node:me[Ae],shadow:null});if(ce){let Ae=ae?ae(j):null;if(typeof Ae=="string"&&dt(Ae)==="template"){let At=j.content;ys(At)&&b.push({node:At,shadow:null})}}if(ce){let Ae=U(j);ys(Ae)&&b.push({node:null,shadow:Ae},{node:Ae,shadow:null})}}};return e.sanitize=function($){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=null,G=null,j=null,ce=null;if(Wh=!$,Wh&&($="<!-->"),typeof $!="string"&&!Ja($)&&($=Sre($),typeof $!="string"))throw ns("dirty is not a string, aborting");if(!e.isSupported)return $;Vh?(lt=Ni,ut=Ha):_s(T),e.removed=[];let me=$a&&typeof $!="string"&&Ja($),Ae=[],At=Yr;if(me){au($);let Ot=v($);if(typeof Ot=="string"){let Lt=dt(Ot);if(!lt[Lt]||fs[Lt])throw iu($),ns("root node is forbidden and cannot be sanitized in-place")}if(cu($))throw iu($),ns("root node is clobbered and cannot be sanitized in-place");Ae=Xh($),Yr=cb()}else if(Ja($))b=Jh("<!---->"),G=b.ownerDocument.importNode($,!0),G.nodeType===bt.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?b=G:b.appendChild(G),lu(b);else{if(!bi&&!Jn&&!Ri&&$.indexOf("<")===-1)return hs($);if(b=Jh($),!b)return bi?null:Bh?L:""}b&&Zl&&Xr(b.firstChild);let Pr=me?$:b;try{me&&lu($);let Ot=We(Pr);for(;j=Ot.nextNode();)bo(j,Pr);me&&hS($,Ae)}catch(Ot){throw me&&(iu($),Qh($,Ae)),Ot}finally{Yr=At}if(me){if(Qh($,Ae))throw ns("a node selected for removal could not be safely returned; refusing to sanitize in place");return Jn&&Co($),$}if(bi){if(Jn&&Co(b),eu)for(ce=iS.call(b.ownerDocument);b.firstChild;)ce.appendChild(b.firstChild);else ce=b;return(ut.shadowroot||ut.shadowrootmode)&&(ce=oS.call(r,ce,!0)),ce}let Cn=()=>Ri?b.outerHTML:b.innerHTML,Dn=Cn();return Jn&&hn(Ore,Dn)&&(Do(b),Dn=Cn()),Ri&<["!doctype"]&&b.ownerDocument&&b.ownerDocument.doctype&&b.ownerDocument.doctype.name&&hn(kre,b.ownerDocument.doctype.name)&&(Dn="<!DOCTYPE "+b.ownerDocument.doctype.name+`>
|
|
150
|
+
`+Dn),hs(Dn)},e.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_s($),Vh=!0,Ni=lt,Ha=ut},e.clearConfig=function(){Ka=null,Vh=!1,Ni=null,Ha=null,N=D,L=""},e.isValidAttribute=function($,T,b){Ka||_s({});let G=dt($),j=dt(T);return typeof b=="string"&&(Mm(T,b)||!Ht&&hn(ej,b))?!1:No(G,j,b)},e.addHook=function($,T){typeof T=="function"&&Vn(et,$)&&Gp(et[$],T)},e.removeHook=function($,T){if(Vn(et,$)){if(T!==void 0){let b=pre(et[$],T);return b===-1?void 0:mre(et[$],b,1)[0]}return W2(et[$])}},e.removeHooks=function($){Vn(et,$)&&(et[$]=[])},e.removeAllHooks=function(){et=tj()},e}var My=aj();var $re=/^\/\/\*\[@id='([^']+)'\]/;function Tb(t){try{if(typeof t!="string")return null;let e=$re.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 Wre=[/:r[0-9a-z]+:/i,/_r_[0-9a-z]+_/i,/«r[0-9a-z]+»/i,/^radix-/i];function lj(t){try{return t?Wre.some(e=>e.test(t)):!1}catch{return!1}}function TFe(t){if(Array.isArray(t))return cj(t);if(!t||typeof t!="object"||!("documentIds"in t))return{documentIds:null};let e=t.documentIds;return Array.isArray(e)?cj(e):{documentIds:[],problem:"not-an-array"}}function cj(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 V({documentIds:Array.from(new Set(e)).sort()},e.length<t.length?{problem:"dropped-entries"}:{})}function yFe(t,e){return t===null||e===null?t===e:t.length===e.length&&t.every((n,r)=>n===e[r])}var uj={ADD_TAGS:["velt-skeleton-loader"],ADD_ATTR:["border-radius","target"]};function Wp(t,e,n){if(!t)return!0;try{return t(e)!==!1}catch(r){return n?.catch("Error in DomService target filter: ",r),!0}}var zre=new Set([k.ATTRIBUTES.VELT_ELEMENT_CACHE_ID,k.ATTRIBUTES.VELT_COMMENT_PIN_HOST]);function dj(t){try{if(!t)return"";let e=dj(t.parent);return e===null?null:[t.id,t.tagName,t.elementSelector,t.robustXPath,t.xPath,t.cfXPath,t.fXPath,t.contentHash?.value].map(n=>n??"").join("")+""+e}catch(e){return O.catch("Error in DomService getAnchorSignature: ",e),null}}function qre(t){let e=(t??"").replace(/\+position$/,"");return e==="id"||e==="id-duplicate"?0:e==="element-selector"||e==="element-selector-duplicate"?1:e==="robustXPath"?2:3}function Kre(t,e){try{if(!t||!e?.cacheKey&&e?.accept)return null;let n=dj(t);return n===null?null:e?.cacheKey?`k${e.cacheKey}${n}`:`a${n}`}catch(n){return O.catch("Error in DomService getAnchorCacheKey: ",n),null}}var hj=(()=>{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 de(!1),this.enableRectSelection$=this.enableRectSelectionSubject$.asObservable(),this.scrollableElementsIds$=new de([]),this.mousedown=!1,this.windowMouseDown$=new Ue,this.windowPointerMove$=new de(null),this.windowPointerUp$=new Ue,this.documentSelectionChange$=new Ue,this.windowClick$=new Ue,this.windowScroll$=new de(null),this.windowResize$=new de(null),this.windowKeyupBackspace$=new Ue,this.windowKeyupDelete$=new Ue,this.windowKeyupEsc$=new Ue,this.windowPopState$=new de(null),this.documentClick$=new Ue,this.lastDocumentClickTarget=null,this.documentClickSubject$=new Ue,this.documentFocus$=new Ue,this.isShiftKeyPressed=!1,this.mutation$=new Ue,this.pendingMutations=[],this.frameTasks=new Map,this.childListMutation$=new Ue,this.networkStatus$=new de(!1),this.xpathCache=new Map,this.anchorResolutionCache=new Map,this.passMemo=null,this.passDepth=0,this.xpathCacheId=new Map,this.selectedAnnotationsMap$=new de({}),this.selectedAnnotationsLocationMap$=new de({}),this.selectedAnnotationsContextIdMap$=new de({}),this.recordingInProgress$=new de({}),this.deleteAnnotations$=new de([]),this.pinHighlighterClass$=new de(null),this.dialogOpenedInSidebar$=new de(!1),this.textHighlighterClass$=new de(null),this.commentPinHighlighter$=new de(!1),this.deviceInfo$=new de(new Br),this.customCss$=new de(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.unlistenElementScroll={},this.tabId=null,this.dynamicIdPatterns=[/^yui_[a-z0-9_]+$/i],this.excludeClassList=["show-pin-cursor"],this.annotationDraftContentReader=null,this.filterSnippylyNodes=a=>{try{let c=[];return a.forEach(l=>{if(!oo(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=>{oo(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 de(a),this.currentMousePosition$=new de(this.currentMousePosition),this.detectNetworkStatusChange(),this.getScrollableElementsIds$().pipe(cc(),hE(([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",()=>{this.runOncePerFrame("screen-size",()=>this.currentScreenSize$.next(this.calculateScreenSize()))})})}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?_B("snippylyUserScalableNo","viewport","width=device-width, user-scalable=no"):TB("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)||lj(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 tB(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}}runPositionPass(r){this.passDepth===0&&(this.passMemo={robustXPath:new Map,selector:new Map,visibleTextHash:new WeakMap}),this.passDepth++;try{return r()}finally{this.passDepth--,this.passDepth===0&&(this.passMemo=null)}}hashVisibleText(r){let i=this.passMemo?.visibleTextHash;if(i?.has(r))return i.get(r);let o=this.hashText(this.getVisibleText(r));return i?.set(r,o),o}getAllElementsFromRobustXPath(r){let i=this.passMemo?.robustXPath,o=i?.get(r);if(o)return o;let s=this.evaluateRobustXPath(r);return i?.set(r,s),s}getAllElementsFromSelector(r){let i=this.passMemo?.selector,o=i?.get(r);if(o)return o;let s=Array.from(document.querySelectorAll(r));return i?.set(r,s),s}evaluateRobustXPath(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&&cd(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,i){try{let o=Kre(r,i);if(o){let a=this.getVerifiedCachedAnchor(o,r,i?.accept);if(a)return a}let s=this.resolveAnchorRecordUncached(r,i);return o&&this.cacheAnchorResolution(o,r,s),s}catch(o){return this.loggingService.catch("Error in DomService resolveAnchorRecord: ",o),this.resolveAnchorRecordUncached(r,i)}}getVerifiedCachedAnchor(r,i,o){try{let s=this.anchorResolutionCache.get(r);if(!s)return null;let a=s.element.deref();return!!a&&a.isConnected&&Wp(o,a,this.loggingService)&&(!i.tagName||a.tagName?.toUpperCase()===i.tagName)&&(!i.contentHash?.value||this.hashVisibleText(a)===i.contentHash.value)&&(!i.id||a.id===i.id)&&!this.isOutrankedByStrongerLocator(i,s.resolution,a,o)?le(V({},s.resolution),{element:a}):(this.anchorResolutionCache.delete(r),null)}catch(s){return this.loggingService.catch("Error in DomService getVerifiedCachedAnchor: ",s),null}}isOutrankedByStrongerLocator(r,i,o,s){try{let a=qre(i.matchedBy),c=i.score??0,l=h=>h!==o&&Wp(s,h,this.loggingService),d=(h,f)=>f+(r.tagName&&h.tagName?.toUpperCase()===r.tagName?10:0)+(r.contentHash?.value&&this.hashVisibleText(h)===r.contentHash.value?30:0);if(a>1&&r.elementSelector){let h=this.getAllElementsFromSelector(r.elementSelector);if(h.length===1&&l(h[0])||h.some(f=>l(f)&&d(f,60)>=c))return!0}return!!(a>2&&r.robustXPath&&this.getAllElementsFromRobustXPath(r.robustXPath).slice(0,e.MAX_ROBUST_XPATH_CANDIDATES).some(f=>l(f)&&d(f,50)>=c))}catch(a){return this.loggingService.catch("Error in DomService isOutrankedByStrongerLocator: ",a),!0}}cacheAnchorResolution(r,i,o){try{if(!o?.element){this.anchorResolutionCache.delete(r);return}let a=!!i.contentHash?.value&&!!o.scoreBreakdown?.some(h=>h.method==="contentHash-match"),c=o.matchedBy==="id";if(!a&&!c){this.anchorResolutionCache.delete(r);return}this.anchorResolutionCache.size>=e.ANCHOR_CACHE_LIMIT&&this.anchorResolutionCache.clear();let s=o,{element:l}=s,d=vS(s,["element"]);this.anchorResolutionCache.set(r,{element:new WeakRef(l),resolution:d})}catch(a){this.loggingService.catch("Error in DomService cacheAnchorResolution: ",a)}}resolveAnchorRecordUncached(r,i){try{let o=[],s=null,a=i?.accept,c=R=>Wp(a,R,this.loggingService),l=(R,U,H=0)=>{if(!c(R))return;let Q=[],ae=H;Q.push({method:U,score:H}),r.tagName&&R.tagName?.toUpperCase()===r.tagName&&(ae+=10,Q.push({method:"tagName-match",score:10})),r.contentHash?.value&&this.hashVisibleText(R)===r.contentHash.value&&(ae+=30,Q.push({method:"contentHash-match",score:30})),o.push({el:R,score:ae,by:U,scoreBreakdown:Q})};if(r.id){let R=document.querySelectorAll(`#${CSS.escape(r.id)}`);if(R.length===1&&c(R[0]))return{element:R[0],matchedBy:"id",score:90};R.length>1&&R.forEach(U=>l(U,"id-duplicate",70))}if(r.elementSelector){let R=document.querySelectorAll(r.elementSelector);if(R.length===1&&c(R[0]))return{element:R[0],matchedBy:"element-selector",score:80};R.forEach(U=>l(U,"element-selector-duplicate",60))}r.robustXPath&&this.getAllElementsFromRobustXPath(r.robustXPath).slice(0,e.MAX_ROBUST_XPATH_CANDIDATES).forEach(H=>l(H,"robustXPath",50));let d=()=>o.reduce((R,U)=>Math.max(R,U.score),-1/0),h=80,f=70;r?.parent&&d()<=h&&(s=this.resolveAnchorRecord(r.parent,le(V({},i),{cacheKey:i?.cacheKey?`${i.cacheKey}#parent`:void 0})),s.element&&s.element.querySelectorAll(r.tagName?.toLowerCase()||"*").forEach(U=>l(U,"parent+tag",40)));let g=(R,U,H)=>{if(!R)return;let Q=this.getElementFromXPathAccepted(R,a);Q&&l(Q,U||"xpath",H||30)};if(d()<=f&&(g(r.xPath,"xPath",30),g(r.cfXPath,"cfXPath",30),g(r.fXPath,"fXPath",30)),r.contentHash?.value&&o.length===0){let U=H=>{let Q=0;for(let ae=0;ae<H.length&&Q<400;ae++){let ne=H[ae];if(Q++,!this.isElementVisible(ne))continue;let A=this.hashVisibleText(ne);A&&A===r.contentHash?.value&&l(ne,"contentHash",15)}};if(s?.element&&s?.element instanceof Element){let H=s?.element?.querySelectorAll("*");U(H)}}if(!o.length)return{element:null};o.sort((R,U)=>U.score-R.score);let E=o[0].score,I=o.filter(R=>R.score===E);if(I.length>1){let R=[{path:r.xPath,label:"xPath"},{path:r.cfXPath,label:"cfXPath"},{path:r.fXPath,label:"fXPath"}];for(let U of R)if(U.path){let H=this.getElementFromXPathAccepted(U.path,a);if(H){let Q=I.find(ae=>ae.el===H);if(Q)return{element:Q.el,matchedBy:`${Q.by}+position`,score:Q.score,scoreBreakdown:Q.scoreBreakdown}}}}let S=o[0];return{element:S.el,matchedBy:S.by,score:S.score,scoreBreakdown:S.scoreBreakdown}}catch(o){return this.loggingService.catch("Error in DomService resolveAnchorRecord: ",o),{element:null}}}subscribeToDomEvents(){try{this.docService?.getDocumentPaths$().pipe(Ce(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===k.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(k.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))}}}),oo(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=>!zre.has(s.attributeName??"")).filter(s=>!oo(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(k.VELT_IGNORE_CHANGE_DETECTION):!0}return!0})),o=o.filter(s=>{let a=!0;return Object.keys(k.INGNORE_MUTATION_OBSERVER_CHANGE_TAGS).forEach(c=>{s.target?.closest(c)&&(a=!1)}),a}),o=o.filter(s=>s.target&&cd(s.target)),this.animationFilterEnabled&&(o=o.filter(s=>!this.isAnimatingElement(s.target))),o.length&&(this.pendingMutations.push(...o),this.runOncePerFrame("mutations",()=>{let s=this.pendingMutations;this.pendingMutations=[],s.length&&this.mutation$.next(s)}))}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}}runOncePerFrame(r,i){let o=this.frameTasks.has(r);if(this.frameTasks.set(r,i),o)return;let s=!1,a,c,l=()=>{if(s)return;s=!0,a!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(a),c!==void 0&&clearTimeout(c);let d=this.frameTasks.get(r);this.frameTasks.delete(r);try{d?.()}catch(h){this.loggingService.catch(`Error in DomService frame task ${r}: `,h)}};typeof requestAnimationFrame=="function"&&(a=requestAnimationFrame(l)),c=setTimeout(l,100)}unsetMutationObserver(){try{this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null,this.pendingMutations=[],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{Rs(ji(window,"offline").pipe(Ce(()=>!1)),ji(window,"online").pipe(Ce(()=>!0)),new he(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();let r=null;this.unlistenWindowResize=this.renderer.listen("window","resize",i=>{r=i,this.runOncePerFrame("resize",()=>{let o=r;r=null,this.windowResize$.next(o);let s=this.calculateScreenSize();this.deviceInfo$.next(new Br),this.currentScreenSize$.next(s)})})}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),this.runOncePerFrame("screen-size",()=>this.currentScreenSize$.next(this.calculateScreenSize()))})}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()!==k.TAGS.SUPERFLOW_TOOLBAR&&(this.lastDocumentClickTarget=r?.target?new WeakRef(r.target):null,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",()=>{this.isShiftKeyPressed=!0})}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",()=>{this.isShiftKeyPressed=!1})}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 ji(window,"keydown")}catch(r){return this.loggingService.catch("Error in DomService onWindowKeydown$: ",r),ic}}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),R=E.getBoundingClientRect(),U=f-R.x,H=g-R.y,Q=U*100/(R.width||1),ae=H*100/(R.height||1),ne={xpath:I,fXpath:S,leftPercentage:Q,topPercentage:ae};if(s){let A=this.getXPath(E,!0,!0);ne.cfXpath=A}if(c){let A=this.generateAnchorRecord(E,d);A&&(ne.anchor=A)}return ne}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=>{oo(d)?c=[]:cd(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=>{oo(a)&&cd(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&&!zs(r)){if(!o&&this.getCommentPinHighlighter()&&(this.pinHighlighterClass$.value?this.addClassToElement(r,this.pinHighlighterClass$.value):this.addClassToElement(r,k.SNIPPYLY_HIGHLIGHT)),i&&!r.hasAttribute(k.ATTRIBUTES.DEFAULT_CURSOR)){let s=r.style.getPropertyValue("cursor"),a=r.style.getPropertyPriority("cursor"),c=s?{defaultCursorValue:s,defaultCursorPriority:a}:"";r.setAttribute(k.ATTRIBUTES.DEFAULT_CURSOR,c?JSON.stringify(c):""),r.style.setProperty("cursor",i,"important")}r.setAttribute(k.SNIPPYLY_HIGHLIGHT,"true"),r.setAttribute(k.VELT_IGNORE_CHANGE_DETECTION,"true")}}removeHighlightFromElement(r){if(r&&(this.pinHighlighterClass$.value&&this.removeClassFromElement(r,this.pinHighlighterClass$.value),this.removeClassFromElement(r,k.SNIPPYLY_HIGHLIGHT),r.removeAttribute(k.SNIPPYLY_HIGHLIGHT),r.removeAttribute(k.VELT_IGNORE_CHANGE_DETECTION),r.hasAttribute(k.ATTRIBUTES.DEFAULT_CURSOR))){try{if(r.style.removeProperty("cursor"),r.getAttribute(k.ATTRIBUTES.DEFAULT_CURSOR)){let i=JSON.parse(r.getAttribute(k.ATTRIBUTES.DEFAULT_CURSOR));r.style.setProperty("cursor",i.defaultCursorValue,i.defaultCursorPriority)}}catch{}r.removeAttribute(k.ATTRIBUTES.DEFAULT_CURSOR)}}highlightUserElement(r,i,o,s=!1){try{r&&(this.addClassToElement(r,k.VELT_LIVE_SELECTION_ON_ELEMENT),s&&this.addClassToElement(r,k.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT),r.setAttribute(k.SNIPPYLY_HIGHLIGHT,"true"),r.setAttribute(k.VELT_IGNORE_CHANGE_DETECTION,"true"),i&&!r.style.getPropertyValue(k.VELT_SELECTION_COLOR)&&r.style.setProperty(k.VELT_SELECTION_COLOR,i),o&&r.setAttribute(k.SNIPPYLY_HIGHLIGHT_USER_NAME,o))}catch(a){this.loggingService.catch("Error in DomService highlightUserElement: ",a)}}removeHighlightUserFromElement(r){try{r&&(this.removeClassFromElement(r,k.VELT_LIVE_SELECTION_ON_ELEMENT),this.removeClassFromElement(r,k.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT),r.removeAttribute(k.SNIPPYLY_HIGHLIGHT),r.removeAttribute(k.VELT_IGNORE_CHANGE_DETECTION),r.removeAttribute(k.VELT_SELECTION_COLOR),r.removeAttribute(k.SNIPPYLY_HIGHLIGHT_USER_NAME),r.style.removeProperty(k.VELT_SELECTION_COLOR))}catch(i){this.loggingService.catch("Error in DomService removeHighlightUserFromElement: ",i)}}previewHighlightElement(r){r&&r.setAttribute(k.SNIPPYLY_HIGHLIGHT_PREVIEW,"true")}removePreviewHighlightFromElement(r){r&&r.removeAttribute(k.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"&&!zs(s)){let a=Wc();s.setAttribute(k.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}}getElementFromXPathAccepted(r,i){let o=this.getElementFromXPath(r);if(!i||!o||Wp(i,o,this.loggingService))return o;try{let s=this.getXPath(r,!1,!1,document)?.iterateNext();if(s&&s!==o&&Wp(i,s,this.loggingService)){if(typeof s.setAttribute=="function"&&!zs(s)){let a=Wc();s.setAttribute(k.ATTRIBUTES.VELT_ELEMENT_CACHE_ID,a),this.xpathCacheId.set(a,r)}return this.xpathCache.set(r,s),s}}catch(s){this.loggingService.catch("Error in DomService getElementFromXPathAccepted:",s)}return o}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=Tb(i);if(!i||!o||this.isGeneratedId(o.rootId))return{applicable:!1,element:null};let s=this.getUniqueElementById(o.rootId);if(!s||!this.isElementVisible(s)||!cd(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&&Tb(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);let o=new up;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 up}}calculatePageScrollHeight(){this.loggingService.log("%c[WB] Calling FUNCTION: calculatePageScrollHeight","color: green;");try{this.pageScrollHeight=0,this.highestNode=void 0;let r=this.findLongestNode(document?.documentElement?.childNodes);this.highestNode=r?new WeakRef(r):void 0}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){let i;try{for(let o=r.length-1;o>=0;o--){if(r[o]?.scrollHeight&&r[o]?.clientHeight){let s=Math.max(r[o]?.scrollHeight,r[o]?.clientHeight);s>=this.pageScrollHeight&&(this.pageScrollHeight=s,i=r[o])}r[o]?.childNodes?.length&&(i=this.findLongestNode(r[o]?.childNodes)??i)}}catch(o){this.loggingService.catch("Error in DomService findLongestNode: ",o)}return i}resetSelectedAnnotationsMap(r=!0,i){try{let s=this.getDraftAnnotationRefs().map(d=>d.classList.contains("velt-annotation-draft-checked")?(d.classList.remove("velt-annotation-draft-checked"),null):(this.removeClassFromElement(d,"velt-comment-dialog-shake"),setTimeout(()=>{this.addClassToElement(d,"velt-comment-dialog-shake"),d.getAttribute(k.ATTRIBUTES.VELT_ANNOTATION_EDIT_COMMENT)||d.classList.contains("velt-annotation-draft-checked")||this.addClassToElement(d,"velt-annotation-draft-checked")},100),d.getAttribute(k.ATTRIBUTES.VELT_ANNOTATION_DRAFT))).filter(d=>d),a=Object.keys(this.getRecordingInProgress()||{});s=[...s,...a];let c=this.selectedAnnotationsMap$.value;if(r&&this.selectedAnnotationsMap$.value&&Object.keys(this.selectedAnnotationsMap$.value).length){let d=[];Object.keys(c).forEach(h=>{if(c[h]?.type==="tag"){let f=c[h];f?.to?.length||s.includes(h)||d.push(f)}else c[h]?.comments?.length||s.includes(h)||d.push(c[h])}),this.deleteAnnotations$.next(d),this.deleteAnnotations$.next([])}let l={};Object.keys(c).forEach(d=>{s.includes(d)&&(l[d]=c[d]),i&&(i==="comment"?["comment","videoPin"].includes(c[d]?.type)||(l[d]=c[d]):c[d]?.type!==i&&(l[d]=c[d]))}),Object.keys(l).forEach(d=>{let h=l[d]?.multiThreadAnnotationId;h&&!l[h]&&(l[h]={annotationId:h,type:"multiThread"})}),JSON.stringify(this.selectedAnnotationsMap$.value)!==JSON.stringify(l)&&this.selectedAnnotationsMap$.next(l),this.setDialogOpenedInSidebar(!1)}catch(o){this.loggingService.catch("Error in DomService resetSelectedAnnotationsMap: ",o)}}getDraftAnnotationRefs(){let r=Array.from(document.querySelectorAll(`[${k.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`));return r.push(...this.getDraftCommentAnnotationDialogs()||[]),Array.from(new Set(r))}isEmptyDraftAnnotation(r){try{let i=this.selectedAnnotationsMap$.value?.[r];if(!i||i.type==="tag"||i.type==="multiThread"||i.comments?.length||Object.prototype.hasOwnProperty.call(this.getRecordingInProgress()||{},r))return!1;let o=this.readAnnotationDraftContent(r);return o!==void 0?!o:!this.getDraftAnnotationRefs().some(s=>s.getAttribute(k.ATTRIBUTES.VELT_ANNOTATION_DRAFT)===r)}catch(i){return this.loggingService.catch("Error in DomService isEmptyDraftAnnotation: ",i),!1}}registerAnnotationDraftContentReader(r){this.annotationDraftContentReader=r}readAnnotationDraftContent(r){try{return this.annotationDraftContentReader?.(r)}catch(i){this.loggingService.catch("Error in DomService readAnnotationDraftContent: ",i);return}}discardEmptyDraftAnnotation(r){try{let i=this.selectedAnnotationsMap$.value||{};if(!r||!this.isEmptyDraftAnnotation(r))return!1;this.deleteAnnotations$.next([i[r]]),this.deleteAnnotations$.next([]);let o=V({},i);return delete o[r],this.selectedAnnotationsMap$.next(o),!0}catch(i){return this.loggingService.catch("Error in DomService discardEmptyDraftAnnotation: ",i),!1}}setRecordingInProgress(r,i){try{if(i)this.recordingInProgress$.next(le(V({},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(`${k.TAGS.SNIPPYLY_COMMENT_DIALOG}`)),o=Array.from(document.querySelectorAll(`${k.TAGS.VELT_COMMENT_DIALOG}`));return[...i,...o].forEach(a=>{if(a?.shadowRoot){let c=a.shadowRoot.querySelector(`[${k.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);c&&r.push(c)}else{let c=a.querySelector(`${k.TAGS.VELT_SHADOW_DOM_INTERNAL}`);if(c?.shadowRoot){let l=c.shadowRoot?.querySelector(`[${k.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);l&&r.push(l)}else{let l=a.querySelector(`[${k.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(Ce(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(Ce(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.isShiftKeyPressed||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),it([])}}getHighestNode(){return this.loggingService.log("%c[WB] Calling FUNCTION: getHighestNode","color: green;"),this.highestNode?.deref()}onWindowMouseDown$(){return this.windowMouseDown$.asObservable()}onWindowPointerMove$(){return this.windowPointerMove$.asObservable()}onWindowPointerMove(){return this.windowPointerMove$.value}onWindowPointerUp$(){return this.windowPointerUp$.pipe(cn(null))}onSelectionChange$(){return this.documentSelectionChange$.pipe(cn(null))}onWindowClick$(){return this.windowClick$.pipe(cn(null))}onWindowScroll$(){return this.windowScroll$.asObservable()}onWindowResize$(){return this.windowResize$.asObservable()}onWindowKeyupBackspace$(){return this.windowKeyupBackspace$.pipe(cn(null))}onWindowKeyupDelete$(){return this.windowKeyupDelete$.pipe(cn(null))}onWindowKeyupEsc$(){return this.windowKeyupEsc$.pipe(cn(null))}onWindowPopState$(){return this.windowPopState$.asObservable()}onDocumentClick$(){return this.documentClick$.pipe(cn(null))}getLastDocumentClickTarget(){return this.lastDocumentClickTarget?.deref()??null}onDocumentClickSubject$(){return this.documentClickSubject$.asObservable()}onDocumentFocus$(){return this.documentFocus$.pipe(cn(null))}onDomChange$(r){try{return this.mutationObserver||this.setMutationObserver(r),this.mutation$.pipe(cn(null))}catch(i){return this.loggingService.catch("Error in DomService onDomChange$: ",i),it([])}}getChildListMutation$(){return this.childListMutation$.pipe(cn(null))}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 he(r=>{let i=ji(document,"mousedown").pipe(Ce(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),o=ji(document,"mousemove").pipe(Ce(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),s=ji(document,"mouseup").pipe(Ce(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),c=i.pipe(er(l=>o.pipe(cc(),Ce(([d,h])=>({startPoint:l,prevPoint:d,curPoint:h})),Ds(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(k.ATTRIBUTES.VELT_COMMENT_DISABLED,"true"),o.setAttribute(k.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(k.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(`[${k.ATTRIBUTES.VELT_LOCATION}], [${k.ATTRIBUTES.VELT_LOCATION_ID}]`)}catch(i){return this.loggingService.catch("Error in DomService isElementInsideAdditionalLocationContainer: ",i),!1}}getAdditionalLocationContainer(r){try{return r?.closest(`[${k.ATTRIBUTES.VELT_LOCATION}], [${k.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),it(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(`[${k.VELT_CUSTOM_CSS}]`);if(o&&o.remove(),i?.type==="link"){let s=document.createElement("link");s.href=i?.value,s.rel="stylesheet",s.setAttribute(k.VELT_CUSTOM_CSS,"true"),r?.shadowRoot?.appendChild(s)}else{let s=document.createElement("style");s.innerHTML=this.sanitizeHtml(i?.value),s.setAttribute(k.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=this.parseHtmlInInertDocument(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;"),My.sanitize(r,uj)}catch(i){return this.loggingService.catch("Error in DomService sanitizeHtml: ",i),""}}sanitizeHtmlForPaste(r){try{let i=this.convertStylesToTags(r);return My.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),""}}parseHtmlInInertDocument(r){let o=document.implementation.createHTMLDocument("").createElement("div");return o.innerHTML=r,o}convertStylesToTags(r){try{let i=this.parseHtmlInInertDocument(r);return 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(r.ownerDocument.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.ownerDocument,c=s.style,l=o,d=c?.fontWeight;if(d==="bold"||d==="700"||d==="800"||d==="900"){let h=s.tagName?.toLowerCase();if(h!=="b"&&h!=="strong"){let f=a.createElement("b");l.parentNode.insertBefore(f,l),f.appendChild(l),l=f}}if(c?.fontStyle==="italic"){let h=s.tagName?.toLowerCase();if(h!=="i"&&h!=="em"){let f=a.createElement("i");l.parentNode.insertBefore(f,l),f.appendChild(l),l=f}}if((c?.textDecorationLine?.includes("underline")||c?.textDecoration?.includes("underline"))&&s.tagName?.toLowerCase()!=="u"){let f=a.createElement("u");l.parentNode.insertBefore(f,l),f.appendChild(l),l=f}}}catch(i){this.loggingService.catch("Error in DomService processNodeStyles: ",i)}}sanitizeSvg(r){try{return My.sanitize(r,uj)}catch(i){return this.loggingService.catch("Error in DomService sanitizeSvg: ",i),""}}setDeviceInfo(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDeviceInfo","color: green;");let r=new Br;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),it(new Br)}}getTabId(){try{let r=sessionStorage.getItem(k.SESSION_STORAGE.VELT_TAB_ID);!r&&this.tabId&&(r=this.tabId,sessionStorage.setItem(k.SESSION_STORAGE.VELT_TAB_ID,r)),!this.tabId&&r&&(this.tabId=r);let i=this.getTabIdFromWindowName();return(!r||r!==i)&&(r=Wc(),this.tabId=r,sessionStorage.setItem(k.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 Br}}isMobileDevice(){try{return new Br().getDeviceType()===Ir.MOBILE}catch(r){return this.loggingService.catch("Error in DomService isMobileDevice: ",r),!1}}isTabletDevice(){try{return new Br().getDeviceType()===Ir.TABLET}catch(r){return this.loggingService.catch("Error in DomService isTabletDevice: ",r),!1}}isDesktopDevice(){try{return new Br().getDeviceType()===Ir.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 Br().getDeviceType()===Ir.MONITOR}catch(r){return this.loggingService.catch("Error in DomService isMonitorDevice: ",r),!1}}isElementOriginallyStatic(r){try{return window.getComputedStyle(r).position==="static"||r.hasAttribute(k.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)||r.hasAttribute(k.ATTRIBUTES.VELT_AREA_PIN_HOST_STATIC)||r.hasAttribute(k.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC)||r.hasAttribute(k.ATTRIBUTES.VELT_RECORDER_PIN_HOST_STATIC)||r.hasAttribute(k.ATTRIBUTES.VELT_ARROW_PIN_HOST_STATIC)}catch(i){return this.loggingService.catch("Error in DomService isElementOriginallyStatic: ",i),!1}}};e.ANCHOR_CACHE_LIMIT=2e4,e.MAX_ROBUST_XPATH_CANDIDATES=20,e.MULTIPLE_NBSP_REGEX=/(?: \s*){2,}/g,e.TRIM_NBSP_REGEX=/^(?: \s*)+|(?: \s*)+$/g,e.\u0275fac=function(i){return new(i||e)(q(oa),q(Bo),q(Rt),q(vR))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function al(t){let e=t?.refreshToken;return typeof e=="string"&&e.length>0?e:void 0}var yb=Symbol("velt-auth-state-pending");function Xre(t,e){let n=V(V({},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}var Qre=["userId","userSnippylyId","organizationId","clientOrganizationId","isAdmin","isReadOnly","isAnonymous","isGuest","plan","contacts"];function Jre(t){if(!t||typeof t!="object")return{};let e=V({},t);for(let n of Qre)delete e[n];return e}function fj(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 Id=(()=>{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(vy),this.portableBackend$=new de(null),this.portableAuthUser$=new de(null),this.user$=new de(null),this.userOptions$=new de(null),this.userContacts$=new de(null),this.userOrganization$=new de(null),this.isPrivateCommentsEnabled$=new de(!1),this.providedUser=new io,this.portableRefreshTimer=null,this.portableToken=null,this.portableRefreshInFlightEpoch=null,this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0,this.portableRefreshWarnedEpoch=null,this.portableApiKeyRefusalWarned=!1,this.portableApiKeyRenewalAskedAt=null,this.portableLicensePause=null,this.portableLicenseRetry=null,this.portableLicenseRetryRunSince=null,this.portableLicenseRetryRun=Promise.resolve(),this.portableLicenseNotices=new Cy(f=>this.coreActionsService.triggerAction(di.ERROR,f)),this.portableVisibilityHandler=null,this.loggedInUserResolveRetryDelaysMs=[2e3,8e3,3e4],this.loggedInUserResolveRetryInFlightUserId=null,this.firebaseConfig$=new de(null),this.advancedQueries$=new de(null),this.planDetails$=new de(null),this.signOutPreviousUser$=new de(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.portablePlanSeeded=!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.portableChunkReady=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(CT).subscribe(f=>{this.commentService=f??void 0}),this.serviceBook.observe(DT).subscribe(f=>{this.reactionService=f??void 0}),this.serviceBook.observe(RT).subscribe(f=>{this.areaService=f??void 0}),this.serviceBook.observe(KU).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(XU).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(k.LOCAL_STORAGE.VELT_USER_FORCE_RE_LOGGED_IN)==="true",this.sessionReLoginSubscription=Ed(this.afAuth).pipe(cn(this.afAuth.currentUser),cc(),er(([f,g])=>this.domService.onNetworkStatusChange$().pipe(Tn(E=>E),yn(1),Ce(()=>({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(),R=I-S;S>I&&(this.analyticsService.trackEvent(yt.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:R,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(yt.Events.Core.SDK_SESSION_RE_LOGIN_COUNT_EXCEEDED,{apiKey:this.apiKey,clientUserId:this.lastLoggedInUserData.user.userId,snippylyUserId:this.lastLoggedInUserData.user.userSnippylyId,timeLeft:R,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.user$.value?.userSnippylyId),this.sessionReLoginSubscription?.unsubscribe()):(this.sessionReLoginCount++,this.analyticsService.trackEvent(yt.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:R,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(ri(gp)).subscribe(f=>{let g=$R(f);this.coreActionsService.triggerAction(di.USER_UPDATE,g),this.coreActionsService.triggerAction(di.INIT_UPDATE,{event:di.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 LT),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||Ed(this.afAuth).pipe(yn(1)).subscribe(s=>y(this,null,function*(){if(this.autoLoginCalled=!0,s){let a=yield xp(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(yt.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++,this.cancelPortableLicenseRetry();let i=null;if(!r.user)return null;r.generateToken&&typeof r.generateToken=="function"&&(i=yield r.generateToken());let o=yield HR(()=>window.Velt.identify(r.user,V(V({},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(di.ERROR).pipe(Tn(s=>s.code==="token_expired"),yn(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 HR(()=>y(this,null,function*(){try{let I=yield r.generateToken?.();return c()&&I?window.Velt.identify(r.user,V(V({},r.options||{}),I&&{authToken:I}),{fromProvider:!0}):!0}catch{return!1}}),r.retryConfig||{retryCount:0,retryDelay:0}))&&c()){let I=this.docService?.getDocumentIds()?.map(U=>U.clientDocumentId)??[];fj(l.map(U=>U.id),I)&&(yield this.docService?.setDocuments({documents:l,options:d,source:"internal"}));let S=[],R=this.docService?.getLocation();R?.location?.id&&S.push(R.location.id),Object.values(this.docService?.getLocations()??{}).forEach(U=>{U?.location?.id&&S.push(U.location.id)}),fj(h.map(U=>U?.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 GT(r,r?.userId??"");localStorage.setItem(k.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(k.LOCAL_STORAGE.VELT_IDENTIFY_USER);return i?yield fp(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:le(V({},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{a!==Vp&&this.cancelPortableLicenseRetry(),r.userSnippylyId=lB(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 Ed(this.afAuth).pipe(yn(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?($e("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?($e("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 xp(d,!0).catch(U=>null);if(!E)return;let{user:I,firebaseConfig:S,advancedQueries:R}=E.claims;if(sb({userSnippylyId:d?.uid,groupId:I?.groupId,organizationId:I?.organizationId},r,i)||!s&&r?.organizationId&&!this.forceReLoggedIn||this.forceReLoginRequiredForAdvancedQueries(r)||this.forceReLoginRequiredForRegion(r,S)||this.forceReLoginRequiredForCommentViews(r)){localStorage.setItem(k.LOCAL_STORAGE.VELT_USER_FORCE_RE_LOGGED_IN,"true"),localStorage.setItem(k.LOCAL_STORAGE.VELT_COMMENT_VIEWS_MIGRATED,"true"),this.forceReLoggedIn=!0;let U=this.portableSessionEpoch,H=this.portableLocalSessionEnds,Q=this.signOutUser("internal");c+=this.portableSessionEpoch-U,l+=this.portableLocalSessionEnds-H,yield Q}else 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(R),I&&(this.providedUser.isAdmin=!!I.isAdmin),this.initializeSignedInUser(d,s,r),h=!1,this.configService?.getEnablePortableBackend()!==!0&&this.portableLicenseNotices.served(null,"identify","hosted-callable"),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(yt.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=Date.now(),I=a===Vp,S=this.endpointsService?.getPortableIdentifyUrl?.()?"gateway":"hosted-callable",R=I&&S==="hosted-callable"?yield this.requestIdentify(r,i?.authToken).catch(H=>{if(w2(H))return Iy("the license re-run of identify could not reach the deployment");throw H}):yield this.requestIdentify(r,i?.authToken);if(I&&this.pendingUserLogin)return $e("credential.license-retry-discarded","pending identify"),this.initializeClientToken=0,this.checkForPendingLogin(),null;if(I&&S==="hosted-callable"&&this.isCallableLicenseRetryOvertaken(r,c,l,s))return $e("credential.license-retry-discarded","overtaken"),this.endLicenseRetryRunQuietly();if(R.error){if(this.analyticsService.trackEvent(yt.Events.Core.SDK_VALIDATE_CLIENT_FAILED,le(V({apiKey:this.apiKey,clientUserId:r.userId,snippylyUserId:r.userSnippylyId,message:R.error,forceReset:this.userOptions$.value?.forceReset,user:this.getUserForTelemetry(r)},R),{source:a}),!0,r.userSnippylyId,r.userId),Dy(R)){let H=I?this.portableLicenseRetryRunSince??E:E;if(this.isPortableIdentifyOvertaken(c,l,s)||(this.notePortableLicenseRefusalAnswer(R,S),S==="gateway"?!this.pauseLivePortableSessionForLicense("identify")&&!s&&this.armLicenseRefusedIdentifyRetry(r,i,H):this.armLicenseRefusedIdentifyRetry(r,i,H,"hosted-callable",s)),I)return this.endLicenseRetryRunQuietly()}else if(I&&this.isTransientLicenseRetryFailure(R)){if(!this.isPortableIdentifyOvertaken(c,l,s)){let H=this.portableLicenseRetryRunSince??E;S==="gateway"?this.armLicenseRefusedIdentifyRetry(r,i,H):this.armLicenseRefusedIdentifyRetry(r,i,H,"hosted-callable",s)}return this.endLicenseRetryRunQuietly()}else if(R.error&&typeof R.error=="string")if(this.isTokenExpiredIdentifyError(R))this.emitIdentifyTokenExpiredError(R,r,a);else{let H=R;this.coreActionsService.triggerAction(di.ERROR,H)}throw R}else this.tokenExpiredErrorCount=0;if(this.shouldHandlePortableBackend(R)&&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(R)?this.portableLicenseNotices.served(ol(R?.license),"identify",S):S==="hosted-callable"&&R?.firebaseConfig&&this.portableLicenseNotices.served(ol(R?.license),"identify","hosted-callable"),this.shouldHandlePortableBackend(R)&&c!==this.portableSessionEpoch&&(this.autoLoginRequired=!1,this.portableResumeUserId=null),this.analyticsService.trackEvent(yt.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,R,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}isCallableLicenseRetryOvertaken(r,i,o,s){try{if(this.isPortableIdentifyOvertaken(i,o,s))return!0;let a=this.afAuth?.currentUser;return!!a&&a.uid!==r?.userSnippylyId}catch{return!0}}isPortableIdentityChange(r,i){try{if(!this.portableAuthUser$.value)return!1;let o=this.portableSessionIdentity?.user??this.user$.value;return o?sb(o,r,i):!1}catch(o){return this.loggingService.catch("Error in isPortableIdentityChange: ",o),!1}}isVersionGreaterThanOrEqualTo4(){try{let r=zc();return(r?parseInt(r.split(".")?.[0]||"0"):0)>=4}catch(r){return this.loggingService.catch("Error in isVersionGreaterThanOrEqualTo4: ",r),!1}}isVersion4Point5(){try{let r=zc();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(k.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(k.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:V(V({},this.endpointsService.getFirebaseConfig()),r)})}catch(i){this.loggingService.catch("Error in setFirebaseConfig: ",i)}}requestIdentify(r,i){return y(this,null,function*(){let o=zc();this.usersService?.userResolverConfigured?.()&&(r=qR(r));let s=this.endpointsService.getPortableIdentifyUrl();return s?f2({url:s,apiKey:this.apiKey,user:r,version:o,authToken:i}):(yield Td(this.functions,ud({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.getConfiguredPortableIdentifyUrl();return i?m2({url:g2(i,"refresh"),apiKey:this.apiKey,refreshToken:r,timeoutMs:d2()}):Iy("the portable identify URL is not configured; the renewal credential was not sent")})}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(di.ERROR,s)}else{let s={code:"too_many_retries",message:"Token expired. Too many retries.",error:r?.error,source:r?.source};this.coreActionsService.triggerAction(di.ERROR,s),this.analyticsService.trackEvent(yt.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)}}getConfiguredPortableIdentifyUrl(){try{let r=this.endpointsService?.getPortableIdentifyUrl?.();return r&&!ad(r)?r:null}catch{return null}}notePortableLicenseRefusalAnswer(r,i="gateway"){this.portableLicenseNotices.refused(ol(r?.license),rb(r?.message),i)}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&&k2(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=al(i),c=a?this.endpointsService.getPortableIdentifyUrl()??void 0:void 0;this.portableSessionIdentity=V({user:r,epoch:s},a?{refreshToken:a,refreshTokenIssuer:c}:{}),this.portableSessionStartedAt=Date.now();let l=this.handlePortableBackendResponse(i);this.planDetails$.value||(this.getPlanDetailsCalled=!0,this.portablePlanSeeded=!0,this.planDetails$.next({planInfo:null,isPlanExpired:!1})),yield this.applyPortableProjectConfig(i);let d=null;if(i?.token&&this.usersService?.externalUserDataProviderAvailable())try{d=yield this.resolveSignedInUserWithProvider(r,this.providedUser?.clientOrganizationId||r.clientOrganizationId)}catch(f){this.loggingService.catch("Error in resolveSignedInUserWithProvider (Tier B sign-in): ",f),d=null}if(s!==this.portableSessionEpoch)return $e("session.adopt-discarded"),this.loggingService.log("Velt [portable backend]: discarding a portable sign-in that a sign-out or a new identify overtook."),!0;let h=this.initializePortableSignedInUser(r,i,d);h&&this.probeIdentifyPermissionWhenPortableReady(h,s,l)}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 xp(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 ob({apiEndpoint:r?.apiEndpoint,token:r?.token});if(!i)return;this.applyProjectConfig(i)}catch(i){this.loggingService.catch("Error in applyPortableProjectConfig: ",i)}})}applyProjectConfig(r){this.setIsPrivateCommentsEnabled(!!r?.isPrivateCommentsEnabled);let i=r?.activityConfig??{immutable:!1,isEnabled:!1};this.cachedActivityConfig=i,this.activityService?.setActivityFeatureConfig(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});let i=F2({backend:r?.backend,token:r?.token??null,wsEndpoint:r?.wsEndpoint,apiEndpoint:r?.apiEndpoint});return this.portableChunkReady=i,L2(o=>this.onPortableLicenseRefusalReported(o)),P2(()=>this.onPortableApiKeyRefusalReported()),this.schedulePortableTokenRefresh(r?.token??null),i}catch(i){return this.loggingService.catch("Error in handlePortableBackendResponse: ",i),null}}schedulePortableTokenRefresh(r){try{if(this.clearPortableTokenRefresh(),this.portableLicensePause=null,this.cancelPortableLicenseRetry(),this.portableToken=r,!r)return;this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0;let i=v2(Up(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=tb(this.portableToken,Date.now());if($e(`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"}`),V2()}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(k.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{return}}readPortableSavedSession(r){return y(this,null,function*(){try{let i;try{i=localStorage.getItem(k.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 fp(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)?al(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(k.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)??"{}");i&&typeof i=="object"&&!Array.isArray(i)&&(r=i)}catch{r={}}r[this.apiKey]=Date.now(),localStorage.setItem(k.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(k.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){$e("credential.refresh-skipped",`${this.portableRenewalStopped.reason}; waiting for identify()`);return}if(this.holdRefreshForLicensePause(i,r))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&&($e("credential.shared-adopted"),this.portableSessionIdentity=le(V({},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}).`),$e("credential.refresh-requested",`reason=${r} via=refresh`);let f=yield this.requestPortableRefresh(h);if(i!==this.portableSessionEpoch){$e("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(Dy(f)){$e("credential.refresh-license-refused",`reason=${r}`),this.notePortableLicenseRefusalAnswer(f),this.pausePortableRenewalsForLicense(i,!0);return}if(f?.code===ZN){this.endPortableSessionForDeadCredential(s,f,r);return}if(kp.has(f?.code)){$e("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();tb(this.portableToken,S)&&this.portableRefreshFailuresPastExpiry++,this.armPortableRefreshTimer(S2(Up(this.portableToken),S,this.portableRefreshFailuresPastExpiry),r);return}let g=this.readStoredPortableSessionRaw(),E=yield this.readPortableSavedSession(s.userId);if(i!==this.portableSessionEpoch){$e("credential.refresh-discarded",`reason=${r}`);return}if(E.verdict==="stop"){this.endPortableSessionFromAnotherPage(s,`refresh-answered:${r}`);return}$e("credential.refreshed"),this.portableLicenseNotices.served(ol(f?.license),"renewal"),this.handlePortableBackendResponse(f);let I=al(f)??h;this.portableSessionIdentity?.epoch===i&&(this.portableSessionIdentity=le(V({},this.portableSessionIdentity),{refreshToken:I,refreshTokenIssuer:l})),E.verdict==="persist"&&this.persistPortableSession(s,le(V({},f),{refreshToken:I}),{expectStoredRaw:g})}catch(o){this.loggingService.catch("Error refreshing portable token: ",o)}finally{this.portableRefreshInFlightEpoch===i&&(this.portableRefreshInFlightEpoch=null)}}})}holdRefreshForLicensePause(r,i){let o=this.portableLicensePause;if(o?.epoch!==r||i==="license")return!1;let s=Date.now(),a=Math.min(o.retryAt-s,b2);return a<=0?!1:(o.retryAt=s+a,$e("credential.refresh-skipped",`license paused; next retry in ${Math.round(a/1e3)}s`),this.armPortableRefreshTimer(a,"license"),this.checkPortableSessionAgainstStorage(`license-paused:${i}`),!0)}pausePortableRenewalsForLicense(r,i){try{let o=this.portableLicensePause?.epoch===r?this.portableLicensePause:null;if(o&&!i)return;let s=(o?.refusals??0)+(i?1:0),a=ib(Math.random());this.portableLicensePause={epoch:r,refusals:s,retryAt:Date.now()+a},$e("credential.license-paused",`refusals=${s} retryInS=${Math.round(a/1e3)}`),this.armPortableRefreshTimer(a,"license")}catch(o){this.loggingService.catch("Error pausing portable renewals for the license: ",o)}}onPortableLicenseRefusalReported(r){try{this.portableLicenseNotices.refused(r?.license??null,r?.message),this.pauseLivePortableSessionForLicense(r?.source??"?")}catch(i){this.loggingService.catch("Error handling a portable license refusal: ",i)}}onPortableApiKeyRefusalReported(){try{let r=this.portableSessionIdentity;if(!r||r.epoch!==this.portableSessionEpoch||!this.portableBackend$.value){$e("credential.api-key-refused","no live session");return}if(this.portableApiKeyRefusalWarned||(this.portableApiKeyRefusalWarned=!0,console.warn("Velt [portable backend]: the gateway refused the realtime session because the API key is disabled. The SDK does not reconnect in a loop: it renews the session (every 30 s while the token is valid, less often after it expires) and reconnects once the key is enabled again.")),this.portableRefreshFailures>0){$e("credential.api-key-refused","renewal retry already running");return}let i=Date.now(),o=this.portableApiKeyRenewalAskedAt;if(o?.epoch===r.epoch&&i-o.at<Fp){$e("credential.api-key-refused","renewal floor"),this.armPortableRefreshTimer(Fp-(i-o.at),"focus");return}this.portableApiKeyRenewalAskedAt={epoch:r.epoch,at:i},$e("credential.api-key-refused","renewing now"),this.refreshPortableToken("focus")}catch(r){this.loggingService.catch("Error handling a portable API-key refusal: ",r)}}pauseLivePortableSessionForLicense(r){let i=this.portableSessionIdentity;return!i||i.epoch!==this.portableSessionEpoch||!this.portableBackend$.value?!1:($e("credential.license-reported",`source=${r}`),this.pausePortableRenewalsForLicense(i.epoch,!1),!0)}armPortableLicenseRetry(r,i){try{this.cancelPortableLicenseRetry();let o=ib(Math.random()),s=setTimeout(()=>this.runPortableLicenseRetry(),o);this.portableLicenseRetry={timer:s,epoch:this.portableSessionEpoch,dueAt:Date.now()+o,what:r,rerun:i},$e("credential.license-retry-armed",`${r} retryInS=${Math.round(o/1e3)}`)}catch(o){this.loggingService.catch("Error arming the portable license retry: ",o)}}runPortableLicenseRetry(){let r=this.portableLicenseRetry;if(r){this.portableLicenseRetry=null,clearTimeout(r.timer);try{if(r.epoch!==this.portableSessionEpoch||this.portableSessionIdentity||this.initializeClientToken){$e("credential.license-retry-skipped",r.what);return}$e("credential.license-retry",r.what),r.rerun()}catch(i){this.loggingService.catch("Error running the portable license retry: ",i)}}}cancelPortableLicenseRetry(){let r=this.portableLicenseRetry;r&&(clearTimeout(r.timer),this.portableLicenseRetry=null),this.portableLicenseRetryRunSince=null}armLicenseRefusedIdentifyRetry(r,i,o,s="gateway",a){this.armPortableLicenseRetry("identify",()=>{this.portableLicenseRetryRun=this.rerunLicenseRefusedIdentify(r,i,o,s,a)})}rerunLicenseRefusedIdentify(r,i,o,s="gateway",a){return y(this,null,function*(){try{if(s==="hosted-callable"){let f=this.afAuth?.currentUser;if(f&&f.uid!==r?.userSnippylyId){$e("credential.license-retry-skipped","another user signed in");return}if(this.initializeClientToken)return;this.portableLicenseRetryRunSince=o,yield this.initializeClient(r,i,new Date().getTime(),a,Vp).catch(()=>{});return}let c=this.portableSessionEpoch,l=this.readPortableSignOutAt();if(l!==null&&l>o){$e("credential.license-retry-skipped","signed out in another page");return}let d=yield this.readPersistedPortableSession();if(c!==this.portableSessionEpoch||this.portableSessionIdentity||this.initializeClientToken)return;let h=d?.envelope?.user?.userId;if(h&&h!==r?.userId){$e("credential.license-retry-skipped","another user signed in");return}this.portableLicenseRetryRunSince=o,yield this.initializeClient(r,i,new Date().getTime(),void 0,Vp).catch(()=>{})}catch(c){this.loggingService.catch("Error re-running the license-refused identify: ",c)}finally{this.portableLicenseRetryRunSince=null}})}endLicenseRetryRunQuietly(){return this.initializeClientToken=0,this.checkForPendingLogin(),null}isTransientLicenseRetryFailure(r){let i=r?.code;return!this.isTokenExpiredIdentifyError(r)&&!kp.has(i)&&i!=="missing_jwt_token"&&i!=="unauthenticated"&&i!=="permission-denied"}armRestoreLicenseRetry(r){this.armPortableLicenseRetry("restore",()=>{this.portableAutoLoginInFlight=this.portableAutoLoginInFlight.then(()=>this.autoLoginPortableSession(le(V({},r??{}),{licenseRetry:!0}))).catch(()=>{})})}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){$e("credential.refresh-credential-invalid",`reason=${o}`),this.portableSavedSessionRaw&&this.clearPersistedPortableSessionIfUnchanged(this.portableSavedSessionRaw),this.endPortableSessionLocally(r),this.emitIdentifyTokenExpiredError(i,r,"internal-portableRefresh")}endPortableSessionFromAnotherPage(r,i){$e("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!==k.LOCAL_STORAGE.VELT_PORTABLE_SESSION&&i!==k.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,o=null){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: initializePortableSignedInUser","color: green;"),!i?.token)return this.portableAuthUser$.value&&(this.userPermissionService?.invalidateAllPermissionsState(),this.releaseLiveUserSession("clear")),null;let s=new io;s.type="signedIn",s=V(V(V({},s),r),Jre(o)),ab(s,{provided:le(V({},r),{isAdmin:I2(i?.token)}),resolved:o,avatarColor:c=>this.getUserAvatarColor(c),textColor:c=>this.getUserTextColor(c)}),this.setUserToStorage(s),this.persistPortableSession(s,i);let a=Object.assign({},s);return delete a.contacts,this.analyticsService.identifyUser(s.userSnippylyId,a,{forceReset:this.userOptions$.value?.forceReset}),this.user$.next(s),this.portableAuthUser$.next({uid:s.userSnippylyId}),s}catch(s){return this.loggingService.catch("Error in initializePortableSignedInUser: ",s),null}}clearPortableBackendState(){try{this.portableSignOutOwnsEpochBump||this.portableSessionEpoch++,this.releasePortableSession({clearStorage:!0})}catch(r){this.loggingService.catch("Error clearing portable backend state: ",r)}}releaseLiveUserSession(r){this.resetServicesCache(),this.user$.next(null),r==="local"?this.releasePortableSession({clearStorage:!1}):this.clearPortableBackendState()}releasePortableSession(r){this.portablePlanSeeded&&(this.portablePlanSeeded=!1,this.getPlanDetailsCalled=!1),this.pendingPortableRestore=null,this.portableSessionIdentity=null,this.cancelPortableLicenseRetry(),r.clearStorage&&(this.portableAutoLoginCalled||this.configService?.getEnablePortableBackend()===!0)&&this.clearPersistedPortableSession(),!(!this.portableBackend$.value&&!this.portableAuthUser$.value)&&(this.clearPortableTokenRefresh(),this.portableToken=null,this.portableChunkReady=null,this.portableRefreshFailures=0,this.portableRefreshFailuresPastExpiry=0,this.portableLicensePause=null,this.portableBackend$.next(null),this.portableAuthUser$.next(null),this.user$.next(null),U2())}endPortableSessionLocally(r){try{this.userPermissionService?.invalidateAllPermissionsState(),this.portableSessionEpoch++,this.portableLocalSessionEnds++,this.releaseLiveUserSession("local"),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(yt.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?le(V({},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:V({backend:i.backend,wsEndpoint:i.wsEndpoint,apiEndpoint:i.apiEndpoint,token:i.token},al(i)?{refreshToken:al(i)}:{})},d=yield GT(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(k.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(k.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(k.LOCAL_STORAGE.VELT_PORTABLE_SESSION);if(!r)return null;let i=yield fp(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(k.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{}}clearPersistedPortableSessionIfUnchanged(r){try{r&&localStorage.getItem(k.LOCAL_STORAGE.VELT_PORTABLE_SESSION)===r&&this.clearPersistedPortableSession()}catch{}}isPortableTokenNearExpiry(r){let i=Up(r);return i===null||i-Date.now()<=eb}isPortableRestoreConfigured(){try{return this.configService?.getEnablePortableBackend()===!0&&!!this.getConfiguredPortableIdentifyUrl()}catch{return!1}}isRestorablePortableSession(r,i,o){try{if(!this.isPortableRestoreConfigured()||o?.forceReset||r.portableBackendUrl!==(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)||!rl(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=al(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}$e("credential.restore-renew","via=refresh");let f=yield this.requestPortableRefresh(h);if(o())return;if(!this.shouldHandlePortableBackend(f)||!f?.token){if(Dy(f)){this.notePortableLicenseRefusalAnswer(f),this.loggingService.log("Velt [portable backend]: the persisted session was not renewed: the deployment refuses new sessions (license). Keeping it and asking again in 5 minutes or more."),this.armRestoreLicenseRetry(r);return}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."),r?.licenseRetry&&this.armRestoreLicenseRetry(r);return}if(kp.has(f?.code)&&this.reportPortableRefreshMisconfigured(f),f?.code!==ZN){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.`),r?.licenseRetry&&!kp.has(f?.code)&&this.armRestoreLicenseRetry(r);return}this.loggingService.log("Velt [portable backend]: the persisted session could not be renewed on reload; waiting for identify()."),this.clearPersistedPortableSessionIfUnchanged(a.raw);return}this.portableLicenseNotices.served(ol(f?.license),"renewal");let g=al(f)??h;l=le(V({},c),{res:{backend:f.backend,wsEndpoint:f.wsEndpoint,apiEndpoint:f.apiEndpoint,token:f.token,refreshToken:g}})}if(o())return;this.pendingPortableRestore=V({envelope:l,epoch:i,raw:a.raw},s?{resume:!0}:{});let d=this.buildAutoLoginOptions();s&&delete d.forceReset,yield this.initializeClient(V({},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(k.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:MT.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&&!this.portableAuthUser$.value)return!0;let s=Xre(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 ac([Ed(this.afAuth).pipe(cn(yb)),this.portableAuthUser$]).pipe(Tn(([i,o])=>(o!==null&&(r=!0),!!(i!==yb||o!==null||r))),Ce(([i,o])=>(i===yb?null:i)??o))}getUser$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUser$","color: green;"),this.combinedAuthBearer$().pipe(er(r=>r?this.user$.asObservable():it(null)),ri(gp))}getAuthUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAuthUser","color: green;"),this.afAuth?.currentUser}getAuthState$(){return this.combinedAuthBearer$()}getIdTokenResultForUser(r,i){return xp(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=V(V({},this.providedUser),r),i){let o=V(V({},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 QG(this.afAuth,i).then(s=>(this.analyticsService.trackEvent(yt.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(yt.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(AT)?.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 io;s.userSnippylyId=r.uid,s.type="signedIn",o&&(s=V(V({},s),o)),this.setUserToStorage(s),this.mergeUserWithProvidedUserData(s,i)}catch(s){this.loggingService.catch("Error in initializeSignedInUser: ",s)}}resolveSignedInUserWithProvider(r,i){return y(this,null,function*(){{let o=Wc(),s=MT.IDENTIFY;this.coreActionsService.triggerAction(di.USER_RESOLVER,{event:yt.Events.Resolver.USER_RESOLUTION_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:o,methodName:NR.MERGE_USER_WITH_PROVIDED_USER_DATA,moduleName:s,source:"internal",payload:{userIds:[r.userId],organizationId:i}});let a=yield this.usersService?.resolveUsers({userIds:[r.userId],organizationId:i,skipUserCheck:!0,uniqueId:o,moduleName:s});return a&&a[r.userId]?JSON.parse(JSON.stringify(a[r.userId]||{})):(this.scheduleLoggedInUserResolveRetry(r.userId,i),null)}})}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=this.providedUser?.clientOrganizationId||r.clientOrganizationId;o=yield this.resolveSignedInUserWithProvider(r,s),r=V(V({},r),o||{})}ab(r,{provided:this.providedUser,resolved:o,avatarColor:s=>this.getUserAvatarColor(s),textColor:s=>this.getUserTextColor(s)}),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});let o=this.portableBackend$.value,s=this.portableSessionEpoch;!this.getPlanDetailsCalled&&!o&&this.getPlanDetailsFromDb();let a;if(o)a=ob({apiEndpoint:o.apiEndpoint,token:this.portableToken});else{let h=Td(this.functions,ud({url:this.endpointsService.getCloudFunctionUrl("sdkProxy"),apiProxyDomain:this.configService?.getApiProxyDomain()}));a=vB({methodName:"updateUserInternally",data:{type:"getProjectConfig"},getSdkProxy:h,userId:r?.userId??""})}let c=Promise.resolve();o?this.probeIdentifyPermissionWhenPortableReady(r,s,this.portableChunkReady):c=this.buildIdentifyPermissionProbe(r);let[l,d]=yield Promise.allSettled([a,c]);if(o){if(s!==this.portableSessionEpoch){this.loggingService.log("Velt [portable backend]: discarding an updateUser() that a sign-out or a new identify overtook.");return}l.status==="fulfilled"&&l.value&&this.applyProjectConfig(l.value)}else l.status==="fulfilled"?this.applyProjectConfig(l.value?.data):this.loggingService.warn("Failed to fetch project config:",l.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)}})}buildIdentifyPermissionProbe(r){if(this.userPermissionService?.isPermissionProviderAvailable()&&r.clientOrganizationId){let i=[{userId:r.userId,resource:{id:r.clientOrganizationId,type:_V.ORGANIZATION,source:PT.IDENTIFY,organizationId:r.clientOrganizationId}}],o=Wc();return this.coreActionsService.triggerAction(di.PERMISSION_PROVIDER,{event:yt.Events.PermissionProvider.RESOURCE_ACCESS_REQUEST_FORMED,methodName:PT.IDENTIFY,uniqueId:o,timestamp:new Date().getTime(),source:"internal",payload:{requests:i}}),this.userPermissionService?.onResourceAccessRequired({requests:i,uniqueId:o,userId:r.userId,methodName:PT.IDENTIFY,fromCache:!1})??Promise.resolve()}return Promise.resolve()}probeIdentifyPermissionWhenPortableReady(r,i,o){return y(this,null,function*(){try{if(yield o,i!==this.portableSessionEpoch||this.user$.value?.userId!==r.userId||!pj()||this.commonDbService?.isPortableBackendActive?.()!==!0)return;yield this.buildIdentifyPermissionProbe(r)}catch(s){this.loggingService.catch("Error in probeIdentifyPermissionWhenPortableReady: ",s)}})}updateUserToFirebase(r){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserToFirebase","color: green;");try{let i=JSON.parse(JSON.stringify(r)),o=le(V({},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 Td(this.functions,ud({url:this.endpointsService.getCloudFunctionUrl("getPlanDetails"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:1200*1e3})({apiKey:this.configService.getApiKey(),sdkVersion:zc(),sdkType:this.configService.getSdkType()});return i?.data?.isPlanExpired&&(this.analyticsService.trackEvent(yt.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(Tn(r=>!!r),Ce(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(er(r=>r?this.userOrganization$.asObservable().pipe(Ce(i=>i?.metadata?.organizationId===r.organizationId?i:null)):it(null)))}signOutUser(r="internal"){return y(this,null,function*(){try{this.userPermissionService?.invalidateAllPermissionsState(),this.portableSessionEpoch++,this.portableSignOutOwnsEpochBump=!0,this.pendingPortableRestore=null,this.cancelPortableLicenseRetry(),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(yt.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 Ed(this.afAuth).pipe(yn(1)).toPromise().catch(o=>null);if(i){this.releaseLiveUserSession("clear");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 gB(1e3),JG(this.afAuth).catch(o=>{this.loggingService.catch("Error in signOutUser:",o)})}else return(this.portableAuthUser$.value||this.portableBackend$.value)&&this.releaseLiveUserSession("clear"),Promise.resolve()}catch(i){this.loggingService.catch("Error in signOutUser: ",i)}finally{this.portableSignOutOwnsEpochBump=!1}})}isFeatureAllowed(r){return oB(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?.()?qR(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(Hc(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)(q(el),q(uo),q(G2),q(j2),q(hj),q(Zo),q(oa),q(Rt),q(NT))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var mj="@firebase/database",Ej="1.0.20";var Dw="";function Zre(t){Dw=t}var Nb=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:hd(n)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}};var bb=class{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,n){n==null?delete this.cache_[e]:this.cache_[e]=n}get(e){return Gr(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}};var Yj=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 Nb(e)}}catch{}return new bb},ll=Yj("localStorage"),wb=Yj("sessionStorage");var Cd=new jr("@firebase/database"),Xj=(function(){let t=1;return function(){return t++}})(),Qj=function(t){let e=$B(t),n=new zT;n.update(e);let r=n.digest();return fd.encodeByteArray(r)},fg=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+=fg.apply(null,r):typeof r=="object"?e+=xt(r):e+=r,e+=" "}return e},ul=null,_j=!0,eie=function(t,e){X(!e||t===!0||t===!1,"Can't turn on custom loggers persistently."),t===!0?(Cd.logLevel=Ne.VERBOSE,ul=Cd.log.bind(Cd),e&&wb.set("logging_enabled",!0)):typeof t=="function"?ul=t:(ul=null,wb.remove("logging_enabled"))},pn=function(...t){if(_j===!0&&(_j=!1,ul===null&&wb.get("logging_enabled")===!0&&eie(!0)),ul){let e=fg.apply(null,t);ul(e)}},pg=function(t){return function(...e){pn(t,...e)}},Ob=function(...t){let e="FIREBASE INTERNAL ERROR: "+fg(...t);Cd.error(e)},rs=function(...t){let e=`FIREBASE FATAL ERROR: ${fg(...t)}`;throw Cd.error(e),new Error(e)},Bn=function(...t){let e="FIREBASE WARNING: "+fg(...t);Cd.warn(e)},tie=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&Bn("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},sI=function(t){return typeof t=="number"&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},nie=function(t){if(so()||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))}},hl="[MIN_NAME]",fa="[MAX_NAME]",_l=function(t,e){if(t===e)return 0;if(t===hl||e===fa)return-1;if(e===hl||t===fa)return 1;{let n=Tj(t),r=Tj(e);return n!==null?r!==null?n-r===0?t.length-e.length:n-r:-1:r!==null?1:t<e?-1:1}},rie=function(t,e){return t===e?0:t<e?-1:1},zp=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+xt(e))},Rw=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+=Rw(t[e[r]]);return n+="}",n},Jj=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 gn(t,e){for(let n in t)t.hasOwnProperty(n)&&e(n,t[n])}var Zj=function(t){X(!sI(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()},iie=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},oie=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function sie(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 aie=new RegExp("^-?(0*)\\d{1,10}$"),cie=-2147483648,lie=2147483647,Tj=function(t){if(aie.test(t)){let e=Number(t);if(e>=cie&&e<=lie)return e}return null},Pd=function(t){try{t()}catch(e){setTimeout(()=>{let n=e.stack||"";throw Bn("Exception was thrown by user callback.",n),e},Math.floor(0))}},uie=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Xp=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 Lb=class{constructor(e,n){this.appCheckProvider=n,this.appName=e.name,ir(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(){Bn(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}};var Mb=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"?(pn("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/.',Bn(e)}},Qp=(()=>{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})(),xy="5",eH="v",tH="s",nH="r",rH="f",iH=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,oH="ls",sH="p",Pb="ac",aH="websocket",cH="long_polling";var ky=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=ll.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()&&ll.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 die(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function lH(t,e,n){X(typeof e=="string","typeof type must == string"),X(typeof n=="object","typeof params must == object");let r;if(e===aH)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===cH)r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);die(t)&&(n.ns=t.namespace);let i=[];return gn(n,(o,s)=>{i.push(o+"="+s)}),r+i.join("&")}var xb=class{constructor(){this.counters_={}}incrementCounter(e,n=1){Gr(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=n}get(){return OB(this.counters_)}};var Ib={},vb={};function Nw(t){let e=t.toString();return Ib[e]||(Ib[e]=new xb),Ib[e]}function hie(t,e){let n=t.toString();return vb[n]||(vb[n]=e()),vb[n]}var kb=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]&&Pd(()=>{this.onMessage_(r[i])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}};var yj="start",fie="close",pie="pLPCommand",gie="pRTLPCB",uH="id",dH="pw",hH="ser",mie="cb",Eie="seg",_ie="ts",Tie="d",yie="dframe",fH=1870,pH=30,Iie=fH-pH,vie=25e3,Sie=3e4,Fy=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_=pg(e),this.stats_=Nw(n),this.urlFn=c=>(this.appCheckToken&&(c[Pb]=this.appCheckToken),lH(n,cH,c))}open(e,n){this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new kb(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(Sie)),nie(()=>{if(this.isClosed_)return;this.scriptTagHolder=new Fb((...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===yj)this.id=a,this.password=c;else if(s===fie)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[yj]="t",r[hH]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(r[mie]=this.scriptTagHolder.uniqueCallbackIdentifier),r[eH]=xy,this.transportSessionId&&(r[tH]=this.transportSessionId),this.lastSessionId&&(r[oH]=this.lastSessionId),this.applicationId&&(r[sH]=this.applicationId),this.appCheckToken&&(r[Pb]=this.appCheckToken),typeof location<"u"&&location.hostname&&iH.test(location.hostname)&&(r[nH]=rH);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 so()?!1:t.forceAllow_?!0:!t.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!iie()&&!oie()}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=ZR(n),i=Jj(r,Iie);for(let o=0;o<i.length;o++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[o]),this.curSegmentNum++}addDisconnectPingFrame(e,n){if(so())return;this.myDisconnFrame=document.createElement("iframe");let r={};r[yie]="t",r[uH]=e,r[dH]=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)}},Fb=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,so())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=Xj(),window[pie+this.uniqueCallbackIdentifier]=e,window[gie+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){pn("frame writing exception"),a.stack&&pn(a.stack),pn(a)}}}static createIFrame_(){let e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||pn("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[uH]=this.myID,e[dH]=this.myPW,e[hH]=this.currentSerial;let n=this.urlFn(e),r="",i=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+pH+r.length<=fH;){let s=this.pendingSegs.shift();r=r+"&"+Eie+i+"="+s.seg+"&"+_ie+i+"="+s.ts+"&"+Tie+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(vie)),o=()=>{clearTimeout(i),r()};this.addTag(e,o)}addTag(e,n){so()?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=()=>{pn("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))}};var Aie=16384,Cie=45e3,Uy=null;typeof MozWebSocket<"u"?Uy=MozWebSocket:typeof WebSocket<"u"&&(Uy=WebSocket);var Sd=(()=>{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_=pg(this.connId),this.stats_=Nw(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[eH]=xy,!so()&&typeof location<"u"&&location.hostname&&iH.test(location.hostname)&&(a[nH]=rH),r&&(a[tH]=r),i&&(a[oH]=i),o&&(a[Pb]=o),s&&(a[sH]=s),lH(n,aH,a)}open(n,r){this.onDisconnect=r,this.onMessage=n,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,ll.set("previous_websocket_failure",!0);try{let i;if(so()){let o=this.nodeAdmin?"AdminNode":"Node";i={headers:{"User-Agent":`Firebase/${xy}/${Dw}/${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 Uy(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&&Uy!==null&&!t.forceDisallow_}static previouslyFailed(){return ll.isInMemoryStorage||ll.get("previous_websocket_failure")===!0}markConnectionHealthy(){ll.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=hd(r);this.onMessage(i)}}handleNewFrameCount_(n){this.totalFrames=n,this.frames=[]}extractFrameCount_(n){if(X(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=Jj(r,Aie);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(Cie))}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})(),gH=(()=>{class t{static get ALL_TRANSPORTS(){return[Fy,Sd]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(n){this.initTransports_(n)}initTransports_(n){let r=Sd&&Sd.isAvailable(),i=r&&!Sd.previouslyFailed();if(n.webSocketOnly&&(r||Bn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[Sd];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})(),Die=6e4,Rie=5e3,Nie=10*1024,bie=100*1024,Sb="t",Ij="d",wie="s",vj="r",Oie="e",Sj="o",Aj="a",Cj="n",Dj="p",Lie="h",Ub=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_=pg("c:"+this.id+":"),this.transportManager_=new gH(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_=Xp(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>bie?(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>Nie?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(Sb in e){let n=e[Sb];n===Aj?this.upgradeIfSecondaryHealthy_():n===vj?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===Sj&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){let n=zp("t",e),r=zp("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:Dj,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:Aj,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:Cj,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){let n=zp("t",e),r=zp("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=zp(Sb,e);if(Ij in e){let r=e[Ij];if(n===Lie){let i=Object.assign({},r);this.repoInfo_.isUsingEmulator&&(i.h=this.repoInfo_.host),this.onHandshake_(i)}else if(n===Cj){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===wie?this.onConnectionShutdown_(r):n===vj?this.onReset_(r):n===Oie?Ob("Server Error: "+r):n===Sj?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):Ob("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),xy!==r&&Bn("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),Xp(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(Die))}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):Xp(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(Rie))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:Dj,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()&&(ll.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 Vy=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 By=class{constructor(e){this.allowedEvents_=e,this.listeners_={},X(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){X(this.allowedEvents_.find(n=>n===e),"Unknown event: "+e)}};var Gy=class t extends By{static getInstance(){return new t}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!Tp()&&(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 X(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}};var Rj=32,Nj=768,Ge=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 Be(){return new Ge("")}function be(t){return t.pieceNum_>=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function pa(t){return t.pieces_.length-t.pieceNum_}function at(t){let e=t.pieceNum_;return e<t.pieces_.length&&e++,new Ge(t.pieces_,e)}function bw(t){return t.pieceNum_<t.pieces_.length?t.pieces_[t.pieces_.length-1]:null}function Mie(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 tg(t,e=0){return t.pieces_.slice(t.pieceNum_+e)}function mH(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 Ge(e,0)}function St(t,e){let n=[];for(let r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);if(e instanceof Ge)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 Ge(n,0)}function we(t){return t.pieceNum_>=t.pieces_.length}function Yn(t,e){let n=be(t),r=be(e);if(n===null)return e;if(n===r)return Yn(at(t),at(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function Pie(t,e){let n=tg(t,0),r=tg(e,0);for(let i=0;i<n.length&&i<r.length;i++){let o=_l(n[i],r[i]);if(o!==0)return o}return n.length===r.length?0:n.length<r.length?-1:1}function ww(t,e){if(pa(t)!==pa(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 $r(t,e){let n=t.pieceNum_,r=e.pieceNum_;if(pa(t)>pa(e))return!1;for(;n<t.pieces_.length;){if(t.pieces_[n]!==e.pieces_[r])return!1;++n,++r}return!0}var Vb=class{constructor(e,n){this.errorPrefix_=n,this.parts_=tg(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let r=0;r<this.parts_.length;r++)this.byteLength_+=Sp(this.parts_[r]);EH(this)}};function xie(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=Sp(e),EH(t)}function kie(t){let e=t.parts_.pop();t.byteLength_-=Sp(e),t.parts_.length>0&&(t.byteLength_-=1)}function EH(t){if(t.byteLength_>Nj)throw new Error(t.errorPrefix_+"has a key path longer than "+Nj+" bytes ("+t.byteLength_+").");if(t.parts_.length>Rj)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+Rj+") or object contains a cycle "+cl(t))}function cl(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}var Bb=class t extends By{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 X(e==="visible","Unknown event type: "+e),[this.visible_]}};var qp=1e3,Fie=300*1e3,bj=30*1e3,Uie=1.3,Vie=3e4,Bie="server_kill",wj=3,Ow=(()=>{class t extends Vy{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_=pg("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_=qp,this.maxReconnectDelay_=Fie,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&&!so())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");Bb.getInstance().on("visible",this.onVisible_,this),n.host.indexOf("fblocal")===-1&&Gy.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)),X(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 dn,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),X(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"listen() called for non-default but complete query"),X(!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"&&Gr(n,"w")){let i=Xs(n,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){let o='".indexOn": "'+r._queryParams.getIndex().toString()+'"',s=r._path.toString();Bn(`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||jB(n))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=bj)}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=GB(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),X(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):Ob("Unrecognized action received from server: "+xt(n)+`
|
|
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){X(!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_=qp,this.realtime_||this.scheduleConnect_(0)),this.visible_=n}onOnline_(n){n?(this.log_("Browser went online."),this.reconnectDelay_=qp,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_>Vie&&(this.reconnectDelay_=qp),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_*Uie)}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){X(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?pn("getToken() completed but was canceled"):(pn("getToken() completed. Creating connection."),this.authToken_=f&&f.accessToken,this.appCheckToken_=g&&g.token,c=new Ub(o,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,n,r,i,E=>{Bn(E+" ("+this.repoInfo_.toString()+")"),this.interrupt(Bie)},s))}catch(f){this.log_("Failed to get token: "+f),a||(this.repoInfo_.nodeAdmin&&Bn(f),l())}}})}interrupt(n){pn("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){pn("Resuming connection for reason: "+n),delete this.interruptReasons_[n],yp(this.interruptReasons_)&&(this.reconnectDelay_=qp,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=>Rw(s)).join("$"):i="default";let o=this.removeListen_(n,i);o&&o.onComplete&&o.onComplete("permission_denied")}removeListen_(n,r){let i=new Ge(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){pn("Auth token revoked: "+n+"/"+r),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(n==="invalid_token"||n==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=wj&&(this.reconnectDelay_=bj,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(n,r){pn("App check token revoked: "+n+"/"+r),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(n==="invalid_token"||n==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=wj&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(n){this.securityDebugCallback_?this.securityDebugCallback_(n):"msg"in n&&console.log("FIREBASE: "+n.msg.replace(`
|
|
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";so()&&(this.repoInfo_.nodeAdmin?r="admin_node":r="node"),n["sdk."+r+"."+Dw.replace(/\./g,"-")]=1,Tp()?n["framework.cordova"]=1:XT()&&(n["framework.reactnative"]=1),this.reportStats(n)}shouldReconnect_(){let n=Gy.getInstance().currentlyOnline();return yp(this.interruptReasons_)&&n}}t.nextPersistentConnectionId_=0,t.nextConnectionId_=0;return t})(),Le=class t{constructor(e,n){this.name=e,this.node=n}static Wrap(e,n){return new t(e,n)}};var Dd=class{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,n){let r=new Le(hl,e),i=new Le(hl,n);return this.compare(r,i)!==0}minPost(){return Le.MIN}};var Py,jy=class extends Dd{static get __EMPTY_NODE(){return Py}static set __EMPTY_NODE(e){Py=e}compare(e,n){return _l(e.name,n.name)}isDefinedOn(e){throw qc("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,n){return!1}minPost(){return Le.MIN}maxPost(){return new Le(fa,Py)}makePost(e,n){return X(typeof e=="string","KeyIndex indexValue must always be a string."),new Le(e,Py)}toString(){return".key"}},dl=new jy;var Ad=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}}},_i=(()=>{class t{constructor(n,r,i,o,s){this.key=n,this.value=r,this.color=i??t.RED,this.left=o??Wr.EMPTY_NODE,this.right=s??Wr.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 Wr.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 Wr.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})(),Gb=class{copy(e,n,r,i,o){return this}insert(e,n,r){return new _i(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}},Wr=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,_i.BLACK,null,null))}remove(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,_i.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 Ad(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,n){return new Ad(this.root_,e,this.comparator_,!1,n)}getReverseIteratorFrom(e,n){return new Ad(this.root_,e,this.comparator_,!0,n)}getReverseIterator(e){return new Ad(this.root_,null,this.comparator_,!0,e)}};Wr.EMPTY_NODE=new Gb;function Gie(t,e){return _l(t.name,e.name)}function Lw(t,e){return _l(t,e)}var jb;function jie(t){jb=t}var _H=function(t){return typeof t=="number"?"number:"+Zj(t):"string:"+t},TH=function(t){if(t.isLeafNode()){let e=t.val();X(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Gr(e,".sv"),"Priority must be a string or number.")}else X(t===jb||t.isEmpty(),"priority of unexpected type.");X(t===jb||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};var Oj,Rd=(()=>{class t{static set __childrenNodeConstructor(n){Oj=n}static get __childrenNodeConstructor(){return Oj}constructor(n,r=t.__childrenNodeConstructor.EMPTY_NODE){this.value_=n,this.priorityNode_=r,this.lazyHash_=null,X(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),TH(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:be(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=be(n);return i===null?r:r.isEmpty()&&i!==".priority"?this:(X(i!==".priority"||pa(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:"+_H(this.priorityNode_.val())+":");let r=typeof this.value_;n+=r+":",r==="number"?n+=Zj(this.value_):n+=this.value_,this.lazyHash_=Qj(n)}return this.lazyHash_}getValue(){return this.value_}compareTo(n){return n===t.__childrenNodeConstructor.EMPTY_NODE?1:n instanceof t.__childrenNodeConstructor?-1:(X(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 X(o>=0,"Unknown leaf type: "+r),X(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})(),yH,IH;function Hie(t){yH=t}function $ie(t){IH=t}var Hb=class extends Dd{compare(e,n){let r=e.node.getPriority(),i=n.node.getPriority(),o=r.compareTo(i);return o===0?_l(e.name,n.name):o}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,n){return!e.getPriority().equals(n.getPriority())}minPost(){return Le.MIN}maxPost(){return new Le(fa,new Rd("[PRIORITY-POST]",IH))}makePost(e,n){let r=yH(e);return new Le(n,new Rd("[PRIORITY-POST]",r))}toString(){return".priority"}},ft=new Hb;var Wie=Math.log(2),$b=class{constructor(e){let n=o=>parseInt(Math.log(o)/Wie,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}},Hy=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 _i(f,h.node,_i.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 _i(f,h.node,_i.BLACK,E,I)}},o=function(c){let l=null,d=null,h=t.length,f=function(E,I){let S=h-E,R=h;h-=E;let U=i(S+1,R),H=t[S],Q=n?n(H):H;g(new _i(Q,H.node,I,null,U))},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,_i.BLACK):(f(S,_i.BLACK),f(S,_i.RED))}return d},s=new $b(t.length),a=o(s);return new Wr(r||e,a)};var Ab,vd={},Nd=class t{static get Default(){return X(vd&&ft,"ChildrenNode.ts has not been loaded"),Ab=Ab||new t({".priority":vd},{".priority":ft}),Ab}constructor(e,n){this.indexes_=e,this.indexSet_=n}get(e){let n=Xs(this.indexes_,e);if(!n)throw new Error("No index defined for "+e);return n instanceof Wr?n:null}hasIndex(e){return Gr(this.indexSet_,e.toString())}addIndex(e,n){X(e!==dl,"KeyIndex always exists and isn't meant to be added to the IndexMap.");let r=[],i=!1,o=n.getIterator(Le.Wrap),s=o.getNext();for(;s;)i=i||e.isDefinedOn(s.node),r.push(s),s=o.getNext();let a;i?a=Hy(r,e.getCompare()):a=vd;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=Ip(this.indexes_,(i,o)=>{let s=Xs(this.indexSet_,o);if(X(s,"Missing index implementation for "+o),i===vd)if(s.isDefinedOn(e.node)){let a=[],c=n.getIterator(Le.Wrap),l=c.getNext();for(;l;)l.name!==e.name&&a.push(l),l=c.getNext();return a.push(e),Hy(a,s.getCompare())}else return vd;else{let a=n.get(e.name),c=i;return a&&(c=c.remove(new Le(e.name,a))),c.insert(e,e.node)}});return new t(r,this.indexSet_)}removeFromIndexes(e,n){let r=Ip(this.indexes_,i=>{if(i===vd)return i;{let o=n.get(e.name);return o?i.remove(new Le(e.name,o)):i}});return new t(r,this.indexSet_)}};var Kp,ve=(()=>{class t{static get EMPTY_NODE(){return Kp||(Kp=new t(new Wr(Lw),null,Nd.Default))}constructor(n,r,i){this.children_=n,this.priorityNode_=r,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&TH(this.priorityNode_),this.children_.isEmpty()&&X(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Kp}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?Kp:r}}getChild(n){let r=be(n);return r===null?this:this.getImmediateChild(r).getChild(at(n))}hasChild(n){return this.children_.get(n)!==null}updateImmediateChild(n,r){if(X(r,"We should always be passing snapshot nodes"),n===".priority")return this.updatePriority(r);{let i=new Le(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()?Kp:this.priorityNode_;return new t(o,a,s)}}updateChild(n,r){let i=be(n);if(i===null)return r;{X(be(n)!==".priority"||pa(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:"+_H(this.getPriority().val())+":"),this.forEachChild(ft,(r,i)=>{let o=i.hash();o!==""&&(n+=":"+r+":"+o)}),this.lazyHash_=n===""?"":Qj(n)}return this.lazyHash_}getPredecessorChildName(n,r,i){let o=this.resolveIndex_(i);if(o){let s=o.getPredecessorKey(new Le(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 Le(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 Le(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,Le.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,Le.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===gg?-1:0}withIndex(n){if(n===dl||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===dl||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===dl?null:this.indexMap_.get(n.toString())}}return t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t})(),Wb=class extends ve{constructor(){super(new Wr(Lw),ve.EMPTY_NODE,Nd.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}},gg=new Wb;Object.defineProperties(Le,{MIN:{value:new Le(hl,ve.EMPTY_NODE)},MAX:{value:new Le(fa,gg)}});jy.__EMPTY_NODE=ve.EMPTY_NODE;Rd.__childrenNodeConstructor=ve;jie(gg);$ie(gg);var zie=!0;function vt(t,e=null){if(t===null)return ve.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),X(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 Rd(n,vt(e))}if(!(t instanceof Array)&&zie){let n=[],r=!1;if(gn(t,(s,a)=>{if(s.substring(0,1)!=="."){let c=vt(a);c.isEmpty()||(r=r||!c.getPriority().isEmpty(),n.push(new Le(s,c)))}}),n.length===0)return ve.EMPTY_NODE;let o=Hy(n,Gie,s=>s.name,Lw);if(r){let s=Hy(n,ft.getCompare());return new ve(o,vt(e),new Nd({".priority":s},{".priority":ft}))}else return new ve(o,vt(e),Nd.Default)}else{let n=ve.EMPTY_NODE;return gn(t,(r,i)=>{if(Gr(t,r)&&r.substring(0,1)!=="."){let o=vt(i);(o.isLeafNode()||!o.isEmpty())&&(n=n.updateImmediateChild(r,o))}}),n.updatePriority(vt(e))}}Hie(vt);var ng=class extends Dd{constructor(e){super(),this.indexPath_=e,X(!we(e)&&be(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?_l(e.name,n.name):o}makePost(e,n){let r=vt(e),i=ve.EMPTY_NODE.updateChild(this.indexPath_,r);return new Le(n,i)}maxPost(){let e=ve.EMPTY_NODE.updateChild(this.indexPath_,gg);return new Le(fa,e)}toString(){return tg(this.indexPath_,0).join("/")}};var zb=class extends Dd{compare(e,n){let r=e.node.compareTo(n.node);return r===0?_l(e.name,n.name):r}isDefinedOn(e){return!0}indexedValueChanged(e,n){return!e.equals(n)}minPost(){return Le.MIN}maxPost(){return Le.MAX}makePost(e,n){let r=vt(e);return new Le(n,r)}toString(){return".value"}},vH=new zb;function SH(t){return{type:"value",snapshotNode:t}}function bd(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function rg(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function ig(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}function qie(t,e){return{type:"child_moved",snapshotNode:e,childName:t}}var og=class{constructor(e){this.index_=e}updateChild(e,n,r,i,o,s){X(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(rg(n,a)):X(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?s.trackChildChange(bd(n,r)):s.trackChildChange(ig(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(rg(i,o))}),n.isLeafNode()||n.forEachChild(ft,(i,o)=>{if(e.hasChild(i)){let s=e.getImmediateChild(i);s.equals(o)||r.trackChildChange(ig(i,o,s))}else r.trackChildChange(bd(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 $y=class t{constructor(e){this.indexedFilter_=new og(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 Le(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 Le(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 qb=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 $y(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 Le(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;X(a.numChildren()===this.limit_,"");let c=new Le(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(ig(n,r,h)),a.updateImmediateChild(n,r);{o?.trackChildChange(rg(n,h));let I=a.updateImmediateChild(n,ve.EMPTY_NODE);return f!=null&&this.rangedFilter_.matches(f)?(o?.trackChildChange(bd(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(rg(l.name,l.node)),o.trackChildChange(bd(n,r))),a.updateImmediateChild(n,r).updateImmediateChild(l.name,ve.EMPTY_NODE)):e}};var Kb=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 X(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return X(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:hl}hasEnd(){return this.endSet_}getIndexEndValue(){return X(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return X(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:fa}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return X(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 Kie(t){return t.loadsAllData()?new og(t.getIndex()):t.hasLimit()?new qb(t):new $y(t)}function Yie(t,e){let n=t.copy();return n.limitSet_=!0,n.limit_=e,n.viewFrom_="r",n}function Xie(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 Qie(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 Jie(t,e){let n=t.copy();return n.index_=e,n}function Lj(t){let e={};if(t.isDefault())return e;let n;if(t.index_===ft?n="$priority":t.index_===vH?n="$value":t.index_===dl?n="$key":(X(t.index_ instanceof ng,"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 Mj(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 Yb=class t extends Vy{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,n){return n!==void 0?"tag$"+n:(X(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_=pg("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=Lj(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),Xs(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=Lj(e._queryParams),r=e._path.toString(),i=new dn;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+vp(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=hd(a.responseText)}catch{Bn("Failed to parse JSON response for "+s+": "+a.responseText)}r(null,c)}else a.status!==401&&a.status!==404&&Bn("Got unsuccessful REST response for "+s+" Status: "+a.status),r(a.status);r=null}},a.open("GET",s,!0),a.send()})}};var Xb=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 Wy(){return{value:null,children:new Map}}function xd(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=be(e);t.children.has(r)||t.children.set(r,Wy());let i=t.children.get(r);e=at(e),xd(i,e,n)}}function Qb(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)=>{xd(t,new Ge(r),i)}),Qb(t,e)}}else if(t.children.size>0){let n=be(e);return e=at(e),t.children.has(n)&&Qb(t.children.get(n),e)&&t.children.delete(n),t.children.size===0}else return!0}function Jb(t,e,n){t.value!==null?n(e,t.value):Zie(t,(r,i)=>{let o=new Ge(e.toString()+"/"+r);Jb(i,o,n)})}function Zie(t,e){t.children.forEach((n,r)=>{e(r,n)})}var Zb=class{constructor(e){this.collection_=e,this.last_=null}get(){let e=this.collection_.get(),n=Object.assign({},e);return this.last_&&gn(this.last_,(r,i)=>{n[r]=n[r]-i}),this.last_=e,n}};var Pj=10*1e3,eoe=30*1e3,toe=300*1e3,ew=class{constructor(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new Zb(e);let r=Pj+(eoe-Pj)*Math.random();Xp(this.reportStats_.bind(this),Math.floor(r))}reportStats_(){let e=this.statsListener_.get(),n={},r=!1;gn(e,(i,o)=>{o>0&&Gr(this.statsToReport_,i)&&(n[i]=o,r=!0)}),r&&this.server_.reportStats(n),Xp(this.reportStats_.bind(this),Math.floor(Math.random()*2*toe))}};var ho=(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})(ho||{});function Mw(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function Pw(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function xw(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}var tw=class t{constructor(e,n,r){this.path=e,this.affectedTree=n,this.revert=r,this.type=ho.ACK_USER_WRITE,this.source=Mw()}operationForChild(e){if(we(this.path)){if(this.affectedTree.value!=null)return X(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{let n=this.affectedTree.subtree(new Ge(e));return new t(Be(),n,this.revert)}}else return X(be(this.path)===e,"operationForChild called for unrelated child."),new t(at(this.path),this.affectedTree,this.revert)}};var zy=class t{constructor(e,n){this.source=e,this.path=n,this.type=ho.LISTEN_COMPLETE}operationForChild(e){return we(this.path)?new t(this.source,Be()):new t(this.source,at(this.path))}};var wd=class t{constructor(e,n,r){this.source=e,this.path=n,this.snap=r,this.type=ho.OVERWRITE}operationForChild(e){return we(this.path)?new t(this.source,Be(),this.snap.getImmediateChild(e)):new t(this.source,at(this.path),this.snap)}};var sg=class t{constructor(e,n,r){this.source=e,this.path=n,this.children=r,this.type=ho.MERGE}operationForChild(e){if(we(this.path)){let n=this.children.subtree(new Ge(e));return n.isEmpty()?null:n.value?new wd(this.source,Be(),n.value):new t(this.source,Be(),n)}else return X(be(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 fo=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=be(e);return this.isCompleteForChild(n)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}};var nw=class{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}};function noe(t,e,n,r){let i=[],o=[];return e.forEach(s=>{s.type==="child_changed"&&t.index_.indexedValueChanged(s.oldSnap,s.snapshotNode)&&o.push(qie(s.childName,s.snapshotNode))}),Yp(t,i,"child_removed",e,r,n),Yp(t,i,"child_added",e,r,n),Yp(t,i,"child_moved",o,r,n),Yp(t,i,"child_changed",e,r,n),Yp(t,i,"value",e,r,n),i}function Yp(t,e,n,r,i,o){let s=r.filter(a=>a.type===n);s.sort((a,c)=>ioe(t,a,c)),s.forEach(a=>{let c=roe(t,a,o);i.forEach(l=>{l.respondsTo(a.type)&&e.push(l.createEvent(c,t.query_))})})}function roe(t,e,n){return e.type==="value"||e.type==="child_removed"||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}function ioe(t,e,n){if(e.childName==null||n.childName==null)throw qc("Should only compare child_ events.");let r=new Le(e.childName,e.snapshotNode),i=new Le(n.childName,n.snapshotNode);return t.index_.compare(r,i)}function aI(t,e){return{eventCache:t,serverCache:e}}function Jp(t,e,n,r){return aI(new fo(e,n,r),t.serverCache)}function AH(t,e,n,r){return aI(t.eventCache,new fo(e,n,r))}function qy(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function fl(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}var Cb,ooe=()=>(Cb||(Cb=new Wr(rie)),Cb),Xn=class t{static fromObject(e){let n=new t(null);return gn(e,(r,i)=>{n=n.set(new Ge(r),i)}),n}constructor(e,n=ooe()){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:Be(),value:this.value};if(we(e))return null;{let r=be(e),i=this.children.get(r);if(i!==null){let o=i.findRootMostMatchingPathAndValue(at(e),n);return o!=null?{path:St(new Ge(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=be(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=be(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=be(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=be(e),r=this.children.get(n);return r?r.get(at(e)):null}}setTree(e,n){if(we(e))return n;{let r=be(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_(Be(),e)}fold_(e,n){let r={};return this.children.inorderTraversal((i,o)=>{r[i]=o.fold_(St(e,i),n)}),n(e,this.value,r)}findOnPath(e,n){return this.findOnPath_(e,Be(),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=be(e),s=this.children.get(o);return s?s.findOnPath_(at(e),St(n,o),r):null}}foreachOnPath(e,n){return this.foreachOnPath_(e,Be(),n)}foreachOnPath_(e,n,r){if(we(e))return this;{this.value&&r(n,this.value);let i=be(e),o=this.children.get(i);return o?o.foreachOnPath_(at(e),St(n,i),r):new t(null)}}foreach(e){this.foreach_(Be(),e)}foreach_(e,n){this.children.inorderTraversal((r,i)=>{i.foreach_(St(e,r),n)}),this.value&&n(e,this.value)}foreachChild(e){this.children.inorderTraversal((n,r)=>{r.value&&e(n,r.value)})}};var Ti=class t{constructor(e){this.writeTree_=e}static empty(){return new t(new Xn(null))}};function Zp(t,e,n){if(we(e))return new Ti(new Xn(n));{let r=t.writeTree_.findRootMostValueAndPath(e);if(r!=null){let i=r.path,o=r.value,s=Yn(i,e);return o=o.updateChild(s,n),new Ti(t.writeTree_.set(i,o))}else{let i=new Xn(n),o=t.writeTree_.setTree(e,i);return new Ti(o)}}}function rw(t,e,n){let r=t;return gn(n,(i,o)=>{r=Zp(r,St(e,i),o)}),r}function xj(t,e){if(we(e))return Ti.empty();{let n=t.writeTree_.setTree(e,new Xn(null));return new Ti(n)}}function iw(t,e){return Tl(t,e)!=null}function Tl(t,e){let n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(Yn(n.path,e)):null}function kj(t){let e=[],n=t.writeTree_.value;return n!=null?n.isLeafNode()||n.forEachChild(ft,(r,i)=>{e.push(new Le(r,i))}):t.writeTree_.children.inorderTraversal((r,i)=>{i.value!=null&&e.push(new Le(r,i.value))}),e}function da(t,e){if(we(e))return t;{let n=Tl(t,e);return n!=null?new Ti(new Xn(n)):new Ti(t.writeTree_.subtree(e))}}function ow(t){return t.writeTree_.isEmpty()}function Od(t,e){return CH(Be(),t.writeTree_,e)}function CH(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);{let r=null;return e.children.inorderTraversal((i,o)=>{i===".priority"?(X(o.value!==null,"Priority writes must always be leaf nodes"),r=o.value):n=CH(St(t,i),o,n)}),!n.getChild(t).isEmpty()&&r!==null&&(n=n.updateChild(St(t,".priority"),r)),n}}function cI(t,e){return bH(e,t)}function soe(t,e,n,r,i){X(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=Zp(t.visibleWrites,e,n)),t.lastWriteId=r}function aoe(t,e,n,r){X(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=rw(t.visibleWrites,e,n),t.lastWriteId=r}function coe(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 loe(t,e){let n=t.allWrites.findIndex(a=>a.writeId===e);X(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&&uoe(a,r.path)?i=!1:$r(r.path,a.path)&&(o=!0)),s--}if(i){if(o)return doe(t),!0;if(r.snap)t.visibleWrites=xj(t.visibleWrites,r.path);else{let a=r.children;gn(a,c=>{t.visibleWrites=xj(t.visibleWrites,St(r.path,c))})}return!0}else return!1}function uoe(t,e){if(t.snap)return $r(t.path,e);for(let n in t.children)if(t.children.hasOwnProperty(n)&&$r(St(t.path,n),e))return!0;return!1}function doe(t){t.visibleWrites=DH(t.allWrites,hoe,Be()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function hoe(t){return t.visible}function DH(t,e,n){let r=Ti.empty();for(let i=0;i<t.length;++i){let o=t[i];if(e(o)){let s=o.path,a;if(o.snap)$r(n,s)?(a=Yn(n,s),r=Zp(r,a,o.snap)):$r(s,n)&&(a=Yn(s,n),r=Zp(r,Be(),o.snap.getChild(a)));else if(o.children){if($r(n,s))a=Yn(n,s),r=rw(r,a,o.children);else if($r(s,n))if(a=Yn(s,n),we(a))r=rw(r,Be(),o.children);else{let c=Xs(o.children,be(a));if(c){let l=c.getChild(at(a));r=Zp(r,Be(),l)}}}else throw qc("WriteRecord should have .snap or .children")}}return r}function RH(t,e,n,r,i){if(!r&&!i){let o=Tl(t.visibleWrites,e);if(o!=null)return o;{let s=da(t.visibleWrites,e);if(ow(s))return n;if(n==null&&!iw(s,Be()))return null;{let a=n||ve.EMPTY_NODE;return Od(s,a)}}}else{let o=da(t.visibleWrites,e);if(!i&&ow(o))return n;if(!i&&n==null&&!iw(o,Be()))return null;{let s=function(l){return(l.visible||i)&&(!r||!~r.indexOf(l.writeId))&&($r(l.path,e)||$r(e,l.path))},a=DH(t.allWrites,s,e),c=n||ve.EMPTY_NODE;return Od(a,c)}}}function foe(t,e,n){let r=ve.EMPTY_NODE,i=Tl(t.visibleWrites,e);if(i)return i.isLeafNode()||i.forEachChild(ft,(o,s)=>{r=r.updateImmediateChild(o,s)}),r;if(n){let o=da(t.visibleWrites,e);return n.forEachChild(ft,(s,a)=>{let c=Od(da(o,new Ge(s)),a);r=r.updateImmediateChild(s,c)}),kj(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}else{let o=da(t.visibleWrites,e);return kj(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}}function poe(t,e,n,r,i){X(r||i,"Either existingEventSnap or existingServerSnap must exist");let o=St(e,n);if(iw(t.visibleWrites,o))return null;{let s=da(t.visibleWrites,o);return ow(s)?i.getChild(n):Od(s,i.getChild(n))}}function goe(t,e,n,r){let i=St(e,n),o=Tl(t.visibleWrites,i);if(o!=null)return o;if(r.isCompleteForChild(n)){let s=da(t.visibleWrites,i);return Od(s,r.getNode().getImmediateChild(n))}else return null}function moe(t,e){return Tl(t.visibleWrites,e)}function Eoe(t,e,n,r,i,o,s){let a,c=da(t.visibleWrites,e),l=Tl(c,Be());if(l!=null)a=l;else if(n!=null)a=Od(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 _oe(){return{visibleWrites:Ti.empty(),allWrites:[],lastWriteId:-1}}function Ky(t,e,n,r){return RH(t.writeTree,t.treePath,e,n,r)}function kw(t,e){return foe(t.writeTree,t.treePath,e)}function Fj(t,e,n,r){return poe(t.writeTree,t.treePath,e,n,r)}function Yy(t,e){return moe(t.writeTree,St(t.treePath,e))}function Toe(t,e,n,r,i,o){return Eoe(t.writeTree,t.treePath,e,n,r,i,o)}function Fw(t,e,n){return goe(t.writeTree,t.treePath,e,n)}function NH(t,e){return bH(St(t.treePath,e),t.writeTree)}function bH(t,e){return{treePath:t,writeTree:e}}var sw=class{constructor(){this.changeMap=new Map}trackChildChange(e){let n=e.type,r=e.childName;X(n==="child_added"||n==="child_changed"||n==="child_removed","Only child changes supported for tracking"),X(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,ig(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,rg(r,i.oldSnap));else if(n==="child_changed"&&o==="child_added")this.changeMap.set(r,bd(r,e.snapshotNode));else if(n==="child_changed"&&o==="child_changed")this.changeMap.set(r,ig(r,e.snapshotNode,i.oldSnap));else throw qc("Illegal combination of changes: "+e+" occurred after "+i)}else this.changeMap.set(r,e)}getChanges(){return Array.from(this.changeMap.values())}};var aw=class{getCompleteChild(e){return null}getChildAfterChild(e,n,r){return null}},wH=new aw,ag=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 fo(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return Fw(this.writes_,e,r)}}getChildAfterChild(e,n,r){let i=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:fl(this.viewCache_),o=Toe(this.writes_,i,n,1,r,e);return o.length===0?null:o[0]}};function yoe(t){return{filter:t}}function Ioe(t,e){X(e.eventCache.getNode().isIndexed(t.filter.getIndex()),"Event snap not indexed"),X(e.serverCache.getNode().isIndexed(t.filter.getIndex()),"Server snap not indexed")}function voe(t,e,n,r,i){let o=new sw,s,a;if(n.type===ho.OVERWRITE){let l=n;l.source.fromUser?s=cw(t,e,l.path,l.snap,r,i,o):(X(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered()&&!we(l.path),s=Xy(t,e,l.path,l.snap,r,i,a,o))}else if(n.type===ho.MERGE){let l=n;l.source.fromUser?s=Aoe(t,e,l.path,l.children,r,i,o):(X(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered(),s=lw(t,e,l.path,l.children,r,i,a,o))}else if(n.type===ho.ACK_USER_WRITE){let l=n;l.revert?s=Roe(t,e,l.path,r,i,o):s=Coe(t,e,l.path,l.affectedTree,r,i,o)}else if(n.type===ho.LISTEN_COMPLETE)s=Doe(t,e,n.path,r,o);else throw qc("Unknown operation type: "+n.type);let c=o.getChanges();return Soe(e,s,c),{viewCache:s,changes:c}}function Soe(t,e,n){let r=e.eventCache;if(r.isFullyInitialized()){let i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=qy(t);(n.length>0||!t.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(SH(qy(e)))}}function OH(t,e,n,r,i,o){let s=e.eventCache;if(Yy(r,n)!=null)return e;{let a,c;if(we(n))if(X(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){let l=fl(e),d=l instanceof ve?l:ve.EMPTY_NODE,h=kw(r,d);a=t.filter.updateFullNode(e.eventCache.getNode(),h,o)}else{let l=Ky(r,fl(e));a=t.filter.updateFullNode(e.eventCache.getNode(),l,o)}else{let l=be(n);if(l===".priority"){X(pa(n)===1,"Can't have a priority with additional path components");let d=s.getNode();c=e.serverCache.getNode();let h=Fj(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=Fj(r,n,s.getNode(),c);f!=null?h=s.getNode().getImmediateChild(l).updateChild(d,f):h=s.getNode().getImmediateChild(l)}else h=Fw(r,l,e.serverCache);h!=null?a=t.filter.updateChild(s.getNode(),l,h,d,i,o):a=s.getNode()}}return Jp(e,a,s.isFullyInitialized()||we(n),t.filter.filtersNodes())}}function Xy(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=be(n);if(!c.isCompleteForPath(n)&&pa(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,wH,null)}let h=AH(e,l,c.isFullyInitialized()||we(n),d.filtersNodes()),f=new ag(i,h,o);return OH(t,h,n,i,f,a)}function cw(t,e,n,r,i,o,s){let a=e.eventCache,c,l,d=new ag(i,e,o);if(we(n))l=t.filter.updateFullNode(e.eventCache.getNode(),r,s),c=Jp(e,l,!0,t.filter.filtersNodes());else{let h=be(n);if(h===".priority")l=t.filter.updatePriority(e.eventCache.getNode(),r),c=Jp(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?bw(f)===".priority"&&I.getChild(mH(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=Jp(e,I,a.isFullyInitialized(),t.filter.filtersNodes())}}}return c}function Uj(t,e){return t.eventCache.isCompleteForChild(e)}function Aoe(t,e,n,r,i,o,s){let a=e;return r.foreach((c,l)=>{let d=St(n,c);Uj(e,be(d))&&(a=cw(t,a,d,l,i,o,s))}),r.foreach((c,l)=>{let d=St(n,c);Uj(e,be(d))||(a=cw(t,a,d,l,i,o,s))}),a}function Vj(t,e,n){return n.foreach((r,i)=>{e=e.updateChild(r,i)}),e}function lw(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 Xn(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=Vj(t,g,f);c=Xy(t,c,new Ge(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=Vj(t,E,f);c=Xy(t,c,new Ge(h),I,i,o,s,a)}}),c}function Coe(t,e,n,r,i,o,s){if(Yy(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 Xy(t,e,n,c.getNode().getChild(n),i,o,a,s);if(we(n)){let l=new Xn(null);return c.getNode().forEachChild(dl,(d,h)=>{l=l.set(new Ge(d),h)}),lw(t,e,n,l,i,o,a,s)}else return e}else{let l=new Xn(null);return r.foreach((d,h)=>{let f=St(n,d);c.isCompleteForPath(f)&&(l=l.set(d,c.getNode().getChild(f)))}),lw(t,e,n,l,i,o,a,s)}}function Doe(t,e,n,r,i){let o=e.serverCache,s=AH(e,o.getNode(),o.isFullyInitialized()||we(n),o.isFiltered());return OH(t,s,n,r,wH,i)}function Roe(t,e,n,r,i,o){let s;if(Yy(r,n)!=null)return e;{let a=new ag(r,e,i),c=e.eventCache.getNode(),l;if(we(n)||be(n)===".priority"){let d;if(e.serverCache.isFullyInitialized())d=Ky(r,fl(e));else{let h=e.serverCache.getNode();X(h instanceof ve,"serverChildren would be complete if leaf node"),d=kw(r,h)}d=d,l=t.filter.updateFullNode(c,d,o)}else{let d=be(n),h=Fw(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=Ky(r,fl(e)),s.isLeafNode()&&(l=t.filter.updateFullNode(l,s,o)))}return s=e.serverCache.isFullyInitialized()||Yy(r,Be())!=null,Jp(e,l,s,t.filter.filtersNodes())}}var uw=class{constructor(e,n){this.query_=e,this.eventRegistrations_=[];let r=this.query_._queryParams,i=new og(r.getIndex()),o=Kie(r);this.processor_=yoe(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 fo(c,s.isFullyInitialized(),i.filtersNodes()),h=new fo(l,a.isFullyInitialized(),o.filtersNodes());this.viewCache_=aI(h,d),this.eventGenerator_=new nw(this.query_)}get query(){return this.query_}};function Noe(t){return t.viewCache_.serverCache.getNode()}function boe(t){return qy(t.viewCache_)}function woe(t,e){let n=fl(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!we(e)&&!n.getImmediateChild(be(e)).isEmpty())?n.getChild(e):null}function Bj(t){return t.eventRegistrations_.length===0}function Ooe(t,e){t.eventRegistrations_.push(e)}function Gj(t,e,n){let r=[];if(n){X(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 jj(t,e,n,r){e.type===ho.MERGE&&e.source.queryId!==null&&(X(fl(t.viewCache_),"We should always have a full cache before handling merges"),X(qy(t.viewCache_),"Missing event cache, even though we have a server cache"));let i=t.viewCache_,o=voe(t.processor_,i,e,n,r);return Ioe(t.processor_,o.viewCache),X(o.viewCache.serverCache.isFullyInitialized()||!i.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=o.viewCache,LH(t,o.changes,o.viewCache.eventCache.getNode(),null)}function Loe(t,e){let n=t.viewCache_.eventCache,r=[];return n.getNode().isLeafNode()||n.getNode().forEachChild(ft,(o,s)=>{r.push(bd(o,s))}),n.isFullyInitialized()&&r.push(SH(n.getNode())),LH(t,r,n.getNode(),e)}function LH(t,e,n,r){let i=r?[r]:t.eventRegistrations_;return noe(t.eventGenerator_,e,n,i)}var Qy,Jy=class{constructor(){this.views=new Map}};function Moe(t){X(!Qy,"__referenceConstructor has already been defined"),Qy=t}function Poe(){return X(Qy,"Reference.ts has not been loaded"),Qy}function xoe(t){return t.views.size===0}function Uw(t,e,n,r){let i=e.source.queryId;if(i!==null){let o=t.views.get(i);return X(o!=null,"SyncTree gave us an op for an invalid query."),jj(o,e,n,r)}else{let o=[];for(let s of t.views.values())o=o.concat(jj(s,e,n,r));return o}}function MH(t,e,n,r,i){let o=e._queryIdentifier,s=t.views.get(o);if(!s){let a=Ky(n,i?r:null),c=!1;a?c=!0:r instanceof ve?(a=kw(n,r),c=!1):(a=ve.EMPTY_NODE,c=!1);let l=aI(new fo(a,c,!1),new fo(r,i,!1));return new uw(e,l)}return s}function koe(t,e,n,r,i,o){let s=MH(t,e,r,i,o);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,s),Ooe(s,n),Loe(s,n)}function Foe(t,e,n,r){let i=e._queryIdentifier,o=[],s=[],a=ga(t);if(i==="default")for(let[c,l]of t.views.entries())s=s.concat(Gj(l,n,r)),Bj(l)&&(t.views.delete(c),l.query._queryParams.loadsAllData()||o.push(l.query));else{let c=t.views.get(i);c&&(s=s.concat(Gj(c,n,r)),Bj(c)&&(t.views.delete(i),c.query._queryParams.loadsAllData()||o.push(c.query)))}return a&&!ga(t)&&o.push(new(Poe())(e._repo,e._path)),{removed:o,events:s}}function PH(t){let e=[];for(let n of t.views.values())n.query._queryParams.loadsAllData()||e.push(n);return e}function ha(t,e){let n=null;for(let r of t.views.values())n=n||woe(r,e);return n}function xH(t,e){if(e._queryParams.loadsAllData())return lI(t);{let r=e._queryIdentifier;return t.views.get(r)}}function kH(t,e){return xH(t,e)!=null}function ga(t){return lI(t)!=null}function lI(t){for(let e of t.views.values())if(e.query._queryParams.loadsAllData())return e;return null}var Zy;function Uoe(t){X(!Zy,"__referenceConstructor has already been defined"),Zy=t}function Voe(){return X(Zy,"Reference.ts has not been loaded"),Zy}var Boe=1,eI=class{constructor(e){this.listenProvider_=e,this.syncPointTree_=new Xn(null),this.pendingWriteTree_=_oe(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}};function Vw(t,e,n,r,i){return soe(t.pendingWriteTree_,e,n,r,i),i?kd(t,new wd(Mw(),e,n)):[]}function Goe(t,e,n,r){aoe(t.pendingWriteTree_,e,n,r);let i=Xn.fromObject(n);return kd(t,new sg(Mw(),e,i))}function la(t,e,n=!1){let r=coe(t.pendingWriteTree_,e);if(loe(t.pendingWriteTree_,e)){let o=new Xn(null);return r.snap!=null?o=o.set(Be(),!0):gn(r.children,s=>{o=o.set(new Ge(s),!0)}),kd(t,new tw(r.path,o,n))}else return[]}function mg(t,e,n){return kd(t,new wd(Pw(),e,n))}function joe(t,e,n){let r=Xn.fromObject(n);return kd(t,new sg(Pw(),e,r))}function Hoe(t,e){return kd(t,new zy(Pw(),e))}function $oe(t,e,n){let r=Bw(t,n);if(r){let i=Gw(r),o=i.path,s=i.queryId,a=Yn(o,e),c=new zy(xw(s),a);return jw(t,o,c)}else return[]}function tI(t,e,n,r,i=!1){let o=e._path,s=t.syncPointTree_.get(o),a=[];if(s&&(e._queryIdentifier==="default"||kH(s,e))){let c=Foe(s,e,n,r);xoe(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)=>ga(g));if(d&&!h){let f=t.syncPointTree_.subtree(o);if(!f.isEmpty()){let g=qoe(f);for(let E=0;E<g.length;++E){let I=g[E],S=I.query,R=BH(t,I);t.listenProvider_.startListening(eg(S),cg(t,S),R.hashFn,R.onComplete)}}}!h&&l.length>0&&!r&&(d?t.listenProvider_.stopListening(eg(e),null):l.forEach(f=>{let g=t.queryToTagMap.get(dI(f));t.listenProvider_.stopListening(eg(f),g)}))}Koe(t,l)}return a}function FH(t,e,n,r){let i=Bw(t,r);if(i!=null){let o=Gw(i),s=o.path,a=o.queryId,c=Yn(s,e),l=new wd(xw(a),c,n);return jw(t,s,l)}else return[]}function Woe(t,e,n,r){let i=Bw(t,r);if(i){let o=Gw(i),s=o.path,a=o.queryId,c=Yn(s,e),l=Xn.fromObject(n),d=new sg(xw(a),c,l);return jw(t,s,d)}else return[]}function dw(t,e,n,r=!1){let i=e._path,o=null,s=!1;t.syncPointTree_.foreachOnPath(i,(f,g)=>{let E=Yn(f,i);o=o||ha(g,E),s=s||ga(g)});let a=t.syncPointTree_.get(i);a?(s=s||ga(a),o=o||ha(a,Be())):(a=new Jy,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=ha(E,Be());I&&(o=o.updateImmediateChild(g,I))}));let l=kH(a,e);if(!l&&!e._queryParams.loadsAllData()){let f=dI(e);X(!t.queryToTagMap.has(f),"View does not exist, but we have a tag");let g=Yoe();t.queryToTagMap.set(f,g),t.tagToQueryMap.set(g,f)}let d=cI(t.pendingWriteTree_,i),h=koe(a,e,n,d,o,c);if(!l&&!s&&!r){let f=xH(a,e);h=h.concat(Xoe(t,e,f))}return h}function uI(t,e,n){let i=t.pendingWriteTree_,o=t.syncPointTree_.findOnPath(e,(s,a)=>{let c=Yn(s,e),l=ha(a,c);if(l)return l});return RH(i,e,o,n,!0)}function zoe(t,e){let n=e._path,r=null;t.syncPointTree_.foreachOnPath(n,(l,d)=>{let h=Yn(l,n);r=r||ha(d,h)});let i=t.syncPointTree_.get(n);i?r=r||ha(i,Be()):(i=new Jy,t.syncPointTree_=t.syncPointTree_.set(n,i));let o=r!=null,s=o?new fo(r,!0,!1):null,a=cI(t.pendingWriteTree_,e._path),c=MH(i,e,a,o?s.getNode():ve.EMPTY_NODE,o);return boe(c)}function kd(t,e){return UH(e,t.syncPointTree_,null,cI(t.pendingWriteTree_,Be()))}function UH(t,e,n,r){if(we(t.path))return VH(t,e,n,r);{let i=e.get(Be());n==null&&i!=null&&(n=ha(i,Be()));let o=[],s=be(t.path),a=t.operationForChild(s),c=e.children.get(s);if(c&&a){let l=n?n.getImmediateChild(s):null,d=NH(r,s);o=o.concat(UH(a,c,l,d))}return i&&(o=o.concat(Uw(i,t,r,n))),o}}function VH(t,e,n,r){let i=e.get(Be());n==null&&i!=null&&(n=ha(i,Be()));let o=[];return e.children.inorderTraversal((s,a)=>{let c=n?n.getImmediateChild(s):null,l=NH(r,s),d=t.operationForChild(s);d&&(o=o.concat(VH(d,a,c,l)))}),i&&(o=o.concat(Uw(i,t,r,n))),o}function BH(t,e){let n=e.query,r=cg(t,n);return{hashFn:()=>(Noe(e)||ve.EMPTY_NODE).hash(),onComplete:i=>{if(i==="ok")return r?$oe(t,n._path,r):Hoe(t,n._path);{let o=sie(i,n);return tI(t,n,null,o)}}}}function cg(t,e){let n=dI(e);return t.queryToTagMap.get(n)}function dI(t){return t._path.toString()+"$"+t._queryIdentifier}function Bw(t,e){return t.tagToQueryMap.get(e)}function Gw(t){let e=t.indexOf("$");return X(e!==-1&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new Ge(t.substr(0,e))}}function jw(t,e,n){let r=t.syncPointTree_.get(e);X(r,"Missing sync point for query tag that we're tracking");let i=cI(t.pendingWriteTree_,e);return Uw(r,n,i,null)}function qoe(t){return t.fold((e,n,r)=>{if(n&&ga(n))return[lI(n)];{let i=[];return n&&(i=PH(n)),gn(r,(o,s)=>{i=i.concat(s)}),i}})}function eg(t){return t._queryParams.loadsAllData()&&!t._queryParams.isDefault()?new(Voe())(t._repo,t._path):t}function Koe(t,e){for(let n=0;n<e.length;++n){let r=e[n];if(!r._queryParams.loadsAllData()){let i=dI(r),o=t.queryToTagMap.get(i);t.queryToTagMap.delete(i),t.tagToQueryMap.delete(o)}}}function Yoe(){return Boe++}function Xoe(t,e,n){let r=e._path,i=cg(t,e),o=BH(t,n),s=t.listenProvider_.startListening(eg(e),i,o.hashFn,o.onComplete),a=t.syncPointTree_.subtree(r);if(i)X(!ga(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&&ga(d))return[lI(d).query];{let f=[];return d&&(f=f.concat(PH(d).map(g=>g.query))),gn(h,(g,E)=>{f=f.concat(E)}),f}});for(let l=0;l<c.length;++l){let d=c[l];t.listenProvider_.stopListening(eg(d),cg(t,d))}}return s}var hw=class t{constructor(e){this.node_=e}getImmediateChild(e){let n=this.node_.getImmediateChild(e);return new t(n)}node(){return this.node_}},fw=class t{constructor(e,n){this.syncTree_=e,this.path_=n}getImmediateChild(e){let n=St(this.path_,e);return new t(this.syncTree_,n)}node(){return uI(this.syncTree_,this.path_)}},Qoe=function(t){return t=t||{},t.timestamp=t.timestamp||new Date().getTime(),t},Hj=function(t,e,n){if(!t||typeof t!="object")return t;if(X(".sv"in t,"Unexpected leaf node or priority contents"),typeof t[".sv"]=="string")return Joe(t[".sv"],e,n);if(typeof t[".sv"]=="object")return Zoe(t[".sv"],e);X(!1,"Unexpected server value: "+JSON.stringify(t,null,2))},Joe=function(t,e,n){if(t==="timestamp")return n.timestamp;X(!1,"Unexpected server value: "+t)},Zoe=function(t,e,n){t.hasOwnProperty("increment")||X(!1,"Unexpected server value: "+JSON.stringify(t,null,2));let r=t.increment;typeof r!="number"&&X(!1,"Unexpected increment value: "+r);let i=e.node();if(X(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},GH=function(t,e,n,r){return $w(e,new fw(n,t),r)},Hw=function(t,e,n){return $w(t,new hw(e),n)};function $w(t,e,n){let r=t.getPriority().val(),i=Hj(r,e.getImmediateChild(".priority"),n),o;if(t.isLeafNode()){let s=t,a=Hj(s.getValue(),e,n);return a!==s.getValue()||i!==s.getPriority().val()?new Rd(a,vt(i)):t}else{let s=t;return o=s,i!==s.getPriority().val()&&(o=o.updatePriority(new Rd(i))),s.forEachChild(ft,(a,c)=>{let l=$w(c,e.getImmediateChild(a),n);l!==c&&(o=o.updateImmediateChild(a,l))}),o}}var lg=class{constructor(e="",n=null,r={children:{},childCount:0}){this.name=e,this.parent=n,this.node=r}};function hI(t,e){let n=e instanceof Ge?e:new Ge(e),r=t,i=be(n);for(;i!==null;){let o=Xs(r.node.children,i)||{children:{},childCount:0};r=new lg(i,r,o),n=at(n),i=be(n)}return r}function yl(t){return t.node.value}function Ww(t,e){t.node.value=e,pw(t)}function jH(t){return t.node.childCount>0}function ese(t){return yl(t)===void 0&&!jH(t)}function fI(t,e){gn(t.node.children,(n,r)=>{e(new lg(n,t,r))})}function HH(t,e,n,r){n&&!r&&e(t),fI(t,i=>{HH(i,e,!0,r)}),n&&r&&e(t)}function tse(t,e,n){let r=n?t:t.parent;for(;r!==null;){if(e(r))return!0;r=r.parent}return!1}function Eg(t){return new Ge(t.parent===null?t.name:Eg(t.parent)+"/"+t.name)}function pw(t){t.parent!==null&&nse(t.parent,t.name,t)}function nse(t,e,n){let r=ese(n),i=Gr(t.node.children,e);r&&i?(delete t.node.children[e],t.node.childCount--,pw(t)):!r&&!i&&(t.node.children[e]=n.node,t.node.childCount++,pw(t))}var rse=/[\[\].#$\/\u0000-\u001F\u007F]/,ise=/[\[\].#$\u0000-\u001F\u007F]/,Db=10*1024*1024,pI=function(t){return typeof t=="string"&&t.length!==0&&!rse.test(t)},$H=function(t){return typeof t=="string"&&t.length!==0&&!ise.test(t)},ose=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),$H(t)},ug=function(t){return t===null||typeof t=="string"||typeof t=="number"&&!sI(t)||t&&typeof t=="object"&&Gr(t,".sv")},pl=function(t,e,n,r){r&&e===void 0||_g(Qs(t,"value"),e,n)},_g=function(t,e,n){let r=n instanceof Ge?new Vb(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+cl(r));if(typeof e=="function")throw new Error(t+"contains a function "+cl(r)+" with contents = "+e.toString());if(sI(e))throw new Error(t+"contains "+e.toString()+" "+cl(r));if(typeof e=="string"&&e.length>Db/3&&Sp(e)>Db)throw new Error(t+"contains a string greater than "+Db+" utf8 bytes "+cl(r)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let i=!1,o=!1;if(gn(e,(s,a)=>{if(s===".value")i=!0;else if(s!==".priority"&&s!==".sv"&&(o=!0,!pI(s)))throw new Error(t+" contains an invalid key ("+s+") "+cl(r)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);xie(r,s),_g(t,a,r),kie(r)}),i&&o)throw new Error(t+' contains ".value" child '+cl(r)+" in addition to actual children.")}},sse=function(t,e){let n,r;for(n=0;n<e.length;n++){r=e[n];let o=tg(r);for(let s=0;s<o.length;s++)if(!(o[s]===".priority"&&s===o.length-1)){if(!pI(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(Pie);let i=null;for(n=0;n<e.length;n++){if(r=e[n],i!==null&&$r(i,r))throw new Error(t+"contains a path "+i.toString()+" that is ancestor of another path "+r.toString());i=r}},WH=function(t,e,n,r){if(r&&e===void 0)return;let i=Qs(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=[];gn(e,(s,a)=>{let c=new Ge(s);if(_g(i,a,St(n,c)),bw(c)===".priority"&&!ug(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)}),sse(i,o)},ase=function(t,e,n){if(!(n&&e===void 0)){if(sI(e))throw new Error(Qs(t,"priority")+"is "+e.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!ug(e))throw new Error(Qs(t,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},zH=function(t,e,n,r){if(!(r&&n===void 0)&&!pI(n))throw new Error(Qs(t,e)+'was an invalid key = "'+n+`". Firebase keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]").`)},zw=function(t,e,n,r){if(!(r&&n===void 0)&&!$H(n))throw new Error(Qs(t,e)+'was an invalid path = "'+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},cse=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),zw(t,e,n,r)},ua=function(t,e){if(be(e)===".info")throw new Error(t+" failed = Can't modify data under /.info/")},lse=function(t,e){let n=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!pI(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||n.length!==0&&!ose(n))throw new Error(Qs(t,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};var gw=class{constructor(){this.eventLists_=[],this.recursionDepth_=0}};function gI(t,e){let n=null;for(let r=0;r<e.length;r++){let i=e[r],o=i.getPath();n!==null&&!ww(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 qH(t,e,n){gI(t,n),KH(t,r=>ww(r,e))}function Ar(t,e,n){gI(t,n),KH(t,r=>$r(r,e)||$r(e,r))}function KH(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)?(use(t.eventLists_[r]),t.eventLists_[r]=null):n=!1}}n&&(t.eventLists_=[]),t.recursionDepth_--}function use(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();ul&&pn("event: "+n.toString()),Pd(r)}}}var dse="repo_interrupt",hse=25,mw=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 gw,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Wy(),this.transactionQueueTree_=new lg,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}};function fse(t,e,n){if(t.stats_=Nw(t.repoInfo_),t.forceRestClient_||uie())t.server_=new Yb(t.repoInfo_,(r,i,o,s)=>{$j(t,r,i,o,s)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>Wj(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 Ow(t.repoInfo_,e,(r,i,o,s)=>{$j(t,r,i,o,s)},r=>{Wj(t,r)},r=>{pse(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_=hie(t.repoInfo_,()=>new ew(t.stats_,t.server_)),t.infoData_=new Xb,t.infoSyncTree_=new eI({startListening:(r,i,o,s)=>{let a=[],c=t.infoData_.getNode(r._path);return c.isEmpty()||(a=mg(t.infoSyncTree_,r._path,c),setTimeout(()=>{s("ok")},0)),a},stopListening:()=>{}}),qw(t,"connected",!1),t.serverSyncTree_=new eI({startListening:(r,i,o,s)=>(t.server_.listen(r,o,i,(a,c)=>{let l=s(a,c);Ar(t.eventQueue_,r._path,l)}),[]),stopListening:(r,i)=>{t.server_.unlisten(r,i)}})}function YH(t){let n=t.infoData_.getNode(new Ge(".info/serverTimeOffset")).val()||0;return new Date().getTime()+n}function Tg(t){return Qoe({timestamp:YH(t)})}function $j(t,e,n,r,i){t.dataUpdateCount++;let o=new Ge(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let s=[];if(i)if(r){let c=Ip(n,l=>vt(l));s=Woe(t.serverSyncTree_,o,c,i)}else{let c=vt(n);s=FH(t.serverSyncTree_,o,c,i)}else if(r){let c=Ip(n,l=>vt(l));s=joe(t.serverSyncTree_,o,c)}else{let c=vt(n);s=mg(t.serverSyncTree_,o,c)}let a=o;s.length>0&&(a=Ld(t,o)),Ar(t.eventQueue_,a,s)}function Wj(t,e){qw(t,"connected",e),e===!1&&_se(t)}function pse(t,e){gn(e,(n,r)=>{qw(t,n,r)})}function qw(t,e,n){let r=new Ge("/.info/"+e),i=vt(n);t.infoData_.updateSnapshot(r,i);let o=mg(t.infoSyncTree_,r,i);Ar(t.eventQueue_,r,o)}function mI(t){return t.nextWriteId_++}function gse(t,e,n){let r=zoe(t.serverSyncTree_,e);return r!=null?Promise.resolve(r):t.server_.get(e).then(i=>{let o=vt(i).withIndex(e._queryParams.getIndex());dw(t.serverSyncTree_,e,n,!0);let s;if(e._queryParams.loadsAllData())s=mg(t.serverSyncTree_,e._path,o);else{let a=cg(t.serverSyncTree_,e);s=FH(t.serverSyncTree_,e._path,o,a)}return Ar(t.eventQueue_,e._path,s),tI(t.serverSyncTree_,e,n,null,!0),o},i=>(Fd(t,"get for query "+xt(e)+" failed: "+i),Promise.reject(new Error(i))))}function mse(t,e,n,r,i){Fd(t,"set",{path:e.toString(),value:n,priority:r});let o=Tg(t),s=vt(n,r),a=uI(t.serverSyncTree_,e),c=Hw(s,a,o),l=mI(t),d=Vw(t.serverSyncTree_,e,c,l,!0);gI(t.eventQueue_,d),t.server_.put(e.toString(),s.val(!0),(f,g)=>{let E=f==="ok";E||Bn("set at "+e+" failed: "+f);let I=la(t.serverSyncTree_,l,!E);Ar(t.eventQueue_,e,I),ma(t,i,f,g)});let h=Yw(t,e);Ld(t,h),Ar(t.eventQueue_,h,[])}function Ese(t,e,n,r){Fd(t,"update",{path:e.toString(),value:n});let i=!0,o=Tg(t),s={};if(gn(n,(a,c)=>{i=!1,s[a]=GH(St(e,a),vt(c),t.serverSyncTree_,o)}),i)pn("update() called with empty data. Don't do anything."),ma(t,r,"ok",void 0);else{let a=mI(t),c=Goe(t.serverSyncTree_,e,s,a);gI(t.eventQueue_,c),t.server_.merge(e.toString(),n,(l,d)=>{let h=l==="ok";h||Bn("update at "+e+" failed: "+l);let f=la(t.serverSyncTree_,a,!h),g=f.length>0?Ld(t,e):e;Ar(t.eventQueue_,g,f),ma(t,r,l,d)}),gn(n,l=>{let d=Yw(t,St(e,l));Ld(t,d)}),Ar(t.eventQueue_,e,[])}}function _se(t){Fd(t,"onDisconnectEvents");let e=Tg(t),n=Wy();Jb(t.onDisconnect_,Be(),(i,o)=>{let s=GH(i,o,t.serverSyncTree_,e);xd(n,i,s)});let r=[];Jb(n,Be(),(i,o)=>{r=r.concat(mg(t.serverSyncTree_,i,o));let s=Yw(t,i);Ld(t,s)}),t.onDisconnect_=Wy(),Ar(t.eventQueue_,Be(),r)}function Tse(t,e,n){t.server_.onDisconnectCancel(e.toString(),(r,i)=>{r==="ok"&&Qb(t.onDisconnect_,e),ma(t,n,r,i)})}function zj(t,e,n,r){let i=vt(n);t.server_.onDisconnectPut(e.toString(),i.val(!0),(o,s)=>{o==="ok"&&xd(t.onDisconnect_,e,i),ma(t,r,o,s)})}function yse(t,e,n,r,i){let o=vt(n,r);t.server_.onDisconnectPut(e.toString(),o.val(!0),(s,a)=>{s==="ok"&&xd(t.onDisconnect_,e,o),ma(t,i,s,a)})}function Ise(t,e,n,r){if(yp(n)){pn("onDisconnect().update() called with empty data. Don't do anything."),ma(t,r,"ok",void 0);return}t.server_.onDisconnectMerge(e.toString(),n,(i,o)=>{i==="ok"&&gn(n,(s,a)=>{let c=vt(a);xd(t.onDisconnect_,St(e,s),c)}),ma(t,r,i,o)})}function vse(t,e,n){let r;be(e._path)===".info"?r=dw(t.infoSyncTree_,e,n):r=dw(t.serverSyncTree_,e,n),qH(t.eventQueue_,e._path,r)}function Ew(t,e,n){let r;be(e._path)===".info"?r=tI(t.infoSyncTree_,e,n):r=tI(t.serverSyncTree_,e,n),qH(t.eventQueue_,e._path,r)}function Sse(t){t.persistentConnection_&&t.persistentConnection_.interrupt(dse)}function Fd(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),pn(n,...e)}function ma(t,e,n,r){e&&Pd(()=>{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 Ase(t,e,n,r,i,o){Fd(t,"transaction on "+e);let s={path:e,update:n,onComplete:r,status:null,order:Xj(),applyLocally:o,retryCount:0,unwatcher:i,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},a=Kw(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{_g("transaction failed: Data returned ",c,s.path),s.status=0;let l=hI(t.transactionQueueTree_,e),d=yl(l)||[];d.push(s),Ww(l,d);let h;typeof c=="object"&&c!==null&&Gr(c,".priority")?(h=Xs(c,".priority"),X(ug(h),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):h=(uI(t.serverSyncTree_,e)||ve.EMPTY_NODE).getPriority().val();let f=Tg(t),g=vt(c,h),E=Hw(g,a,f);s.currentOutputSnapshotRaw=g,s.currentOutputSnapshotResolved=E,s.currentWriteId=mI(t);let I=Vw(t.serverSyncTree_,e,E,s.currentWriteId,s.applyLocally);Ar(t.eventQueue_,e,I),EI(t,t.transactionQueueTree_)}}function Kw(t,e,n){return uI(t.serverSyncTree_,e,n)||ve.EMPTY_NODE}function EI(t,e=t.transactionQueueTree_){if(e||_I(t,e),yl(e)){let n=QH(t,e);X(n.length>0,"Sending zero length transaction queue"),n.every(i=>i.status===0)&&Cse(t,Eg(e),n)}else jH(e)&&fI(e,n=>{EI(t,n)})}function Cse(t,e,n){let r=n.map(l=>l.currentWriteId),i=Kw(t,e,r),o=i,s=i.hash();for(let l=0;l<n.length;l++){let d=n[l];X(d.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),d.status=1,d.retryCount++;let h=Yn(e,d.path);o=o.updateChild(h,d.currentOutputSnapshotRaw)}let a=o.val(!0),c=e;t.server_.put(c.toString(),a,l=>{Fd(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(la(t.serverSyncTree_,n[f].currentWriteId)),n[f].onComplete&&h.push(()=>n[f].onComplete(null,!0,n[f].currentOutputSnapshotResolved)),n[f].unwatcher();_I(t,hI(t.transactionQueueTree_,e)),EI(t,t.transactionQueueTree_),Ar(t.eventQueue_,e,d);for(let f=0;f<h.length;f++)Pd(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{Bn("transaction at "+c.toString()+" failed: "+l);for(let h=0;h<n.length;h++)n[h].status=4,n[h].abortReason=l}Ld(t,e)}},s)}function Ld(t,e){let n=XH(t,e),r=Eg(n),i=QH(t,n);return Dse(t,i,r),r}function Dse(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=Yn(n,c.path),d=!1,h;if(X(l!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),c.status===4)d=!0,h=c.abortReason,i=i.concat(la(t.serverSyncTree_,c.currentWriteId,!0));else if(c.status===0)if(c.retryCount>=hse)d=!0,h="maxretry",i=i.concat(la(t.serverSyncTree_,c.currentWriteId,!0));else{let f=Kw(t,c.path,s);c.currentInputSnapshot=f;let g=e[a].update(f.val());if(g!==void 0){_g("transaction failed: Data returned ",g,c.path);let E=vt(g);typeof g=="object"&&g!=null&&Gr(g,".priority")||(E=E.updatePriority(f.getPriority()));let S=c.currentWriteId,R=Tg(t),U=Hw(E,f,R);c.currentOutputSnapshotRaw=E,c.currentOutputSnapshotResolved=U,c.currentWriteId=mI(t),s.splice(s.indexOf(S),1),i=i.concat(Vw(t.serverSyncTree_,c.path,U,c.currentWriteId,c.applyLocally)),i=i.concat(la(t.serverSyncTree_,S,!0))}else d=!0,h="nodata",i=i.concat(la(t.serverSyncTree_,c.currentWriteId,!0))}Ar(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))))}_I(t,t.transactionQueueTree_);for(let a=0;a<r.length;a++)Pd(r[a]);EI(t,t.transactionQueueTree_)}function XH(t,e){let n,r=t.transactionQueueTree_;for(n=be(e);n!==null&&yl(r)===void 0;)r=hI(r,n),e=at(e),n=be(e);return r}function QH(t,e){let n=[];return JH(t,e,n),n.sort((r,i)=>r.order-i.order),n}function JH(t,e,n){let r=yl(e);if(r)for(let i=0;i<r.length;i++)n.push(r[i]);fI(e,i=>{JH(t,i,n)})}function _I(t,e){let n=yl(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,Ww(e,n.length>0?n:void 0)}fI(e,r=>{_I(t,r)})}function Yw(t,e){let n=Eg(XH(t,e)),r=hI(t.transactionQueueTree_,e);return tse(r,i=>{Rb(t,i)}),Rb(t,r),HH(r,i=>{Rb(t,i)}),n}function Rb(t,e){let n=yl(e);if(n){let r=[],i=[],o=-1;for(let s=0;s<n.length;s++)n[s].status===3||(n[s].status===1?(X(o===s-1,"All SENT items should be at beginning of queue."),o=s,n[s].status=3,n[s].abortReason="set"):(X(n[s].status===0,"Unexpected transaction status in abort"),n[s].unwatcher(),i=i.concat(la(t.serverSyncTree_,n[s].currentWriteId,!0)),n[s].onComplete&&r.push(n[s].onComplete.bind(null,new Error("set"),!1,null))));o===-1?Ww(e,void 0):n.length=o+1,Ar(t.eventQueue_,Eg(e),i);for(let s=0;s<r.length;s++)Pd(r[s])}}function Rse(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 Nse(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]):Bn(`Invalid query segment '${n}' in query '${t}'`)}return e}var qj=function(t,e){let n=bse(t),r=n.namespace;n.domain==="firebase.com"&&rs(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!r||r==="undefined")&&n.domain!=="localhost"&&rs("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||tie();let i=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new ky(n.host,n.secure,r,i,e,"",r!==n.subdomain),path:new Ge(n.pathString)}},bse=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=Rse(t.substring(d,h)));let f=Nse(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 Kj="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",wse=(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]=Kj.charAt(n%64),n=Math.floor(n/64);X(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+=Kj.charAt(e[i]);return X(s.length===20,"nextPushId: Length should be 20."),s}})();var nI=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())}},rI=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 dg=class{constructor(e,n){this.snapshotCallback=e,this.cancelCallback=n}onValue(e,n){this.snapshotCallback.call(null,e,n)}onCancel(e){return X(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 _w=class{constructor(e,n){this._repo=e,this._path=n}cancel(){let e=new dn;return Tse(this._repo,this._path,e.wrapCallback(()=>{})),e.promise}remove(){ua("OnDisconnect.remove",this._path);let e=new dn;return zj(this._repo,this._path,null,e.wrapCallback(()=>{})),e.promise}set(e){ua("OnDisconnect.set",this._path),pl("OnDisconnect.set",e,this._path,!1);let n=new dn;return zj(this._repo,this._path,e,n.wrapCallback(()=>{})),n.promise}setWithPriority(e,n){ua("OnDisconnect.setWithPriority",this._path),pl("OnDisconnect.setWithPriority",e,this._path,!1),ase("OnDisconnect.setWithPriority",n,!1);let r=new dn;return yse(this._repo,this._path,e,n,r.wrapCallback(()=>{})),r.promise}update(e){ua("OnDisconnect.update",this._path),WH("OnDisconnect.update",e,this._path,!1);let n=new dn;return Ise(this._repo,this._path,e,n.wrapCallback(()=>{})),n.promise}};var gl=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:bw(this._path)}get ref(){return new yi(this._repo,this._path)}get _queryIdentifier(){let e=Mj(this._queryParams),n=Rw(e);return n==="{}"?"default":n}get _queryObject(){return Mj(this._queryParams)}isEqual(e){if(e=Me(e),!(e instanceof t))return!1;let n=this._repo===e._repo,r=ww(this._path,e._path),i=this._queryIdentifier===e._queryIdentifier;return n&&r&&i}toJSON(){return this.toString()}toString(){return this._repo.toString()+Mie(this._path)}};function Ose(t,e){if(t._orderByCalled===!0)throw new Error(e+": You can't combine multiple orderBy calls.")}function Xw(t){let e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===dl){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()!==hl)throw new Error(r);if(typeof e!="string")throw new Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!==fa)throw new Error(r);if(typeof n!="string")throw new Error(i)}}else if(t.getIndex()===ft){if(e!=null&&!ug(e)||n!=null&&!ug(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(X(t.getIndex()instanceof ng||t.getIndex()===vH,"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 ZH(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 yi=class t extends gl{constructor(e,n){super(e,n,new Kb,!1)}get parent(){let e=mH(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}},Md=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 Ge(e),r=ml(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,ml(this.ref,r),ft)))}hasChild(e){let n=new Ge(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 e$(t,e){return t=Me(t),t._checkNotDeleted("ref"),e!==void 0?ml(t._root,e):t._root}function ml(t,e){return t=Me(t),be(t._path)===null?cse("child","path",e,!1):zw("child","path",e,!1),new yi(t._repo,St(t._path,e))}function t$(t){return t=Me(t),new _w(t._repo,t._path)}function n$(t,e){t=Me(t),ua("push",t._path),pl("push",e,t._path,!0);let n=YH(t._repo),r=wse(n),i=ml(t,r),o=ml(t,r),s;return e!=null?s=TI(o,e).then(()=>o):s=Promise.resolve(o),i.then=s.then.bind(s),i.catch=s.then.bind(s,void 0),i}function r$(t){return ua("remove",t._path),TI(t,null)}function TI(t,e){t=Me(t),ua("set",t._path),pl("set",e,t._path,!1);let n=new dn;return mse(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}function i$(t,e){WH("update",e,t._path,!1);let n=new dn;return Ese(t._repo,t._path,e,n.wrapCallback(()=>{})),n.promise}function yI(t){t=Me(t);let e=new dg(()=>{}),n=new hg(e);return gse(t._repo,t,n).then(r=>new Md(r,new yi(t._repo,t._path),t._queryParams.getIndex()))}var hg=class t{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,n){let r=n._queryParams.getIndex();return new nI("value",this,new Md(e.snapshotNode,new yi(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 rI(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}},iI=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 rI(this,e,n):null}createEvent(e,n){X(e.childName!=null,"Child events should have a childName.");let r=ml(new yi(n._repo,n._path),e.childName),i=n._queryParams.getIndex();return new nI(e.type,this,new Md(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 yg(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)=>{Ew(t._repo,t,a),c(d,h)};l.userCallback=n.userCallback,l.context=n.context,n=l}let s=new dg(n,o||void 0),a=e==="value"?new hg(s):new iI(e,s);return vse(t._repo,t,a),()=>Ew(t._repo,t,a)}function Ig(t,e,n,r){return yg(t,"value",e,n,r)}function II(t,e,n,r){return yg(t,"child_added",e,n,r)}function vI(t,e,n,r){return yg(t,"child_changed",e,n,r)}function Qw(t,e,n,r){return yg(t,"child_moved",e,n,r)}function SI(t,e,n,r){return yg(t,"child_removed",e,n,r)}function AI(t,e,n){let r=null,i=n?new dg(n):null;e==="value"?r=new hg(i):e&&(r=new iI(e,i)),Ew(t._repo,t,r)}var El=class{},Tw=class extends El{constructor(e,n){super(),this._value=e,this._key=n,this.type="endAt"}_apply(e){pl("endAt",this._value,e._path,!0);let n=Qie(e._queryParams,this._value,this._key);if(ZH(n),Xw(n),e._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new gl(e._repo,e._path,n,e._orderByCalled)}};var oI=class extends El{constructor(e,n){super(),this._value=e,this._key=n,this.type="startAt"}_apply(e){pl("startAt",this._value,e._path,!0);let n=Xie(e._queryParams,this._value,this._key);if(ZH(n),Xw(n),e._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new gl(e._repo,e._path,n,e._orderByCalled)}};function o$(t=null,e){return zH("startAt","key",e,!0),new oI(t,e)}var yw=class extends El{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 gl(e._repo,e._path,Yie(e._queryParams,this._limit),e._orderByCalled)}};function s$(t){if(typeof t!="number"||Math.floor(t)!==t||t<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new yw(t)}var Iw=class extends El{constructor(e){super(),this._path=e,this.type="orderByChild"}_apply(e){Ose(e,"orderByChild");let n=new Ge(this._path);if(we(n))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");let r=new ng(n),i=Jie(e._queryParams,r);return Xw(i),new gl(e._repo,e._path,i,!0)}};function a$(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 zw("orderByChild","path",t,!1),new Iw(t)}var vw=class extends El{constructor(e,n){super(),this._value=e,this._key=n,this.type="equalTo"}_apply(e){if(pl("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 Tw(this._value,this._key)._apply(new oI(this._value,this._key)._apply(e))}};function c$(t,e){return zH("equalTo","key",e,!0),new vw(t,e)}function l$(t,...e){let n=Me(t);for(let r of e)n=r._apply(n);return n}Moe(yi);Uoe(yi);var Lse="FIREBASE_DATABASE_EMULATOR_HOST",Sw={},Mse=!1;function Pse(t,e,n,r){let i=e.lastIndexOf(":"),o=e.substring(0,i),s=vr(o);t.repoInfo_=new ky(e,s,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams,!0,n),r&&(t.authTokenProvider_=r)}function xse(t,e,n,r,i){let o=r||t.options.databaseURL;o===void 0&&(t.options.projectId||rs("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),pn("Using default host for project ",t.options.projectId),o=`${t.options.projectId}-default-rtdb.firebaseio.com`);let s=qj(o,i),a=s.repoInfo,c,l;typeof process<"u"&&process.env&&(l=process.env[Lse]),l?(c=!0,o=`http://${l}?ns=${a.namespace}`,s=qj(o,i),a=s.repoInfo):c=!s.repoInfo.secure;let d=i&&c?new Qp(Qp.OWNER):new Mb(t.name,t.options,e);lse("Invalid Firebase Database URL",s),we(s.path)||rs("Database URL must point to the root of a Firebase Database (not including a child path).");let h=Fse(a,t,d,new Lb(t,n));return new Aw(h,t)}function kse(t,e){let n=Sw[e];(!n||n[t.key]!==t)&&rs(`Database ${e}(${t.repoInfo_}) has already been deleted.`),Sse(t),delete n[t.key]}function Fse(t,e,n,r){let i=Sw[e.name];i||(i={},Sw[e.name]=i);let o=i[t.toURLString()];return o&&rs("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),o=new mw(t,Mse,n,r),i[t.toURLString()]=o,o}var Aw=class{constructor(e,n){this._repoInternal=e,this.app=n,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(fse(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new yi(this._repo,Be())),this._rootInternal}_delete(){return this._rootInternal!==null&&(kse(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&rs("Cannot call "+e+" on a deleted database.")}};function Use(){gH.IS_TRANSPORT_INITIALIZED&&Bn("Transport has already been initialized. Please call this function before calling ref or setting up a listener")}function Jw(){Use(),Sd.forceDisallow(),Fy.forceAllow()}function Ud(t=or(),e){let n=co(t,"database").getImmediate({identifier:e});if(!n._instanceStarted){let r=pd("database");r&&u$(n,...r)}return n}function u$(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&&fi(r,o.repoInfo_.emulatorOptions))return;rs("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let s;if(o.repoInfo_.nodeAdmin)r.mockUserToken&&rs('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 Qp(Qp.OWNER);else if(r.mockUserToken){let a=typeof r.mockUserToken=="string"?r.mockUserToken:YT(r.mockUserToken,t.app.options.projectId);s=new Qp(a)}vr(e)&&(Ys(e),Kc("Database",!0)),Pse(o,i,r,s)}function Vse(t){Zre(Zs),Kn(new en("database",(e,{instanceIdentifier:n})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),o=e.getProvider("app-check-internal");return xse(r,i,o,n)},"PUBLIC").setMultipleInstances(!0)),je(mj,Ej,t),je(mj,Ej,"esm2017")}var Cw=class{constructor(e,n){this.committed=e,this.snapshot=n}toJSON(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}}};function d$(t,e,n){var r;if(t=Me(t),ua("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 dn,s=(c,l,d)=>{let h=null;c?o.reject(c):(h=new Md(d,new yi(t._repo,t._path),ft),o.resolve(new Cw(l,h)))},a=Ig(t,()=>{});return Ase(t._repo,t._path,e,s,a,i),o.promise}Ow.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)};Ow.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};Vse();var Il,mn=(function(t){return t.added="child_added",t.removed="child_removed",t.changed="child_changed",t.moved="child_moved",t.value="value",t})(mn||{}),Bse=Object.freeze((Il={},Il[mn.added]=II,Il[mn.removed]=SI,Il[mn.changed]=vI,Il[mn.moved]=Qw,Il[mn.value]=Ig,Il));function DI(t,e){return new he(function(n){var r=Bse[e](t,function(i,o){n.next({snapshot:i,prevKey:o,event:e})},n.error.bind(n));return{unsubscribe:function(){AI(t,e,r)}}}).pipe(kS(0))}var CI=function(){return CI=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},CI.apply(this,arguments)};function Zw(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 h$(t){return(t==null||t.length===0)&&(t=[mn.added,mn.removed,mn.changed,mn.moved]),t}function f$(t,e){return e===void 0&&(e={}),DI(t,mn.value).pipe(Ce(function(n){return eO(n,e)}))}function eO(t,e){var n;e===void 0&&(e={});var r=t.snapshot.val();return!t.snapshot.exists()||typeof r!="object"?r:CI(CI({},r),e.keyField?(n={},n[e.keyField]=t.snapshot.key,n):null)}function p$(t,e){e===void 0&&(e={});var n=h$(e.events),r=n.map(function(i){return DI(t,i)});return Rs.apply(void 0,r)}function Gse(t){return hr(yI(t)).pipe(Ce(function(e){var n=mn.value;return{snapshot:e,prevKey:null,event:n}}))}function g$(t,e){e===void 0&&(e={});var n=h$(e.events);return Gse(t).pipe(er(function(r){var i=[it(r)];return n.forEach(function(o){i.push(DI(t,o))}),Rs.apply(void 0,i).pipe(uE(Hse,[]))}),ri())}function m$(t,e){return e===void 0&&(e={}),g$(t).pipe(Ce(function(n){return n.map(function(r){return eO(r,e)})}))}function E$(t,e){for(var n=t.length,r=0;r<n;r++)if(t[r].snapshot.key===e)return r;return-1}function jse(t,e){if(e==null)return 0;var n=E$(t,e);return n===-1?t.length:n+1}function Hse(t,e){var n=e.snapshot,r=e.prevKey,i=e.event,o=n.key,s=E$(t,o),a=jse(t,r||void 0);switch(i){case mn.value:if(e.snapshot&&e.snapshot.exists()){var c=null;e.snapshot.forEach(function(h){var f={snapshot:h,event:mn.value,prevKey:c};return c=h.key,t=Zw(Zw([],t,!0),[f],!1),!1})}return t;case mn.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 Zw([e],t,!0);t=t.slice(),t.splice(a,0,e)}return t;case mn.removed:return t.filter(function(h){return h.snapshot.key!==n.key});case mn.changed:return t.map(function(h){return h.snapshot.key===o?e:h});case mn.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 vg=class{constructor(e){return e}},_$="database",tO=class{constructor(){return Qo(_$)}};var nO=new K("angularfire2.database-instances");function $se(t,e){let n=ea(_$,t,e);return n&&new vg(n)}function Wse(t){return(e,n)=>{let r=e.runOutsideAngular(()=>t(n));return new vg(r)}}var zse={provide:tO,deps:[[new Yt,nO]]},qse={provide:vg,useFactory:$se,deps:[[new Yt,nO],mi]};function zUe(t,...e){return je("angularfire",pi.full,"rtdb"),tr([qse,zse,{provide:nO,useFactory:Wse(t),multi:!0,deps:[De,Ke,gi,Jo,[new Yt,tl],[new Yt,na],...e]}])}var T$=fe(m$,!0);var y$=fe(f$,!0),I$=fe(p$,!0);var qUe=fe(c$,!0,2);var Sg=fe(yI,!0),KUe=fe(Ud,!0);var YUe=fe(s$,!0,2),v$=fe(AI,!0),S$=fe(II,!0),A$=fe(vI,!0);var C$=fe(SI,!0),D$=fe(t$,!0),rO=fe(Ig,!0),XUe=fe(a$,!0,2);var R$=fe(n$,!0,2),N$=fe(l$,!0,2),Vd=fe(e$,!0,2);var b$=fe(r$,!0,2),w$=fe(d$,!0),O$=fe(TI,!0,2);var QUe=fe(o$,!0,2),L$=fe(i$,!0,2);var M$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},P$={};var is,iO;(function(){var t;function e(A,v){function C(){}C.prototype=v.prototype,A.D=v.prototype,A.prototype=new C,A.prototype.constructor=A,A.C=function(w,N,L){for(var D=Array(arguments.length-2),Or=2;Or<arguments.length;Or++)D[Or-2]=arguments[Or];return v.prototype[N].apply(w,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(A,v,C){C||(C=0);var w=Array(16);if(typeof v=="string")for(var N=0;16>N;++N)w[N]=v.charCodeAt(C++)|v.charCodeAt(C++)<<8|v.charCodeAt(C++)<<16|v.charCodeAt(C++)<<24;else for(N=0;16>N;++N)w[N]=v[C++]|v[C++]<<8|v[C++]<<16|v[C++]<<24;v=A.g[0],C=A.g[1],N=A.g[2];var L=A.g[3],D=v+(L^C&(N^L))+w[0]+3614090360&4294967295;v=C+(D<<7&4294967295|D>>>25),D=L+(N^v&(C^N))+w[1]+3905402710&4294967295,L=v+(D<<12&4294967295|D>>>20),D=N+(C^L&(v^C))+w[2]+606105819&4294967295,N=L+(D<<17&4294967295|D>>>15),D=C+(v^N&(L^v))+w[3]+3250441966&4294967295,C=N+(D<<22&4294967295|D>>>10),D=v+(L^C&(N^L))+w[4]+4118548399&4294967295,v=C+(D<<7&4294967295|D>>>25),D=L+(N^v&(C^N))+w[5]+1200080426&4294967295,L=v+(D<<12&4294967295|D>>>20),D=N+(C^L&(v^C))+w[6]+2821735955&4294967295,N=L+(D<<17&4294967295|D>>>15),D=C+(v^N&(L^v))+w[7]+4249261313&4294967295,C=N+(D<<22&4294967295|D>>>10),D=v+(L^C&(N^L))+w[8]+1770035416&4294967295,v=C+(D<<7&4294967295|D>>>25),D=L+(N^v&(C^N))+w[9]+2336552879&4294967295,L=v+(D<<12&4294967295|D>>>20),D=N+(C^L&(v^C))+w[10]+4294925233&4294967295,N=L+(D<<17&4294967295|D>>>15),D=C+(v^N&(L^v))+w[11]+2304563134&4294967295,C=N+(D<<22&4294967295|D>>>10),D=v+(L^C&(N^L))+w[12]+1804603682&4294967295,v=C+(D<<7&4294967295|D>>>25),D=L+(N^v&(C^N))+w[13]+4254626195&4294967295,L=v+(D<<12&4294967295|D>>>20),D=N+(C^L&(v^C))+w[14]+2792965006&4294967295,N=L+(D<<17&4294967295|D>>>15),D=C+(v^N&(L^v))+w[15]+1236535329&4294967295,C=N+(D<<22&4294967295|D>>>10),D=v+(N^L&(C^N))+w[1]+4129170786&4294967295,v=C+(D<<5&4294967295|D>>>27),D=L+(C^N&(v^C))+w[6]+3225465664&4294967295,L=v+(D<<9&4294967295|D>>>23),D=N+(v^C&(L^v))+w[11]+643717713&4294967295,N=L+(D<<14&4294967295|D>>>18),D=C+(L^v&(N^L))+w[0]+3921069994&4294967295,C=N+(D<<20&4294967295|D>>>12),D=v+(N^L&(C^N))+w[5]+3593408605&4294967295,v=C+(D<<5&4294967295|D>>>27),D=L+(C^N&(v^C))+w[10]+38016083&4294967295,L=v+(D<<9&4294967295|D>>>23),D=N+(v^C&(L^v))+w[15]+3634488961&4294967295,N=L+(D<<14&4294967295|D>>>18),D=C+(L^v&(N^L))+w[4]+3889429448&4294967295,C=N+(D<<20&4294967295|D>>>12),D=v+(N^L&(C^N))+w[9]+568446438&4294967295,v=C+(D<<5&4294967295|D>>>27),D=L+(C^N&(v^C))+w[14]+3275163606&4294967295,L=v+(D<<9&4294967295|D>>>23),D=N+(v^C&(L^v))+w[3]+4107603335&4294967295,N=L+(D<<14&4294967295|D>>>18),D=C+(L^v&(N^L))+w[8]+1163531501&4294967295,C=N+(D<<20&4294967295|D>>>12),D=v+(N^L&(C^N))+w[13]+2850285829&4294967295,v=C+(D<<5&4294967295|D>>>27),D=L+(C^N&(v^C))+w[2]+4243563512&4294967295,L=v+(D<<9&4294967295|D>>>23),D=N+(v^C&(L^v))+w[7]+1735328473&4294967295,N=L+(D<<14&4294967295|D>>>18),D=C+(L^v&(N^L))+w[12]+2368359562&4294967295,C=N+(D<<20&4294967295|D>>>12),D=v+(C^N^L)+w[5]+4294588738&4294967295,v=C+(D<<4&4294967295|D>>>28),D=L+(v^C^N)+w[8]+2272392833&4294967295,L=v+(D<<11&4294967295|D>>>21),D=N+(L^v^C)+w[11]+1839030562&4294967295,N=L+(D<<16&4294967295|D>>>16),D=C+(N^L^v)+w[14]+4259657740&4294967295,C=N+(D<<23&4294967295|D>>>9),D=v+(C^N^L)+w[1]+2763975236&4294967295,v=C+(D<<4&4294967295|D>>>28),D=L+(v^C^N)+w[4]+1272893353&4294967295,L=v+(D<<11&4294967295|D>>>21),D=N+(L^v^C)+w[7]+4139469664&4294967295,N=L+(D<<16&4294967295|D>>>16),D=C+(N^L^v)+w[10]+3200236656&4294967295,C=N+(D<<23&4294967295|D>>>9),D=v+(C^N^L)+w[13]+681279174&4294967295,v=C+(D<<4&4294967295|D>>>28),D=L+(v^C^N)+w[0]+3936430074&4294967295,L=v+(D<<11&4294967295|D>>>21),D=N+(L^v^C)+w[3]+3572445317&4294967295,N=L+(D<<16&4294967295|D>>>16),D=C+(N^L^v)+w[6]+76029189&4294967295,C=N+(D<<23&4294967295|D>>>9),D=v+(C^N^L)+w[9]+3654602809&4294967295,v=C+(D<<4&4294967295|D>>>28),D=L+(v^C^N)+w[12]+3873151461&4294967295,L=v+(D<<11&4294967295|D>>>21),D=N+(L^v^C)+w[15]+530742520&4294967295,N=L+(D<<16&4294967295|D>>>16),D=C+(N^L^v)+w[2]+3299628645&4294967295,C=N+(D<<23&4294967295|D>>>9),D=v+(N^(C|~L))+w[0]+4096336452&4294967295,v=C+(D<<6&4294967295|D>>>26),D=L+(C^(v|~N))+w[7]+1126891415&4294967295,L=v+(D<<10&4294967295|D>>>22),D=N+(v^(L|~C))+w[14]+2878612391&4294967295,N=L+(D<<15&4294967295|D>>>17),D=C+(L^(N|~v))+w[5]+4237533241&4294967295,C=N+(D<<21&4294967295|D>>>11),D=v+(N^(C|~L))+w[12]+1700485571&4294967295,v=C+(D<<6&4294967295|D>>>26),D=L+(C^(v|~N))+w[3]+2399980690&4294967295,L=v+(D<<10&4294967295|D>>>22),D=N+(v^(L|~C))+w[10]+4293915773&4294967295,N=L+(D<<15&4294967295|D>>>17),D=C+(L^(N|~v))+w[1]+2240044497&4294967295,C=N+(D<<21&4294967295|D>>>11),D=v+(N^(C|~L))+w[8]+1873313359&4294967295,v=C+(D<<6&4294967295|D>>>26),D=L+(C^(v|~N))+w[15]+4264355552&4294967295,L=v+(D<<10&4294967295|D>>>22),D=N+(v^(L|~C))+w[6]+2734768916&4294967295,N=L+(D<<15&4294967295|D>>>17),D=C+(L^(N|~v))+w[13]+1309151649&4294967295,C=N+(D<<21&4294967295|D>>>11),D=v+(N^(C|~L))+w[4]+4149444226&4294967295,v=C+(D<<6&4294967295|D>>>26),D=L+(C^(v|~N))+w[11]+3174756917&4294967295,L=v+(D<<10&4294967295|D>>>22),D=N+(v^(L|~C))+w[2]+718787259&4294967295,N=L+(D<<15&4294967295|D>>>17),D=C+(L^(N|~v))+w[9]+3951481745&4294967295,A.g[0]=A.g[0]+v&4294967295,A.g[1]=A.g[1]+(N+(D<<21&4294967295|D>>>11))&4294967295,A.g[2]=A.g[2]+N&4294967295,A.g[3]=A.g[3]+L&4294967295}r.prototype.u=function(A,v){v===void 0&&(v=A.length);for(var C=v-this.blockSize,w=this.B,N=this.h,L=0;L<v;){if(N==0)for(;L<=C;)i(this,A,L),L+=this.blockSize;if(typeof A=="string"){for(;L<v;)if(w[N++]=A.charCodeAt(L++),N==this.blockSize){i(this,w),N=0;break}}else for(;L<v;)if(w[N++]=A[L++],N==this.blockSize){i(this,w),N=0;break}}this.h=N,this.o+=v},r.prototype.v=function(){var A=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);A[0]=128;for(var v=1;v<A.length-8;++v)A[v]=0;var C=8*this.o;for(v=A.length-8;v<A.length;++v)A[v]=C&255,C/=256;for(this.u(A),A=Array(16),v=C=0;4>v;++v)for(var w=0;32>w;w+=8)A[C++]=this.g[v]>>>w&255;return A};function o(A,v){var C=a;return Object.prototype.hasOwnProperty.call(C,A)?C[A]:C[A]=v(A)}function s(A,v){this.h=v;for(var C=[],w=!0,N=A.length-1;0<=N;N--){var L=A[N]|0;w&&L==v||(C[N]=L,w=!1)}this.g=C}var a={};function c(A){return-128<=A&&128>A?o(A,function(v){return new s([v|0],0>v?-1:0)}):new s([A|0],0>A?-1:0)}function l(A){if(isNaN(A)||!isFinite(A))return h;if(0>A)return S(l(-A));for(var v=[],C=1,w=0;A>=C;w++)v[w]=A/C|0,C*=4294967296;return new s(v,0)}function d(A,v){if(A.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(A.charAt(0)=="-")return S(d(A.substring(1),v));if(0<=A.indexOf("-"))throw Error('number format error: interior "-" character');for(var C=l(Math.pow(v,8)),w=h,N=0;N<A.length;N+=8){var L=Math.min(8,A.length-N),D=parseInt(A.substring(N,N+L),v);8>L?(L=l(Math.pow(v,L)),w=w.j(L).add(l(D))):(w=w.j(C),w=w.add(l(D)))}return w}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 A=0,v=1,C=0;C<this.g.length;C++){var w=this.i(C);A+=(0<=w?w:4294967296+w)*v,v*=4294967296}return A},t.toString=function(A){if(A=A||10,2>A||36<A)throw Error("radix out of range: "+A);if(E(this))return"0";if(I(this))return"-"+S(this).toString(A);for(var v=l(Math.pow(A,6)),C=this,w="";;){var N=Q(C,v).g;C=R(C,N.j(v));var L=((0<C.g.length?C.g[0]:C.h)>>>0).toString(A);if(C=N,E(C))return L+w;for(;6>L.length;)L="0"+L;w=L+w}},t.i=function(A){return 0>A?0:A<this.g.length?this.g[A]:this.h};function E(A){if(A.h!=0)return!1;for(var v=0;v<A.g.length;v++)if(A.g[v]!=0)return!1;return!0}function I(A){return A.h==-1}t.l=function(A){return A=R(this,A),I(A)?-1:E(A)?0:1};function S(A){for(var v=A.g.length,C=[],w=0;w<v;w++)C[w]=~A.g[w];return new s(C,~A.h).add(f)}t.abs=function(){return I(this)?S(this):this},t.add=function(A){for(var v=Math.max(this.g.length,A.g.length),C=[],w=0,N=0;N<=v;N++){var L=w+(this.i(N)&65535)+(A.i(N)&65535),D=(L>>>16)+(this.i(N)>>>16)+(A.i(N)>>>16);w=D>>>16,L&=65535,D&=65535,C[N]=D<<16|L}return new s(C,C[C.length-1]&-2147483648?-1:0)};function R(A,v){return A.add(S(v))}t.j=function(A){if(E(this)||E(A))return h;if(I(this))return I(A)?S(this).j(S(A)):S(S(this).j(A));if(I(A))return S(this.j(S(A)));if(0>this.l(g)&&0>A.l(g))return l(this.m()*A.m());for(var v=this.g.length+A.g.length,C=[],w=0;w<2*v;w++)C[w]=0;for(w=0;w<this.g.length;w++)for(var N=0;N<A.g.length;N++){var L=this.i(w)>>>16,D=this.i(w)&65535,Or=A.i(N)>>>16,qr=A.i(N)&65535;C[2*w+2*N]+=D*qr,U(C,2*w+2*N),C[2*w+2*N+1]+=L*qr,U(C,2*w+2*N+1),C[2*w+2*N+1]+=D*Or,U(C,2*w+2*N+1),C[2*w+2*N+2]+=L*Or,U(C,2*w+2*N+2)}for(w=0;w<v;w++)C[w]=C[2*w+1]<<16|C[2*w];for(w=v;w<2*v;w++)C[w]=0;return new s(C,0)};function U(A,v){for(;(A[v]&65535)!=A[v];)A[v+1]+=A[v]>>>16,A[v]&=65535,v++}function H(A,v){this.g=A,this.h=v}function Q(A,v){if(E(v))throw Error("division by zero");if(E(A))return new H(h,h);if(I(A))return v=Q(S(A),v),new H(S(v.g),S(v.h));if(I(v))return v=Q(A,S(v)),new H(S(v.g),v.h);if(30<A.g.length){if(I(A)||I(v))throw Error("slowDivide_ only works with positive integers.");for(var C=f,w=v;0>=w.l(A);)C=ae(C),w=ae(w);var N=ne(C,1),L=ne(w,1);for(w=ne(w,2),C=ne(C,2);!E(w);){var D=L.add(w);0>=D.l(A)&&(N=N.add(C),L=D),w=ne(w,1),C=ne(C,1)}return v=R(A,N.j(v)),new H(N,v)}for(N=h;0<=A.l(v);){for(C=Math.max(1,Math.floor(A.m()/v.m())),w=Math.ceil(Math.log(C)/Math.LN2),w=48>=w?1:Math.pow(2,w-48),L=l(C),D=L.j(v);I(D)||0<D.l(A);)C-=w,L=l(C),D=L.j(v);E(L)&&(L=f),N=N.add(L),A=R(A,D)}return new H(N,A)}t.A=function(A){return Q(this,A).h},t.and=function(A){for(var v=Math.max(this.g.length,A.g.length),C=[],w=0;w<v;w++)C[w]=this.i(w)&A.i(w);return new s(C,this.h&A.h)},t.or=function(A){for(var v=Math.max(this.g.length,A.g.length),C=[],w=0;w<v;w++)C[w]=this.i(w)|A.i(w);return new s(C,this.h|A.h)},t.xor=function(A){for(var v=Math.max(this.g.length,A.g.length),C=[],w=0;w<v;w++)C[w]=this.i(w)^A.i(w);return new s(C,this.h^A.h)};function ae(A){for(var v=A.g.length+1,C=[],w=0;w<v;w++)C[w]=A.i(w)<<1|A.i(w-1)>>>31;return new s(C,A.h)}function ne(A,v){var C=v>>5;v%=32;for(var w=A.g.length-C,N=[],L=0;L<w;L++)N[L]=0<v?A.i(L+C)>>>v|A.i(L+C+1)<<32-v:A.i(L+C);return new s(N,A.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,iO=P$.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,is=P$.Integer=s}).apply(typeof M$<"u"?M$:typeof self<"u"?self:typeof window<"u"?window:{});var RI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},os={};var oO,Kse,Bd,sO,Ag,NI,aO,cO,lO;(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 RI=="object"&&RI];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 M=u[_];if(!(M in m))break e;m=m[M]}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,M={next:function(){if(!_&&m<u.length){var F=m++;return{value:p(F,u[F]),done:!1}}return _=!0,{done:!0,value:void 0}}};return M[Symbol.iterator]=function(){return M},M}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 M=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(M,_),u.apply(p,M)}}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(_,M,F){for(var Z=Array(arguments.length-2),rt=2;rt<arguments.length;rt++)Z[rt-2]=arguments[rt];return p.prototype[M].apply(_,Z)}}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 M=u.length||0,F=_.length||0;u.length=M+F;for(let Z=0;Z<F;Z++)u[M+Z]=_[Z]}else u.push(_)}}class R{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 U(u){return/^[\s\xa0]*$/.test(u)}function H(){var u=a.navigator;return u&&(u=u.userAgent)?u:""}function Q(u){return Q[" "](u),u}Q[" "]=function(){};var ae=H().indexOf("Gecko")!=-1&&!(H().toLowerCase().indexOf("webkit")!=-1&&H().indexOf("Edge")==-1)&&!(H().indexOf("Trident")!=-1||H().indexOf("MSIE")!=-1)&&H().indexOf("Edge")==-1;function ne(u,p,m){for(let _ in u)p.call(m,u[_],_,u)}function A(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 C="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function w(u,p){let m,_;for(let M=1;M<arguments.length;M++){_=arguments[M];for(m in _)u[m]=_[m];for(let F=0;F<C.length;F++)m=C[F],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 L(u){a.setTimeout(()=>{throw u},0)}function D(){var u=Lh;let p=null;return u.g&&(p=u.g,u.g=u.g.next,u.g||(u.h=null),p.next=null),p}class Or{constructor(){this.h=this.g=null}add(p,m){let _=qr.get();_.set(p,m),this.h?this.h.next=_:this.g=_,this.h=_}}var qr=new R(()=>new Sm,u=>u.reset());class Sm{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 Kr,hs=!1,Lh=new Or,Am=()=>{let u=a.Promise.resolve(void 0);Kr=()=>{u.then(Kl)}};var Kl=()=>{for(var u;u=D();){try{u.h.call(u.g)}catch(m){L(m)}var p=qr;p.j(u),100>p.h&&(p.h++,u.next=p.g,p.g=u)}hs=!1};function Lr(){this.s=this.s,this.C=this.C}Lr.prototype.s=!1,Lr.prototype.ma=function(){this.s||(this.s=!0,this.N())},Lr.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function sn(u,p){this.type=u,this.g=this.target=p,this.defaultPrevented=!1}sn.prototype.h=function(){this.defaultPrevented=!0};var iS=(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 Ga(u,p){if(sn.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(ae){e:{try{Q(p.nodeName);var M=!0;break e}catch{}M=!1}M||(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:oS[u.pointerType]||"",this.state=u.state,this.i=u,u.defaultPrevented&&Ga.aa.h.call(this)}}E(Ga,sn);var oS={2:"touch",3:"pen",4:"mouse"};Ga.prototype.h=function(){Ga.aa.h.call(this);var u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var et="closure_listenable_"+(1e6*Math.random()|0),sS=0;function aS(u,p,m,_,M){this.listener=u,this.proxy=null,this.src=p,this.type=m,this.capture=!!_,this.ha=M,this.key=++sS,this.da=this.fa=!1}function Yl(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Xl(u){this.src=u,this.g={},this.h=0}Xl.prototype.add=function(u,p,m,_,M){var F=u.toString();u=this.g[F],u||(u=this.g[F]=[],this.h++);var Z=Ph(u,p,_,M);return-1<Z?(p=u[Z],m||(p.fa=!1)):(p=new aS(p,this.src,F,!!_,M),p.fa=m,u.push(p)),p};function Mh(u,p){var m=p.type;if(m in u.g){var _=u.g[m],M=Array.prototype.indexOf.call(_,p,void 0),F;(F=0<=M)&&Array.prototype.splice.call(_,M,1),F&&(Yl(p),u.g[m].length==0&&(delete u.g[m],u.h--))}}function Ph(u,p,m,_){for(var M=0;M<u.length;++M){var F=u[M];if(!F.da&&F.listener==p&&F.capture==!!m&&F.ha==_)return M}return-1}var xh="closure_lm_"+(1e6*Math.random()|0),kh={};function Fh(u,p,m,_,M){if(_&&_.once)return ut(u,p,m,_,M);if(Array.isArray(p)){for(var F=0;F<p.length;F++)Fh(u,p[F],m,_,M);return null}return m=ja(m),u&&u[et]?u.K(p,m,l(_)?!!_.capture:!!_,M):lt(u,p,m,!1,_,M)}function lt(u,p,m,_,M,F){if(!p)throw Error("Invalid event type");var Z=l(M)?!!M.capture:!!M,rt=Mr(u);if(rt||(u[xh]=rt=new Xl(u)),m=rt.add(p,m,_,Z,F),m.proxy)return m;if(_=Uh(),m.proxy=_,_.src=u,_.listener=m,u.addEventListener)iS||(M=Z),M===void 0&&(M=!1),u.addEventListener(p.toString(),_,M);else if(u.attachEvent)u.attachEvent(fs(p.toString()),_);else if(u.addListener&&u.removeListener)u.addListener(_);else throw Error("addEventListener and attachEvent are unavailable.");return m}function Uh(){function u(m){return p.call(u.src,u.listener,m)}let p=Cm;return u}function ut(u,p,m,_,M){if(Array.isArray(p)){for(var F=0;F<p.length;F++)ut(u,p[F],m,_,M);return null}return m=ja(m),u&&u[et]?u.L(p,m,l(_)?!!_.capture:!!_,M):lt(u,p,m,!0,_,M)}function Ql(u,p,m,_,M){if(Array.isArray(p))for(var F=0;F<p.length;F++)Ql(u,p[F],m,_,M);else _=l(_)?!!_.capture:!!_,m=ja(m),u&&u[et]?(u=u.i,p=String(p).toString(),p in u.g&&(F=u.g[p],m=Ph(F,m,_,M),-1<m&&(Yl(F[m]),Array.prototype.splice.call(F,m,1),F.length==0&&(delete u.g[p],u.h--)))):u&&(u=Mr(u))&&(p=u.g[p.toString()],u=-1,p&&(u=Ph(p,m,_,M)),(m=-1<u?p[u]:null)&&Qn(m))}function Qn(u){if(typeof u!="number"&&u&&!u.da){var p=u.src;if(p&&p[et])Mh(p.i,u);else{var m=u.type,_=u.proxy;p.removeEventListener?p.removeEventListener(m,_,u.capture):p.detachEvent?p.detachEvent(fs(m),_):p.addListener&&p.removeListener&&p.removeListener(_),(m=Mr(p))?(Mh(m,u),m.h==0&&(m.src=null,p[xh]=null)):Yl(u)}}}function fs(u){return u in kh?kh[u]:kh[u]="on"+u}function Cm(u,p){if(u.da)u=!0;else{p=new Ga(p,this);var m=u.listener,_=u.ha||u.src;u.fa&&Qn(u),u=m.call(_,p)}return u}function Mr(u){return u=u[xh],u instanceof Xl?u:null}var Jl="__closure_events_fn_"+(1e9*Math.random()>>>0);function ja(u){return typeof u=="function"?u:(u[Jl]||(u[Jl]=function(p){return u.handleEvent(p)}),u[Jl])}function jt(){Lr.call(this),this.i=new Xl(this),this.M=this,this.F=null}E(jt,Lr),jt.prototype[et]=!0,jt.prototype.removeEventListener=function(u,p,m,_){Ql(this,u,p,m,_)};function Ht(u,p){var m,_=u.F;if(_)for(m=[];_;_=_.F)m.push(_);if(u=u.M,_=p.type||p,typeof p=="string")p=new sn(p,u);else if(p instanceof sn)p.target=p.target||u;else{var M=p;p=new sn(_,u),w(p,M)}if(M=!0,m)for(var F=m.length-1;0<=F;F--){var Z=p.g=m[F];M=Jn(Z,_,!0,p)&&M}if(Z=p.g=u,M=Jn(Z,_,!0,p)&&M,M=Jn(Z,_,!1,p)&&M,m)for(F=0;F<m.length;F++)Z=p.g=m[F],M=Jn(Z,_,!1,p)&&M}jt.prototype.N=function(){if(jt.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;_++)Yl(m[_]);delete u.g[p],u.h--}}this.F=null},jt.prototype.K=function(u,p,m,_){return this.i.add(String(u),p,!1,m,_)},jt.prototype.L=function(u,p,m,_){return this.i.add(String(u),p,!0,m,_)};function Jn(u,p,m,_){if(p=u.i.g[String(p)],!p)return!0;p=p.concat();for(var M=!0,F=0;F<p.length;++F){var Z=p[F];if(Z&&!Z.da&&Z.capture==m){var rt=Z.listener,_n=Z.ha||Z.src;Z.fa&&Mh(u.i,Z),M=rt.call(_n,_)!==!1&&M}}return M&&!_.defaultPrevented}function Di(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 Ri(u){u.g=Di(()=>{u.g=null,u.i&&(u.i=!1,Ri(u))},u.l);let p=u.h;u.h=null,u.m.apply(null,p)}class Vh extends Lr{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:Ri(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ni(u){Lr.call(this),this.h=u,this.g={}}E(Ni,Lr);var Ha=[];function Zl(u){ne(u.g,function(p,m){this.g.hasOwnProperty(m)&&Qn(p)},u),u.g={}}Ni.prototype.N=function(){Ni.aa.N.call(this),Zl(this)},Ni.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var bi=a.JSON.stringify,eu=a.JSON.parse,Bh=class{stringify(u){return a.JSON.stringify(u,void 0)}parse(u){return a.JSON.parse(u,void 0)}};function tu(){}tu.prototype.h=null;function Gh(u){return u.h||(u.h=u.i())}function jh(){}var Io={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function $a(){sn.call(this,"d")}E($a,sn);function Yr(){sn.call(this,"c")}E(Yr,sn);var Zn={},wi=null;function Wa(){return wi=wi||new jt}Zn.La="serverreachability";function Hh(u){sn.call(this,Zn.La,u)}E(Hh,sn);function ps(u){let p=Wa();Ht(p,new Hh(p))}Zn.STAT_EVENT="statevent";function $h(u,p){sn.call(this,Zn.STAT_EVENT,u),this.stat=p}E($h,sn);function an(u){let p=Wa();Ht(p,new $h(p,u))}Zn.Ma="timingevent";function za(u,p){sn.call(this,Zn.Ma,u),this.size=p}E(za,sn);function Oi(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 An(){this.g=!0}An.prototype.xa=function(){this.g=!1};function gs(u,p,m,_,M,F){u.info(function(){if(u.g)if(F)for(var Z="",rt=F.split("&"),_n=0;_n<rt.length;_n++){var Fe=rt[_n].split("=");if(1<Fe.length){var Rn=Fe[0];Fe=Fe[1];var Nn=Rn.split("_");Z=2<=Nn.length&&Nn[1]=="type"?Z+(Rn+"="+Fe+"&"):Z+(Rn+"=redacted&")}}else Z=null;else Z=F;return"XMLHTTP REQ ("+_+") [attempt "+M+"]: "+p+`
|
|
154
|
+
`+m+`
|
|
155
|
+
`+Z})}function Wh(u,p,m,_,M,F,Z){u.info(function(){return"XMLHTTP RESP ("+_+") [ attempt "+M+"]: "+p+`
|
|
156
|
+
`+m+`
|
|
157
|
+
`+F+" "+Z})}function vo(u,p,m,_){u.info(function(){return"XMLHTTP TEXT ("+p+"): "+lS(u,m)+(_?" "+_:"")})}function cS(u,p){u.info(function(){return"TIMEOUT: "+p})}An.prototype.info=function(){};function lS(u,p){if(!u.g)return p;if(!p)return null;try{var m=JSON.parse(p);if(m){for(u=0;u<m.length;u++)if(Array.isArray(m[u])){var _=m[u];if(!(2>_.length)){var M=_[1];if(Array.isArray(M)&&!(1>M.length)){var F=M[0];if(F!="noop"&&F!="stop"&&F!="close")for(var Z=1;Z<M.length;Z++)M[Z]=""}}}}return bi(m)}catch{return p}}var ms={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},Dm={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},qa;function nu(){}E(nu,tu),nu.prototype.g=function(){return new XMLHttpRequest},nu.prototype.i=function(){return{}},qa=new nu;function Li(u,p,m,_){this.j=u,this.i=p,this.l=m,this.R=_||1,this.U=new Ni(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Es}function Es(){this.i=null,this.g="",this.h=!1}var Rm={},zh={};function dt(u,p,m){u.L=1,u.v=Ts(Qr(p)),u.m=m,u.P=!0,Ka(u,null)}function Ka(u,p){u.F=Date.now(),_s(u),u.A=Qr(u.v);var m=u.A,_=u.R;Array.isArray(_)||(_=[String(_)]),Om(m.i,"t",_),u.C=0,m=u.j.J,u.h=new Es,u.g=IM(u.j,m?p:null,!u.m),0<u.O&&(u.M=new Vh(f(u.Y,u,u.g),u.O)),p=u.U,m=u.g,_=u.ca;var M="readystatechange";Array.isArray(M)||(M&&(Ha[0]=M.toString()),M=Ha);for(var F=0;F<M.length;F++){var Z=Fh(m,M[F],_||p.handleEvent,!1,p.h||p);if(!Z)break;p.g[Z.key]=Z}p=u.H?v(u.H):{},u.m?(u.u||(u.u="POST"),p["Content-Type"]="application/x-www-form-urlencoded",u.g.ea(u.A,u.u,u.m,p)):(u.u="GET",u.g.ea(u.A,u.u,null,p)),ps(),gs(u.i,u.u,u.A,u.l,u.R,u.m)}Li.prototype.ca=function(u){u=u.target;let p=this.M;p&&Ot(u)==3?p.j():this.Y(u)},Li.prototype.Y=function(u){try{if(u==this.g)e:{let Nn=Ot(this.g);var p=this.g.Ba();let du=this.g.Z();if(!(3>Nn)&&(Nn!=3||this.g&&(this.h.h||this.g.oa()||Lt(this.g)))){this.J||Nn!=4||p==7||(p==8||0>=du?ps(3):ps(2)),ru(this);var m=this.g.Z();this.X=m;t:if(Nm(this)){var _=Lt(this.g);u="";var M=_.length,F=Ot(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){So(this),Ya(this);var Z="";break t}this.h.i=new a.TextDecoder}for(p=0;p<M;p++)this.h.h=!0,u+=this.h.i.decode(_[p],{stream:!(F&&p==M-1)});_.length=0,this.h.g+=u,this.C=0,Z=this.h.g}else Z=this.g.oa();if(this.o=m==200,Wh(this.i,this.u,this.A,this.l,this.R,Nn,m),this.o){if(this.T&&!this.K){t:{if(this.g){var rt,_n=this.g;if((rt=_n.g?_n.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!U(rt)){var Fe=rt;break t}}Fe=null}if(m=Fe)vo(this.i,this.l,m,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,Kh(this,m);else{this.o=!1,this.s=3,an(12),So(this),Ya(this);break e}}if(this.P){m=!0;let Jr;for(;!this.J&&this.C<Z.length;)if(Jr=bm(this,Z),Jr==zh){Nn==4&&(this.s=4,an(14),m=!1),vo(this.i,this.l,null,"[Incomplete Response]");break}else if(Jr==Rm){this.s=4,an(15),vo(this.i,this.l,Z,"[Invalid Chunk]"),m=!1;break}else vo(this.i,this.l,Jr,null),Kh(this,Jr);if(Nm(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Nn!=4||Z.length!=0||this.h.h||(this.s=1,an(16),m=!1),this.o=this.o&&m,!m)vo(this.i,this.l,Z,"[Invalid Chunked Response]"),So(this),Ya(this);else if(0<Z.length&&!this.W){this.W=!0;var Rn=this.j;Rn.g==this&&Rn.ba&&!Rn.M&&(Rn.j.info("Great, no buffering proxy detected. Bytes received: "+Z.length),TS(Rn),Rn.M=!0,an(11))}}else vo(this.i,this.l,Z,null),Kh(this,Z);Nn==4&&So(this),this.o&&!this.J&&(Nn==4?EM(this.j,this):(this.o=!1,_s(this)))}else Pm(this.g),m==400&&0<Z.indexOf("Unknown SID")?(this.s=3,an(12)):(this.s=0,an(13)),So(this),Ya(this)}}}catch{}};function Nm(u){return u.g?u.u=="GET"&&u.L!=2&&u.j.Ca:!1}function bm(u,p){var m=u.C,_=p.indexOf(`
|
|
158
|
+
`,m);return _==-1?zh:(m=Number(p.substring(m,_)),isNaN(m)?Rm:(_+=1,_+m>p.length?zh:(p=p.slice(_,_+m),u.C=_+m,p)))}Li.prototype.cancel=function(){this.J=!0,So(this)};function _s(u){u.S=Date.now()+u.I,qh(u,u.I)}function qh(u,p){if(u.B!=null)throw Error("WatchDog timer not null");u.B=Oi(f(u.ba,u),p)}function ru(u){u.B&&(a.clearTimeout(u.B),u.B=null)}Li.prototype.ba=function(){this.B=null;let u=Date.now();0<=u-this.S?(cS(this.i,this.A),this.L!=2&&(ps(),an(17)),So(this),this.s=2,Ya(this)):qh(this,this.S-u)};function Ya(u){u.j.G==0||u.J||EM(u.j,u)}function So(u){ru(u);var p=u.M;p&&typeof p.ma=="function"&&p.ma(),u.M=null,Zl(u.U),u.g&&(p=u.g,u.g=null,p.abort(),p.ma())}function Kh(u,p){try{var m=u.j;if(m.G!=0&&(m.g==u||Mi(m.h,u))){if(!u.K&&Mi(m.h,u)&&m.G==3){try{var _=m.Da.g.parse(p)}catch{_=null}if(Array.isArray(_)&&_.length==3){var M=_;if(M[0]==0){e:if(!m.u){if(m.g)if(m.g.F+3e3<u.F)Fm(m),xm(m);else break e;_S(m),an(18)}}else m.za=M[1],0<m.za-m.T&&37500>M[2]&&m.F&&m.v==0&&!m.C&&(m.C=Oi(f(m.Za,m),6e3));if(1>=iu(m.h)&&m.ca){try{m.ca()}catch{}m.ca=void 0}}else Za(m,11)}else if((u.K||m.g==u)&&Fm(m),!U(p))for(M=m.Da.g.parse(p),p=0;p<M.length;p++){let Fe=M[p];if(m.T=Fe[0],Fe=Fe[1],m.G==2)if(Fe[0]=="c"){m.K=Fe[1],m.ia=Fe[2];let Rn=Fe[3];Rn!=null&&(m.la=Rn,m.j.info("VER="+m.la));let Nn=Fe[4];Nn!=null&&(m.Aa=Nn,m.j.info("SVER="+m.Aa));let du=Fe[5];du!=null&&typeof du=="number"&&0<du&&(_=1.5*du,m.L=_,m.j.info("backChannelRequestTimeoutMs_="+_)),_=m;let Jr=u.g;if(Jr){let Vm=Jr.g?Jr.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Vm){var F=_.h;F.g||Vm.indexOf("spdy")==-1&&Vm.indexOf("quic")==-1&&Vm.indexOf("h2")==-1||(F.j=F.l,F.g=new Set,F.h&&(Xa(F,F.h),F.h=null))}if(_.D){let yS=Jr.g?Jr.g.getResponseHeader("X-HTTP-Session-Id"):null;yS&&(_.ya=yS,We(_.I,_.D,yS))}}m.G=3,m.l&&m.l.ua(),m.ba&&(m.R=Date.now()-u.F,m.j.info("Handshake RTT: "+m.R+"ms")),_=m;var Z=u;if(_.qa=yM(_,_.J?_.ia:null,_.W),Z.K){ou(_.h,Z);var rt=Z,_n=_.L;_n&&(rt.I=_n),rt.B&&(ru(rt),_s(rt)),_.g=Z}else gM(_);0<m.i.length&&km(m)}else Fe[0]!="stop"&&Fe[0]!="close"||Za(m,7);else m.G==3&&(Fe[0]=="stop"||Fe[0]=="close"?Fe[0]=="stop"?Za(m,7):ES(m):Fe[0]!="noop"&&m.l&&m.l.ta(Fe),m.v=0)}}ps(4)}catch{}}var uS=class{constructor(u,p){this.g=u,this.map=p}};function Xr(u){this.l=u||10,a.PerformanceNavigationTiming?(u=a.performance.getEntriesByType("navigation"),u=0<u.length&&(u[0].nextHopProtocol=="hq"||u[0].nextHopProtocol=="h2")):u=!!(a.chrome&&a.chrome.loadTimes&&a.chrome.loadTimes()&&a.chrome.loadTimes().wasFetchedViaSpdy),this.j=u?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function Yh(u){return u.h?!0:u.g?u.g.size>=u.j:!1}function iu(u){return u.h?1:u.g?u.g.size:0}function Mi(u,p){return u.h?u.h==p:u.g?u.g.has(p):!1}function Xa(u,p){u.g?u.g.add(p):u.h=p}function ou(u,p){u.h&&u.h==p?u.h=null:u.g&&u.g.has(p)&&u.g.delete(p)}Xr.prototype.cancel=function(){if(this.i=su(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(let u of this.g.values())u.cancel();this.g.clear()}};function su(u){if(u.h!=null)return u.i.concat(u.h.D);if(u.g!=null&&u.g.size!==0){let p=u.i;for(let m of u.g.values())p=p.concat(m.D);return p}return I(u.i)}function Xh(u){if(u.V&&typeof u.V=="function")return u.V();if(typeof Map<"u"&&u instanceof Map||typeof Set<"u"&&u instanceof Set)return Array.from(u.values());if(typeof u=="string")return u.split("");if(c(u)){for(var p=[],m=u.length,_=0;_<m;_++)p.push(u[_]);return p}p=[],m=0;for(_ in u)p[m++]=u[_];return p}function dS(u){if(u.na&&typeof u.na=="function")return u.na();if(!u.V||typeof u.V!="function"){if(typeof Map<"u"&&u instanceof Map)return Array.from(u.keys());if(!(typeof Set<"u"&&u instanceof Set)){if(c(u)||typeof u=="string"){var p=[];u=u.length;for(var m=0;m<u;m++)p.push(m);return p}p=[],m=0;for(let _ in u)p[m++]=_;return p}}}function Qh(u,p){if(u.forEach&&typeof u.forEach=="function")u.forEach(p,void 0);else if(c(u)||typeof u=="string")Array.prototype.forEach.call(u,p,void 0);else for(var m=dS(u),_=Xh(u),M=_.length,F=0;F<M;F++)p.call(void 0,_[F],m&&m[F],u)}var wm=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function hS(u,p){if(u){u=u.split("&");for(var m=0;m<u.length;m++){var _=u[m].indexOf("="),M=null;if(0<=_){var F=u[m].substring(0,_);M=u[m].substring(_+1)}else F=u[m];p(F,M?decodeURIComponent(M.replace(/\+/g," ")):"")}}}function Ao(u){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,u instanceof Ao){this.h=u.h,Qa(this,u.j),this.o=u.o,this.g=u.g,au(this,u.s),this.l=u.l;var p=u.i,m=new Pi;m.i=p.i,p.g&&(m.g=new Map(p.g),m.h=p.h),Jh(this,m),this.m=u.m}else u&&(p=String(u).match(wm))?(this.h=!1,Qa(this,p[1]||"",!0),this.o=Co(p[2]||""),this.g=Co(p[3]||"",!0),au(this,p[4]),this.l=Co(p[5]||"",!0),Jh(this,p[6]||"",!0),this.m=Co(p[7]||"")):(this.h=!1,this.i=new Pi(null,this.h))}Ao.prototype.toString=function(){var u=[],p=this.j;p&&u.push(Do(p,Zh,!0),":");var m=this.g;return(m||p=="file")&&(u.push("//"),(p=this.o)&&u.push(Do(p,Zh,!0),"@"),u.push(encodeURIComponent(String(m)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),m=this.s,m!=null&&u.push(":",String(m))),(m=this.l)&&(this.g&&m.charAt(0)!="/"&&u.push("/"),u.push(Do(m,m.charAt(0)=="/"?Ja:ys,!0))),(m=this.i.toString())&&u.push("?",m),(m=this.m)&&u.push("#",Do(m,fS)),u.join("")};function Qr(u){return new Ao(u)}function Qa(u,p,m){u.j=m?Co(p,!0):p,u.j&&(u.j=u.j.replace(/:$/,""))}function au(u,p){if(p){if(p=Number(p),isNaN(p)||0>p)throw Error("Bad port number "+p);u.s=p}else u.s=null}function Jh(u,p,m){p instanceof Pi?(u.i=p,pS(u.i,u.h)):(m||(p=Do(p,ur)),u.i=new Pi(p,u.h))}function We(u,p,m){u.i.set(p,m)}function Ts(u){return We(u,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),u}function Co(u,p){return u?p?decodeURI(u.replace(/%25/g,"%2525")):decodeURIComponent(u):""}function Do(u,p,m){return typeof u=="string"?(u=encodeURI(u).replace(p,cu),m&&(u=u.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),u):null}function cu(u){return u=u.charCodeAt(0),"%"+(u>>4&15).toString(16)+(u&15).toString(16)}var Zh=/[#\/\?@]/g,ys=/[#\?:]/g,Ja=/[#\?]/g,ur=/[#\?@]/g,fS=/#/g;function Pi(u,p){this.h=this.g=null,this.i=u||null,this.j=!!p}function xi(u){u.g||(u.g=new Map,u.h=0,u.i&&hS(u.i,function(p,m){u.add(decodeURIComponent(p.replace(/\+/g," ")),m)}))}t=Pi.prototype,t.add=function(u,p){xi(this),this.i=null,u=No(this,u);var m=this.g.get(u);return m||this.g.set(u,m=[]),m.push(p),this.h+=1,this};function ef(u,p){xi(u),p=No(u,p),u.g.has(p)&&(u.i=null,u.h-=u.g.get(p).length,u.g.delete(p))}function Ro(u,p){return xi(u),p=No(u,p),u.g.has(p)}t.forEach=function(u,p){xi(this),this.g.forEach(function(m,_){m.forEach(function(M){u.call(p,M,_,this)},this)},this)},t.na=function(){xi(this);let u=Array.from(this.g.values()),p=Array.from(this.g.keys()),m=[];for(let _=0;_<p.length;_++){let M=u[_];for(let F=0;F<M.length;F++)m.push(p[_])}return m},t.V=function(u){xi(this);let p=[];if(typeof u=="string")Ro(this,u)&&(p=p.concat(this.g.get(No(this,u))));else{u=Array.from(this.g.values());for(let m=0;m<u.length;m++)p=p.concat(u[m])}return p},t.set=function(u,p){return xi(this),this.i=null,u=No(this,u),Ro(this,u)&&(this.h-=this.g.get(u).length),this.g.set(u,[p]),this.h+=1,this},t.get=function(u,p){return u?(u=this.V(u),0<u.length?String(u[0]):p):p};function Om(u,p,m){ef(u,p),0<m.length&&(u.i=null,u.g.set(No(u,p),I(m)),u.h+=m.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";let u=[],p=Array.from(this.g.keys());for(var m=0;m<p.length;m++){var _=p[m];let F=encodeURIComponent(String(_)),Z=this.V(_);for(_=0;_<Z.length;_++){var M=F;Z[_]!==""&&(M+="="+encodeURIComponent(String(Z[_]))),u.push(M)}}return this.i=u.join("&")};function No(u,p){return p=String(p),u.j&&(p=p.toLowerCase()),p}function pS(u,p){p&&!u.j&&(xi(u),u.i=null,u.g.forEach(function(m,_){var M=_.toLowerCase();_!=M&&(ef(this,_),Om(this,M,m))},u)),u.j=p}function Lm(u,p){let m=new An;if(a.Image){let _=new Image;_.onload=g(ki,m,"TestLoadImage: loaded",!0,p,_),_.onerror=g(ki,m,"TestLoadImage: error",!1,p,_),_.onabort=g(ki,m,"TestLoadImage: abort",!1,p,_),_.ontimeout=g(ki,m,"TestLoadImage: timeout",!1,p,_),a.setTimeout(function(){_.ontimeout&&_.ontimeout()},1e4),_.src=u}else p(!1)}function gS(u,p){let m=new An,_=new AbortController,M=setTimeout(()=>{_.abort(),ki(m,"TestPingServer: timeout",!1,p)},1e4);fetch(u,{signal:_.signal}).then(F=>{clearTimeout(M),F.ok?ki(m,"TestPingServer: ok",!0,p):ki(m,"TestPingServer: server error",!1,p)}).catch(()=>{clearTimeout(M),ki(m,"TestPingServer: error",!1,p)})}function ki(u,p,m,_,M){try{M&&(M.onload=null,M.onerror=null,M.onabort=null,M.ontimeout=null),_(m)}catch{}}function Mm(){this.g=new Bh}function mS(u,p,m){let _=m||"";try{Qh(u,function(M,F){let Z=M;l(M)&&(Z=bi(M)),p.push(_+F+"="+encodeURIComponent(Z))})}catch(M){throw p.push(_+"type="+encodeURIComponent("_badmap")),M}}function bo(u){this.l=u.Ub||null,this.j=u.eb||!1}E(bo,tu),bo.prototype.g=function(){return new Is(this.l,this.j)},bo.prototype.i=(function(u){return function(){return u}})({});function Is(u,p){jt.call(this),this.D=u,this.o=p,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}E(Is,jt),t=Is.prototype,t.open=function(u,p){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=u,this.A=p,this.readyState=1,T(this)},t.send=function(u){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;let p={headers:this.u,method:this.B,credentials:this.m,cache:void 0};u&&(p.body=u),(this.D||a).fetch(new Request(this.A,p)).then(this.Sa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,$(this)),this.readyState=0},t.Sa=function(u){if(this.g&&(this.l=u,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=u.headers,this.readyState=2,T(this)),this.g&&(this.readyState=3,T(this),this.g)))if(this.responseType==="arraybuffer")u.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in u){if(this.j=u.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;lu(this)}else u.text().then(this.Ra.bind(this),this.ga.bind(this))};function lu(u){u.j.read().then(u.Pa.bind(u)).catch(u.ga.bind(u))}t.Pa=function(u){if(this.g){if(this.o&&u.value)this.response.push(u.value);else if(!this.o){var p=u.value?u.value:new Uint8Array(0);(p=this.v.decode(p,{stream:!u.done}))&&(this.response=this.responseText+=p)}u.done?$(this):T(this),this.readyState==3&&lu(this)}},t.Ra=function(u){this.g&&(this.response=this.responseText=u,$(this))},t.Qa=function(u){this.g&&(this.response=u,$(this))},t.ga=function(){this.g&&$(this)};function $(u){u.readyState=4,u.l=null,u.j=null,u.v=null,T(u)}t.setRequestHeader=function(u,p){this.u.append(u,p)},t.getResponseHeader=function(u){return this.h&&this.h.get(u.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";let u=[],p=this.h.entries();for(var m=p.next();!m.done;)m=m.value,u.push(m[0]+": "+m[1]),m=p.next();return u.join(`\r
|
|
159
|
+
`)};function T(u){u.onreadystatechange&&u.onreadystatechange.call(u)}Object.defineProperty(Is.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(u){this.m=u?"include":"same-origin"}});function b(u){let p="";return ne(u,function(m,_){p+=_,p+=":",p+=m,p+=`\r
|
|
160
|
+
`}),p}function G(u,p,m){e:{for(_ in m){var _=!1;break e}_=!0}_||(m=b(m),typeof u=="string"?m!=null&&encodeURIComponent(String(m)):We(u,p,m))}function j(u){jt.call(this),this.headers=new Map,this.o=u||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}E(j,jt);var ce=/^https?$/i,me=["POST","PUT"];t=j.prototype,t.Ha=function(u){this.J=u},t.ea=function(u,p,m,_){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+u);p=p?p.toUpperCase():"GET",this.D=u,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():qa.g(),this.v=this.o?Gh(this.o):Gh(qa),this.g.onreadystatechange=f(this.Ea,this);try{this.B=!0,this.g.open(p,String(u),!0),this.B=!1}catch(F){Ae(this,F);return}if(u=m||"",m=new Map(this.headers),_)if(Object.getPrototypeOf(_)===Object.prototype)for(var M in _)m.set(M,_[M]);else if(typeof _.keys=="function"&&typeof _.get=="function")for(let F of _.keys())m.set(F,_.get(F));else throw Error("Unknown input type for opt_headers: "+String(_));_=Array.from(m.keys()).find(F=>F.toLowerCase()=="content-type"),M=a.FormData&&u instanceof a.FormData,!(0<=Array.prototype.indexOf.call(me,p,void 0))||_||M||m.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(let[F,Z]of m)this.g.setRequestHeader(F,Z);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Dn(this),this.u=!0,this.g.send(u),this.u=!1}catch(F){Ae(this,F)}};function Ae(u,p){u.h=!1,u.g&&(u.j=!0,u.g.abort(),u.j=!1),u.l=p,u.m=5,At(u),Cn(u)}function At(u){u.A||(u.A=!0,Ht(u,"complete"),Ht(u,"error"))}t.abort=function(u){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=u||7,Ht(this,"complete"),Ht(this,"abort"),Cn(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Cn(this,!0)),j.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?Pr(this):this.bb())},t.bb=function(){Pr(this)};function Pr(u){if(u.h&&typeof s<"u"&&(!u.v[1]||Ot(u)!=4||u.Z()!=2)){if(u.u&&Ot(u)==4)Di(u.Ea,0,u);else if(Ht(u,"readystatechange"),Ot(u)==4){u.h=!1;try{let Z=u.Z();e:switch(Z){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var p=!0;break e;default:p=!1}var m;if(!(m=p)){var _;if(_=Z===0){var M=String(u.D).match(wm)[1]||null;!M&&a.self&&a.self.location&&(M=a.self.location.protocol.slice(0,-1)),_=!ce.test(M?M.toLowerCase():"")}m=_}if(m)Ht(u,"complete"),Ht(u,"success");else{u.m=6;try{var F=2<Ot(u)?u.g.statusText:""}catch{F=""}u.l=F+" ["+u.Z()+"]",At(u)}}finally{Cn(u)}}}}function Cn(u,p){if(u.g){Dn(u);let m=u.g,_=u.v[0]?()=>{}:null;u.g=null,u.v=null,p||Ht(u,"ready");try{m.onreadystatechange=_}catch{}}}function Dn(u){u.I&&(a.clearTimeout(u.I),u.I=null)}t.isActive=function(){return!!this.g};function Ot(u){return u.g?u.g.readyState:0}t.Z=function(){try{return 2<Ot(this)?this.g.status:-1}catch{return-1}},t.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.Oa=function(u){if(this.g){var p=this.g.responseText;return u&&p.indexOf(u)==0&&(p=p.substring(u.length)),eu(p)}};function Lt(u){try{if(!u.g)return null;if("response"in u.g)return u.g.response;switch(u.H){case"":case"text":return u.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in u.g)return u.g.mozResponseArrayBuffer}return null}catch{return null}}function Pm(u){let p={};u=(u.g&&2<=Ot(u)&&u.g.getAllResponseHeaders()||"").split(`\r
|
|
161
|
+
`);for(let _=0;_<u.length;_++){if(U(u[_]))continue;var m=N(u[_]);let M=m[0];if(m=m[1],typeof m!="string")continue;m=m.trim();let F=p[M]||[];p[M]=F,F.push(m)}A(p,function(_){return _.join(", ")})}t.Ba=function(){return this.m},t.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function tf(u,p,m){return m&&m.internalChannelParams&&m.internalChannelParams[u]||p}function dM(u){this.Aa=0,this.i=[],this.j=new An,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=tf("failFast",!1,u),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=tf("baseRetryDelayMs",5e3,u),this.cb=tf("retryDelaySeedMs",1e4,u),this.Wa=tf("forwardChannelMaxRetries",2,u),this.wa=tf("forwardChannelRequestTimeoutMs",2e4,u),this.pa=u&&u.xmlHttpFactory||void 0,this.Xa=u&&u.Tb||void 0,this.Ca=u&&u.useFetchStreams||!1,this.L=void 0,this.J=u&&u.supportsCrossDomainXhr||!1,this.K="",this.h=new Xr(u&&u.concurrentRequestLimit),this.Da=new Mm,this.P=u&&u.fastHandshake||!1,this.O=u&&u.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=u&&u.Rb||!1,u&&u.xa&&this.j.xa(),u&&u.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&u&&u.detectBufferingProxy||!1,this.ja=void 0,u&&u.longPollingTimeout&&0<u.longPollingTimeout&&(this.ja=u.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}t=dM.prototype,t.la=8,t.G=1,t.connect=function(u,p,m,_){an(0),this.W=u,this.H=p||{},m&&_!==void 0&&(this.H.OSID=m,this.H.OAID=_),this.F=this.X,this.I=yM(this,null,this.W),km(this)};function ES(u){if(hM(u),u.G==3){var p=u.U++,m=Qr(u.I);if(We(m,"SID",u.K),We(m,"RID",p),We(m,"TYPE","terminate"),nf(u,m),p=new Li(u,u.j,p),p.L=2,p.v=Ts(Qr(m)),m=!1,a.navigator&&a.navigator.sendBeacon)try{m=a.navigator.sendBeacon(p.v.toString(),"")}catch{}!m&&a.Image&&(new Image().src=p.v,m=!0),m||(p.g=IM(p.j,null),p.g.ea(p.v)),p.F=Date.now(),_s(p)}TM(u)}function xm(u){u.g&&(TS(u),u.g.cancel(),u.g=null)}function hM(u){xm(u),u.u&&(a.clearTimeout(u.u),u.u=null),Fm(u),u.h.cancel(),u.s&&(typeof u.s=="number"&&a.clearTimeout(u.s),u.s=null)}function km(u){if(!Yh(u.h)&&!u.s){u.s=!0;var p=u.Ga;Kr||Am(),hs||(Kr(),hs=!0),Lh.add(p,u),u.B=0}}function N4(u,p){return iu(u.h)>=u.h.j-(u.s?1:0)?!1:u.s?(u.i=p.D.concat(u.i),!0):u.G==1||u.G==2||u.B>=(u.Va?0:u.Wa)?!1:(u.s=Oi(f(u.Ga,u,p),_M(u,u.B)),u.B++,!0)}t.Ga=function(u){if(this.s)if(this.s=null,this.G==1){if(!u){this.U=Math.floor(1e5*Math.random()),u=this.U++;let M=new Li(this,this.j,u),F=this.o;if(this.S&&(F?(F=v(F),w(F,this.S)):F=this.S),this.m!==null||this.O||(M.H=F,F=null),this.P)e:{for(var p=0,m=0;m<this.i.length;m++){t:{var _=this.i[m];if("__data__"in _.map&&(_=_.map.__data__,typeof _=="string")){_=_.length;break t}_=void 0}if(_===void 0)break;if(p+=_,4096<p){p=m;break e}if(p===4096||m===this.i.length-1){p=m+1;break e}}p=1e3}else p=1e3;p=pM(this,M,p),m=Qr(this.I),We(m,"RID",u),We(m,"CVER",22),this.D&&We(m,"X-HTTP-Session-Id",this.D),nf(this,m),F&&(this.O?p="headers="+encodeURIComponent(String(b(F)))+"&"+p:this.m&&G(m,this.m,F)),Xa(this.h,M),this.Ua&&We(m,"TYPE","init"),this.P?(We(m,"$req",p),We(m,"SID","null"),M.T=!0,dt(M,m,null)):dt(M,m,p),this.G=2}}else this.G==3&&(u?fM(this,u):this.i.length==0||Yh(this.h)||fM(this))};function fM(u,p){var m;p?m=p.l:m=u.U++;let _=Qr(u.I);We(_,"SID",u.K),We(_,"RID",m),We(_,"AID",u.T),nf(u,_),u.m&&u.o&&G(_,u.m,u.o),m=new Li(u,u.j,m,u.B+1),u.m===null&&(m.H=u.o),p&&(u.i=p.D.concat(u.i)),p=pM(u,m,1e3),m.I=Math.round(.5*u.wa)+Math.round(.5*u.wa*Math.random()),Xa(u.h,m),dt(m,_,p)}function nf(u,p){u.H&&ne(u.H,function(m,_){We(p,_,m)}),u.l&&Qh({},function(m,_){We(p,_,m)})}function pM(u,p,m){m=Math.min(u.i.length,m);var _=u.l?f(u.l.Na,u.l,u):null;e:{var M=u.i;let F=-1;for(;;){let Z=["count="+m];F==-1?0<m?(F=M[0].g,Z.push("ofs="+F)):F=0:Z.push("ofs="+F);let rt=!0;for(let _n=0;_n<m;_n++){let Fe=M[_n].g,Rn=M[_n].map;if(Fe-=F,0>Fe)F=Math.max(0,M[_n].g-100),rt=!1;else try{mS(Rn,Z,"req"+Fe+"_")}catch{_&&_(Rn)}}if(rt){_=Z.join("&");break e}}}return u=u.i.splice(0,m),p.D=u,_}function gM(u){if(!u.g&&!u.u){u.Y=1;var p=u.Fa;Kr||Am(),hs||(Kr(),hs=!0),Lh.add(p,u),u.v=0}}function _S(u){return u.g||u.u||3<=u.v?!1:(u.Y++,u.u=Oi(f(u.Fa,u),_M(u,u.v)),u.v++,!0)}t.Fa=function(){if(this.u=null,mM(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var u=2*this.R;this.j.info("BP detection timer enabled: "+u),this.A=Oi(f(this.ab,this),u)}},t.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,an(10),xm(this),mM(this))};function TS(u){u.A!=null&&(a.clearTimeout(u.A),u.A=null)}function mM(u){u.g=new Li(u,u.j,"rpc",u.Y),u.m===null&&(u.g.H=u.o),u.g.O=0;var p=Qr(u.qa);We(p,"RID","rpc"),We(p,"SID",u.K),We(p,"AID",u.T),We(p,"CI",u.F?"0":"1"),!u.F&&u.ja&&We(p,"TO",u.ja),We(p,"TYPE","xmlhttp"),nf(u,p),u.m&&u.o&&G(p,u.m,u.o),u.L&&(u.g.I=u.L);var m=u.g;u=u.ia,m.L=1,m.v=Ts(Qr(p)),m.m=null,m.P=!0,Ka(m,u)}t.Za=function(){this.C!=null&&(this.C=null,xm(this),_S(this),an(19))};function Fm(u){u.C!=null&&(a.clearTimeout(u.C),u.C=null)}function EM(u,p){var m=null;if(u.g==p){Fm(u),TS(u),u.g=null;var _=2}else if(Mi(u.h,p))m=p.D,ou(u.h,p),_=1;else return;if(u.G!=0){if(p.o)if(_==1){m=p.m?p.m.length:0,p=Date.now()-p.F;var M=u.B;_=Wa(),Ht(_,new za(_,m)),km(u)}else gM(u);else if(M=p.s,M==3||M==0&&0<p.X||!(_==1&&N4(u,p)||_==2&&_S(u)))switch(m&&0<m.length&&(p=u.h,p.i=p.i.concat(m)),M){case 1:Za(u,5);break;case 4:Za(u,10);break;case 3:Za(u,6);break;default:Za(u,2)}}}function _M(u,p){let m=u.Ta+Math.floor(Math.random()*u.cb);return u.isActive()||(m*=2),m*p}function Za(u,p){if(u.j.info("Error code "+p),p==2){var m=f(u.fb,u),_=u.Xa;let M=!_;_=new Ao(_||"//www.google.com/images/cleardot.gif"),a.location&&a.location.protocol=="http"||Qa(_,"https"),Ts(_),M?Lm(_.toString(),m):gS(_.toString(),m)}else an(2);u.G=0,u.l&&u.l.sa(p),TM(u),hM(u)}t.fb=function(u){u?(this.j.info("Successfully pinged google.com"),an(2)):(this.j.info("Failed to ping google.com"),an(1))};function TM(u){if(u.G=0,u.ka=[],u.l){let p=su(u.h);(p.length!=0||u.i.length!=0)&&(S(u.ka,p),S(u.ka,u.i),u.h.i.length=0,I(u.i),u.i.length=0),u.l.ra()}}function yM(u,p,m){var _=m instanceof Ao?Qr(m):new Ao(m);if(_.g!="")p&&(_.g=p+"."+_.g),au(_,_.s);else{var M=a.location;_=M.protocol,p=p?p+"."+M.hostname:M.hostname,M=+M.port;var F=new Ao(null);_&&Qa(F,_),p&&(F.g=p),M&&au(F,M),m&&(F.l=m),_=F}return m=u.D,p=u.ya,m&&p&&We(_,m,p),We(_,"VER",u.la),nf(u,_),_}function IM(u,p,m){if(p&&!u.J)throw Error("Can't create secondary domain capable XhrIo object.");return p=u.Ca&&!u.pa?new j(new bo({eb:m})):new j(u.pa),p.Ha(u.J),p}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function vM(){}t=vM.prototype,t.ua=function(){},t.ta=function(){},t.sa=function(){},t.ra=function(){},t.isActive=function(){return!0},t.Na=function(){};function Um(){}Um.prototype.g=function(u,p){return new dr(u,p)};function dr(u,p){jt.call(this),this.g=new dM(p),this.l=u,this.h=p&&p.messageUrlParams||null,u=p&&p.messageHeaders||null,p&&p.clientProtocolHeaderRequired&&(u?u["X-Client-Protocol"]="webchannel":u={"X-Client-Protocol":"webchannel"}),this.g.o=u,u=p&&p.initMessageHeaders||null,p&&p.messageContentType&&(u?u["X-WebChannel-Content-Type"]=p.messageContentType:u={"X-WebChannel-Content-Type":p.messageContentType}),p&&p.va&&(u?u["X-WebChannel-Client-Profile"]=p.va:u={"X-WebChannel-Client-Profile":p.va}),this.g.S=u,(u=p&&p.Sb)&&!U(u)&&(this.g.m=u),this.v=p&&p.supportsCrossDomainXhr||!1,this.u=p&&p.sendRawJson||!1,(p=p&&p.httpSessionIdParam)&&!U(p)&&(this.g.D=p,u=this.h,u!==null&&p in u&&(u=this.h,p in u&&delete u[p])),this.j=new uu(this)}E(dr,jt),dr.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},dr.prototype.close=function(){ES(this.g)},dr.prototype.o=function(u){var p=this.g;if(typeof u=="string"){var m={};m.__data__=u,u=m}else this.u&&(m={},m.__data__=bi(u),u=m);p.i.push(new uS(p.Ya++,u)),p.G==3&&km(p)},dr.prototype.N=function(){this.g.l=null,delete this.j,ES(this.g),delete this.g,dr.aa.N.call(this)};function SM(u){$a.call(this),u.__headers__&&(this.headers=u.__headers__,this.statusCode=u.__status__,delete u.__headers__,delete u.__status__);var p=u.__sm__;if(p){e:{for(let m in p){u=m;break e}u=void 0}(this.i=u)&&(u=this.i,p=p!==null&&u in p?p[u]:void 0),this.data=p}else this.data=u}E(SM,$a);function AM(){Yr.call(this),this.status=1}E(AM,Yr);function uu(u){this.g=u}E(uu,vM),uu.prototype.ua=function(){Ht(this.g,"a")},uu.prototype.ta=function(u){Ht(this.g,new SM(u))},uu.prototype.sa=function(u){Ht(this.g,new AM)},uu.prototype.ra=function(){Ht(this.g,"b")},Um.prototype.createWebChannel=Um.prototype.g,dr.prototype.send=dr.prototype.o,dr.prototype.open=dr.prototype.m,dr.prototype.close=dr.prototype.close,lO=os.createWebChannelTransport=function(){return new Um},cO=os.getStatEventTarget=function(){return Wa()},aO=os.Event=Zn,NI=os.Stat={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},ms.NO_ERROR=0,ms.TIMEOUT=8,ms.HTTP_ERROR=6,Ag=os.ErrorCode=ms,Dm.COMPLETE="complete",sO=os.EventType=Dm,jh.EventType=Io,Io.OPEN="a",Io.CLOSE="b",Io.ERROR="c",Io.MESSAGE="d",jt.prototype.listen=jt.prototype.K,Bd=os.WebChannel=jh,Kse=os.FetchXmlHttpFactory=bo,j.prototype.listenOnce=j.prototype.L,j.prototype.getLastError=j.prototype.Ka,j.prototype.getLastErrorCode=j.prototype.Ba,j.prototype.getStatus=j.prototype.Z,j.prototype.getResponseJson=j.prototype.Oa,j.prototype.getResponseText=j.prototype.oa,j.prototype.send=j.prototype.ea,j.prototype.setWithCredentials=j.prototype.Ha,oO=os.XhrIo=j}).apply(typeof RI<"u"?RI:typeof self<"u"?self:typeof window<"u"?window:{});var x$="@firebase/firestore",k$="4.8.0";var Vt=class{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}};Vt.UNAUTHENTICATED=new Vt(null),Vt.GOOGLE_CREDENTIALS=new Vt("google-credentials-uid"),Vt.FIRST_PARTY=new Vt("first-party-uid"),Vt.MOCK_USER=new Vt("mock-user");var Dh="11.10.0";var Na=new jr("@firebase/firestore");function qd(){return Na.logLevel}function A0(t){Na.setLogLevel(t)}function z(t,...e){if(Na.logLevel<=Ne.DEBUG){let n=e.map(C0);Na.debug(`Firestore (${Dh}): ${t}`,...n)}}function wt(t,...e){if(Na.logLevel<=Ne.ERROR){let n=e.map(C0);Na.error(`Firestore (${Dh}): ${t}`,...n)}}function ls(t,...e){if(Na.logLevel<=Ne.WARN){let n=e.map(C0);Na.warn(`Firestore (${Dh}): ${t}`,...n)}}function C0(t){if(typeof t=="string")return t;try{return(function(n){return JSON.stringify(n)})(t)}catch{return t}}function ie(t,e,n){let r="Unexpected state";typeof e=="string"?r=e:n=e,Q3(t,r,n)}function Q3(t,e,n){let r=`FIRESTORE (${Dh}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw wt(r),new Error(r)}function se(t,e,n,r){let i="Unexpected state";typeof n=="string"?i=n:r=n,t||Q3(e,i,r)}function oe(t,e){return t}var x={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},W=class extends rr{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}};var cr=class{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}};var jI=class{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}},EO=class{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(Vt.UNAUTHENTICATED))}shutdown(){}},_O=class{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}},TO=class{constructor(e){this.t=e,this.currentUser=Vt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){se(this.o===void 0,42304);let r=this.i,i=c=>this.i!==r?(r=this.i,n(c)):Promise.resolve(),o=new cr;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new cr,e.enqueueRetryable(()=>i(this.currentUser))};let s=()=>{let c=o;e.enqueueRetryable(()=>y(this,null,function*(){yield c.promise,yield i(this.currentUser)}))},a=c=>{z("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(c=>a(c)),setTimeout(()=>{if(!this.auth){let c=this.t.getImmediate({optional:!0});c?a(c):(z("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new cr)}},0),s()}getToken(){let e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(z("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(se(typeof r.accessToken=="string",31837,{l:r}),new jI(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){let e=this.auth&&this.auth.getUid();return se(e===null||typeof e=="string",2055,{h:e}),new Vt(e)}},yO=class{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=Vt.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);let e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}},IO=class{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new yO(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable(()=>n(Vt.FIRST_PARTY))}shutdown(){}invalidateToken(){}},HI=class{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}},vO=class{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,ir(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){se(this.o===void 0,3512);let r=o=>{o.error!=null&&z("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);let s=o.token!==this.m;return this.m=o.token,z("FirebaseAppCheckTokenProvider",`Received ${s?"new":"existing"} token.`),s?n(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>r(o))};let i=o=>{z("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(o=>i(o)),setTimeout(()=>{if(!this.appCheck){let o=this.V.getImmediate({optional:!0});o?i(o):z("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new HI(this.p));let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(se(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new HI(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}};function Yse(t){let e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}function J3(){return new TextEncoder}var Bg=class{static newId(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=62*Math.floor(4.129032258064516),r="";for(;r.length<20;){let i=Yse(40);for(let o=0;o<i.length;++o)r.length<20&&i[o]<n&&(r+=e.charAt(i[o]%62))}return r}};function Ie(t,e){return t<e?-1:t>e?1:0}function SO(t,e){let n=0;for(;n<t.length&&n<e.length;){let r=t.codePointAt(n),i=e.codePointAt(n);if(r!==i){if(r<128&&i<128)return Ie(r,i);{let o=J3(),s=Xse(o.encode(F$(t,n)),o.encode(F$(e,n)));return s!==0?s:Ie(r,i)}}n+=r>65535?2:1}return Ie(t.length,e.length)}function F$(t,e){return t.codePointAt(e)>65535?t.substring(e,e+2):t.substring(e,e+1)}function Xse(t,e){for(let n=0;n<t.length&&n<e.length;++n)if(t[n]!==e[n])return Ie(t[n],e[n]);return Ie(t.length,e.length)}function nh(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}function Z3(t){return t+"\0"}var U$="__name__",$I=class t{constructor(e,n,r){n===void 0?n=0:n>e.length&&ie(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&ie(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return t.comparator(this,e)===0}child(e){let n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}forEach(e){for(let n=this.offset,r=this.limit();n<r;n++)e(this.segments[n])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,n){let r=Math.min(e.length,n.length);for(let i=0;i<r;i++){let o=t.compareSegments(e.get(i),n.get(i));if(o!==0)return o}return Ie(e.length,n.length)}static compareSegments(e,n){let r=t.isNumericId(e),i=t.isNumericId(n);return r&&!i?-1:!r&&i?1:r&&i?t.extractNumericId(e).compare(t.extractNumericId(n)):SO(e,n)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return is.fromString(e.substring(4,e.length-2))}},ke=class t extends $I{construct(e,n,r){return new t(e,n,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){let n=[];for(let r of e){if(r.indexOf("//")>=0)throw new W(x.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new t(n)}static emptyPath(){return new t([])}},Qse=/^[_a-zA-Z][_a-zA-Z0-9]*$/,tn=class t extends $I{construct(e,n,r){return new t(e,n,r)}static isValidIdentifier(e){return Qse.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===U$}static keyField(){return new t([U$])}static fromServerFormat(e){let n=[],r="",i=0,o=()=>{if(r.length===0)throw new W(x.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""},s=!1;for(;i<e.length;){let a=e[i];if(a==="\\"){if(i+1===e.length)throw new W(x.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let c=e[i+1];if(c!=="\\"&&c!=="."&&c!=="`")throw new W(x.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=c,i+=2}else a==="`"?(s=!s,i++):a!=="."||s?(r+=a,i++):(o(),i++)}if(o(),s)throw new W(x.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new t(n)}static emptyPath(){return new t([])}};var te=class t{constructor(e){this.path=e}static fromPath(e){return new t(ke.fromString(e))}static fromName(e){return new t(ke.fromString(e).popFirst(5))}static empty(){return new t(ke.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&ke.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return ke.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new t(new ke(e.slice()))}};function D0(t,e,n){if(!n)throw new W(x.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function Jse(t,e,n,r){if(e===!0&&r===!0)throw new W(x.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function V$(t){if(!te.isDocumentKey(t))throw new W(x.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function B$(t){if(te.isDocumentKey(t))throw new W(x.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function eW(t){return typeof t=="object"&&t!==null&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function Uv(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{let e=(function(r){return r.constructor?r.constructor.name:null})(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":ie(12329,{type:typeof t})}function lr(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new W(x.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let n=Uv(t);throw new W(x.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function Zse(t,e){if(e<=0)throw new W(x.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)}function Bt(t,e){let n={typeString:t};return e&&(n.value=e),n}function pm(t,e){if(!eW(t))throw new W(x.INVALID_ARGUMENT,"JSON must be an object");let n;for(let r in e)if(e[r]){let i=e[r].typeString,o="value"in e[r]?{value:e[r].value}:void 0;if(!(r in t)){n=`JSON missing required field: '${r}'`;break}let s=t[r];if(i&&typeof s!==i){n=`JSON field '${r}' must be a ${i}.`;break}if(o!==void 0&&s!==o.value){n=`Expected '${r}' field to equal '${o.value}'`;break}}if(n)throw new W(x.INVALID_ARGUMENT,n);return!0}var G$=-62135596800,j$=1e6,_t=class t{static now(){return t.fromMillis(Date.now())}static fromDate(e){return t.fromMillis(e.getTime())}static fromMillis(e){let n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*j$);return new t(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new W(x.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new W(x.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<G$)throw new W(x.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new W(x.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/j$}_compareTo(e){return this.seconds===e.seconds?Ie(this.nanoseconds,e.nanoseconds):Ie(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:t._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(pm(e,t._jsonSchema))return new t(e.seconds,e.nanoseconds)}valueOf(){let e=this.seconds-G$;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}};_t._jsonSchemaVersion="firestore/timestamp/1.0",_t._jsonSchema={type:Bt("string",_t._jsonSchemaVersion),seconds:Bt("number"),nanoseconds:Bt("number")};var ue=class t{static fromTimestamp(e){return new t(e)}static min(){return new t(new _t(0,0))}static max(){return new t(new _t(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}};var rh=-1,ih=class{constructor(e,n,r,i){this.indexId=e,this.collectionGroup=n,this.fields=r,this.indexState=i}};function AO(t){return t.fields.find(e=>e.kind===2)}function Sl(t){return t.fields.filter(e=>e.kind!==2)}ih.UNKNOWN_ID=-1;var Jd=class{constructor(e,n){this.fieldPath=e,this.kind=n}};var Gg=class t{constructor(e,n){this.sequenceNumber=e,this.offset=n}static empty(){return new t(0,zr.min())}};function tW(t,e){let n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=ue.fromTimestamp(r===1e9?new _t(n+1,0):new _t(n,r));return new zr(i,te.empty(),e)}function nW(t){return new zr(t.readTime,t.key,rh)}var zr=class t{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new t(ue.min(),te.empty(),rh)}static max(){return new t(ue.max(),te.empty(),rh)}};function R0(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=te.comparator(t.documentKey,e.documentKey),n!==0?n:Ie(t.largestBatchId,e.largestBatchId))}var rW="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",WI=class{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}};function ka(t){return y(this,null,function*(){if(t.code!==x.FAILED_PRECONDITION||t.message!==rW)throw t;z("LocalStore","Unexpectedly lost primary lease")})}var P=class t{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&ie(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t((r,i)=>{this.nextCallback=o=>{this.wrapSuccess(e,o).next(r,i)},this.catchCallback=o=>{this.wrapFailure(n,o).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{let n=e();return n instanceof t?n:t.resolve(n)}catch(n){return t.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):t.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):t.reject(n)}static resolve(e){return new t((n,r)=>{n(e)})}static reject(e){return new t((n,r)=>{r(e)})}static waitFor(e){return new t((n,r)=>{let i=0,o=0,s=!1;e.forEach(a=>{++i,a.next(()=>{++o,s&&o===i&&n()},c=>r(c))}),s=!0,o===i&&n()})}static or(e){let n=t.resolve(!1);for(let r of e)n=n.next(i=>i?t.resolve(i):r());return n}static forEach(e,n){let r=[];return e.forEach((i,o)=>{r.push(n.call(this,i,o))}),this.waitFor(r)}static mapArray(e,n){return new t((r,i)=>{let o=e.length,s=new Array(o),a=0;for(let c=0;c<o;c++){let l=c;n(e[l]).next(d=>{s[l]=d,++a,a===o&&r(s)},d=>i(d))}})}static doWhile(e,n){return new t((r,i)=>{let o=()=>{e()===!0?n().next(()=>{o()},i):r()};o()})}};var Cr="SimpleDb",zI=class t{static open(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(o){throw new Ol(n,o)}}constructor(e,n){this.action=e,this.transaction=n,this.aborted=!1,this.S=new cr,this.transaction.oncomplete=()=>{this.S.resolve()},this.transaction.onabort=()=>{n.error?this.S.reject(new Ol(e,n.error)):this.S.resolve()},this.transaction.onerror=r=>{let i=N0(r.target.error);this.S.reject(new Ol(e,i))}}get D(){return this.S.promise}abort(e){e&&this.S.reject(e),this.aborted||(z(Cr,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}v(){let e=this.transaction;this.aborted||typeof e.commit!="function"||e.commit()}store(e){let n=this.transaction.objectStore(e);return new DO(n)}},oh=class t{static delete(e){return z(Cr,"Removing database:",e),Cl(qT().indexedDB.deleteDatabase(e)).toPromise()}static C(){if(!gd())return!1;if(t.F())return!0;let e=Zt(),n=t.M(e),r=0<n&&n<10,i=iW(e),o=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)}static F(){var e;return typeof process<"u"&&((e=process.__PRIVATE_env)===null||e===void 0?void 0:e.O)==="YES"}static N(e,n){return e.store(n)}static M(e){let n=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),r=n?n[1].split("_").slice(0,2).join("."):"-1";return Number(r)}constructor(e,n,r){this.name=e,this.version=n,this.B=r,this.L=null,t.M(Zt())===12.2&&wt("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}k(e){return y(this,null,function*(){return this.db||(z(Cr,"Opening database:",this.name),this.db=yield new Promise((n,r)=>{let i=indexedDB.open(this.name,this.version);i.onsuccess=o=>{let s=o.target.result;n(s)},i.onblocked=()=>{r(new Ol(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=o=>{let s=o.target.error;s.name==="VersionError"?r(new W(x.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):s.name==="InvalidStateError"?r(new W(x.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+s)):r(new Ol(e,s))},i.onupgradeneeded=o=>{z(Cr,'Database "'+this.name+'" requires upgrade from version:',o.oldVersion);let s=o.target.result;if(this.L!==null&&this.L!==o.oldVersion)throw new Error(`refusing to open IndexedDB database due to potential corruption of the IndexedDB database data; this corruption could be caused by clicking the "clear site data" button in a web browser; try reloading the web page to re-initialize the IndexedDB database: lastClosedDbVersion=${this.L}, event.oldVersion=${o.oldVersion}, event.newVersion=${o.newVersion}, db.version=${s.version}`);this.B.q(s,i.transaction,o.oldVersion,this.version).next(()=>{z(Cr,"Database upgrade to version "+this.version+" complete")})}}),this.db.addEventListener("close",n=>{let r=n.target;this.L=r.version},{passive:!0})),this.db.addEventListener("versionchange",n=>{var r;n.newVersion===null&&(ls('Received "versionchange" event with newVersion===null; notifying the registered DatabaseDeletedListener, if any'),(r=this.databaseDeletedListener)===null||r===void 0||r.call(this))},{passive:!0}),this.db})}setDatabaseDeletedListener(e){if(this.databaseDeletedListener)throw new Error("setDatabaseDeletedListener() may only be called once, and it has already been called");this.databaseDeletedListener=e}runTransaction(e,n,r,i){return y(this,null,function*(){let o=n==="readonly",s=0;for(;;){++s;try{this.db=yield this.k(e);let a=zI.open(this.db,e,o?"readonly":"readwrite",r),c=i(a).next(l=>(a.v(),l)).catch(l=>(a.abort(l),P.reject(l))).toPromise();return c.catch(()=>{}),yield a.D,c}catch(a){let c=a,l=c.name!=="FirebaseError"&&s<3;if(z(Cr,"Transaction failed with error:",c.message,"Retrying:",l),this.close(),!l)return Promise.reject(c)}}})}close(){this.db&&this.db.close(),this.db=void 0}};function iW(t){let e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}var CO=class{constructor(e){this.$=e,this.U=!1,this.K=null}get isDone(){return this.U}get W(){return this.K}set cursor(e){this.$=e}done(){this.U=!0}G(e){this.K=e}delete(){return Cl(this.$.delete())}},Ol=class extends W{constructor(e,n){super(x.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${n}`),this.name="IndexedDbTransactionError"}};function Fa(t){return t.name==="IndexedDbTransactionError"}var DO=class{constructor(e){this.store=e}put(e,n){let r;return n!==void 0?(z(Cr,"PUT",this.store.name,e,n),r=this.store.put(n,e)):(z(Cr,"PUT",this.store.name,"<auto-key>",e),r=this.store.put(e)),Cl(r)}add(e){return z(Cr,"ADD",this.store.name,e,e),Cl(this.store.add(e))}get(e){return Cl(this.store.get(e)).next(n=>(n===void 0&&(n=null),z(Cr,"GET",this.store.name,e,n),n))}delete(e){return z(Cr,"DELETE",this.store.name,e),Cl(this.store.delete(e))}count(){return z(Cr,"COUNT",this.store.name),Cl(this.store.count())}j(e,n){let r=this.options(e,n),i=r.index?this.store.index(r.index):this.store;if(typeof i.getAll=="function"){let o=i.getAll(r.range);return new P((s,a)=>{o.onerror=c=>{a(c.target.error)},o.onsuccess=c=>{s(c.target.result)}})}{let o=this.cursor(r),s=[];return this.J(o,(a,c)=>{s.push(c)}).next(()=>s)}}H(e,n){let r=this.store.getAll(e,n===null?void 0:n);return new P((i,o)=>{r.onerror=s=>{o(s.target.error)},r.onsuccess=s=>{i(s.target.result)}})}Y(e,n){z(Cr,"DELETE ALL",this.store.name);let r=this.options(e,n);r.Z=!1;let i=this.cursor(r);return this.J(i,(o,s,a)=>a.delete())}X(e,n){let r;n?r=e:(r={},n=e);let i=this.cursor(r);return this.J(i,n)}ee(e){let n=this.cursor({});return new P((r,i)=>{n.onerror=o=>{let s=N0(o.target.error);i(s)},n.onsuccess=o=>{let s=o.target.result;s?e(s.primaryKey,s.value).next(a=>{a?s.continue():r()}):r()}})}J(e,n){let r=[];return new P((i,o)=>{e.onerror=s=>{o(s.target.error)},e.onsuccess=s=>{let a=s.target.result;if(!a)return void i();let c=new CO(a),l=n(a.primaryKey,a.value,c);if(l instanceof P){let d=l.catch(h=>(c.done(),P.reject(h)));r.push(d)}c.isDone?i():c.W===null?a.continue():a.continue(c.W)}}).next(()=>P.waitFor(r))}options(e,n){let r;return e!==void 0&&(typeof e=="string"?r=e:n=e),{index:r,range:n}}cursor(e){let n="next";if(e.reverse&&(n="prev"),e.index){let r=this.store.index(e.index);return e.Z?r.openKeyCursor(e.range,n):r.openCursor(e.range,n)}return this.store.openCursor(e.range,n)}};function Cl(t){return new P((e,n)=>{t.onsuccess=r=>{let i=r.target.result;e(i)},t.onerror=r=>{let i=N0(r.target.error);n(i)}})}var H$=!1;function N0(t){let e=oh.M(Zt());if(e>=12.2&&e<13){let n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){let r=new W("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${n}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return H$||(H$=!0,setTimeout(()=>{throw r},0)),r}}return t}var Lg="IndexBackfiller",RO=class{constructor(e,n){this.asyncQueue=e,this.te=n,this.task=null}start(){this.ne(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return this.task!==null}ne(e){z(Lg,`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,()=>y(this,null,function*(){this.task=null;try{let n=yield this.te.re();z(Lg,`Documents written: ${n}`)}catch(n){Fa(n)?z(Lg,"Ignoring IndexedDB error during index backfill: ",n):yield ka(n)}yield this.ne(6e4)}))}},NO=class{constructor(e,n){this.localStore=e,this.persistence=n}re(e=50){return y(this,null,function*(){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",n=>this.ie(n,e))})}ie(e,n){let r=new Set,i=n,o=!0;return P.doWhile(()=>o===!0&&i>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(s=>{if(s!==null&&!r.has(s))return z(Lg,`Processing collection: ${s}`),this.se(e,s,i).next(a=>{i-=a,r.add(s)});o=!1})).next(()=>n-i)}se(e,n,r){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,n).next(i=>this.localStore.localDocuments.getNextDocuments(e,n,i,r).next(o=>{let s=o.changes;return this.localStore.indexManager.updateIndexEntries(e,s).next(()=>this.oe(i,o)).next(a=>(z(Lg,`Updating offset: ${a}`),this.localStore.indexManager.updateCollectionGroup(e,n,a))).next(()=>s.size)}))}oe(e,n){let r=e;return n.changes.forEach((i,o)=>{let s=nW(o);R0(s,r)>0&&(r=s)}),new zr(r.readTime,r.documentKey,Math.max(n.batchId,e.largestBatchId))}};var Dr=(()=>{class t{constructor(n,r){this.previousValue=n,r&&(r.sequenceNumberHandler=i=>this._e(i),this.ae=i=>r.writeSequenceNumber(i))}_e(n){return this.previousValue=Math.max(n,this.previousValue),this.previousValue}next(){let n=++this.previousValue;return this.ae&&this.ae(n),n}}t.ue=-1;return t})(),Ll=-1;function gm(t){return t==null}function jg(t){return t===0&&1/t==-1/0}function oW(t){return typeof t=="number"&&Number.isInteger(t)&&!jg(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var qI="";function Hn(t){let e="";for(let n=0;n<t.length;n++)e.length>0&&(e=$$(e)),e=eae(t.get(n),e);return $$(e)}function eae(t,e){let n=e,r=t.length;for(let i=0;i<r;i++){let o=t.charAt(i);switch(o){case"\0":n+="";break;case qI:n+="";break;default:n+=o}}return n}function $$(t){return t+qI+""}function go(t){let e=t.length;if(se(e>=2,64408,{path:t}),e===2)return se(t.charAt(0)===qI&&t.charAt(1)==="",56145,{path:t}),ke.emptyPath();let n=e-2,r=[],i="";for(let o=0;o<e;){let s=t.indexOf(qI,o);switch((s<0||s>n)&&ie(50515,{path:t}),t.charAt(s+1)){case"":let a=t.substring(o,s),c;i.length===0?c=a:(i+=a,c=i,i=""),r.push(c);break;case"":i+=t.substring(o,s),i+="\0";break;case"":i+=t.substring(o,s+1);break;default:ie(61167,{path:t})}o=s+2}return new ke(r)}var Al="remoteDocuments",mm="owner",Gd="owner",Hg="mutationQueues",tae="userId",Ii="mutations",W$="batchId",bl="userMutationsIndex",z$=["userId","batchId"];function PI(t,e){return[t,Hn(e)]}function sW(t,e,n){return[t,Hn(e),n]}var nae={},sh="documentMutations",KI="remoteDocumentsV14",rae=["prefixPath","collectionGroup","readTime","documentId"],xI="documentKeyIndex",iae=["prefixPath","collectionGroup","documentId"],aW="collectionGroupIndex",oae=["collectionGroup","readTime","prefixPath","documentId"],$g="remoteDocumentGlobal",bO="remoteDocumentGlobalKey",ah="targets",cW="queryTargetsIndex",sae=["canonicalId","targetId"],ch="targetDocuments",aae=["targetId","path"],b0="documentTargetsIndex",cae=["path","targetId"],YI="targetGlobalKey",Ml="targetGlobal",Wg="collectionParents",lae=["collectionId","parent"],lh="clientMetadata",uae="clientId",Vv="bundles",dae="bundleId",Bv="namedQueries",hae="name",w0="indexConfiguration",fae="indexId",wO="collectionGroupIndex",pae="collectionGroup",Mg="indexState",gae=["indexId","uid"],lW="sequenceNumberIndex",mae=["uid","sequenceNumber"],Pg="indexEntries",Eae=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],uW="documentKeyIndex",_ae=["indexId","uid","orderedDocumentKey"],Gv="documentOverlays",Tae=["userId","collectionPath","documentId"],OO="collectionPathOverlayIndex",yae=["userId","collectionPath","largestBatchId"],dW="collectionGroupOverlayIndex",Iae=["userId","collectionGroup","largestBatchId"],O0="globals",vae="name",hW=[Hg,Ii,sh,Al,ah,mm,Ml,ch,lh,$g,Wg,Vv,Bv],Sae=[...hW,Gv],fW=[Hg,Ii,sh,KI,ah,mm,Ml,ch,lh,$g,Wg,Vv,Bv,Gv],pW=fW,L0=[...pW,w0,Mg,Pg],Aae=L0,gW=[...L0,O0],Cae=gW;var zg=class extends WI{constructor(e,n){super(),this.ce=e,this.currentSequenceNumber=n}};function on(t,e){let n=oe(t);return oh.N(n.ce,e)}function q$(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Ua(t,e){for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function Dae(t,e){let n=[];for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(e(t[r],r,t));return n}function mW(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var pt=class t{constructor(e,n){this.comparator=e,this.root=n||Eo.EMPTY}insert(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Eo.BLACK,null,null))}remove(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Eo.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){let r=this.comparator(e,n.key);if(r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){let i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){let e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Qd(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Qd(this.root,e,this.comparator,!1)}getReverseIterator(){return new Qd(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Qd(this.root,e,this.comparator,!0)}},Qd=class{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let o=1;for(;!e.isEmpty();)if(o=n?r(e.key,n):1,n&&i&&(o*=-1),o<0)e=this.isReverse?e.left:e.right;else{if(o===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),n={key:e.key,value:e.value};if(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{key:e.key,value:e.value}}},Eo=class t{constructor(e,n,r,i,o){this.key=e,this.value=n,this.color=r??t.RED,this.left=i??t.EMPTY,this.right=o??t.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,o){return new t(e??this.key,n??this.value,r??this.color,i??this.left,o??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}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(e,n,r){let i=this,o=r(e,i.key);return i=o<0?i.copy(null,null,null,i.left.insert(e,n,r),null):o===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return t.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,i=this;if(n(e,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(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){let e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){let e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw ie(43730,{key:this.key,value:this.value});if(this.right.isRed())throw ie(14113,{key:this.key,value:this.value});let e=this.left.check();if(e!==this.right.check())throw ie(27949);return e+(this.isRed()?0:1)}};Eo.EMPTY=null,Eo.RED=!0,Eo.BLACK=!1;Eo.EMPTY=new class{constructor(){this.size=0}get key(){throw ie(57766)}get value(){throw ie(16141)}get color(){throw ie(16727)}get left(){throw ie(29726)}get right(){throw ie(36894)}copy(e,n,r,i,o){return this}insert(e,n,r){return new Eo(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};var nt=class t{constructor(e){this.comparator=e,this.data=new pt(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){let r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){let i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){let n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new XI(this.data.getIterator())}getIteratorFrom(e){return new XI(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size<e.size&&(n=e,e=this),e.forEach(r=>{n=n.add(r)}),n}isEqual(e){if(!(e instanceof t)||this.size!==e.size)return!1;let n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){let i=n.getNext().key,o=r.getNext().key;if(this.comparator(i,o)!==0)return!1}return!0}toArray(){let e=[];return this.forEach(n=>{e.push(n)}),e}toString(){let e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){let n=new t(this.comparator);return n.data=e,n}},XI=class{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}};function jd(t){return t.hasNext()?t.getNext():void 0}var Rr=class t{constructor(e){this.fields=e,e.sort(tn.comparator)}static empty(){return new t([])}unionWith(e){let n=new nt(tn.comparator);for(let r of this.fields)n=n.add(r);for(let r of e)n=n.add(r);return new t(n.toArray())}covers(e){for(let n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return nh(this.fields,e.fields,(n,r)=>n.isEqual(r))}};var QI=class extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}};var Gt=class t{constructor(e){this.binaryString=e}static fromBase64String(e){let n=(function(i){try{return atob(i)}catch(o){throw typeof DOMException<"u"&&o instanceof DOMException?new QI("Invalid base64 string: "+o):o}})(e);return new t(n)}static fromUint8Array(e){let n=(function(i){let o="";for(let s=0;s<i.length;++s)o+=String.fromCharCode(i[s]);return o})(e);return new t(n)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return(function(n){return btoa(n)})(this.binaryString)}toUint8Array(){return(function(n){let r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r})(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Ie(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}};Gt.EMPTY_BYTE_STRING=new Gt("");var Rae=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function us(t){if(se(!!t,39018),typeof t=="string"){let e=0,n=Rae.exec(t);if(se(!!n,46558,{timestamp:t}),n[1]){let i=n[1];i=(i+"000000000").substr(0,9),e=Number(i)}let r=new Date(t);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:Et(t.seconds),nanos:Et(t.nanos)}}function Et(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function ds(t){return typeof t=="string"?Gt.fromBase64String(t):Gt.fromUint8Array(t)}var EW="server_timestamp",_W="__type__",TW="__previous_value__",yW="__local_write_time__";function jv(t){var e,n;return((n=(((e=t?.mapValue)===null||e===void 0?void 0:e.fields)||{})[_W])===null||n===void 0?void 0:n.stringValue)===EW}function Hv(t){let e=t.mapValue.fields[TW];return jv(e)?Hv(e):e}function qg(t){let e=us(t.mapValue.fields[yW].timestampValue);return new _t(e.seconds,e.nanos)}var LO=class{constructor(e,n,r,i,o,s,a,c,l,d){this.databaseId=e,this.appId=n,this.persistenceKey=r,this.host=i,this.ssl=o,this.forceLongPolling=s,this.autoDetectLongPolling=a,this.longPollingOptions=c,this.useFetchStreams=l,this.isUsingEmulator=d}},Kg="(default)",uh=class t{constructor(e,n){this.projectId=e,this.database=n||Kg}static empty(){return new t("","")}get isDefaultDatabase(){return this.database===Kg}isEqual(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database}};var M0="__type__",IW="__max__",va={mapValue:{fields:{__type__:{stringValue:IW}}}},P0="__vector__",dh="value",kI={nullValue:"NULL_VALUE"};function ba(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?jv(t)?4:vW(t)?9007199254740991:$v(t)?10:11:ie(28295,{value:t})}function _o(t,e){if(t===e)return!0;let n=ba(t);if(n!==ba(e))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return qg(t).isEqual(qg(e));case 3:return(function(i,o){if(typeof i.timestampValue=="string"&&typeof o.timestampValue=="string"&&i.timestampValue.length===o.timestampValue.length)return i.timestampValue===o.timestampValue;let s=us(i.timestampValue),a=us(o.timestampValue);return s.seconds===a.seconds&&s.nanos===a.nanos})(t,e);case 5:return t.stringValue===e.stringValue;case 6:return(function(i,o){return ds(i.bytesValue).isEqual(ds(o.bytesValue))})(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return(function(i,o){return Et(i.geoPointValue.latitude)===Et(o.geoPointValue.latitude)&&Et(i.geoPointValue.longitude)===Et(o.geoPointValue.longitude)})(t,e);case 2:return(function(i,o){if("integerValue"in i&&"integerValue"in o)return Et(i.integerValue)===Et(o.integerValue);if("doubleValue"in i&&"doubleValue"in o){let s=Et(i.doubleValue),a=Et(o.doubleValue);return s===a?jg(s)===jg(a):isNaN(s)&&isNaN(a)}return!1})(t,e);case 9:return nh(t.arrayValue.values||[],e.arrayValue.values||[],_o);case 10:case 11:return(function(i,o){let s=i.mapValue.fields||{},a=o.mapValue.fields||{};if(q$(s)!==q$(a))return!1;for(let c in s)if(s.hasOwnProperty(c)&&(a[c]===void 0||!_o(s[c],a[c])))return!1;return!0})(t,e);default:return ie(52216,{left:t})}}function Yg(t,e){return(t.values||[]).find(n=>_o(n,e))!==void 0}function wa(t,e){if(t===e)return 0;let n=ba(t),r=ba(e);if(n!==r)return Ie(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return Ie(t.booleanValue,e.booleanValue);case 2:return(function(o,s){let a=Et(o.integerValue||o.doubleValue),c=Et(s.integerValue||s.doubleValue);return a<c?-1:a>c?1:a===c?0:isNaN(a)?isNaN(c)?0:-1:1})(t,e);case 3:return K$(t.timestampValue,e.timestampValue);case 4:return K$(qg(t),qg(e));case 5:return SO(t.stringValue,e.stringValue);case 6:return(function(o,s){let a=ds(o),c=ds(s);return a.compareTo(c)})(t.bytesValue,e.bytesValue);case 7:return(function(o,s){let a=o.split("/"),c=s.split("/");for(let l=0;l<a.length&&l<c.length;l++){let d=Ie(a[l],c[l]);if(d!==0)return d}return Ie(a.length,c.length)})(t.referenceValue,e.referenceValue);case 8:return(function(o,s){let a=Ie(Et(o.latitude),Et(s.latitude));return a!==0?a:Ie(Et(o.longitude),Et(s.longitude))})(t.geoPointValue,e.geoPointValue);case 9:return Y$(t.arrayValue,e.arrayValue);case 10:return(function(o,s){var a,c,l,d;let h=o.fields||{},f=s.fields||{},g=(a=h[dh])===null||a===void 0?void 0:a.arrayValue,E=(c=f[dh])===null||c===void 0?void 0:c.arrayValue,I=Ie(((l=g?.values)===null||l===void 0?void 0:l.length)||0,((d=E?.values)===null||d===void 0?void 0:d.length)||0);return I!==0?I:Y$(g,E)})(t.mapValue,e.mapValue);case 11:return(function(o,s){if(o===va.mapValue&&s===va.mapValue)return 0;if(o===va.mapValue)return 1;if(s===va.mapValue)return-1;let a=o.fields||{},c=Object.keys(a),l=s.fields||{},d=Object.keys(l);c.sort(),d.sort();for(let h=0;h<c.length&&h<d.length;++h){let f=SO(c[h],d[h]);if(f!==0)return f;let g=wa(a[c[h]],l[d[h]]);if(g!==0)return g}return Ie(c.length,d.length)})(t.mapValue,e.mapValue);default:throw ie(23264,{le:n})}}function K$(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return Ie(t,e);let n=us(t),r=us(e),i=Ie(n.seconds,r.seconds);return i!==0?i:Ie(n.nanos,r.nanos)}function Y$(t,e){let n=t.values||[],r=e.values||[];for(let i=0;i<n.length&&i<r.length;++i){let o=wa(n[i],r[i]);if(o)return o}return Ie(n.length,r.length)}function hh(t){return MO(t)}function MO(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?(function(n){let r=us(n);return`time(${r.seconds},${r.nanos})`})(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?(function(n){return ds(n).toBase64()})(t.bytesValue):"referenceValue"in t?(function(n){return te.fromName(n).toString()})(t.referenceValue):"geoPointValue"in t?(function(n){return`geo(${n.latitude},${n.longitude})`})(t.geoPointValue):"arrayValue"in t?(function(n){let r="[",i=!0;for(let o of n.values||[])i?i=!1:r+=",",r+=MO(o);return r+"]"})(t.arrayValue):"mapValue"in t?(function(n){let r=Object.keys(n.fields||{}).sort(),i="{",o=!0;for(let s of r)o?o=!1:i+=",",i+=`${s}:${MO(n.fields[s])}`;return i+"}"})(t.mapValue):ie(61005,{value:t})}function FI(t){switch(ba(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:let e=Hv(t);return e?16+FI(e):16;case 5:return 2*t.stringValue.length;case 6:return ds(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return(function(r){return(r.values||[]).reduce((i,o)=>i+FI(o),0)})(t.arrayValue);case 10:case 11:return(function(r){let i=0;return Ua(r.fields,(o,s)=>{i+=o.length+FI(s)}),i})(t.mapValue);default:throw ie(13486,{value:t})}}function xl(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function PO(t){return!!t&&"integerValue"in t}function Xg(t){return!!t&&"arrayValue"in t}function X$(t){return!!t&&"nullValue"in t}function Q$(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function UI(t){return!!t&&"mapValue"in t}function $v(t){var e,n;return((n=(((e=t?.mapValue)===null||e===void 0?void 0:e.fields)||{})[M0])===null||n===void 0?void 0:n.stringValue)===P0}function xg(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){let e={mapValue:{fields:{}}};return Ua(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=xg(r)),e}if(t.arrayValue){let e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=xg(t.arrayValue.values[n]);return e}return Object.assign({},t)}function vW(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===IW}var SW={mapValue:{fields:{[M0]:{stringValue:P0},[dh]:{arrayValue:{}}}}};function Nae(t){return"nullValue"in t?kI:"booleanValue"in t?{booleanValue:!1}:"integerValue"in t||"doubleValue"in t?{doubleValue:NaN}:"timestampValue"in t?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in t?{stringValue:""}:"bytesValue"in t?{bytesValue:""}:"referenceValue"in t?xl(uh.empty(),te.empty()):"geoPointValue"in t?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in t?{arrayValue:{}}:"mapValue"in t?$v(t)?SW:{mapValue:{}}:ie(35942,{value:t})}function bae(t){return"nullValue"in t?{booleanValue:!1}:"booleanValue"in t?{doubleValue:NaN}:"integerValue"in t||"doubleValue"in t?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in t?{stringValue:""}:"stringValue"in t?{bytesValue:""}:"bytesValue"in t?xl(uh.empty(),te.empty()):"referenceValue"in t?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in t?{arrayValue:{}}:"arrayValue"in t?SW:"mapValue"in t?$v(t)?{mapValue:{}}:va:ie(61959,{value:t})}function J$(t,e){let n=wa(t.value,e.value);return n!==0?n:t.inclusive&&!e.inclusive?-1:!t.inclusive&&e.inclusive?1:0}function Z$(t,e){let n=wa(t.value,e.value);return n!==0?n:t.inclusive&&!e.inclusive?1:!t.inclusive&&e.inclusive?-1:0}var jn=class t{constructor(e){this.value=e}static empty(){return new t({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r<e.length-1;++r)if(n=(n.mapValue.fields||{})[e.get(r)],!UI(n))return null;return n=(n.mapValue.fields||{})[e.lastSegment()],n||null}}set(e,n){this.getFieldsMap(e.popLast())[e.lastSegment()]=xg(n)}setAll(e){let n=tn.emptyPath(),r={},i=[];e.forEach((s,a)=>{if(!n.isImmediateParentOf(a)){let c=this.getFieldsMap(n);this.applyChanges(c,r,i),r={},i=[],n=a.popLast()}s?r[a.lastSegment()]=xg(s):i.push(a.lastSegment())});let o=this.getFieldsMap(n);this.applyChanges(o,r,i)}delete(e){let n=this.field(e.popLast());UI(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return _o(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;r<e.length;++r){let i=n.mapValue.fields[e.get(r)];UI(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},n.mapValue.fields[e.get(r)]=i),n=i}return n.mapValue.fields}applyChanges(e,n,r){Ua(n,(i,o)=>e[i]=o);for(let i of r)delete e[i]}clone(){return new t(xg(this.value))}};function AW(t){let e=[];return Ua(t.fields,(n,r)=>{let i=new tn([n]);if(UI(r)){let o=AW(r.mapValue).fields;if(o.length===0)e.push(i);else for(let s of o)e.push(i.child(s))}else e.push(i)}),new Rr(e)}var nn=class t{constructor(e,n,r,i,o,s,a){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=o,this.data=s,this.documentState=a}static newInvalidDocument(e){return new t(e,0,ue.min(),ue.min(),ue.min(),jn.empty(),0)}static newFoundDocument(e,n,r,i){return new t(e,1,n,ue.min(),r,i,0)}static newNoDocument(e,n){return new t(e,2,n,ue.min(),ue.min(),jn.empty(),0)}static newUnknownDocument(e,n){return new t(e,3,n,ue.min(),ue.min(),jn.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(ue.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=jn.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=jn.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ue.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new t(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}};var To=class{constructor(e,n){this.position=e,this.inclusive=n}};function e3(t,e,n){let r=0;for(let i=0;i<t.position.length;i++){let o=e[i],s=t.position[i];if(o.field.isKeyField()?r=te.comparator(te.fromName(s.referenceValue),n.key):r=wa(s,n.data.field(o.field)),o.dir==="desc"&&(r*=-1),r!==0)break}return r}function t3(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!_o(t.position[n],e.position[n]))return!1;return!0}var kl=class{constructor(e,n="asc"){this.field=e,this.dir=n}};function wae(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}var JI=class{},Pe=class t extends JI{constructor(e,n,r){super(),this.field=e,this.op=n,this.value=r}static create(e,n,r){return e.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(e,n,r):new FO(e,n,r):n==="array-contains"?new BO(e,r):n==="in"?new ZI(e,r):n==="not-in"?new GO(e,r):n==="array-contains-any"?new jO(e,r):new t(e,n,r)}static createKeyFieldInFilter(e,n,r){return n==="in"?new UO(e,r):new VO(e,r)}matches(e){let n=e.data.field(this.field);return this.op==="!="?n!==null&&n.nullValue===void 0&&this.matchesComparison(wa(n,this.value)):n!==null&&ba(this.value)===ba(n)&&this.matchesComparison(wa(n,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return ie(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}},Je=class t extends JI{constructor(e,n){super(),this.filters=e,this.op=n,this.he=null}static create(e,n){return new t(e,n)}matches(e){return fh(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.he!==null||(this.he=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.he}getFilters(){return Object.assign([],this.filters)}};function fh(t){return t.op==="and"}function xO(t){return t.op==="or"}function x0(t){return CW(t)&&fh(t)}function CW(t){for(let e of t.filters)if(e instanceof Je)return!1;return!0}function kO(t){if(t instanceof Pe)return t.field.canonicalString()+t.op.toString()+hh(t.value);if(x0(t))return t.filters.map(e=>kO(e)).join(",");{let e=t.filters.map(n=>kO(n)).join(",");return`${t.op}(${e})`}}function DW(t,e){return t instanceof Pe?(function(r,i){return i instanceof Pe&&r.op===i.op&&r.field.isEqual(i.field)&&_o(r.value,i.value)})(t,e):t instanceof Je?(function(r,i){return i instanceof Je&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((o,s,a)=>o&&DW(s,i.filters[a]),!0):!1})(t,e):void ie(19439)}function RW(t,e){let n=t.filters.concat(e);return Je.create(n,t.op)}function NW(t){return t instanceof Pe?(function(n){return`${n.field.canonicalString()} ${n.op} ${hh(n.value)}`})(t):t instanceof Je?(function(n){return n.op.toString()+" {"+n.getFilters().map(NW).join(" ,")+"}"})(t):"Filter"}var FO=class extends Pe{constructor(e,n,r){super(e,n,r),this.key=te.fromName(r.referenceValue)}matches(e){let n=te.comparator(e.key,this.key);return this.matchesComparison(n)}},UO=class extends Pe{constructor(e,n){super(e,"in",n),this.keys=bW("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}},VO=class extends Pe{constructor(e,n){super(e,"not-in",n),this.keys=bW("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}};function bW(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>te.fromName(r.referenceValue))}var BO=class extends Pe{constructor(e,n){super(e,"array-contains",n)}matches(e){let n=e.data.field(this.field);return Xg(n)&&Yg(n.arrayValue,this.value)}},ZI=class extends Pe{constructor(e,n){super(e,"in",n)}matches(e){let n=e.data.field(this.field);return n!==null&&Yg(this.value.arrayValue,n)}},GO=class extends Pe{constructor(e,n){super(e,"not-in",n)}matches(e){if(Yg(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!Yg(this.value.arrayValue,n)}},jO=class extends Pe{constructor(e,n){super(e,"array-contains-any",n)}matches(e){let n=e.data.field(this.field);return!(!Xg(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>Yg(this.value.arrayValue,r))}};var HO=class{constructor(e,n=null,r=[],i=[],o=null,s=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=o,this.startAt=s,this.endAt=a,this.Pe=null}};function $O(t,e=null,n=[],r=[],i=null,o=null,s=null){return new HO(t,e,n,r,i,o,s)}function Fl(t){let e=oe(t);if(e.Pe===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>kO(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>(function(o){return o.field.canonicalString()+o.dir})(r)).join(","),gm(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>hh(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>hh(r)).join(",")),e.Pe=n}return e.Pe}function Em(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!wae(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!DW(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!t3(t.startAt,e.startAt)&&t3(t.endAt,e.endAt)}function ev(t){return te.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}function tv(t,e){return t.filters.filter(n=>n instanceof Pe&&n.field.isEqual(e))}function n3(t,e,n){let r=kI,i=!0;for(let o of tv(t,e)){let s=kI,a=!0;switch(o.op){case"<":case"<=":s=Nae(o.value);break;case"==":case"in":case">=":s=o.value;break;case">":s=o.value,a=!1;break;case"!=":case"not-in":s=kI}J$({value:r,inclusive:i},{value:s,inclusive:a})<0&&(r=s,i=a)}if(n!==null){for(let o=0;o<t.orderBy.length;++o)if(t.orderBy[o].field.isEqual(e)){let s=n.position[o];J$({value:r,inclusive:i},{value:s,inclusive:n.inclusive})<0&&(r=s,i=n.inclusive);break}}return{value:r,inclusive:i}}function r3(t,e,n){let r=va,i=!0;for(let o of tv(t,e)){let s=va,a=!0;switch(o.op){case">=":case">":s=bae(o.value),a=!1;break;case"==":case"in":case"<=":s=o.value;break;case"<":s=o.value,a=!1;break;case"!=":case"not-in":s=va}Z$({value:r,inclusive:i},{value:s,inclusive:a})>0&&(r=s,i=a)}if(n!==null){for(let o=0;o<t.orderBy.length;++o)if(t.orderBy[o].field.isEqual(e)){let s=n.position[o];Z$({value:r,inclusive:i},{value:s,inclusive:n.inclusive})>0&&(r=s,i=n.inclusive);break}}return{value:r,inclusive:i}}var yo=class{constructor(e,n=null,r=[],i=[],o=null,s="F",a=null,c=null){this.path=e,this.collectionGroup=n,this.explicitOrderBy=r,this.filters=i,this.limit=o,this.limitType=s,this.startAt=a,this.endAt=c,this.Te=null,this.Ie=null,this.de=null,this.startAt,this.endAt}};function wW(t,e,n,r,i,o,s,a){return new yo(t,e,n,r,i,o,s,a)}function _m(t){return new yo(t)}function i3(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function k0(t){return t.collectionGroup!==null}function Zd(t){let e=oe(t);if(e.Te===null){e.Te=[];let n=new Set;for(let o of e.explicitOrderBy)e.Te.push(o),n.add(o.field.canonicalString());let r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(s){let a=new nt(tn.comparator);return s.filters.forEach(c=>{c.getFlattenedFilters().forEach(l=>{l.isInequality()&&(a=a.add(l.field))})}),a})(e).forEach(o=>{n.has(o.canonicalString())||o.isKeyField()||e.Te.push(new kl(o,r))}),n.has(tn.keyField().canonicalString())||e.Te.push(new kl(tn.keyField(),r))}return e.Te}function br(t){let e=oe(t);return e.Ie||(e.Ie=OW(e,Zd(t))),e.Ie}function Oae(t){let e=oe(t);return e.de||(e.de=OW(e,t.explicitOrderBy)),e.de}function OW(t,e){if(t.limitType==="F")return $O(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{let o=i.dir==="desc"?"asc":"desc";return new kl(i.field,o)});let n=t.endAt?new To(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new To(t.startAt.position,t.startAt.inclusive):null;return $O(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function WO(t,e){let n=t.filters.concat([e]);return new yo(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function nv(t,e,n){return new yo(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Wv(t,e){return Em(br(t),br(e))&&t.limitType===e.limitType}function LW(t){return`${Fl(br(t))}|lt:${t.limitType}`}function Kd(t){return`Query(target=${(function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>NW(i)).join(", ")}]`),gm(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>(function(s){return`${s.field.canonicalString()} (${s.dir})`})(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>hh(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>hh(i)).join(",")),`Target(${r})`})(br(t))}; limitType=${t.limitType})`}function Tm(t,e){return e.isFoundDocument()&&(function(r,i){let o=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(o):te.isDocumentKey(r.path)?r.path.isEqual(o):r.path.isImmediateParentOf(o)})(t,e)&&(function(r,i){for(let o of Zd(r))if(!o.field.isKeyField()&&i.data.field(o.field)===null)return!1;return!0})(t,e)&&(function(r,i){for(let o of r.filters)if(!o.matches(i))return!1;return!0})(t,e)&&(function(r,i){return!(r.startAt&&!(function(s,a,c){let l=e3(s,a,c);return s.inclusive?l<=0:l<0})(r.startAt,Zd(r),i)||r.endAt&&!(function(s,a,c){let l=e3(s,a,c);return s.inclusive?l>=0:l>0})(r.endAt,Zd(r),i))})(t,e)}function MW(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function PW(t){return(e,n)=>{let r=!1;for(let i of Zd(t)){let o=Lae(i,e,n);if(o!==0)return o;r=r||i.field.isKeyField()}return 0}}function Lae(t,e,n){let r=t.field.isKeyField()?te.comparator(e.key,n.key):(function(o,s,a){let c=s.data.field(o),l=a.data.field(o);return c!==null&&l!==null?wa(c,l):ie(42886)})(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return ie(19790,{direction:t.dir})}}var vi=class{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){let n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(let[i,o]of r)if(this.equalsFn(i,e))return o}}has(e){return this.get(e)!==void 0}set(e,n){let r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let o=0;o<i.length;o++)if(this.equalsFn(i[o][0],e))return void(i[o]=[e,n]);i.push([e,n]),this.innerSize++}delete(e){let n=this.mapKeyFn(e),r=this.inner[n];if(r===void 0)return!1;for(let i=0;i<r.length;i++)if(this.equalsFn(r[i][0],e))return r.length===1?delete this.inner[n]:r.splice(i,1),this.innerSize--,!0;return!1}forEach(e){Ua(this.inner,(n,r)=>{for(let[i,o]of r)e(i,o)})}isEmpty(){return mW(this.inner)}size(){return this.innerSize}};var Mae=new pt(te.comparator);function Nr(){return Mae}var xW=new pt(te.comparator);function bg(...t){let e=xW;for(let n of t)e=e.insert(n.key,n);return e}function kW(t){let e=xW;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function mo(){return kg()}function FW(){return kg()}function kg(){return new vi(t=>t.toString(),(t,e)=>t.isEqual(e))}var Pae=new pt(te.comparator),xae=new nt(te.comparator);function Oe(...t){let e=xae;for(let n of t)e=e.add(n);return e}var kae=new nt(Ie);function F0(){return kae}function U0(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:jg(e)?"-0":e}}function UW(t){return{integerValue:""+t}}function Fae(t,e){return oW(e)?UW(e):U0(t,e)}var ph=class{constructor(){this._=void 0}};function Uae(t,e,n){return t instanceof Ul?(function(i,o){let s={fields:{[_W]:{stringValue:EW},[yW]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return o&&jv(o)&&(o=Hv(o)),o&&(s.fields[TW]=o),{mapValue:s}})(n,e):t instanceof Oa?BW(t,e):t instanceof La?GW(t,e):(function(i,o){let s=VW(i,o),a=o3(s)+o3(i.Ee);return PO(s)&&PO(i.Ee)?UW(a):U0(i.serializer,a)})(t,e)}function Vae(t,e,n){return t instanceof Oa?BW(t,e):t instanceof La?GW(t,e):n}function VW(t,e){return t instanceof Vl?(function(r){return PO(r)||(function(o){return!!o&&"doubleValue"in o})(r)})(e)?e:{integerValue:0}:null}var Ul=class extends ph{},Oa=class extends ph{constructor(e){super(),this.elements=e}};function BW(t,e){let n=jW(e);for(let r of t.elements)n.some(i=>_o(i,r))||n.push(r);return{arrayValue:{values:n}}}var La=class extends ph{constructor(e){super(),this.elements=e}};function GW(t,e){let n=jW(e);for(let r of t.elements)n=n.filter(i=>!_o(i,r));return{arrayValue:{values:n}}}var Vl=class extends ph{constructor(e,n){super(),this.serializer=e,this.Ee=n}};function o3(t){return Et(t.integerValue||t.doubleValue)}function jW(t){return Xg(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var zO=class{constructor(e,n){this.field=e,this.transform=n}};function Bae(t,e){return t.field.isEqual(e.field)&&(function(r,i){return r instanceof Oa&&i instanceof Oa||r instanceof La&&i instanceof La?nh(r.elements,i.elements,_o):r instanceof Vl&&i instanceof Vl?_o(r.Ee,i.Ee):r instanceof Ul&&i instanceof Ul})(t.transform,e.transform)}var qO=class{constructor(e,n){this.version=e,this.transformResults=n}},Sn=class t{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new t}static exists(e){return new t(void 0,e)}static updateTime(e){return new t(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}};function VI(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}var gh=class{};function HW(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new Bl(t.key,Sn.none()):new Ma(t.key,t.data,Sn.none());{let n=t.data,r=jn.empty(),i=new nt(tn.comparator);for(let o of e.fields)if(!i.has(o)){let s=n.field(o);s===null&&o.length>1&&(o=o.popLast(),s=n.field(o)),s===null?r.delete(o):r.set(o,s),i=i.add(o)}return new Si(t.key,r,new Rr(i.toArray()),Sn.none())}}function Gae(t,e,n){t instanceof Ma?(function(i,o,s){let a=i.value.clone(),c=a3(i.fieldTransforms,o,s.transformResults);a.setAll(c),o.convertToFoundDocument(s.version,a).setHasCommittedMutations()})(t,e,n):t instanceof Si?(function(i,o,s){if(!VI(i.precondition,o))return void o.convertToUnknownDocument(s.version);let a=a3(i.fieldTransforms,o,s.transformResults),c=o.data;c.setAll($W(i)),c.setAll(a),o.convertToFoundDocument(s.version,c).setHasCommittedMutations()})(t,e,n):(function(i,o,s){o.convertToNoDocument(s.version).setHasCommittedMutations()})(0,e,n)}function Fg(t,e,n,r){return t instanceof Ma?(function(o,s,a,c){if(!VI(o.precondition,s))return a;let l=o.value.clone(),d=c3(o.fieldTransforms,c,s);return l.setAll(d),s.convertToFoundDocument(s.version,l).setHasLocalMutations(),null})(t,e,n,r):t instanceof Si?(function(o,s,a,c){if(!VI(o.precondition,s))return a;let l=c3(o.fieldTransforms,c,s),d=s.data;return d.setAll($W(o)),d.setAll(l),s.convertToFoundDocument(s.version,d).setHasLocalMutations(),a===null?null:a.unionWith(o.fieldMask.fields).unionWith(o.fieldTransforms.map(h=>h.field))})(t,e,n,r):(function(o,s,a){return VI(o.precondition,s)?(s.convertToNoDocument(s.version).setHasLocalMutations(),null):a})(t,e,n)}function jae(t,e){let n=null;for(let r of t.fieldTransforms){let i=e.data.field(r.field),o=VW(r.transform,i||null);o!=null&&(n===null&&(n=jn.empty()),n.set(r.field,o))}return n||null}function s3(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!(function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&nh(r,i,(o,s)=>Bae(o,s))})(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}var Ma=class extends gh{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}},Si=class extends gh{constructor(e,n,r,i,o=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=o,this.type=1}getFieldMask(){return this.fieldMask}};function $W(t){let e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){let r=t.data.field(n);e.set(n,r)}}),e}function a3(t,e,n){let r=new Map;se(t.length===n.length,32656,{Ae:n.length,Re:t.length});for(let i=0;i<n.length;i++){let o=t[i],s=o.transform,a=e.data.field(o.field);r.set(o.field,Vae(s,a,n[i]))}return r}function c3(t,e,n){let r=new Map;for(let i of t){let o=i.transform,s=n.data.field(i.field);r.set(i.field,Uae(o,s,e))}return r}var Bl=class extends gh{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}},Qg=class extends gh{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}};var Jg=class{constructor(e,n,r,i){this.batchId=e,this.localWriteTime=n,this.baseMutations=r,this.mutations=i}applyToRemoteDocument(e,n){let r=n.mutationResults;for(let i=0;i<this.mutations.length;i++){let o=this.mutations[i];o.key.isEqual(e.key)&&Gae(o,e,r[i])}}applyToLocalView(e,n){for(let r of this.baseMutations)r.key.isEqual(e.key)&&(n=Fg(r,e,n,this.localWriteTime));for(let r of this.mutations)r.key.isEqual(e.key)&&(n=Fg(r,e,n,this.localWriteTime));return n}applyToLocalDocumentSet(e,n){let r=FW();return this.mutations.forEach(i=>{let o=e.get(i.key),s=o.overlayedDocument,a=this.applyToLocalView(s,o.mutatedFields);a=n.has(i.key)?null:a;let c=HW(s,a);c!==null&&r.set(i.key,c),s.isValidDocument()||s.convertToNoDocument(ue.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),Oe())}isEqual(e){return this.batchId===e.batchId&&nh(this.mutations,e.mutations,(n,r)=>s3(n,r))&&nh(this.baseMutations,e.baseMutations,(n,r)=>s3(n,r))}},KO=class t{constructor(e,n,r,i){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(e,n,r){se(e.mutations.length===r.length,58842,{Ve:e.mutations.length,me:r.length});let i=(function(){return Pae})(),o=e.mutations;for(let s=0;s<o.length;s++)i=i.insert(o[s].key,r[s].version);return new t(e,n,r,i)}};var Zg=class{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
|
|
162
|
+
largestBatchId: ${this.largestBatchId},
|
|
163
|
+
mutation: ${this.mutation.toString()}
|
|
164
|
+
}`}};var YO=class{constructor(e,n,r){this.alias=e,this.aggregateType=n,this.fieldPath=r}};var XO=class{constructor(e,n){this.count=e,this.unchangedNames=n}};var Ft,xe;function WW(t){switch(t){case x.OK:return ie(64938);case x.CANCELLED:case x.UNKNOWN:case x.DEADLINE_EXCEEDED:case x.RESOURCE_EXHAUSTED:case x.INTERNAL:case x.UNAVAILABLE:case x.UNAUTHENTICATED:return!1;case x.INVALID_ARGUMENT:case x.NOT_FOUND:case x.ALREADY_EXISTS:case x.PERMISSION_DENIED:case x.FAILED_PRECONDITION:case x.ABORTED:case x.OUT_OF_RANGE:case x.UNIMPLEMENTED:case x.DATA_LOSS:return!0;default:return ie(15467,{code:t})}}function zW(t){if(t===void 0)return wt("GRPC error has no .code"),x.UNKNOWN;switch(t){case Ft.OK:return x.OK;case Ft.CANCELLED:return x.CANCELLED;case Ft.UNKNOWN:return x.UNKNOWN;case Ft.DEADLINE_EXCEEDED:return x.DEADLINE_EXCEEDED;case Ft.RESOURCE_EXHAUSTED:return x.RESOURCE_EXHAUSTED;case Ft.INTERNAL:return x.INTERNAL;case Ft.UNAVAILABLE:return x.UNAVAILABLE;case Ft.UNAUTHENTICATED:return x.UNAUTHENTICATED;case Ft.INVALID_ARGUMENT:return x.INVALID_ARGUMENT;case Ft.NOT_FOUND:return x.NOT_FOUND;case Ft.ALREADY_EXISTS:return x.ALREADY_EXISTS;case Ft.PERMISSION_DENIED:return x.PERMISSION_DENIED;case Ft.FAILED_PRECONDITION:return x.FAILED_PRECONDITION;case Ft.ABORTED:return x.ABORTED;case Ft.OUT_OF_RANGE:return x.OUT_OF_RANGE;case Ft.UNIMPLEMENTED:return x.UNIMPLEMENTED;case Ft.DATA_LOSS:return x.DATA_LOSS;default:return ie(39323,{code:t})}}(xe=Ft||(Ft={}))[xe.OK=0]="OK",xe[xe.CANCELLED=1]="CANCELLED",xe[xe.UNKNOWN=2]="UNKNOWN",xe[xe.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",xe[xe.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",xe[xe.NOT_FOUND=5]="NOT_FOUND",xe[xe.ALREADY_EXISTS=6]="ALREADY_EXISTS",xe[xe.PERMISSION_DENIED=7]="PERMISSION_DENIED",xe[xe.UNAUTHENTICATED=16]="UNAUTHENTICATED",xe[xe.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",xe[xe.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",xe[xe.ABORTED=10]="ABORTED",xe[xe.OUT_OF_RANGE=11]="OUT_OF_RANGE",xe[xe.UNIMPLEMENTED=12]="UNIMPLEMENTED",xe[xe.INTERNAL=13]="INTERNAL",xe[xe.UNAVAILABLE=14]="UNAVAILABLE",xe[xe.DATA_LOSS=15]="DATA_LOSS";var l3=null;var Hae=new is([4294967295,4294967295],0);function u3(t){let e=J3().encode(t),n=new iO;return n.update(e),new Uint8Array(n.digest())}function d3(t){let e=new DataView(t.buffer),n=e.getUint32(0,!0),r=e.getUint32(4,!0),i=e.getUint32(8,!0),o=e.getUint32(12,!0);return[new is([n,r],0),new is([i,o],0)]}var QO=class t{constructor(e,n,r){if(this.bitmap=e,this.padding=n,this.hashCount=r,n<0||n>=8)throw new wl(`Invalid padding: ${n}`);if(r<0)throw new wl(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new wl(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new wl(`Invalid padding when bitmap length is 0: ${n}`);this.fe=8*e.length-n,this.ge=is.fromNumber(this.fe)}pe(e,n,r){let i=e.add(n.multiply(is.fromNumber(r)));return i.compare(Hae)===1&&(i=new is([i.getBits(0),i.getBits(1)],0)),i.modulo(this.ge).toNumber()}ye(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.fe===0)return!1;let n=u3(e),[r,i]=d3(n);for(let o=0;o<this.hashCount;o++){let s=this.pe(r,i,o);if(!this.ye(s))return!1}return!0}static create(e,n,r){let i=e%8==0?0:8-e%8,o=new Uint8Array(Math.ceil(e/8)),s=new t(o,i,n);return r.forEach(a=>s.insert(a)),s}insert(e){if(this.fe===0)return;let n=u3(e),[r,i]=d3(n);for(let o=0;o<this.hashCount;o++){let s=this.pe(r,i,o);this.we(s)}}we(e){let n=Math.floor(e/8),r=e%8;this.bitmap[n]|=1<<r}},wl=class extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}};var em=class t{constructor(e,n,r,i,o){this.snapshotVersion=e,this.targetChanges=n,this.targetMismatches=r,this.documentUpdates=i,this.resolvedLimboDocuments=o}static createSynthesizedRemoteEventForCurrentChange(e,n,r){let i=new Map;return i.set(e,tm.createSynthesizedTargetChangeForCurrentChange(e,n,r)),new t(ue.min(),i,new pt(Ie),Nr(),Oe())}},tm=class t{constructor(e,n,r,i,o){this.resumeToken=e,this.current=n,this.addedDocuments=r,this.modifiedDocuments=i,this.removedDocuments=o}static createSynthesizedTargetChangeForCurrentChange(e,n,r){return new t(r,n,Oe(),Oe(),Oe())}};var eh=class{constructor(e,n,r,i){this.Se=e,this.removedTargetIds=n,this.key=r,this.be=i}},rv=class{constructor(e,n){this.targetId=e,this.De=n}},iv=class{constructor(e,n,r=Gt.EMPTY_BYTE_STRING,i=null){this.state=e,this.targetIds=n,this.resumeToken=r,this.cause=i}},ov=class{constructor(){this.ve=0,this.Ce=h3(),this.Fe=Gt.EMPTY_BYTE_STRING,this.Me=!1,this.xe=!0}get current(){return this.Me}get resumeToken(){return this.Fe}get Oe(){return this.ve!==0}get Ne(){return this.xe}Be(e){e.approximateByteSize()>0&&(this.xe=!0,this.Fe=e)}Le(){let e=Oe(),n=Oe(),r=Oe();return this.Ce.forEach((i,o)=>{switch(o){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:ie(38017,{changeType:o})}}),new tm(this.Fe,this.Me,e,n,r)}ke(){this.xe=!1,this.Ce=h3()}qe(e,n){this.xe=!0,this.Ce=this.Ce.insert(e,n)}Qe(e){this.xe=!0,this.Ce=this.Ce.remove(e)}$e(){this.ve+=1}Ue(){this.ve-=1,se(this.ve>=0,3241,{ve:this.ve})}Ke(){this.xe=!0,this.Me=!0}},JO=class{constructor(e){this.We=e,this.Ge=new Map,this.ze=Nr(),this.je=bI(),this.Je=bI(),this.He=new pt(Ie)}Ye(e){for(let n of e.Se)e.be&&e.be.isFoundDocument()?this.Ze(n,e.be):this.Xe(n,e.key,e.be);for(let n of e.removedTargetIds)this.Xe(n,e.key,e.be)}et(e){this.forEachTarget(e,n=>{let r=this.tt(n);switch(e.state){case 0:this.nt(n)&&r.Be(e.resumeToken);break;case 1:r.Ue(),r.Oe||r.ke(),r.Be(e.resumeToken);break;case 2:r.Ue(),r.Oe||this.removeTarget(n);break;case 3:this.nt(n)&&(r.Ke(),r.Be(e.resumeToken));break;case 4:this.nt(n)&&(this.rt(n),r.Be(e.resumeToken));break;default:ie(56790,{state:e.state})}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.Ge.forEach((r,i)=>{this.nt(i)&&n(i)})}it(e){let n=e.targetId,r=e.De.count,i=this.st(n);if(i){let o=i.target;if(ev(o))if(r===0){let s=new te(o.path);this.Xe(n,s,nn.newNoDocument(s,ue.min()))}else se(r===1,20013,{expectedCount:r});else{let s=this.ot(n);if(s!==r){let a=this._t(e),c=a?this.ut(a,e,s):1;if(c!==0){this.rt(n);let l=c===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.He=this.He.insert(n,l)}l3?.ct((function(d,h,f,g,E){var I,S,R,U,H,Q;let ae={localCacheCount:d,existenceFilterCount:h.count,databaseId:f.database,projectId:f.projectId},ne=h.unchangedNames;return ne&&(ae.bloomFilter={applied:E===0,hashCount:(I=ne?.hashCount)!==null&&I!==void 0?I:0,bitmapLength:(U=(R=(S=ne?.bits)===null||S===void 0?void 0:S.bitmap)===null||R===void 0?void 0:R.length)!==null&&U!==void 0?U:0,padding:(Q=(H=ne?.bits)===null||H===void 0?void 0:H.padding)!==null&&Q!==void 0?Q:0,mightContain:A=>{var v;return(v=g?.mightContain(A))!==null&&v!==void 0&&v}}),ae})(s,e.De,this.We.lt(),a,c))}}}}_t(e){let n=e.De.unchangedNames;if(!n||!n.bits)return null;let{bits:{bitmap:r="",padding:i=0},hashCount:o=0}=n,s,a;try{s=ds(r).toUint8Array()}catch(c){if(c instanceof QI)return ls("Decoding the base64 bloom filter in existence filter failed ("+c.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw c}try{a=new QO(s,i,o)}catch(c){return ls(c instanceof wl?"BloomFilter error: ":"Applying bloom filter failed: ",c),null}return a.fe===0?null:a}ut(e,n,r){return n.De.count===r-this.ht(e,n.targetId)?0:2}ht(e,n){let r=this.We.getRemoteKeysForTarget(n),i=0;return r.forEach(o=>{let s=this.We.lt(),a=`projects/${s.projectId}/databases/${s.database}/documents/${o.path.canonicalString()}`;e.mightContain(a)||(this.Xe(n,o,null),i++)}),i}Pt(e){let n=new Map;this.Ge.forEach((o,s)=>{let a=this.st(s);if(a){if(o.current&&ev(a.target)){let c=new te(a.target.path);this.Tt(c).has(s)||this.It(s,c)||this.Xe(s,c,nn.newNoDocument(c,e))}o.Ne&&(n.set(s,o.Le()),o.ke())}});let r=Oe();this.Je.forEach((o,s)=>{let a=!0;s.forEachWhile(c=>{let l=this.st(c);return!l||l.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(o))}),this.ze.forEach((o,s)=>s.setReadTime(e));let i=new em(e,n,this.He,this.ze,r);return this.ze=Nr(),this.je=bI(),this.Je=bI(),this.He=new pt(Ie),i}Ze(e,n){if(!this.nt(e))return;let r=this.It(e,n.key)?2:0;this.tt(e).qe(n.key,r),this.ze=this.ze.insert(n.key,n),this.je=this.je.insert(n.key,this.Tt(n.key).add(e)),this.Je=this.Je.insert(n.key,this.dt(n.key).add(e))}Xe(e,n,r){if(!this.nt(e))return;let i=this.tt(e);this.It(e,n)?i.qe(n,1):i.Qe(n),this.Je=this.Je.insert(n,this.dt(n).delete(e)),this.Je=this.Je.insert(n,this.dt(n).add(e)),r&&(this.ze=this.ze.insert(n,r))}removeTarget(e){this.Ge.delete(e)}ot(e){let n=this.tt(e).Le();return this.We.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}$e(e){this.tt(e).$e()}tt(e){let n=this.Ge.get(e);return n||(n=new ov,this.Ge.set(e,n)),n}dt(e){let n=this.Je.get(e);return n||(n=new nt(Ie),this.Je=this.Je.insert(e,n)),n}Tt(e){let n=this.je.get(e);return n||(n=new nt(Ie),this.je=this.je.insert(e,n)),n}nt(e){let n=this.st(e)!==null;return n||z("WatchChangeAggregator","Detected inactive target",e),n}st(e){let n=this.Ge.get(e);return n&&n.Oe?null:this.We.Et(e)}rt(e){this.Ge.set(e,new ov),this.We.getRemoteKeysForTarget(e).forEach(n=>{this.Xe(e,n,null)})}It(e,n){return this.We.getRemoteKeysForTarget(e).has(n)}};function bI(){return new pt(te.comparator)}function h3(){return new pt(te.comparator)}var $ae={asc:"ASCENDING",desc:"DESCENDING"},Wae={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},zae={and:"AND",or:"OR"},ZO=class{constructor(e,n){this.databaseId=e,this.useProto3Json=n}};function eL(t,e){return t.useProto3Json||gm(e)?e:{value:e}}function mh(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function qW(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function qae(t,e){return mh(t,e.toTimestamp())}function En(t){return se(!!t,49232),ue.fromTimestamp((function(n){let r=us(n);return new _t(r.seconds,r.nanos)})(t))}function V0(t,e){return tL(t,e).canonicalString()}function tL(t,e){let n=(function(i){return new ke(["projects",i.projectId,"databases",i.database])})(t).child("documents");return e===void 0?n:n.child(e)}function KW(t){let e=ke.fromString(t);return se(n6(e),10190,{key:e.toString()}),e}function nm(t,e){return V0(t.databaseId,e.path)}function as(t,e){let n=KW(e);if(n.get(1)!==t.databaseId.projectId)throw new W(x.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new W(x.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new te(QW(n))}function YW(t,e){return V0(t.databaseId,e)}function XW(t){let e=KW(t);return e.length===4?ke.emptyPath():QW(e)}function nL(t){return new ke(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function QW(t){return se(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function f3(t,e,n){return{name:nm(t,e),fields:n.value.mapValue.fields}}function Kae(t,e,n){let r=as(t,e.name),i=En(e.updateTime),o=e.createTime?En(e.createTime):ue.min(),s=new jn({mapValue:{fields:e.fields}}),a=nn.newFoundDocument(r,i,o,s);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Yae(t,e){return"found"in e?(function(r,i){se(!!i.found,43571),i.found.name,i.found.updateTime;let o=as(r,i.found.name),s=En(i.found.updateTime),a=i.found.createTime?En(i.found.createTime):ue.min(),c=new jn({mapValue:{fields:i.found.fields}});return nn.newFoundDocument(o,s,a,c)})(t,e):"missing"in e?(function(r,i){se(!!i.missing,3894),se(!!i.readTime,22933);let o=as(r,i.missing),s=En(i.readTime);return nn.newNoDocument(o,s)})(t,e):ie(7234,{result:e})}function Xae(t,e){let n;if("targetChange"in e){e.targetChange;let r=(function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:ie(39313,{state:l})})(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=(function(l,d){return l.useProto3Json?(se(d===void 0||typeof d=="string",58123),Gt.fromBase64String(d||"")):(se(d===void 0||d instanceof Buffer||d instanceof Uint8Array,16193),Gt.fromUint8Array(d||new Uint8Array))})(t,e.targetChange.resumeToken),s=e.targetChange.cause,a=s&&(function(l){let d=l.code===void 0?x.UNKNOWN:zW(l.code);return new W(d,l.message||"")})(s);n=new iv(r,i,o,a||null)}else if("documentChange"in e){e.documentChange;let r=e.documentChange;r.document,r.document.name,r.document.updateTime;let i=as(t,r.document.name),o=En(r.document.updateTime),s=r.document.createTime?En(r.document.createTime):ue.min(),a=new jn({mapValue:{fields:r.document.fields}}),c=nn.newFoundDocument(i,o,s,a),l=r.targetIds||[],d=r.removedTargetIds||[];n=new eh(l,d,c.key,c)}else if("documentDelete"in e){e.documentDelete;let r=e.documentDelete;r.document;let i=as(t,r.document),o=r.readTime?En(r.readTime):ue.min(),s=nn.newNoDocument(i,o),a=r.removedTargetIds||[];n=new eh([],a,s.key,s)}else if("documentRemove"in e){e.documentRemove;let r=e.documentRemove;r.document;let i=as(t,r.document),o=r.removedTargetIds||[];n=new eh([],o,i,null)}else{if(!("filter"in e))return ie(11601,{At:e});{e.filter;let r=e.filter;r.targetId;let{count:i=0,unchangedNames:o}=r,s=new XO(i,o),a=r.targetId;n=new rv(a,s)}}return n}function rm(t,e){let n;if(e instanceof Ma)n={update:f3(t,e.key,e.value)};else if(e instanceof Bl)n={delete:nm(t,e.key)};else if(e instanceof Si)n={update:f3(t,e.key,e.data),updateMask:rce(e.fieldMask)};else{if(!(e instanceof Qg))return ie(16599,{Rt:e.type});n={verify:nm(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>(function(o,s){let a=s.transform;if(a instanceof Ul)return{fieldPath:s.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof Oa)return{fieldPath:s.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof La)return{fieldPath:s.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof Vl)return{fieldPath:s.field.canonicalString(),increment:a.Ee};throw ie(20930,{transform:s.transform})})(0,r))),e.precondition.isNone||(n.currentDocument=(function(i,o){return o.updateTime!==void 0?{updateTime:qae(i,o.updateTime)}:o.exists!==void 0?{exists:o.exists}:ie(27497)})(t,e.precondition)),n}function rL(t,e){let n=e.currentDocument?(function(o){return o.updateTime!==void 0?Sn.updateTime(En(o.updateTime)):o.exists!==void 0?Sn.exists(o.exists):Sn.none()})(e.currentDocument):Sn.none(),r=e.updateTransforms?e.updateTransforms.map(i=>(function(s,a){let c=null;if("setToServerValue"in a)se(a.setToServerValue==="REQUEST_TIME",16630,{proto:a}),c=new Ul;else if("appendMissingElements"in a){let d=a.appendMissingElements.values||[];c=new Oa(d)}else if("removeAllFromArray"in a){let d=a.removeAllFromArray.values||[];c=new La(d)}else"increment"in a?c=new Vl(s,a.increment):ie(16584,{proto:a});let l=tn.fromServerFormat(a.fieldPath);return new zO(l,c)})(t,i)):[];if(e.update){e.update.name;let i=as(t,e.update.name),o=new jn({mapValue:{fields:e.update.fields}});if(e.updateMask){let s=(function(c){let l=c.fieldPaths||[];return new Rr(l.map(d=>tn.fromServerFormat(d)))})(e.updateMask);return new Si(i,o,s,n,r)}return new Ma(i,o,n,r)}if(e.delete){let i=as(t,e.delete);return new Bl(i,n)}if(e.verify){let i=as(t,e.verify);return new Qg(i,n)}return ie(1463,{proto:e})}function Qae(t,e){return t&&t.length>0?(se(e!==void 0,14353),t.map(n=>(function(i,o){let s=i.updateTime?En(i.updateTime):En(o);return s.isEqual(ue.min())&&(s=En(o)),new qO(s,i.transformResults||[])})(n,e))):[]}function JW(t,e){return{documents:[YW(t,e.path)]}}function B0(t,e){let n={structuredQuery:{}},r=e.path,i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=YW(t,i);let o=(function(l){if(l.length!==0)return t6(Je.create(l,"and"))})(e.filters);o&&(n.structuredQuery.where=o);let s=(function(l){if(l.length!==0)return l.map(d=>(function(f){return{field:ya(f.field),direction:ece(f.dir)}})(d))})(e.orderBy);s&&(n.structuredQuery.orderBy=s);let a=eL(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=(function(l){return{before:l.inclusive,values:l.position}})(e.startAt)),e.endAt&&(n.structuredQuery.endAt=(function(l){return{before:!l.inclusive,values:l.position}})(e.endAt)),{Vt:n,parent:i}}function Jae(t,e,n,r){let{Vt:i,parent:o}=B0(t,e),s={},a=[],c=0;return n.forEach(l=>{let d=r?l.alias:"aggregate_"+c++;s[d]=l.alias,l.aggregateType==="count"?a.push({alias:d,count:{}}):l.aggregateType==="avg"?a.push({alias:d,avg:{field:ya(l.fieldPath)}}):l.aggregateType==="sum"&&a.push({alias:d,sum:{field:ya(l.fieldPath)}})}),{request:{structuredAggregationQuery:{aggregations:a,structuredQuery:i.structuredQuery},parent:i.parent},ft:s,parent:o}}function ZW(t){let e=XW(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){se(r===1,65062);let d=n.from[0];d.allDescendants?i=d.collectionId:e=e.child(d.collectionId)}let o=[];n.where&&(o=(function(h){let f=e6(h);return f instanceof Je&&x0(f)?f.getFilters():[f]})(n.where));let s=[];n.orderBy&&(s=(function(h){return h.map(f=>(function(E){return new kl(Yd(E.field),(function(S){switch(S){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(E.direction))})(f))})(n.orderBy));let a=null;n.limit&&(a=(function(h){let f;return f=typeof h=="object"?h.value:h,gm(f)?null:f})(n.limit));let c=null;n.startAt&&(c=(function(h){let f=!!h.before,g=h.values||[];return new To(g,f)})(n.startAt));let l=null;return n.endAt&&(l=(function(h){let f=!h.before,g=h.values||[];return new To(g,f)})(n.endAt)),wW(e,i,s,o,a,"F",c,l)}function Zae(t,e){let n=(function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ie(28987,{purpose:i})}})(e.purpose);return n==null?null:{"goog-listen-tags":n}}function e6(t){return t.unaryFilter!==void 0?(function(n){switch(n.unaryFilter.op){case"IS_NAN":let r=Yd(n.unaryFilter.field);return Pe.create(r,"==",{doubleValue:NaN});case"IS_NULL":let i=Yd(n.unaryFilter.field);return Pe.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let o=Yd(n.unaryFilter.field);return Pe.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let s=Yd(n.unaryFilter.field);return Pe.create(s,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return ie(61313);default:return ie(60726)}})(t):t.fieldFilter!==void 0?(function(n){return Pe.create(Yd(n.fieldFilter.field),(function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return ie(58110);default:return ie(50506)}})(n.fieldFilter.op),n.fieldFilter.value)})(t):t.compositeFilter!==void 0?(function(n){return Je.create(n.compositeFilter.filters.map(r=>e6(r)),(function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return ie(1026)}})(n.compositeFilter.op))})(t):ie(30097,{filter:t})}function ece(t){return $ae[t]}function tce(t){return Wae[t]}function nce(t){return zae[t]}function ya(t){return{fieldPath:t.canonicalString()}}function Yd(t){return tn.fromServerFormat(t.fieldPath)}function t6(t){return t instanceof Pe?(function(n){if(n.op==="=="){if(Q$(n.value))return{unaryFilter:{field:ya(n.field),op:"IS_NAN"}};if(X$(n.value))return{unaryFilter:{field:ya(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(Q$(n.value))return{unaryFilter:{field:ya(n.field),op:"IS_NOT_NAN"}};if(X$(n.value))return{unaryFilter:{field:ya(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ya(n.field),op:tce(n.op),value:n.value}}})(t):t instanceof Je?(function(n){let r=n.getFilters().map(i=>t6(i));return r.length===1?r[0]:{compositeFilter:{op:nce(n.op),filters:r}}})(t):ie(54877,{filter:t})}function rce(t){let e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function n6(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}var Eh=class t{constructor(e,n,r,i,o=ue.min(),s=ue.min(),a=Gt.EMPTY_BYTE_STRING,c=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=o,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=a,this.expectedCount=c}withSequenceNumber(e){return new t(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}};var sv=class{constructor(e){this.gt=e}};function ice(t,e){let n;if(e.document)n=Kae(t.gt,e.document,!!e.hasCommittedMutations);else if(e.noDocument){let r=te.fromSegments(e.noDocument.path),i=jl(e.noDocument.readTime);n=nn.newNoDocument(r,i),e.hasCommittedMutations&&n.setHasCommittedMutations()}else{if(!e.unknownDocument)return ie(56709);{let r=te.fromSegments(e.unknownDocument.path),i=jl(e.unknownDocument.version);n=nn.newUnknownDocument(r,i)}}return e.readTime&&n.setReadTime((function(i){let o=new _t(i[0],i[1]);return ue.fromTimestamp(o)})(e.readTime)),n}function p3(t,e){let n=e.key,r={prefixPath:n.getCollectionPath().popLast().toArray(),collectionGroup:n.collectionGroup,documentId:n.path.lastSegment(),readTime:av(e.readTime),hasCommittedMutations:e.hasCommittedMutations};if(e.isFoundDocument())r.document=(function(o,s){return{name:nm(o,s.key),fields:s.data.value.mapValue.fields,updateTime:mh(o,s.version.toTimestamp()),createTime:mh(o,s.createTime.toTimestamp())}})(t.gt,e);else if(e.isNoDocument())r.noDocument={path:n.path.toArray(),readTime:Gl(e.version)};else{if(!e.isUnknownDocument())return ie(57904,{document:e});r.unknownDocument={path:n.path.toArray(),version:Gl(e.version)}}return r}function av(t){let e=t.toTimestamp();return[e.seconds,e.nanoseconds]}function Gl(t){let e=t.toTimestamp();return{seconds:e.seconds,nanoseconds:e.nanoseconds}}function jl(t){let e=new _t(t.seconds,t.nanoseconds);return ue.fromTimestamp(e)}function Dl(t,e){let n=(e.baseMutations||[]).map(o=>rL(t.gt,o));for(let o=0;o<e.mutations.length-1;++o){let s=e.mutations[o];if(o+1<e.mutations.length&&e.mutations[o+1].transform!==void 0){let a=e.mutations[o+1];s.updateTransforms=a.transform.fieldTransforms,e.mutations.splice(o+1,1),++o}}let r=e.mutations.map(o=>rL(t.gt,o)),i=_t.fromMillis(e.localWriteTimeMs);return new Jg(e.batchId,i,n,r)}function wg(t){let e=jl(t.readTime),n=t.lastLimboFreeSnapshotVersion!==void 0?jl(t.lastLimboFreeSnapshotVersion):ue.min(),r;return r=(function(o){return o.documents!==void 0})(t.query)?(function(o){let s=o.documents.length;return se(s===1,1966,{count:s}),br(_m(XW(o.documents[0])))})(t.query):(function(o){return br(ZW(o))})(t.query),new Eh(r,t.targetId,"TargetPurposeListen",t.lastListenSequenceNumber,e,n,Gt.fromBase64String(t.resumeToken))}function r6(t,e){let n=Gl(e.snapshotVersion),r=Gl(e.lastLimboFreeSnapshotVersion),i;i=ev(e.target)?JW(t.gt,e.target):B0(t.gt,e.target).Vt;let o=e.resumeToken.toBase64();return{targetId:e.targetId,canonicalId:Fl(e.target),readTime:n,resumeToken:o,lastListenSequenceNumber:e.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:i}}function i6(t){let e=ZW({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?nv(e,e.limit,"L"):e}function uO(t,e){return new Zg(e.largestBatchId,rL(t.gt,e.overlayMutation))}function g3(t,e){let n=e.path.lastSegment();return[t,Hn(e.path.popLast()),n]}function m3(t,e,n,r){return{indexId:t,uid:e,sequenceNumber:n,readTime:Gl(r.readTime),documentKey:Hn(r.documentKey.path),largestBatchId:r.largestBatchId}}var iL=class{getBundleMetadata(e,n){return E3(e).get(n).next(r=>{if(r)return(function(o){return{id:o.bundleId,createTime:jl(o.createTime),version:o.version}})(r)})}saveBundleMetadata(e,n){return E3(e).put((function(i){return{bundleId:i.id,createTime:Gl(En(i.createTime)),version:i.version}})(n))}getNamedQuery(e,n){return _3(e).get(n).next(r=>{if(r)return(function(o){return{name:o.name,query:i6(o.bundledQuery),readTime:jl(o.readTime)}})(r)})}saveNamedQuery(e,n){return _3(e).put((function(i){return{name:i.name,readTime:Gl(En(i.readTime)),bundledQuery:i.bundledQuery}})(n))}};function E3(t){return on(t,Vv)}function _3(t){return on(t,Bv)}var cv=class t{constructor(e,n){this.serializer=e,this.userId=n}static yt(e,n){let r=n.uid||"";return new t(e,r)}getOverlay(e,n){return Cg(e).get(g3(this.userId,n)).next(r=>r?uO(this.serializer,r):null)}getOverlays(e,n){let r=mo();return P.forEach(n,i=>this.getOverlay(e,i).next(o=>{o!==null&&r.set(i,o)})).next(()=>r)}saveOverlays(e,n,r){let i=[];return r.forEach((o,s)=>{let a=new Zg(n,s);i.push(this.wt(e,a))}),P.waitFor(i)}removeOverlaysForBatchId(e,n,r){let i=new Set;n.forEach(s=>i.add(Hn(s.getCollectionPath())));let o=[];return i.forEach(s=>{let a=IDBKeyRange.bound([this.userId,s,r],[this.userId,s,r+1],!1,!0);o.push(Cg(e).Y(OO,a))}),P.waitFor(o)}getOverlaysForCollection(e,n,r){let i=mo(),o=Hn(n),s=IDBKeyRange.bound([this.userId,o,r],[this.userId,o,Number.POSITIVE_INFINITY],!0);return Cg(e).j(OO,s).next(a=>{for(let c of a){let l=uO(this.serializer,c);i.set(l.getKey(),l)}return i})}getOverlaysForCollectionGroup(e,n,r,i){let o=mo(),s,a=IDBKeyRange.bound([this.userId,n,r],[this.userId,n,Number.POSITIVE_INFINITY],!0);return Cg(e).X({index:dW,range:a},(c,l,d)=>{let h=uO(this.serializer,l);o.size()<i||h.largestBatchId===s?(o.set(h.getKey(),h),s=h.largestBatchId):d.done()}).next(()=>o)}wt(e,n){return Cg(e).put((function(i,o,s){let[a,c,l]=g3(o,s.mutation.key);return{userId:o,collectionPath:c,documentId:l,collectionGroup:s.mutation.key.getCollectionGroup(),largestBatchId:s.largestBatchId,overlayMutation:rm(i.gt,s.mutation)}})(this.serializer,this.userId,n))}};function Cg(t){return on(t,Gv)}var oL=class{St(e){return on(e,O0)}getSessionToken(e){return this.St(e).get("sessionToken").next(n=>{let r=n?.value;return r?Gt.fromUint8Array(r):Gt.EMPTY_BYTE_STRING})}setSessionToken(e,n){return this.St(e).put({name:"sessionToken",value:n.toUint8Array()})}};var ss=class{constructor(){}bt(e,n){this.Dt(e,n),n.vt()}Dt(e,n){if("nullValue"in e)this.Ct(n,5);else if("booleanValue"in e)this.Ct(n,10),n.Ft(e.booleanValue?1:0);else if("integerValue"in e)this.Ct(n,15),n.Ft(Et(e.integerValue));else if("doubleValue"in e){let r=Et(e.doubleValue);isNaN(r)?this.Ct(n,13):(this.Ct(n,15),jg(r)?n.Ft(0):n.Ft(r))}else if("timestampValue"in e){let r=e.timestampValue;this.Ct(n,20),typeof r=="string"&&(r=us(r)),n.Mt(`${r.seconds||""}`),n.Ft(r.nanos||0)}else if("stringValue"in e)this.xt(e.stringValue,n),this.Ot(n);else if("bytesValue"in e)this.Ct(n,30),n.Nt(ds(e.bytesValue)),this.Ot(n);else if("referenceValue"in e)this.Bt(e.referenceValue,n);else if("geoPointValue"in e){let r=e.geoPointValue;this.Ct(n,45),n.Ft(r.latitude||0),n.Ft(r.longitude||0)}else"mapValue"in e?vW(e)?this.Ct(n,Number.MAX_SAFE_INTEGER):$v(e)?this.Lt(e.mapValue,n):(this.kt(e.mapValue,n),this.Ot(n)):"arrayValue"in e?(this.qt(e.arrayValue,n),this.Ot(n)):ie(19022,{Qt:e})}xt(e,n){this.Ct(n,25),this.$t(e,n)}$t(e,n){n.Mt(e)}kt(e,n){let r=e.fields||{};this.Ct(n,55);for(let i of Object.keys(r))this.xt(i,n),this.Dt(r[i],n)}Lt(e,n){var r,i;let o=e.fields||{};this.Ct(n,53);let s=dh,a=((i=(r=o[s].arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.length)||0;this.Ct(n,15),n.Ft(Et(a)),this.xt(s,n),this.Dt(o[s],n)}qt(e,n){let r=e.values||[];this.Ct(n,50);for(let i of r)this.Dt(i,n)}Bt(e,n){this.Ct(n,37),te.fromName(e).path.forEach(r=>{this.Ct(n,60),this.$t(r,n)})}Ct(e,n){e.Ft(n)}Ot(e){e.Ft(2)}};ss.Ut=new ss;var Hd=255;function oce(t){if(t===0)return 8;let e=0;return t>>4||(e+=4,t<<=4),t>>6||(e+=2,t<<=2),t>>7||(e+=1),e}function T3(t){let e=64-(function(r){let i=0;for(let o=0;o<8;++o){let s=oce(255&r[o]);if(i+=s,s!==8)break}return i})(t);return Math.ceil(e/8)}var sL=class{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Kt(e){let n=e[Symbol.iterator](),r=n.next();for(;!r.done;)this.Wt(r.value),r=n.next();this.Gt()}zt(e){let n=e[Symbol.iterator](),r=n.next();for(;!r.done;)this.jt(r.value),r=n.next();this.Jt()}Ht(e){for(let n of e){let r=n.charCodeAt(0);if(r<128)this.Wt(r);else if(r<2048)this.Wt(960|r>>>6),this.Wt(128|63&r);else if(n<"\uD800"||"\uDBFF"<n)this.Wt(480|r>>>12),this.Wt(128|63&r>>>6),this.Wt(128|63&r);else{let i=n.codePointAt(0);this.Wt(240|i>>>18),this.Wt(128|63&i>>>12),this.Wt(128|63&i>>>6),this.Wt(128|63&i)}}this.Gt()}Yt(e){for(let n of e){let r=n.charCodeAt(0);if(r<128)this.jt(r);else if(r<2048)this.jt(960|r>>>6),this.jt(128|63&r);else if(n<"\uD800"||"\uDBFF"<n)this.jt(480|r>>>12),this.jt(128|63&r>>>6),this.jt(128|63&r);else{let i=n.codePointAt(0);this.jt(240|i>>>18),this.jt(128|63&i>>>12),this.jt(128|63&i>>>6),this.jt(128|63&i)}}this.Jt()}Zt(e){let n=this.Xt(e),r=T3(n);this.en(1+r),this.buffer[this.position++]=255&r;for(let i=n.length-r;i<n.length;++i)this.buffer[this.position++]=255&n[i]}tn(e){let n=this.Xt(e),r=T3(n);this.en(1+r),this.buffer[this.position++]=~(255&r);for(let i=n.length-r;i<n.length;++i)this.buffer[this.position++]=~(255&n[i])}nn(){this.rn(Hd),this.rn(255)}sn(){this._n(Hd),this._n(255)}reset(){this.position=0}seed(e){this.en(e.length),this.buffer.set(e,this.position),this.position+=e.length}an(){return this.buffer.slice(0,this.position)}Xt(e){let n=(function(o){let s=new DataView(new ArrayBuffer(8));return s.setFloat64(0,o,!1),new Uint8Array(s.buffer)})(e),r=!!(128&n[0]);n[0]^=r?255:128;for(let i=1;i<n.length;++i)n[i]^=r?255:0;return n}Wt(e){let n=255&e;n===0?(this.rn(0),this.rn(255)):n===Hd?(this.rn(Hd),this.rn(0)):this.rn(n)}jt(e){let n=255&e;n===0?(this._n(0),this._n(255)):n===Hd?(this._n(Hd),this._n(0)):this._n(e)}Gt(){this.rn(0),this.rn(1)}Jt(){this._n(0),this._n(1)}rn(e){this.en(1),this.buffer[this.position++]=e}_n(e){this.en(1),this.buffer[this.position++]=~e}en(e){let n=e+this.position;if(n<=this.buffer.length)return;let r=2*this.buffer.length;r<n&&(r=n);let i=new Uint8Array(r);i.set(this.buffer),this.buffer=i}},aL=class{constructor(e){this.un=e}Nt(e){this.un.Kt(e)}Mt(e){this.un.Ht(e)}Ft(e){this.un.Zt(e)}vt(){this.un.nn()}},cL=class{constructor(e){this.un=e}Nt(e){this.un.zt(e)}Mt(e){this.un.Yt(e)}Ft(e){this.un.tn(e)}vt(){this.un.sn()}},Rl=class{constructor(){this.un=new sL,this.cn=new aL(this.un),this.ln=new cL(this.un)}seed(e){this.un.seed(e)}hn(e){return e===0?this.cn:this.ln}an(){return this.un.an()}reset(){this.un.reset()}};var Nl=class t{constructor(e,n,r,i){this.Pn=e,this.Tn=n,this.In=r,this.dn=i}En(){let e=this.dn.length,n=e===0||this.dn[e-1]===255?e+1:e,r=new Uint8Array(n);return r.set(this.dn,0),n!==e?r.set([0],this.dn.length):++r[r.length-1],new t(this.Pn,this.Tn,this.In,r)}An(e,n,r){return{indexId:this.Pn,uid:e,arrayValue:BI(this.In),directionalValue:BI(this.dn),orderedDocumentKey:BI(n),documentKey:r.path.toArray()}}Rn(e,n,r){let i=this.An(e,n,r);return[i.indexId,i.uid,i.arrayValue,i.directionalValue,i.orderedDocumentKey,i.documentKey]}};function Ea(t,e){let n=t.Pn-e.Pn;return n!==0?n:(n=y3(t.In,e.In),n!==0?n:(n=y3(t.dn,e.dn),n!==0?n:te.comparator(t.Tn,e.Tn)))}function y3(t,e){for(let n=0;n<t.length&&n<e.length;++n){let r=t[n]-e[n];if(r!==0)return r}return t.length-e.length}function BI(t){return nN()?(function(n){let r="";for(let i=0;i<n.length;i++)r+=String.fromCharCode(n[i]);return r})(t):t}function I3(t){return typeof t!="string"?t:(function(n){let r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r})(t)}var lv=class{constructor(e){this.Vn=new nt((n,r)=>tn.comparator(n.field,r.field)),this.collectionId=e.collectionGroup!=null?e.collectionGroup:e.path.lastSegment(),this.mn=e.orderBy,this.fn=[];for(let n of e.filters){let r=n;r.isInequality()?this.Vn=this.Vn.add(r):this.fn.push(r)}}get gn(){return this.Vn.size>1}pn(e){if(se(e.collectionGroup===this.collectionId,49279),this.gn)return!1;let n=AO(e);if(n!==void 0&&!this.yn(n))return!1;let r=Sl(e),i=new Set,o=0,s=0;for(;o<r.length&&this.yn(r[o]);++o)i=i.add(r[o].fieldPath.canonicalString());if(o===r.length)return!0;if(this.Vn.size>0){let a=this.Vn.getIterator().getNext();if(!i.has(a.field.canonicalString())){let c=r[o];if(!this.wn(a,c)||!this.Sn(this.mn[s++],c))return!1}++o}for(;o<r.length;++o){let a=r[o];if(s>=this.mn.length||!this.Sn(this.mn[s++],a))return!1}return!0}bn(){if(this.gn)return null;let e=new nt(tn.comparator),n=[];for(let r of this.fn)if(!r.field.isKeyField())if(r.op==="array-contains"||r.op==="array-contains-any")n.push(new Jd(r.field,2));else{if(e.has(r.field))continue;e=e.add(r.field),n.push(new Jd(r.field,0))}for(let r of this.mn)r.field.isKeyField()||e.has(r.field)||(e=e.add(r.field),n.push(new Jd(r.field,r.dir==="asc"?0:1)));return new ih(ih.UNKNOWN_ID,this.collectionId,n,Gg.empty())}yn(e){for(let n of this.fn)if(this.wn(n,e))return!0;return!1}wn(e,n){if(e===void 0||!e.field.isEqual(n.fieldPath))return!1;let r=e.op==="array-contains"||e.op==="array-contains-any";return n.kind===2===r}Sn(e,n){return!!e.field.isEqual(n.fieldPath)&&(n.kind===0&&e.dir==="asc"||n.kind===1&&e.dir==="desc")}};function o6(t){var e,n;if(se(t instanceof Pe||t instanceof Je,20012),t instanceof Pe){if(t instanceof ZI){let i=((n=(e=t.value.arrayValue)===null||e===void 0?void 0:e.values)===null||n===void 0?void 0:n.map(o=>Pe.create(t.field,"==",o)))||[];return Je.create(i,"or")}return t}let r=t.filters.map(i=>o6(i));return Je.create(r,t.op)}function sce(t){if(t.getFilters().length===0)return[];let e=dL(o6(t));return se(s6(e),7391),lL(e)||uL(e)?[e]:e.getFilters()}function lL(t){return t instanceof Pe}function uL(t){return t instanceof Je&&x0(t)}function s6(t){return lL(t)||uL(t)||(function(n){if(n instanceof Je&&xO(n)){for(let r of n.getFilters())if(!lL(r)&&!uL(r))return!1;return!0}return!1})(t)}function dL(t){if(se(t instanceof Pe||t instanceof Je,34018),t instanceof Pe)return t;if(t.filters.length===1)return dL(t.filters[0]);let e=t.filters.map(r=>dL(r)),n=Je.create(e,t.op);return n=uv(n),s6(n)?n:(se(n instanceof Je,64498),se(fh(n),40251),se(n.filters.length>1,57927),n.filters.reduce((r,i)=>G0(r,i)))}function G0(t,e){let n;return se(t instanceof Pe||t instanceof Je,38388),se(e instanceof Pe||e instanceof Je,25473),n=t instanceof Pe?e instanceof Pe?(function(i,o){return Je.create([i,o],"and")})(t,e):v3(t,e):e instanceof Pe?v3(e,t):(function(i,o){if(se(i.filters.length>0&&o.filters.length>0,48005),fh(i)&&fh(o))return RW(i,o.getFilters());let s=xO(i)?i:o,a=xO(i)?o:i,c=s.filters.map(l=>G0(l,a));return Je.create(c,"or")})(t,e),uv(n)}function v3(t,e){if(fh(e))return RW(e,t.getFilters());{let n=e.filters.map(r=>G0(t,r));return Je.create(n,"or")}}function uv(t){if(se(t instanceof Pe||t instanceof Je,11850),t instanceof Pe)return t;let e=t.getFilters();if(e.length===1)return uv(e[0]);if(CW(t))return t;let n=e.map(i=>uv(i)),r=[];return n.forEach(i=>{i instanceof Pe?r.push(i):i instanceof Je&&(i.op===t.op?r.push(...i.filters):r.push(i))}),r.length===1?r[0]:Je.create(r,t.op)}var hL=class{constructor(){this.Dn=new im}addToCollectionParentIndex(e,n){return this.Dn.add(n),P.resolve()}getCollectionParents(e,n){return P.resolve(this.Dn.getEntries(n))}addFieldIndex(e,n){return P.resolve()}deleteFieldIndex(e,n){return P.resolve()}deleteAllFieldIndexes(e){return P.resolve()}createTargetIndexes(e,n){return P.resolve()}getDocumentsMatchingTarget(e,n){return P.resolve(null)}getIndexType(e,n){return P.resolve(0)}getFieldIndexes(e,n){return P.resolve([])}getNextCollectionGroupToUpdate(e){return P.resolve(null)}getMinOffset(e,n){return P.resolve(zr.min())}getMinOffsetFromCollectionGroup(e,n){return P.resolve(zr.min())}updateCollectionGroup(e,n,r){return P.resolve()}updateIndexEntries(e,n){return P.resolve()}},im=class{constructor(){this.index={}}add(e){let n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new nt(ke.comparator),o=!i.has(r);return this.index[n]=i.add(r),o}has(e){let n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new nt(ke.comparator)).toArray()}};var S3="IndexedDbIndexManager",wI=new Uint8Array(0),fL=class{constructor(e,n){this.databaseId=n,this.vn=new im,this.Cn=new vi(r=>Fl(r),(r,i)=>Em(r,i)),this.uid=e.uid||""}addToCollectionParentIndex(e,n){if(!this.vn.has(n)){let r=n.lastSegment(),i=n.popLast();e.addOnCommittedListener(()=>{this.vn.add(n)});let o={collectionId:r,parent:Hn(i)};return A3(e).put(o)}return P.resolve()}getCollectionParents(e,n){let r=[],i=IDBKeyRange.bound([n,""],[Z3(n),""],!1,!0);return A3(e).j(i).next(o=>{for(let s of o){if(s.collectionId!==n)break;r.push(go(s.parent))}return r})}addFieldIndex(e,n){let r=Dg(e),i=(function(a){return{indexId:a.indexId,collectionGroup:a.collectionGroup,fields:a.fields.map(c=>[c.fieldPath.canonicalString(),c.kind])}})(n);delete i.indexId;let o=r.add(i);if(n.indexState){let s=Wd(e);return o.next(a=>{s.put(m3(a,this.uid,n.indexState.sequenceNumber,n.indexState.offset))})}return o.next()}deleteFieldIndex(e,n){let r=Dg(e),i=Wd(e),o=$d(e);return r.delete(n.indexId).next(()=>i.delete(IDBKeyRange.bound([n.indexId],[n.indexId+1],!1,!0))).next(()=>o.delete(IDBKeyRange.bound([n.indexId],[n.indexId+1],!1,!0)))}deleteAllFieldIndexes(e){let n=Dg(e),r=$d(e),i=Wd(e);return n.Y().next(()=>r.Y()).next(()=>i.Y())}createTargetIndexes(e,n){return P.forEach(this.Fn(n),r=>this.getIndexType(e,r).next(i=>{if(i===0||i===1){let o=new lv(r).bn();if(o!=null)return this.addFieldIndex(e,o)}}))}getDocumentsMatchingTarget(e,n){let r=$d(e),i=!0,o=new Map;return P.forEach(this.Fn(n),s=>this.Mn(e,s).next(a=>{i&&(i=!!a),o.set(s,a)})).next(()=>{if(i){let s=Oe(),a=[];return P.forEach(o,(c,l)=>{z(S3,`Using index ${(function(H){return`id=${H.indexId}|cg=${H.collectionGroup}|f=${H.fields.map(Q=>`${Q.fieldPath}:${Q.kind}`).join(",")}`})(c)} to execute ${Fl(n)}`);let d=(function(H,Q){let ae=AO(Q);if(ae===void 0)return null;for(let ne of tv(H,ae.fieldPath))switch(ne.op){case"array-contains-any":return ne.value.arrayValue.values||[];case"array-contains":return[ne.value]}return null})(l,c),h=(function(H,Q){let ae=new Map;for(let ne of Sl(Q))for(let A of tv(H,ne.fieldPath))switch(A.op){case"==":case"in":ae.set(ne.fieldPath.canonicalString(),A.value);break;case"not-in":case"!=":return ae.set(ne.fieldPath.canonicalString(),A.value),Array.from(ae.values())}return null})(l,c),f=(function(H,Q){let ae=[],ne=!0;for(let A of Sl(Q)){let v=A.kind===0?n3(H,A.fieldPath,H.startAt):r3(H,A.fieldPath,H.startAt);ae.push(v.value),ne&&(ne=v.inclusive)}return new To(ae,ne)})(l,c),g=(function(H,Q){let ae=[],ne=!0;for(let A of Sl(Q)){let v=A.kind===0?r3(H,A.fieldPath,H.endAt):n3(H,A.fieldPath,H.endAt);ae.push(v.value),ne&&(ne=v.inclusive)}return new To(ae,ne)})(l,c),E=this.xn(c,l,f),I=this.xn(c,l,g),S=this.On(c,l,h),R=this.Nn(c.indexId,d,E,f.inclusive,I,g.inclusive,S);return P.forEach(R,U=>r.H(U,n.limit).next(H=>{H.forEach(Q=>{let ae=te.fromSegments(Q.documentKey);s.has(ae)||(s=s.add(ae),a.push(ae))})}))}).next(()=>a)}return P.resolve(null)})}Fn(e){let n=this.Cn.get(e);return n||(e.filters.length===0?n=[e]:n=sce(Je.create(e.filters,"and")).map(r=>$O(e.path,e.collectionGroup,e.orderBy,r.getFilters(),e.limit,e.startAt,e.endAt)),this.Cn.set(e,n),n)}Nn(e,n,r,i,o,s,a){let c=(n!=null?n.length:1)*Math.max(r.length,o.length),l=c/(n!=null?n.length:1),d=[];for(let h=0;h<c;++h){let f=n?this.Bn(n[h/l]):wI,g=this.Ln(e,f,r[h%l],i),E=this.kn(e,f,o[h%l],s),I=a.map(S=>this.Ln(e,f,S,!0));d.push(...this.createRange(g,E,I))}return d}Ln(e,n,r,i){let o=new Nl(e,te.empty(),n,r);return i?o:o.En()}kn(e,n,r,i){let o=new Nl(e,te.empty(),n,r);return i?o.En():o}Mn(e,n){let r=new lv(n),i=n.collectionGroup!=null?n.collectionGroup:n.path.lastSegment();return this.getFieldIndexes(e,i).next(o=>{let s=null;for(let a of o)r.pn(a)&&(!s||a.fields.length>s.fields.length)&&(s=a);return s})}getIndexType(e,n){let r=2,i=this.Fn(n);return P.forEach(i,o=>this.Mn(e,o).next(s=>{s?r!==0&&s.fields.length<(function(c){let l=new nt(tn.comparator),d=!1;for(let h of c.filters)for(let f of h.getFlattenedFilters())f.field.isKeyField()||(f.op==="array-contains"||f.op==="array-contains-any"?d=!0:l=l.add(f.field));for(let h of c.orderBy)h.field.isKeyField()||(l=l.add(h.field));return l.size+(d?1:0)})(o)&&(r=1):r=0})).next(()=>(function(s){return s.limit!==null})(n)&&i.length>1&&r===2?1:r)}qn(e,n){let r=new Rl;for(let i of Sl(e)){let o=n.data.field(i.fieldPath);if(o==null)return null;let s=r.hn(i.kind);ss.Ut.bt(o,s)}return r.an()}Bn(e){let n=new Rl;return ss.Ut.bt(e,n.hn(0)),n.an()}Qn(e,n){let r=new Rl;return ss.Ut.bt(xl(this.databaseId,n),r.hn((function(o){let s=Sl(o);return s.length===0?0:s[s.length-1].kind})(e))),r.an()}On(e,n,r){if(r===null)return[];let i=[];i.push(new Rl);let o=0;for(let s of Sl(e)){let a=r[o++];for(let c of i)if(this.$n(n,s.fieldPath)&&Xg(a))i=this.Un(i,s,a);else{let l=c.hn(s.kind);ss.Ut.bt(a,l)}}return this.Kn(i)}xn(e,n,r){return this.On(e,n,r.position)}Kn(e){let n=[];for(let r=0;r<e.length;++r)n[r]=e[r].an();return n}Un(e,n,r){let i=[...e],o=[];for(let s of r.arrayValue.values||[])for(let a of i){let c=new Rl;c.seed(a.an()),ss.Ut.bt(s,c.hn(n.kind)),o.push(c)}return o}$n(e,n){return!!e.filters.find(r=>r instanceof Pe&&r.field.isEqual(n)&&(r.op==="in"||r.op==="not-in"))}getFieldIndexes(e,n){let r=Dg(e),i=Wd(e);return(n?r.j(wO,IDBKeyRange.bound(n,n)):r.j()).next(o=>{let s=[];return P.forEach(o,a=>i.get([a.indexId,this.uid]).next(c=>{s.push((function(d,h){let f=h?new Gg(h.sequenceNumber,new zr(jl(h.readTime),new te(go(h.documentKey)),h.largestBatchId)):Gg.empty(),g=d.fields.map(([E,I])=>new Jd(tn.fromServerFormat(E),I));return new ih(d.indexId,d.collectionGroup,g,f)})(a,c))})).next(()=>s)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(n=>n.length===0?null:(n.sort((r,i)=>{let o=r.indexState.sequenceNumber-i.indexState.sequenceNumber;return o!==0?o:Ie(r.collectionGroup,i.collectionGroup)}),n[0].collectionGroup))}updateCollectionGroup(e,n,r){let i=Dg(e),o=Wd(e);return this.Wn(e).next(s=>i.j(wO,IDBKeyRange.bound(n,n)).next(a=>P.forEach(a,c=>o.put(m3(c.indexId,this.uid,s,r)))))}updateIndexEntries(e,n){let r=new Map;return P.forEach(n,(i,o)=>{let s=r.get(i.collectionGroup);return(s?P.resolve(s):this.getFieldIndexes(e,i.collectionGroup)).next(a=>(r.set(i.collectionGroup,a),P.forEach(a,c=>this.Gn(e,i,c).next(l=>{let d=this.zn(o,c);return l.isEqual(d)?P.resolve():this.jn(e,o,c,l,d)}))))})}Jn(e,n,r,i){return $d(e).put(i.An(this.uid,this.Qn(r,n.key),n.key))}Hn(e,n,r,i){return $d(e).delete(i.Rn(this.uid,this.Qn(r,n.key),n.key))}Gn(e,n,r){let i=$d(e),o=new nt(Ea);return i.X({index:uW,range:IDBKeyRange.only([r.indexId,this.uid,BI(this.Qn(r,n))])},(s,a)=>{o=o.add(new Nl(r.indexId,n,I3(a.arrayValue),I3(a.directionalValue)))}).next(()=>o)}zn(e,n){let r=new nt(Ea),i=this.qn(n,e);if(i==null)return r;let o=AO(n);if(o!=null){let s=e.data.field(o.fieldPath);if(Xg(s))for(let a of s.arrayValue.values||[])r=r.add(new Nl(n.indexId,e.key,this.Bn(a),i))}else r=r.add(new Nl(n.indexId,e.key,wI,i));return r}jn(e,n,r,i,o){z(S3,"Updating index entries for document '%s'",n.key);let s=[];return(function(c,l,d,h,f){let g=c.getIterator(),E=l.getIterator(),I=jd(g),S=jd(E);for(;I||S;){let R=!1,U=!1;if(I&&S){let H=d(I,S);H<0?U=!0:H>0&&(R=!0)}else I!=null?U=!0:R=!0;R?(h(S),S=jd(E)):U?(f(I),I=jd(g)):(I=jd(g),S=jd(E))}})(i,o,Ea,a=>{s.push(this.Jn(e,n,r,a))},a=>{s.push(this.Hn(e,n,r,a))}),P.waitFor(s)}Wn(e){let n=1;return Wd(e).X({index:lW,reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(r,i,o)=>{o.done(),n=i.sequenceNumber+1}).next(()=>n)}createRange(e,n,r){r=r.sort((s,a)=>Ea(s,a)).filter((s,a,c)=>!a||Ea(s,c[a-1])!==0);let i=[];i.push(e);for(let s of r){let a=Ea(s,e),c=Ea(s,n);if(a===0)i[0]=e.En();else if(a>0&&c<0)i.push(s),i.push(s.En());else if(c>0)break}i.push(n);let o=[];for(let s=0;s<i.length;s+=2){if(this.Yn(i[s],i[s+1]))return[];let a=i[s].Rn(this.uid,wI,te.empty()),c=i[s+1].Rn(this.uid,wI,te.empty());o.push(IDBKeyRange.bound(a,c))}return o}Yn(e,n){return Ea(e,n)>0}getMinOffsetFromCollectionGroup(e,n){return this.getFieldIndexes(e,n).next(C3)}getMinOffset(e,n){return P.mapArray(this.Fn(n),r=>this.Mn(e,r).next(i=>i||ie(44426))).next(C3)}};function A3(t){return on(t,Wg)}function $d(t){return on(t,Pg)}function Dg(t){return on(t,w0)}function Wd(t){return on(t,Mg)}function C3(t){se(t.length!==0,28825);let e=t[0].indexState.offset,n=e.largestBatchId;for(let r=1;r<t.length;r++){let i=t[r].indexState.offset;R0(i,e)<0&&(e=i),n<i.largestBatchId&&(n=i.largestBatchId)}return new zr(e.readTime,e.documentKey,n)}var D3={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},a6=41943040,ar=class t{static withCacheSize(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}};function c6(t,e,n){let r=t.store(Ii),i=t.store(sh),o=[],s=IDBKeyRange.only(n.batchId),a=0,c=r.X({range:s},(d,h,f)=>(a++,f.delete()));o.push(c.next(()=>{se(a===1,47070,{batchId:n.batchId})}));let l=[];for(let d of n.mutations){let h=sW(e,d.key.path,n.batchId);o.push(i.delete(h)),l.push(d.key)}return P.waitFor(o).next(()=>l)}function dv(t){if(!t)return 0;let e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw ie(14731);e=t.noDocument}return JSON.stringify(e).length}ar.DEFAULT_COLLECTION_PERCENTILE=10,ar.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,ar.DEFAULT=new ar(a6,ar.DEFAULT_COLLECTION_PERCENTILE,ar.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),ar.DISABLED=new ar(-1,0,0);var hv=class t{constructor(e,n,r,i){this.userId=e,this.serializer=n,this.indexManager=r,this.referenceDelegate=i,this.Zn={}}static yt(e,n,r,i){se(e.uid!=="",64387);let o=e.isAuthenticated()?e.uid:"";return new t(o,n,r,i)}checkEmpty(e){let n=!0,r=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return _a(e).X({index:bl,range:r},(i,o,s)=>{n=!1,s.done()}).next(()=>n)}addMutationBatch(e,n,r,i){let o=Xd(e),s=_a(e);return s.add({}).next(a=>{se(typeof a=="number",49019);let c=new Jg(a,n,r,i),l=(function(g,E,I){let S=I.baseMutations.map(U=>rm(g.gt,U)),R=I.mutations.map(U=>rm(g.gt,U));return{userId:E,batchId:I.batchId,localWriteTimeMs:I.localWriteTime.toMillis(),baseMutations:S,mutations:R}})(this.serializer,this.userId,c),d=[],h=new nt((f,g)=>Ie(f.canonicalString(),g.canonicalString()));for(let f of i){let g=sW(this.userId,f.key.path,a);h=h.add(f.key.path.popLast()),d.push(s.put(l)),d.push(o.put(g,nae))}return h.forEach(f=>{d.push(this.indexManager.addToCollectionParentIndex(e,f))}),e.addOnCommittedListener(()=>{this.Zn[a]=c.keys()}),P.waitFor(d).next(()=>c)})}lookupMutationBatch(e,n){return _a(e).get(n).next(r=>r?(se(r.userId===this.userId,48,"Unexpected user for mutation batch",{userId:r.userId,batchId:n}),Dl(this.serializer,r)):null)}Xn(e,n){return this.Zn[n]?P.resolve(this.Zn[n]):this.lookupMutationBatch(e,n).next(r=>{if(r){let i=r.keys();return this.Zn[n]=i,i}return null})}getNextMutationBatchAfterBatchId(e,n){let r=n+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return _a(e).X({index:bl,range:i},(s,a,c)=>{a.userId===this.userId&&(se(a.batchId>=r,47524,{er:r}),o=Dl(this.serializer,a)),c.done()}).next(()=>o)}getHighestUnacknowledgedBatchId(e){let n=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),r=Ll;return _a(e).X({index:bl,range:n,reverse:!0},(i,o,s)=>{r=o.batchId,s.done()}).next(()=>r)}getAllMutationBatches(e){let n=IDBKeyRange.bound([this.userId,Ll],[this.userId,Number.POSITIVE_INFINITY]);return _a(e).j(bl,n).next(r=>r.map(i=>Dl(this.serializer,i)))}getAllMutationBatchesAffectingDocumentKey(e,n){let r=PI(this.userId,n.path),i=IDBKeyRange.lowerBound(r),o=[];return Xd(e).X({range:i},(s,a,c)=>{let[l,d,h]=s,f=go(d);if(l===this.userId&&n.path.isEqual(f))return _a(e).get(h).next(g=>{if(!g)throw ie(61480,{tr:s,batchId:h});se(g.userId===this.userId,10503,"Unexpected user for mutation batch",{userId:g.userId,batchId:h}),o.push(Dl(this.serializer,g))});c.done()}).next(()=>o)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new nt(Ie),i=[];return n.forEach(o=>{let s=PI(this.userId,o.path),a=IDBKeyRange.lowerBound(s),c=Xd(e).X({range:a},(l,d,h)=>{let[f,g,E]=l,I=go(g);f===this.userId&&o.path.isEqual(I)?r=r.add(E):h.done()});i.push(c)}),P.waitFor(i).next(()=>this.nr(e,r))}getAllMutationBatchesAffectingQuery(e,n){let r=n.path,i=r.length+1,o=PI(this.userId,r),s=IDBKeyRange.lowerBound(o),a=new nt(Ie);return Xd(e).X({range:s},(c,l,d)=>{let[h,f,g]=c,E=go(f);h===this.userId&&r.isPrefixOf(E)?E.length===i&&(a=a.add(g)):d.done()}).next(()=>this.nr(e,a))}nr(e,n){let r=[],i=[];return n.forEach(o=>{i.push(_a(e).get(o).next(s=>{if(s===null)throw ie(35274,{batchId:o});se(s.userId===this.userId,9748,"Unexpected user for mutation batch",{userId:s.userId,batchId:o}),r.push(Dl(this.serializer,s))}))}),P.waitFor(i).next(()=>r)}removeMutationBatch(e,n){return c6(e.ce,this.userId,n).next(r=>(e.addOnCommittedListener(()=>{this.rr(n.batchId)}),P.forEach(r,i=>this.referenceDelegate.markPotentiallyOrphaned(e,i))))}rr(e){delete this.Zn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(n=>{if(!n)return P.resolve();let r=IDBKeyRange.lowerBound((function(s){return[s]})(this.userId)),i=[];return Xd(e).X({range:r},(o,s,a)=>{if(o[0]===this.userId){let c=go(o[1]);i.push(c)}else a.done()}).next(()=>{se(i.length===0,56720,{ir:i.map(o=>o.canonicalString())})})})}containsKey(e,n){return l6(e,this.userId,n)}sr(e){return u6(e).get(this.userId).next(n=>n||{userId:this.userId,lastAcknowledgedBatchId:Ll,lastStreamToken:""})}};function l6(t,e,n){let r=PI(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),s=!1;return Xd(t).X({range:o,Z:!0},(a,c,l)=>{let[d,h,f]=a;d===e&&h===i&&(s=!0),l.done()}).next(()=>s)}function _a(t){return on(t,Ii)}function Xd(t){return on(t,sh)}function u6(t){return on(t,Hg)}var _h=class t{constructor(e){this._r=e}next(){return this._r+=2,this._r}static ar(){return new t(0)}static ur(){return new t(-1)}};var pL=class{constructor(e,n){this.referenceDelegate=e,this.serializer=n}allocateTargetId(e){return this.cr(e).next(n=>{let r=new _h(n.highestTargetId);return n.highestTargetId=r.next(),this.lr(e,n).next(()=>n.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.cr(e).next(n=>ue.fromTimestamp(new _t(n.lastRemoteSnapshotVersion.seconds,n.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.cr(e).next(n=>n.highestListenSequenceNumber)}setTargetsMetadata(e,n,r){return this.cr(e).next(i=>(i.highestListenSequenceNumber=n,r&&(i.lastRemoteSnapshotVersion=r.toTimestamp()),n>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=n),this.lr(e,i)))}addTargetData(e,n){return this.hr(e,n).next(()=>this.cr(e).next(r=>(r.targetCount+=1,this.Pr(n,r),this.lr(e,r))))}updateTargetData(e,n){return this.hr(e,n)}removeTargetData(e,n){return this.removeMatchingKeysForTargetId(e,n.targetId).next(()=>zd(e).delete(n.targetId)).next(()=>this.cr(e)).next(r=>(se(r.targetCount>0,8065),r.targetCount-=1,this.lr(e,r)))}removeTargets(e,n,r){let i=0,o=[];return zd(e).X((s,a)=>{let c=wg(a);c.sequenceNumber<=n&&r.get(c.targetId)===null&&(i++,o.push(this.removeTargetData(e,c)))}).next(()=>P.waitFor(o)).next(()=>i)}forEachTarget(e,n){return zd(e).X((r,i)=>{let o=wg(i);n(o)})}cr(e){return R3(e).get(YI).next(n=>(se(n!==null,2888),n))}lr(e,n){return R3(e).put(YI,n)}hr(e,n){return zd(e).put(r6(this.serializer,n))}Pr(e,n){let r=!1;return e.targetId>n.highestTargetId&&(n.highestTargetId=e.targetId,r=!0),e.sequenceNumber>n.highestListenSequenceNumber&&(n.highestListenSequenceNumber=e.sequenceNumber,r=!0),r}getTargetCount(e){return this.cr(e).next(n=>n.targetCount)}getTargetData(e,n){let r=Fl(n),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),o=null;return zd(e).X({range:i,index:cW},(s,a,c)=>{let l=wg(a);Em(n,l.target)&&(o=l,c.done())}).next(()=>o)}addMatchingKeys(e,n,r){let i=[],o=Ia(e);return n.forEach(s=>{let a=Hn(s.path);i.push(o.put({targetId:r,path:a})),i.push(this.referenceDelegate.addReference(e,r,s))}),P.waitFor(i)}removeMatchingKeys(e,n,r){let i=Ia(e);return P.forEach(n,o=>{let s=Hn(o.path);return P.waitFor([i.delete([r,s]),this.referenceDelegate.removeReference(e,r,o)])})}removeMatchingKeysForTargetId(e,n){let r=Ia(e),i=IDBKeyRange.bound([n],[n+1],!1,!0);return r.delete(i)}getMatchingKeysForTargetId(e,n){let r=IDBKeyRange.bound([n],[n+1],!1,!0),i=Ia(e),o=Oe();return i.X({range:r,Z:!0},(s,a,c)=>{let l=go(s[1]),d=new te(l);o=o.add(d)}).next(()=>o)}containsKey(e,n){let r=Hn(n.path),i=IDBKeyRange.bound([r],[Z3(r)],!1,!0),o=0;return Ia(e).X({index:b0,Z:!0,range:i},([s,a],c,l)=>{s!==0&&(o++,l.done())}).next(()=>o>0)}Et(e,n){return zd(e).get(n).next(r=>r?wg(r):null)}};function zd(t){return on(t,ah)}function R3(t){return on(t,Ml)}function Ia(t){return on(t,ch)}var N3="LruGarbageCollector",d6=1048576;function b3([t,e],[n,r]){let i=Ie(t,n);return i===0?Ie(e,r):i}var gL=class{constructor(e){this.Tr=e,this.buffer=new nt(b3),this.Ir=0}dr(){return++this.Ir}Er(e){let n=[e,this.dr()];if(this.buffer.size<this.Tr)this.buffer=this.buffer.add(n);else{let r=this.buffer.last();b3(n,r)<0&&(this.buffer=this.buffer.delete(r).add(n))}}get maxValue(){return this.buffer.last()[0]}},fv=class{constructor(e,n,r){this.garbageCollector=e,this.asyncQueue=n,this.localStore=r,this.Ar=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.Rr(6e4)}stop(){this.Ar&&(this.Ar.cancel(),this.Ar=null)}get started(){return this.Ar!==null}Rr(e){z(N3,`Garbage collection scheduled in ${e}ms`),this.Ar=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,()=>y(this,null,function*(){this.Ar=null;try{yield this.localStore.collectGarbage(this.garbageCollector)}catch(n){Fa(n)?z(N3,"Ignoring IndexedDB error during garbage collection: ",n):yield ka(n)}yield this.Rr(3e5)}))}},mL=class{constructor(e,n){this.Vr=e,this.params=n}calculateTargetCount(e,n){return this.Vr.mr(e).next(r=>Math.floor(n/100*r))}nthSequenceNumber(e,n){if(n===0)return P.resolve(Dr.ue);let r=new gL(n);return this.Vr.forEachTarget(e,i=>r.Er(i.sequenceNumber)).next(()=>this.Vr.gr(e,i=>r.Er(i))).next(()=>r.maxValue)}removeTargets(e,n,r){return this.Vr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.Vr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(z("LruGarbageCollector","Garbage collection skipped; disabled"),P.resolve(D3)):this.getCacheSize(e).next(r=>r<this.params.cacheSizeCollectionThreshold?(z("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),D3):this.pr(e,n))}getCacheSize(e){return this.Vr.getCacheSize(e)}pr(e,n){let r,i,o,s,a,c,l,d=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(h=>(h>this.params.maximumSequenceNumbersToCollect?(z("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),i=this.params.maximumSequenceNumbersToCollect):i=h,s=Date.now(),this.nthSequenceNumber(e,i))).next(h=>(r=h,a=Date.now(),this.removeTargets(e,r,n))).next(h=>(o=h,c=Date.now(),this.removeOrphanedDocuments(e,r))).next(h=>(l=Date.now(),qd()<=Ne.DEBUG&&z("LruGarbageCollector",`LRU Garbage Collection
|
|
165
|
+
Counted targets in ${s-d}ms
|
|
166
|
+
Determined least recently used ${i} in `+(a-s)+`ms
|
|
167
|
+
Removed ${o} targets in `+(c-a)+`ms
|
|
168
|
+
Removed ${h} documents in `+(l-c)+`ms
|
|
169
|
+
Total Duration: ${l-d}ms`),P.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:o,documentsRemoved:h})))}};function h6(t,e){return new mL(t,e)}var EL=class{constructor(e,n){this.db=e,this.garbageCollector=h6(this,n)}mr(e){let n=this.yr(e);return this.db.getTargetCache().getTargetCount(e).next(r=>n.next(i=>r+i))}yr(e){let n=0;return this.gr(e,r=>{n++}).next(()=>n)}forEachTarget(e,n){return this.db.getTargetCache().forEachTarget(e,n)}gr(e,n){return this.wr(e,(r,i)=>n(i))}addReference(e,n,r){return OI(e,r)}removeReference(e,n,r){return OI(e,r)}removeTargets(e,n,r){return this.db.getTargetCache().removeTargets(e,n,r)}markPotentiallyOrphaned(e,n){return OI(e,n)}Sr(e,n){return(function(i,o){let s=!1;return u6(i).ee(a=>l6(i,a,o).next(c=>(c&&(s=!0),P.resolve(!c)))).next(()=>s)})(e,n)}removeOrphanedDocuments(e,n){let r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.wr(e,(s,a)=>{if(a<=n){let c=this.Sr(e,s).next(l=>{if(!l)return o++,r.getEntry(e,s).next(()=>(r.removeEntry(s,ue.min()),Ia(e).delete((function(h){return[0,Hn(h.path)]})(s))))});i.push(c)}}).next(()=>P.waitFor(i)).next(()=>r.apply(e)).next(()=>o)}removeTarget(e,n){let r=n.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)}updateLimboDocument(e,n){return OI(e,n)}wr(e,n){let r=Ia(e),i,o=Dr.ue;return r.X({index:b0},([s,a],{path:c,sequenceNumber:l})=>{s===0?(o!==Dr.ue&&n(new te(go(i)),o),o=l,i=c):o=Dr.ue}).next(()=>{o!==Dr.ue&&n(new te(go(i)),o)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}};function OI(t,e){return Ia(t).put((function(r,i){return{targetId:0,path:Hn(r.path),sequenceNumber:i}})(e,t.currentSequenceNumber))}var pv=class{constructor(){this.changes=new vi(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,nn.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();let r=this.changes.get(n);return r!==void 0?P.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}};var _L=class{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,n,r){return vl(e).put(r)}removeEntry(e,n,r){return vl(e).delete((function(o,s){let a=o.path.toArray();return[a.slice(0,a.length-2),a[a.length-2],av(s),a[a.length-1]]})(n,r))}updateMetadata(e,n){return this.getMetadata(e).next(r=>(r.byteSize+=n,this.br(e,r)))}getEntry(e,n){let r=nn.newInvalidDocument(n);return vl(e).X({index:xI,range:IDBKeyRange.only(Rg(n))},(i,o)=>{r=this.Dr(n,o)}).next(()=>r)}vr(e,n){let r={size:0,document:nn.newInvalidDocument(n)};return vl(e).X({index:xI,range:IDBKeyRange.only(Rg(n))},(i,o)=>{r={document:this.Dr(n,o),size:dv(o)}}).next(()=>r)}getEntries(e,n){let r=Nr();return this.Cr(e,n,(i,o)=>{let s=this.Dr(i,o);r=r.insert(i,s)}).next(()=>r)}Fr(e,n){let r=Nr(),i=new pt(te.comparator);return this.Cr(e,n,(o,s)=>{let a=this.Dr(o,s);r=r.insert(o,a),i=i.insert(o,dv(s))}).next(()=>({documents:r,Mr:i}))}Cr(e,n,r){if(n.isEmpty())return P.resolve();let i=new nt(L3);n.forEach(c=>i=i.add(c));let o=IDBKeyRange.bound(Rg(i.first()),Rg(i.last())),s=i.getIterator(),a=s.getNext();return vl(e).X({index:xI,range:o},(c,l,d)=>{let h=te.fromSegments([...l.prefixPath,l.collectionGroup,l.documentId]);for(;a&&L3(a,h)<0;)r(a,null),a=s.getNext();a&&a.isEqual(h)&&(r(a,l),a=s.hasNext()?s.getNext():null),a?d.G(Rg(a)):d.done()}).next(()=>{for(;a;)r(a,null),a=s.hasNext()?s.getNext():null})}getDocumentsMatchingQuery(e,n,r,i,o){let s=n.path,a=[s.popLast().toArray(),s.lastSegment(),av(r.readTime),r.documentKey.path.isEmpty()?"":r.documentKey.path.lastSegment()],c=[s.popLast().toArray(),s.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return vl(e).j(IDBKeyRange.bound(a,c,!0)).next(l=>{o?.incrementDocumentReadCount(l.length);let d=Nr();for(let h of l){let f=this.Dr(te.fromSegments(h.prefixPath.concat(h.collectionGroup,h.documentId)),h);f.isFoundDocument()&&(Tm(n,f)||i.has(f.key))&&(d=d.insert(f.key,f))}return d})}getAllFromCollectionGroup(e,n,r,i){let o=Nr(),s=O3(n,r),a=O3(n,zr.max());return vl(e).X({index:aW,range:IDBKeyRange.bound(s,a,!0)},(c,l,d)=>{let h=this.Dr(te.fromSegments(l.prefixPath.concat(l.collectionGroup,l.documentId)),l);o=o.insert(h.key,h),o.size===i&&d.done()}).next(()=>o)}newChangeBuffer(e){return new TL(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(n=>n.byteSize)}getMetadata(e){return w3(e).get(bO).next(n=>(se(!!n,20021),n))}br(e,n){return w3(e).put(bO,n)}Dr(e,n){if(n){let r=ice(this.serializer,n);if(!(r.isNoDocument()&&r.version.isEqual(ue.min())))return r}return nn.newInvalidDocument(e)}};function f6(t){return new _L(t)}var TL=class extends pv{constructor(e,n){super(),this.Or=e,this.trackRemovals=n,this.Nr=new vi(r=>r.toString(),(r,i)=>r.isEqual(i))}applyChanges(e){let n=[],r=0,i=new nt((o,s)=>Ie(o.canonicalString(),s.canonicalString()));return this.changes.forEach((o,s)=>{let a=this.Nr.get(o);if(n.push(this.Or.removeEntry(e,o,a.readTime)),s.isValidDocument()){let c=p3(this.Or.serializer,s);i=i.add(o.path.popLast());let l=dv(c);r+=l-a.size,n.push(this.Or.addEntry(e,o,c))}else if(r-=a.size,this.trackRemovals){let c=p3(this.Or.serializer,s.convertToNoDocument(ue.min()));n.push(this.Or.addEntry(e,o,c))}}),i.forEach(o=>{n.push(this.Or.indexManager.addToCollectionParentIndex(e,o))}),n.push(this.Or.updateMetadata(e,r)),P.waitFor(n)}getFromCache(e,n){return this.Or.vr(e,n).next(r=>(this.Nr.set(n,{size:r.size,readTime:r.document.readTime}),r.document))}getAllFromCache(e,n){return this.Or.Fr(e,n).next(({documents:r,Mr:i})=>(i.forEach((o,s)=>{this.Nr.set(o,{size:s,readTime:r.get(o).readTime})}),r))}};function w3(t){return on(t,$g)}function vl(t){return on(t,KI)}function Rg(t){let e=t.path.toArray();return[e.slice(0,e.length-2),e[e.length-2],e[e.length-1]]}function O3(t,e){let n=e.documentKey.path.toArray();return[t,av(e.readTime),n.slice(0,n.length-2),n.length>0?n[n.length-1]:""]}function L3(t,e){let n=t.path.toArray(),r=e.path.toArray(),i=0;for(let o=0;o<n.length-2&&o<r.length-2;++o)if(i=Ie(n[o],r[o]),i)return i;return i=Ie(n.length,r.length),i||(i=Ie(n[n.length-2],r[r.length-2]),i||Ie(n[n.length-1],r[r.length-1]))}var yL=class{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}};var gv=class{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&Fg(r.mutation,i,Rr.empty(),_t.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,Oe()).next(()=>r))}getLocalViewOfDocuments(e,n,r=Oe()){let i=mo();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(o=>{let s=bg();return o.forEach((a,c)=>{s=s.insert(a,c.overlayedDocument)}),s}))}getOverlayedDocuments(e,n){let r=mo();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,Oe()))}populateOverlays(e,n,r){let i=[];return r.forEach(o=>{n.has(o)||i.push(o)}),this.documentOverlayCache.getOverlays(e,i).next(o=>{o.forEach((s,a)=>{n.set(s,a)})})}computeViews(e,n,r,i){let o=Nr(),s=kg(),a=(function(){return kg()})();return n.forEach((c,l)=>{let d=r.get(l.key);i.has(l.key)&&(d===void 0||d.mutation instanceof Si)?o=o.insert(l.key,l):d!==void 0?(s.set(l.key,d.mutation.getFieldMask()),Fg(d.mutation,l,d.mutation.getFieldMask(),_t.now())):s.set(l.key,Rr.empty())}),this.recalculateAndSaveOverlays(e,o).next(c=>(c.forEach((l,d)=>s.set(l,d)),n.forEach((l,d)=>{var h;return a.set(l,new yL(d,(h=s.get(l))!==null&&h!==void 0?h:null))}),a))}recalculateAndSaveOverlays(e,n){let r=kg(),i=new pt((s,a)=>s-a),o=Oe();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(s=>{for(let a of s)a.keys().forEach(c=>{let l=n.get(c);if(l===null)return;let d=r.get(c)||Rr.empty();d=a.applyToLocalView(l,d),r.set(c,d);let h=(i.get(a.batchId)||Oe()).add(c);i=i.insert(a.batchId,h)})}).next(()=>{let s=[],a=i.getReverseIterator();for(;a.hasNext();){let c=a.getNext(),l=c.key,d=c.value,h=FW();d.forEach(f=>{if(!o.has(f)){let g=HW(n.get(f),r.get(f));g!==null&&h.set(f,g),o=o.add(f)}}),s.push(this.documentOverlayCache.saveOverlays(e,l,h))}return P.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return(function(s){return te.isDocumentKey(s.path)&&s.collectionGroup===null&&s.filters.length===0})(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):k0(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(o=>{let s=i-o.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-o.size):P.resolve(mo()),a=rh,c=o;return s.next(l=>P.forEach(l,(d,h)=>(a<h.largestBatchId&&(a=h.largestBatchId),o.get(d)?P.resolve():this.remoteDocumentCache.getEntry(e,d).next(f=>{c=c.insert(d,f)}))).next(()=>this.populateOverlays(e,l,o)).next(()=>this.computeViews(e,c,l,Oe())).next(d=>({batchId:a,changes:kW(d)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new te(n)).next(r=>{let i=bg();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){let o=n.collectionGroup,s=bg();return this.indexManager.getCollectionParents(e,o).next(a=>P.forEach(a,c=>{let l=(function(h,f){return new yo(f,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)})(n,c.child(o));return this.getDocumentsMatchingCollectionQuery(e,l,r,i).next(d=>{d.forEach((h,f)=>{s=s.insert(h,f)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,n,r,i){let o;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(s=>(o=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,o,i))).next(s=>{o.forEach((c,l)=>{let d=l.getKey();s.get(d)===null&&(s=s.insert(d,nn.newInvalidDocument(d)))});let a=bg();return s.forEach((c,l)=>{let d=o.get(c);d!==void 0&&Fg(d.mutation,l,Rr.empty(),_t.now()),Tm(n,l)&&(a=a.insert(c,l))}),a})}};var IL=class{constructor(e){this.serializer=e,this.Br=new Map,this.Lr=new Map}getBundleMetadata(e,n){return P.resolve(this.Br.get(n))}saveBundleMetadata(e,n){return this.Br.set(n.id,(function(i){return{id:i.id,version:i.version,createTime:En(i.createTime)}})(n)),P.resolve()}getNamedQuery(e,n){return P.resolve(this.Lr.get(n))}saveNamedQuery(e,n){return this.Lr.set(n.name,(function(i){return{name:i.name,query:i6(i.bundledQuery),readTime:En(i.readTime)}})(n)),P.resolve()}};var vL=class{constructor(){this.overlays=new pt(te.comparator),this.kr=new Map}getOverlay(e,n){return P.resolve(this.overlays.get(n))}getOverlays(e,n){let r=mo();return P.forEach(n,i=>this.getOverlay(e,i).next(o=>{o!==null&&r.set(i,o)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,o)=>{this.wt(e,n,o)}),P.resolve()}removeOverlaysForBatchId(e,n,r){let i=this.kr.get(r);return i!==void 0&&(i.forEach(o=>this.overlays=this.overlays.remove(o)),this.kr.delete(r)),P.resolve()}getOverlaysForCollection(e,n,r){let i=mo(),o=n.length+1,s=new te(n.child("")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){let c=a.getNext().value,l=c.getKey();if(!n.isPrefixOf(l.path))break;l.path.length===o&&c.largestBatchId>r&&i.set(c.getKey(),c)}return P.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let o=new pt((l,d)=>l-d),s=this.overlays.getIterator();for(;s.hasNext();){let l=s.getNext().value;if(l.getKey().getCollectionGroup()===n&&l.largestBatchId>r){let d=o.get(l.largestBatchId);d===null&&(d=mo(),o=o.insert(l.largestBatchId,d)),d.set(l.getKey(),l)}}let a=mo(),c=o.getIterator();for(;c.hasNext()&&(c.getNext().value.forEach((l,d)=>a.set(l,d)),!(a.size()>=i)););return P.resolve(a)}wt(e,n,r){let i=this.overlays.get(r.key);if(i!==null){let s=this.kr.get(i.largestBatchId).delete(r.key);this.kr.set(i.largestBatchId,s)}this.overlays=this.overlays.insert(r.key,new Zg(n,r));let o=this.kr.get(n);o===void 0&&(o=Oe(),this.kr.set(n,o)),this.kr.set(n,o.add(r.key))}};var SL=class{constructor(){this.sessionToken=Gt.EMPTY_BYTE_STRING}getSessionToken(e){return P.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,P.resolve()}};var om=class{constructor(){this.qr=new nt(Ut.Qr),this.$r=new nt(Ut.Ur)}isEmpty(){return this.qr.isEmpty()}addReference(e,n){let r=new Ut(e,n);this.qr=this.qr.add(r),this.$r=this.$r.add(r)}Kr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Wr(new Ut(e,n))}Gr(e,n){e.forEach(r=>this.removeReference(r,n))}zr(e){let n=new te(new ke([])),r=new Ut(n,e),i=new Ut(n,e+1),o=[];return this.$r.forEachInRange([r,i],s=>{this.Wr(s),o.push(s.key)}),o}jr(){this.qr.forEach(e=>this.Wr(e))}Wr(e){this.qr=this.qr.delete(e),this.$r=this.$r.delete(e)}Jr(e){let n=new te(new ke([])),r=new Ut(n,e),i=new Ut(n,e+1),o=Oe();return this.$r.forEachInRange([r,i],s=>{o=o.add(s.key)}),o}containsKey(e){let n=new Ut(e,0),r=this.qr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}},Ut=class{constructor(e,n){this.key=e,this.Hr=n}static Qr(e,n){return te.comparator(e.key,n.key)||Ie(e.Hr,n.Hr)}static Ur(e,n){return Ie(e.Hr,n.Hr)||te.comparator(e.key,n.key)}};var AL=class{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.er=1,this.Yr=new nt(Ut.Qr)}checkEmpty(e){return P.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){let o=this.er;this.er++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let s=new Jg(o,n,r,i);this.mutationQueue.push(s);for(let a of i)this.Yr=this.Yr.add(new Ut(a.key,o)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return P.resolve(s)}lookupMutationBatch(e,n){return P.resolve(this.Zr(n))}getNextMutationBatchAfterBatchId(e,n){let r=n+1,i=this.Xr(r),o=i<0?0:i;return P.resolve(this.mutationQueue.length>o?this.mutationQueue[o]:null)}getHighestUnacknowledgedBatchId(){return P.resolve(this.mutationQueue.length===0?Ll:this.er-1)}getAllMutationBatches(e){return P.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){let r=new Ut(n,0),i=new Ut(n,Number.POSITIVE_INFINITY),o=[];return this.Yr.forEachInRange([r,i],s=>{let a=this.Zr(s.Hr);o.push(a)}),P.resolve(o)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new nt(Ie);return n.forEach(i=>{let o=new Ut(i,0),s=new Ut(i,Number.POSITIVE_INFINITY);this.Yr.forEachInRange([o,s],a=>{r=r.add(a.Hr)})}),P.resolve(this.ei(r))}getAllMutationBatchesAffectingQuery(e,n){let r=n.path,i=r.length+1,o=r;te.isDocumentKey(o)||(o=o.child(""));let s=new Ut(new te(o),0),a=new nt(Ie);return this.Yr.forEachWhile(c=>{let l=c.key.path;return!!r.isPrefixOf(l)&&(l.length===i&&(a=a.add(c.Hr)),!0)},s),P.resolve(this.ei(a))}ei(e){let n=[];return e.forEach(r=>{let i=this.Zr(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){se(this.ti(n.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Yr;return P.forEach(n.mutations,i=>{let o=new Ut(i.key,n.batchId);return r=r.delete(o),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Yr=r})}rr(e){}containsKey(e,n){let r=new Ut(n,0),i=this.Yr.firstAfterOrEqual(r);return P.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,P.resolve()}ti(e,n){return this.Xr(e)}Xr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Zr(e){let n=this.Xr(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}};var CL=class{constructor(e){this.ni=e,this.docs=(function(){return new pt(te.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){let r=n.key,i=this.docs.get(r),o=i?i.size:0,s=this.ni(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:s}),this.size+=s-o,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){let n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){let r=this.docs.get(n);return P.resolve(r?r.document.mutableCopy():nn.newInvalidDocument(n))}getEntries(e,n){let r=Nr();return n.forEach(i=>{let o=this.docs.get(i);r=r.insert(i,o?o.document.mutableCopy():nn.newInvalidDocument(i))}),P.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let o=Nr(),s=n.path,a=new te(s.child("__id-9223372036854775808__")),c=this.docs.getIteratorFrom(a);for(;c.hasNext();){let{key:l,value:{document:d}}=c.getNext();if(!s.isPrefixOf(l.path))break;l.path.length>s.length+1||R0(nW(d),r)<=0||(i.has(d.key)||Tm(n,d))&&(o=o.insert(d.key,d.mutableCopy()))}return P.resolve(o)}getAllFromCollectionGroup(e,n,r,i){ie(9500)}ri(e,n){return P.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new DL(this)}getSize(e){return P.resolve(this.size)}},DL=class extends pv{constructor(e){super(),this.Or=e}applyChanges(e){let n=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.Or.addEntry(e,i)):this.Or.removeEntry(r)}),P.waitFor(n)}getFromCache(e,n){return this.Or.getEntry(e,n)}getAllFromCache(e,n){return this.Or.getEntries(e,n)}};var RL=class{constructor(e){this.persistence=e,this.ii=new vi(n=>Fl(n),Em),this.lastRemoteSnapshotVersion=ue.min(),this.highestTargetId=0,this.si=0,this.oi=new om,this.targetCount=0,this._i=_h.ar()}forEachTarget(e,n){return this.ii.forEach((r,i)=>n(i)),P.resolve()}getLastRemoteSnapshotVersion(e){return P.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return P.resolve(this.si)}allocateTargetId(e){return this.highestTargetId=this._i.next(),P.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.si&&(this.si=n),P.resolve()}hr(e){this.ii.set(e.target,e);let n=e.targetId;n>this.highestTargetId&&(this._i=new _h(n),this.highestTargetId=n),e.sequenceNumber>this.si&&(this.si=e.sequenceNumber)}addTargetData(e,n){return this.hr(n),this.targetCount+=1,P.resolve()}updateTargetData(e,n){return this.hr(n),P.resolve()}removeTargetData(e,n){return this.ii.delete(n.target),this.oi.zr(n.targetId),this.targetCount-=1,P.resolve()}removeTargets(e,n,r){let i=0,o=[];return this.ii.forEach((s,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.ii.delete(s),o.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),P.waitFor(o).next(()=>i)}getTargetCount(e){return P.resolve(this.targetCount)}getTargetData(e,n){let r=this.ii.get(n)||null;return P.resolve(r)}addMatchingKeys(e,n,r){return this.oi.Kr(n,r),P.resolve()}removeMatchingKeys(e,n,r){this.oi.Gr(n,r);let i=this.persistence.referenceDelegate,o=[];return i&&n.forEach(s=>{o.push(i.markPotentiallyOrphaned(e,s))}),P.waitFor(o)}removeMatchingKeysForTargetId(e,n){return this.oi.zr(n),P.resolve()}getMatchingKeysForTargetId(e,n){let r=this.oi.Jr(n);return P.resolve(r)}containsKey(e,n){return P.resolve(this.oi.containsKey(n))}};var sm=class{constructor(e,n){this.ai={},this.overlays={},this.ui=new Dr(0),this.ci=!1,this.ci=!0,this.li=new SL,this.referenceDelegate=e(this),this.hi=new RL(this),this.indexManager=new hL,this.remoteDocumentCache=(function(i){return new CL(i)})(r=>this.referenceDelegate.Pi(r)),this.serializer=new sv(n),this.Ti=new IL(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ci=!1,Promise.resolve()}get started(){return this.ci}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new vL,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ai[e.toKey()];return r||(r=new AL(n,this.referenceDelegate),this.ai[e.toKey()]=r),r}getGlobalsCache(){return this.li}getTargetCache(){return this.hi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ti}runTransaction(e,n,r){z("MemoryPersistence","Starting transaction:",e);let i=new NL(this.ui.next());return this.referenceDelegate.Ii(),r(i).next(o=>this.referenceDelegate.di(i).next(()=>o)).toPromise().then(o=>(i.raiseOnCommittedEvent(),o))}Ei(e,n){return P.or(Object.values(this.ai).map(r=>()=>r.containsKey(e,n)))}},NL=class extends WI{constructor(e){super(),this.currentSequenceNumber=e}},mv=class t{constructor(e){this.persistence=e,this.Ai=new om,this.Ri=null}static Vi(e){return new t(e)}get mi(){if(this.Ri)return this.Ri;throw ie(60996)}addReference(e,n,r){return this.Ai.addReference(r,n),this.mi.delete(r.toString()),P.resolve()}removeReference(e,n,r){return this.Ai.removeReference(r,n),this.mi.add(r.toString()),P.resolve()}markPotentiallyOrphaned(e,n){return this.mi.add(n.toString()),P.resolve()}removeTarget(e,n){this.Ai.zr(n.targetId).forEach(i=>this.mi.add(i.toString()));let r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(o=>this.mi.add(o.toString()))}).next(()=>r.removeTargetData(e,n))}Ii(){this.Ri=new Set}di(e){let n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return P.forEach(this.mi,r=>{let i=te.fromPath(r);return this.fi(e,i).next(o=>{o||n.removeEntry(i,ue.min())})}).next(()=>(this.Ri=null,n.apply(e)))}updateLimboDocument(e,n){return this.fi(e,n).next(r=>{r?this.mi.delete(n.toString()):this.mi.add(n.toString())})}Pi(e){return 0}fi(e,n){return P.or([()=>P.resolve(this.Ai.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ei(e,n)])}},Ev=class t{constructor(e,n){this.persistence=e,this.gi=new vi(r=>Hn(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=h6(this,n)}static Vi(e,n){return new t(e,n)}Ii(){}di(e){return P.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}mr(e){let n=this.yr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>n.next(i=>r+i))}yr(e){let n=0;return this.gr(e,r=>{n++}).next(()=>n)}gr(e,n){return P.forEach(this.gi,(r,i)=>this.Sr(e,r,i).next(o=>o?P.resolve():n(i)))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0,i=this.persistence.getRemoteDocumentCache(),o=i.newChangeBuffer();return i.ri(e,s=>this.Sr(e,s,n).next(a=>{a||(r++,o.removeEntry(s,ue.min()))})).next(()=>o.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,n){return this.gi.set(n,e.currentSequenceNumber),P.resolve()}removeTarget(e,n){let r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.gi.set(r,e.currentSequenceNumber),P.resolve()}removeReference(e,n,r){return this.gi.set(r,e.currentSequenceNumber),P.resolve()}updateLimboDocument(e,n){return this.gi.set(n,e.currentSequenceNumber),P.resolve()}Pi(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=FI(e.data.value)),n}Sr(e,n,r){return P.or([()=>this.persistence.Ei(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{let i=this.gi.get(n);return P.resolve(i!==void 0&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}};var bL=class{constructor(e){this.serializer=e}q(e,n,r,i){let o=new zI("createOrUpgrade",n);r<1&&i>=1&&((function(c){c.createObjectStore(mm)})(e),(function(c){c.createObjectStore(Hg,{keyPath:tae}),c.createObjectStore(Ii,{keyPath:W$,autoIncrement:!0}).createIndex(bl,z$,{unique:!0}),c.createObjectStore(sh)})(e),M3(e),(function(c){c.createObjectStore(Al)})(e));let s=P.resolve();return r<3&&i>=3&&(r!==0&&((function(c){c.deleteObjectStore(ch),c.deleteObjectStore(ah),c.deleteObjectStore(Ml)})(e),M3(e)),s=s.next(()=>(function(c){let l=c.store(Ml),d={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:ue.min().toTimestamp(),targetCount:0};return l.put(YI,d)})(o))),r<4&&i>=4&&(r!==0&&(s=s.next(()=>(function(c,l){return l.store(Ii).j().next(h=>{c.deleteObjectStore(Ii),c.createObjectStore(Ii,{keyPath:W$,autoIncrement:!0}).createIndex(bl,z$,{unique:!0});let f=l.store(Ii),g=h.map(E=>f.put(E));return P.waitFor(g)})})(e,o))),s=s.next(()=>{(function(c){c.createObjectStore(lh,{keyPath:uae})})(e)})),r<5&&i>=5&&(s=s.next(()=>this.pi(o))),r<6&&i>=6&&(s=s.next(()=>((function(c){c.createObjectStore($g)})(e),this.yi(o)))),r<7&&i>=7&&(s=s.next(()=>this.wi(o))),r<8&&i>=8&&(s=s.next(()=>this.Si(e,o))),r<9&&i>=9&&(s=s.next(()=>{(function(c){c.objectStoreNames.contains("remoteDocumentChanges")&&c.deleteObjectStore("remoteDocumentChanges")})(e)})),r<10&&i>=10&&(s=s.next(()=>this.bi(o))),r<11&&i>=11&&(s=s.next(()=>{(function(c){c.createObjectStore(Vv,{keyPath:dae})})(e),(function(c){c.createObjectStore(Bv,{keyPath:hae})})(e)})),r<12&&i>=12&&(s=s.next(()=>{(function(c){let l=c.createObjectStore(Gv,{keyPath:Tae});l.createIndex(OO,yae,{unique:!1}),l.createIndex(dW,Iae,{unique:!1})})(e)})),r<13&&i>=13&&(s=s.next(()=>(function(c){let l=c.createObjectStore(KI,{keyPath:rae});l.createIndex(xI,iae),l.createIndex(aW,oae)})(e)).next(()=>this.Di(e,o)).next(()=>e.deleteObjectStore(Al))),r<14&&i>=14&&(s=s.next(()=>this.Ci(e,o))),r<15&&i>=15&&(s=s.next(()=>(function(c){c.createObjectStore(w0,{keyPath:fae,autoIncrement:!0}).createIndex(wO,pae,{unique:!1}),c.createObjectStore(Mg,{keyPath:gae}).createIndex(lW,mae,{unique:!1}),c.createObjectStore(Pg,{keyPath:Eae}).createIndex(uW,_ae,{unique:!1})})(e))),r<16&&i>=16&&(s=s.next(()=>{n.objectStore(Mg).clear()}).next(()=>{n.objectStore(Pg).clear()})),r<17&&i>=17&&(s=s.next(()=>{(function(c){c.createObjectStore(O0,{keyPath:vae})})(e)})),r<18&&i>=18&&nN()&&(s=s.next(()=>{n.objectStore(Mg).clear()}).next(()=>{n.objectStore(Pg).clear()})),s}yi(e){let n=0;return e.store(Al).X((r,i)=>{n+=dv(i)}).next(()=>{let r={byteSize:n};return e.store($g).put(bO,r)})}pi(e){let n=e.store(Hg),r=e.store(Ii);return n.j().next(i=>P.forEach(i,o=>{let s=IDBKeyRange.bound([o.userId,Ll],[o.userId,o.lastAcknowledgedBatchId]);return r.j(bl,s).next(a=>P.forEach(a,c=>{se(c.userId===o.userId,18650,"Cannot process batch from unexpected user",{batchId:c.batchId});let l=Dl(this.serializer,c);return c6(e,o.userId,l).next(()=>{})}))}))}wi(e){let n=e.store(ch),r=e.store(Al);return e.store(Ml).get(YI).next(i=>{let o=[];return r.X((s,a)=>{let c=new ke(s),l=(function(h){return[0,Hn(h)]})(c);o.push(n.get(l).next(d=>d?P.resolve():(h=>n.put({targetId:0,path:Hn(h),sequenceNumber:i.highestListenSequenceNumber}))(c)))}).next(()=>P.waitFor(o))})}Si(e,n){e.createObjectStore(Wg,{keyPath:lae});let r=n.store(Wg),i=new im,o=s=>{if(i.add(s)){let a=s.lastSegment(),c=s.popLast();return r.put({collectionId:a,parent:Hn(c)})}};return n.store(Al).X({Z:!0},(s,a)=>{let c=new ke(s);return o(c.popLast())}).next(()=>n.store(sh).X({Z:!0},([s,a,c],l)=>{let d=go(a);return o(d.popLast())}))}bi(e){let n=e.store(ah);return n.X((r,i)=>{let o=wg(i),s=r6(this.serializer,o);return n.put(s)})}Di(e,n){let r=n.store(Al),i=[];return r.X((o,s)=>{let a=n.store(KI),c=(function(h){return h.document?new te(ke.fromString(h.document.name).popFirst(5)):h.noDocument?te.fromSegments(h.noDocument.path):h.unknownDocument?te.fromSegments(h.unknownDocument.path):ie(36783)})(s).path.toArray(),l={prefixPath:c.slice(0,c.length-2),collectionGroup:c[c.length-2],documentId:c[c.length-1],readTime:s.readTime||[0,0],unknownDocument:s.unknownDocument,noDocument:s.noDocument,document:s.document,hasCommittedMutations:!!s.hasCommittedMutations};i.push(a.put(l))}).next(()=>P.waitFor(i))}Ci(e,n){let r=n.store(Ii),i=f6(this.serializer),o=new sm(mv.Vi,this.serializer.gt);return r.j().next(s=>{let a=new Map;return s.forEach(c=>{var l;let d=(l=a.get(c.userId))!==null&&l!==void 0?l:Oe();Dl(this.serializer,c).keys().forEach(h=>d=d.add(h)),a.set(c.userId,d)}),P.forEach(a,(c,l)=>{let d=new Vt(l),h=cv.yt(this.serializer,d),f=o.getIndexManager(d),g=hv.yt(d,this.serializer,f,o.referenceDelegate);return new gv(i,g,h,f).recalculateAndSaveOverlaysForDocumentKeys(new zg(n,Dr.ue),c).next()})})}};function M3(t){t.createObjectStore(ch,{keyPath:aae}).createIndex(b0,cae,{unique:!0}),t.createObjectStore(ah,{keyPath:"targetId"}).createIndex(cW,sae,{unique:!0}),t.createObjectStore(Ml)}var Ta="IndexedDbPersistence",dO=18e5,hO=5e3,fO="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",ace="main",wL=class t{constructor(e,n,r,i,o,s,a,c,l,d,h=18){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Fi=o,this.window=s,this.document=a,this.Mi=l,this.xi=d,this.Oi=h,this.ui=null,this.ci=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ni=null,this.inForeground=!1,this.Bi=null,this.Li=null,this.ki=Number.NEGATIVE_INFINITY,this.qi=f=>Promise.resolve(),!t.C())throw new W(x.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new EL(this,i),this.Qi=n+ace,this.serializer=new sv(c),this.$i=new oh(this.Qi,this.Oi,new bL(this.serializer)),this.li=new oL,this.hi=new pL(this.referenceDelegate,this.serializer),this.remoteDocumentCache=f6(this.serializer),this.Ti=new iL,this.window&&this.window.localStorage?this.Ui=this.window.localStorage:(this.Ui=null,d===!1&&wt(Ta,"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Ki().then(()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new W(x.FAILED_PRECONDITION,fO);return this.Wi(),this.Gi(),this.zi(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.hi.getHighestSequenceNumber(e))}).then(e=>{this.ui=new Dr(e,this.Mi)}).then(()=>{this.ci=!0}).catch(e=>(this.$i&&this.$i.close(),Promise.reject(e)))}ji(e){return this.qi=n=>y(this,null,function*(){if(this.started)return e(n)}),e(this.isPrimary)}setDatabaseDeletedListener(e){this.$i.setDatabaseDeletedListener(e)}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.Fi.enqueueAndForget(()=>y(this,null,function*(){this.started&&(yield this.Ki())})))}Ki(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>LI(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.Ji(e).next(n=>{n||(this.isPrimary=!1,this.Fi.enqueueRetryable(()=>this.qi(!1)))})}).next(()=>this.Hi(e)).next(n=>this.isPrimary&&!n?this.Yi(e).next(()=>!1):!!n&&this.Zi(e).next(()=>!0))).catch(e=>{if(Fa(e))return z(Ta,"Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return z(Ta,"Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.Fi.enqueueRetryable(()=>this.qi(e)),this.isPrimary=e})}Ji(e){return Ng(e).get(Gd).next(n=>P.resolve(this.Xi(n)))}es(e){return LI(e).delete(this.clientId)}ts(){return y(this,null,function*(){if(this.isPrimary&&!this.ns(this.ki,dO)){this.ki=Date.now();let e=yield this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",n=>{let r=on(n,lh);return r.j().next(i=>{let o=this.rs(i,dO),s=i.filter(a=>o.indexOf(a)===-1);return P.forEach(s,a=>r.delete(a.clientId)).next(()=>s)})}).catch(()=>[]);if(this.Ui)for(let n of e)this.Ui.removeItem(this.ss(n.clientId))}})}zi(){this.Li=this.Fi.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.Ki().then(()=>this.ts()).then(()=>this.zi()))}Xi(e){return!!e&&e.ownerId===this.clientId}Hi(e){return this.xi?P.resolve(!0):Ng(e).get(Gd).next(n=>{if(n!==null&&this.ns(n.leaseTimestampMs,hO)&&!this._s(n.ownerId)){if(this.Xi(n)&&this.networkEnabled)return!0;if(!this.Xi(n)){if(!n.allowTabSynchronization)throw new W(x.FAILED_PRECONDITION,fO);return!1}}return!(!this.networkEnabled||!this.inForeground)||LI(e).j().next(r=>this.rs(r,hO).find(i=>{if(this.clientId!==i.clientId){let o=!this.networkEnabled&&i.networkEnabled,s=!this.inForeground&&i.inForeground,a=this.networkEnabled===i.networkEnabled;if(o||s&&a)return!0}return!1})===void 0)}).next(n=>(this.isPrimary!==n&&z(Ta,`Client ${n?"is":"is not"} eligible for a primary lease.`),n))}shutdown(){return y(this,null,function*(){this.ci=!1,this.us(),this.Li&&(this.Li.cancel(),this.Li=null),this.cs(),this.ls(),yield this.$i.runTransaction("shutdown","readwrite",[mm,lh],e=>{let n=new zg(e,Dr.ue);return this.Yi(n).next(()=>this.es(n))}),this.$i.close(),this.hs()})}rs(e,n){return e.filter(r=>this.ns(r.updateTimeMs,n)&&!this._s(r.clientId))}Ps(){return this.runTransaction("getActiveClients","readonly",e=>LI(e).j().next(n=>this.rs(n,dO).map(r=>r.clientId)))}get started(){return this.ci}getGlobalsCache(){return this.li}getMutationQueue(e,n){return hv.yt(e,this.serializer,n,this.referenceDelegate)}getTargetCache(){return this.hi}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new fL(e,this.serializer.gt.databaseId)}getDocumentOverlayCache(e){return cv.yt(this.serializer,e)}getBundleCache(){return this.Ti}runTransaction(e,n,r){z(Ta,"Starting transaction:",e);let i=n==="readonly"?"readonly":"readwrite",o=(function(c){return c===18?Cae:c===17?gW:c===16?Aae:c===15?L0:c===14?pW:c===13?fW:c===12?Sae:c===11?hW:void ie(60245)})(this.Oi),s;return this.$i.runTransaction(e,i,o,a=>(s=new zg(a,this.ui?this.ui.next():Dr.ue),n==="readwrite-primary"?this.Ji(s).next(c=>!!c||this.Hi(s)).next(c=>{if(!c)throw wt(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Fi.enqueueRetryable(()=>this.qi(!1)),new W(x.FAILED_PRECONDITION,rW);return r(s)}).next(c=>this.Zi(s).next(()=>c)):this.Ts(s).next(()=>r(s)))).then(a=>(s.raiseOnCommittedEvent(),a))}Ts(e){return Ng(e).get(Gd).next(n=>{if(n!==null&&this.ns(n.leaseTimestampMs,hO)&&!this._s(n.ownerId)&&!this.Xi(n)&&!(this.xi||this.allowTabSynchronization&&n.allowTabSynchronization))throw new W(x.FAILED_PRECONDITION,fO)})}Zi(e){let n={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return Ng(e).put(Gd,n)}static C(){return oh.C()}Yi(e){let n=Ng(e);return n.get(Gd).next(r=>this.Xi(r)?(z(Ta,"Releasing primary lease."),n.delete(Gd)):P.resolve())}ns(e,n){let r=Date.now();return!(e<r-n)&&(!(e>r)||(wt(`Detected an update time that is in the future: ${e} > ${r}`),!1))}Wi(){this.document!==null&&typeof this.document.addEventListener=="function"&&(this.Bi=()=>{this.Fi.enqueueAndForget(()=>(this.inForeground=this.document.visibilityState==="visible",this.Ki()))},this.document.addEventListener("visibilitychange",this.Bi),this.inForeground=this.document.visibilityState==="visible")}cs(){this.Bi&&(this.document.removeEventListener("visibilitychange",this.Bi),this.Bi=null)}Gi(){var e;typeof((e=this.window)===null||e===void 0?void 0:e.addEventListener)=="function"&&(this.Ni=()=>{this.us();let n=/(?:Version|Mobile)\/1[456]/;tN()&&(navigator.appVersion.match(n)||navigator.userAgent.match(n))&&this.Fi.enterRestrictedMode(!0),this.Fi.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.Ni))}ls(){this.Ni&&(this.window.removeEventListener("pagehide",this.Ni),this.Ni=null)}_s(e){var n;try{let r=((n=this.Ui)===null||n===void 0?void 0:n.getItem(this.ss(e)))!==null;return z(Ta,`Client '${e}' ${r?"is":"is not"} zombied in LocalStorage`),r}catch(r){return wt(Ta,"Failed to get zombied client id.",r),!1}}us(){if(this.Ui)try{this.Ui.setItem(this.ss(this.clientId),String(Date.now()))}catch(e){wt("Failed to set zombie client id.",e)}}hs(){if(this.Ui)try{this.Ui.removeItem(this.ss(this.clientId))}catch{}}ss(e){return`firestore_zombie_${this.persistenceKey}_${e}`}};function Ng(t){return on(t,mm)}function LI(t){return on(t,lh)}function p6(t,e){let n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var OL=class t{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.Is=r,this.ds=i}static Es(e,n){let r=Oe(),i=Oe();for(let o of n.docChanges)switch(o.type){case 0:r=r.add(o.doc.key);break;case 1:i=i.add(o.doc.key)}return new t(e,n.fromCache,r,i)}};var LL=class{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}};var _v=class{constructor(){this.As=!1,this.Rs=!1,this.Vs=100,this.fs=(function(){return tN()?8:iW(Zt())>0?6:4})()}initialize(e,n){this.gs=e,this.indexManager=n,this.As=!0}getDocumentsMatchingQuery(e,n,r,i){let o={result:null};return this.ps(e,n).next(s=>{o.result=s}).next(()=>{if(!o.result)return this.ys(e,n,i,r).next(s=>{o.result=s})}).next(()=>{if(o.result)return;let s=new LL;return this.ws(e,n,s).next(a=>{if(o.result=a,this.Rs)return this.Ss(e,n,s,a.size)})}).next(()=>o.result)}Ss(e,n,r,i){return r.documentReadCount<this.Vs?(qd()<=Ne.DEBUG&&z("QueryEngine","SDK will not create cache indexes for query:",Kd(n),"since it only creates cache indexes for collection contains","more than or equal to",this.Vs,"documents"),P.resolve()):(qd()<=Ne.DEBUG&&z("QueryEngine","Query:",Kd(n),"scans",r.documentReadCount,"local documents and returns",i,"documents as results."),r.documentReadCount>this.fs*i?(qd()<=Ne.DEBUG&&z("QueryEngine","The SDK decides to create cache indexes for query:",Kd(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,br(n))):P.resolve())}ps(e,n){if(i3(n))return P.resolve(null);let r=br(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=nv(n,null,"F"),r=br(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(o=>{let s=Oe(...o);return this.gs.getDocuments(e,s).next(a=>this.indexManager.getMinOffset(e,r).next(c=>{let l=this.bs(n,a);return this.Ds(n,l,s,c.readTime)?this.ps(e,nv(n,null,"F")):this.vs(e,l,n,c)}))})))}ys(e,n,r,i){return i3(n)||i.isEqual(ue.min())?P.resolve(null):this.gs.getDocuments(e,r).next(o=>{let s=this.bs(n,o);return this.Ds(n,s,r,i)?P.resolve(null):(qd()<=Ne.DEBUG&&z("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Kd(n)),this.vs(e,s,n,tW(i,rh)).next(a=>a))})}bs(e,n){let r=new nt(PW(e));return n.forEach((i,o)=>{Tm(e,o)&&(r=r.add(o))}),r}Ds(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;let o=e.limitType==="F"?n.last():n.first();return!!o&&(o.hasPendingWrites||o.version.compareTo(i)>0)}ws(e,n,r){return qd()<=Ne.DEBUG&&z("QueryEngine","Using full collection scan to execute query:",Kd(n)),this.gs.getDocumentsMatchingQuery(e,n,zr.min(),r)}vs(e,n,r,i){return this.gs.getDocumentsMatchingQuery(e,r,i).next(o=>(n.forEach(s=>{o=o.insert(s.key,s)}),o))}};var j0="LocalStore",cce=3e8,ML=class{constructor(e,n,r,i){this.persistence=e,this.Cs=n,this.serializer=i,this.Fs=new pt(Ie),this.Ms=new vi(o=>Fl(o),Em),this.xs=new Map,this.Os=e.getRemoteDocumentCache(),this.hi=e.getTargetCache(),this.Ti=e.getBundleCache(),this.Ns(r)}Ns(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new gv(this.Os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Os.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.Fs))}};function g6(t,e,n,r){return new ML(t,e,n,r)}function m6(t,e){return y(this,null,function*(){let n=oe(t);return yield n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(o=>(i=o,n.Ns(e),n.mutationQueue.getAllMutationBatches(r))).next(o=>{let s=[],a=[],c=Oe();for(let l of i){s.push(l.batchId);for(let d of l.mutations)c=c.add(d.key)}for(let l of o){a.push(l.batchId);for(let d of l.mutations)c=c.add(d.key)}return n.localDocuments.getDocuments(r,c).next(l=>({Bs:l,removedBatchIds:s,addedBatchIds:a}))})})})}function lce(t,e){let n=oe(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{let i=e.batch.keys(),o=n.Os.newChangeBuffer({trackRemovals:!0});return(function(a,c,l,d){let h=l.batch,f=h.keys(),g=P.resolve();return f.forEach(E=>{g=g.next(()=>d.getEntry(c,E)).next(I=>{let S=l.docVersions.get(E);se(S!==null,48541),I.version.compareTo(S)<0&&(h.applyToRemoteDocument(I,l),I.isValidDocument()&&(I.setReadTime(l.commitVersion),d.addEntry(I)))})}),g.next(()=>a.mutationQueue.removeMutationBatch(c,h))})(n,r,e,o).next(()=>o.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,(function(a){let c=Oe();for(let l=0;l<a.mutationResults.length;++l)a.mutationResults[l].transformResults.length>0&&(c=c.add(a.batch.mutations[l].key));return c})(e))).next(()=>n.localDocuments.getDocuments(r,i))})}function E6(t){let e=oe(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.hi.getLastRemoteSnapshotVersion(n))}function uce(t,e){let n=oe(t),r=e.snapshotVersion,i=n.Fs;return n.persistence.runTransaction("Apply remote event","readwrite-primary",o=>{let s=n.Os.newChangeBuffer({trackRemovals:!0});i=n.Fs;let a=[];e.targetChanges.forEach((d,h)=>{let f=i.get(h);if(!f)return;a.push(n.hi.removeMatchingKeys(o,d.removedDocuments,h).next(()=>n.hi.addMatchingKeys(o,d.addedDocuments,h)));let g=f.withSequenceNumber(o.currentSequenceNumber);e.targetMismatches.get(h)!==null?g=g.withResumeToken(Gt.EMPTY_BYTE_STRING,ue.min()).withLastLimboFreeSnapshotVersion(ue.min()):d.resumeToken.approximateByteSize()>0&&(g=g.withResumeToken(d.resumeToken,r)),i=i.insert(h,g),(function(I,S,R){return I.resumeToken.approximateByteSize()===0||S.snapshotVersion.toMicroseconds()-I.snapshotVersion.toMicroseconds()>=cce?!0:R.addedDocuments.size+R.modifiedDocuments.size+R.removedDocuments.size>0})(f,g,d)&&a.push(n.hi.updateTargetData(o,g))});let c=Nr(),l=Oe();if(e.documentUpdates.forEach(d=>{e.resolvedLimboDocuments.has(d)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(o,d))}),a.push(dce(o,s,e.documentUpdates).next(d=>{c=d.Ls,l=d.ks})),!r.isEqual(ue.min())){let d=n.hi.getLastRemoteSnapshotVersion(o).next(h=>n.hi.setTargetsMetadata(o,o.currentSequenceNumber,r));a.push(d)}return P.waitFor(a).next(()=>s.apply(o)).next(()=>n.localDocuments.getLocalViewOfDocuments(o,c,l)).next(()=>c)}).then(o=>(n.Fs=i,o))}function dce(t,e,n){let r=Oe(),i=Oe();return n.forEach(o=>r=r.add(o)),e.getEntries(t,r).next(o=>{let s=Nr();return n.forEach((a,c)=>{let l=o.get(a);c.isFoundDocument()!==l.isFoundDocument()&&(i=i.add(a)),c.isNoDocument()&&c.version.isEqual(ue.min())?(e.removeEntry(a,c.readTime),s=s.insert(a,c)):!l.isValidDocument()||c.version.compareTo(l.version)>0||c.version.compareTo(l.version)===0&&l.hasPendingWrites?(e.addEntry(c),s=s.insert(a,c)):z(j0,"Ignoring outdated watch update for ",a,". Current version:",l.version," Watch version:",c.version)}),{Ls:s,ks:i}})}function hce(t,e){let n=oe(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=Ll),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function Tv(t,e){let n=oe(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.hi.getTargetData(r,e).next(o=>o?(i=o,P.resolve(i)):n.hi.allocateTargetId(r).next(s=>(i=new Eh(e,s,"TargetPurposeListen",r.currentSequenceNumber),n.hi.addTargetData(r,i).next(()=>i))))}).then(r=>{let i=n.Fs.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.Fs=n.Fs.insert(r.targetId,r),n.Ms.set(e,r.targetId)),r})}function Th(t,e,n){return y(this,null,function*(){let r=oe(t),i=r.Fs.get(e),o=n?"readwrite":"readwrite-primary";try{n||(yield r.persistence.runTransaction("Release target",o,s=>r.persistence.referenceDelegate.removeTarget(s,i)))}catch(s){if(!Fa(s))throw s;z(j0,`Failed to update sequence numbers for target ${e}: ${s}`)}r.Fs=r.Fs.remove(e),r.Ms.delete(i.target)})}function PL(t,e,n){let r=oe(t),i=ue.min(),o=Oe();return r.persistence.runTransaction("Execute query","readwrite",s=>(function(c,l,d){let h=oe(c),f=h.Ms.get(d);return f!==void 0?P.resolve(h.Fs.get(f)):h.hi.getTargetData(l,d)})(r,s,br(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.hi.getMatchingKeysForTargetId(s,a.targetId).next(c=>{o=c})}).next(()=>r.Cs.getDocumentsMatchingQuery(s,e,n?i:ue.min(),n?o:Oe())).next(a=>(y6(r,MW(e),a),{documents:a,qs:o})))}function _6(t,e){let n=oe(t),r=oe(n.hi),i=n.Fs.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",o=>r.Et(o,e).next(s=>s?s.target:null))}function T6(t,e){let n=oe(t),r=n.xs.get(e)||ue.min();return n.persistence.runTransaction("Get new document changes","readonly",i=>n.Os.getAllFromCollectionGroup(i,e,tW(r,rh),Number.MAX_SAFE_INTEGER)).then(i=>(y6(n,e,i),i))}function y6(t,e,n){let r=t.xs.get(e)||ue.min();n.forEach((i,o)=>{o.readTime.compareTo(r)>0&&(r=o.readTime)}),t.xs.set(e,r)}var I6="firestore_clients";function P3(t,e){return`${I6}_${t}_${e}`}var v6="firestore_mutations";function x3(t,e,n){let r=`${v6}_${t}_${n}`;return e.isAuthenticated()&&(r+=`_${e.uid}`),r}var S6="firestore_targets";function pO(t,e){return`${S6}_${t}_${e}`}var po="SharedClientState",yv=class t{constructor(e,n,r,i){this.user=e,this.batchId=n,this.state=r,this.error=i}static Ks(e,n,r){let i=JSON.parse(r),o,s=typeof i=="object"&&["pending","acknowledged","rejected"].indexOf(i.state)!==-1&&(i.error===void 0||typeof i.error=="object");return s&&i.error&&(s=typeof i.error.message=="string"&&typeof i.error.code=="string",s&&(o=new W(i.error.code,i.error.message))),s?new t(e,n,i.state,o):(wt(po,`Failed to parse mutation state for ID '${n}': ${r}`),null)}Ws(){let e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}},Ug=class t{constructor(e,n,r){this.targetId=e,this.state=n,this.error=r}static Ks(e,n){let r=JSON.parse(n),i,o=typeof r=="object"&&["not-current","current","rejected"].indexOf(r.state)!==-1&&(r.error===void 0||typeof r.error=="object");return o&&r.error&&(o=typeof r.error.message=="string"&&typeof r.error.code=="string",o&&(i=new W(r.error.code,r.error.message))),o?new t(e,r.state,i):(wt(po,`Failed to parse target state for ID '${e}': ${n}`),null)}Ws(){let e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}},Iv=class t{constructor(e,n){this.clientId=e,this.activeTargetIds=n}static Ks(e,n){let r=JSON.parse(n),i=typeof r=="object"&&r.activeTargetIds instanceof Array,o=F0();for(let s=0;i&&s<r.activeTargetIds.length;++s)i=oW(r.activeTargetIds[s]),o=o.add(r.activeTargetIds[s]);return i?new t(e,o):(wt(po,`Failed to parse client data for instance '${e}': ${n}`),null)}},xL=class t{constructor(e,n){this.clientId=e,this.onlineState=n}static Ks(e){let n=JSON.parse(e);return typeof n=="object"&&["Unknown","Online","Offline"].indexOf(n.onlineState)!==-1&&typeof n.clientId=="string"?new t(n.clientId,n.onlineState):(wt(po,`Failed to parse online state: ${e}`),null)}},am=class{constructor(){this.activeTargetIds=F0()}Gs(e){this.activeTargetIds=this.activeTargetIds.add(e)}zs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){let e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}},Vg=class{constructor(e,n,r,i,o){this.window=e,this.Fi=n,this.persistenceKey=r,this.js=i,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.Js=this.Hs.bind(this),this.Ys=new pt(Ie),this.started=!1,this.Zs=[];let s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=o,this.Xs=P3(this.persistenceKey,this.js),this.eo=(function(c){return`firestore_sequence_number_${c}`})(this.persistenceKey),this.Ys=this.Ys.insert(this.js,new am),this.no=new RegExp(`^${I6}_${s}_([^_]*)$`),this.ro=new RegExp(`^${v6}_${s}_(\\d+)(?:_(.*))?$`),this.io=new RegExp(`^${S6}_${s}_(\\d+)$`),this.so=(function(c){return`firestore_online_state_${c}`})(this.persistenceKey),this.oo=(function(c){return`firestore_bundle_loaded_v2_${c}`})(this.persistenceKey),this.window.addEventListener("storage",this.Js)}static C(e){return!(!e||!e.localStorage)}start(){return y(this,null,function*(){let e=yield this.syncEngine.Ps();for(let r of e){if(r===this.js)continue;let i=this.getItem(P3(this.persistenceKey,r));if(i){let o=Iv.Ks(r,i);o&&(this.Ys=this.Ys.insert(o.clientId,o))}}this._o();let n=this.storage.getItem(this.so);if(n){let r=this.ao(n);r&&this.uo(r)}for(let r of this.Zs)this.Hs(r);this.Zs=[],this.window.addEventListener("pagehide",()=>this.shutdown()),this.started=!0})}writeSequenceNumber(e){this.setItem(this.eo,JSON.stringify(e))}getAllActiveQueryTargets(){return this.co(this.Ys)}isActiveQueryTarget(e){let n=!1;return this.Ys.forEach((r,i)=>{i.activeTargetIds.has(e)&&(n=!0)}),n}addPendingMutation(e){this.lo(e,"pending")}updateMutationState(e,n,r){this.lo(e,n,r),this.ho(e)}addLocalQueryTarget(e,n=!0){let r="not-current";if(this.isActiveQueryTarget(e)){let i=this.storage.getItem(pO(this.persistenceKey,e));if(i){let o=Ug.Ks(e,i);o&&(r=o.state)}}return n&&this.Po.Gs(e),this._o(),r}removeLocalQueryTarget(e){this.Po.zs(e),this._o()}isLocalQueryTarget(e){return this.Po.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(pO(this.persistenceKey,e))}updateQueryState(e,n,r){this.To(e,n,r)}handleUserChange(e,n,r){n.forEach(i=>{this.ho(i)}),this.currentUser=e,r.forEach(i=>{this.addPendingMutation(i)})}setOnlineState(e){this.Io(e)}notifyBundleLoaded(e){this.Eo(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.Js),this.removeItem(this.Xs),this.started=!1)}getItem(e){let n=this.storage.getItem(e);return z(po,"READ",e,n),n}setItem(e,n){z(po,"SET",e,n),this.storage.setItem(e,n)}removeItem(e){z(po,"REMOVE",e),this.storage.removeItem(e)}Hs(e){let n=e;if(n.storageArea===this.storage){if(z(po,"EVENT",n.key,n.newValue),n.key===this.Xs)return void wt("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Fi.enqueueRetryable(()=>y(this,null,function*(){if(this.started){if(n.key!==null){if(this.no.test(n.key)){if(n.newValue==null){let r=this.Ao(n.key);return this.Ro(r,null)}{let r=this.Vo(n.key,n.newValue);if(r)return this.Ro(r.clientId,r)}}else if(this.ro.test(n.key)){if(n.newValue!==null){let r=this.mo(n.key,n.newValue);if(r)return this.fo(r)}}else if(this.io.test(n.key)){if(n.newValue!==null){let r=this.po(n.key,n.newValue);if(r)return this.yo(r)}}else if(n.key===this.so){if(n.newValue!==null){let r=this.ao(n.newValue);if(r)return this.uo(r)}}else if(n.key===this.eo){let r=(function(o){let s=Dr.ue;if(o!=null)try{let a=JSON.parse(o);se(typeof a=="number",30636,{wo:o}),s=a}catch(a){wt(po,"Failed to read sequence number from WebStorage",a)}return s})(n.newValue);r!==Dr.ue&&this.sequenceNumberHandler(r)}else if(n.key===this.oo){let r=this.So(n.newValue);yield Promise.all(r.map(i=>this.syncEngine.bo(i)))}}}else this.Zs.push(n)}))}}get Po(){return this.Ys.get(this.js)}_o(){this.setItem(this.Xs,this.Po.Ws())}lo(e,n,r){let i=new yv(this.currentUser,e,n,r),o=x3(this.persistenceKey,this.currentUser,e);this.setItem(o,i.Ws())}ho(e){let n=x3(this.persistenceKey,this.currentUser,e);this.removeItem(n)}Io(e){let n={clientId:this.js,onlineState:e};this.storage.setItem(this.so,JSON.stringify(n))}To(e,n,r){let i=pO(this.persistenceKey,e),o=new Ug(e,n,r);this.setItem(i,o.Ws())}Eo(e){let n=JSON.stringify(Array.from(e));this.setItem(this.oo,n)}Ao(e){let n=this.no.exec(e);return n?n[1]:null}Vo(e,n){let r=this.Ao(e);return Iv.Ks(r,n)}mo(e,n){let r=this.ro.exec(e),i=Number(r[1]),o=r[2]!==void 0?r[2]:null;return yv.Ks(new Vt(o),i,n)}po(e,n){let r=this.io.exec(e),i=Number(r[1]);return Ug.Ks(i,n)}ao(e){return xL.Ks(e)}So(e){return JSON.parse(e)}fo(e){return y(this,null,function*(){if(e.user.uid===this.currentUser.uid)return this.syncEngine.Do(e.batchId,e.state,e.error);z(po,`Ignoring mutation for non-active user ${e.user.uid}`)})}yo(e){return this.syncEngine.vo(e.targetId,e.state,e.error)}Ro(e,n){let r=n?this.Ys.insert(e,n):this.Ys.remove(e),i=this.co(this.Ys),o=this.co(r),s=[],a=[];return o.forEach(c=>{i.has(c)||s.push(c)}),i.forEach(c=>{o.has(c)||a.push(c)}),this.syncEngine.Co(s,a).then(()=>{this.Ys=r})}uo(e){this.Ys.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}co(e){let n=F0();return e.forEach((r,i)=>{n=n.unionWith(i.activeTargetIds)}),n}},vv=class{constructor(){this.Fo=new am,this.Mo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.Fo.Gs(e),this.Mo[e]||"not-current"}updateQueryState(e,n,r){this.Mo[e]=n}removeLocalQueryTarget(e){this.Fo.zs(e)}isLocalQueryTarget(e){return this.Fo.activeTargetIds.has(e)}clearQueryState(e){delete this.Mo[e]}getAllActiveQueryTargets(){return this.Fo.activeTargetIds}isActiveQueryTarget(e){return this.Fo.activeTargetIds.has(e)}start(){return this.Fo=new am,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}};var kL=class{xo(e){}shutdown(){}};var k3="ConnectivityMonitor",Sv=class{constructor(){this.Oo=()=>this.No(),this.Bo=()=>this.Lo(),this.ko=[],this.qo()}xo(e){this.ko.push(e)}shutdown(){window.removeEventListener("online",this.Oo),window.removeEventListener("offline",this.Bo)}qo(){window.addEventListener("online",this.Oo),window.addEventListener("offline",this.Bo)}No(){z(k3,"Network connectivity changed: AVAILABLE");for(let e of this.ko)e(0)}Lo(){z(k3,"Network connectivity changed: UNAVAILABLE");for(let e of this.ko)e(1)}static C(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}};var MI=null;function FL(){return MI===null?MI=(function(){return 268435456+Math.round(2147483648*Math.random())})():MI++,"0x"+MI.toString(16)}var gO="RestConnection",fce={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"},UL=class{get Qo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;let n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.$o=n+"://"+e.host,this.Uo=`projects/${r}/databases/${i}`,this.Ko=this.databaseId.database===Kg?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Wo(e,n,r,i,o){let s=FL(),a=this.Go(e,n.toUriEncodedString());z(gO,`Sending RPC '${e}' ${s}:`,a,r);let c={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.Ko};this.zo(c,i,o);let{host:l}=new URL(a),d=vr(l);return this.jo(e,a,c,r,d).then(h=>(z(gO,`Received RPC '${e}' ${s}: `,h),h),h=>{throw ls(gO,`RPC '${e}' ${s} failed with error: `,h,"url: ",a,"request:",r),h})}Jo(e,n,r,i,o,s){return this.Wo(e,n,r,i,o)}zo(e,n,r){e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+Dh})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach((i,o)=>e[o]=i),r&&r.headers.forEach((i,o)=>e[o]=i)}Go(e,n){let r=fce[e];return`${this.$o}/v1/${n}:${r}`}terminate(){}};var VL=class{constructor(e){this.Ho=e.Ho,this.Yo=e.Yo}Zo(e){this.Xo=e}e_(e){this.t_=e}n_(e){this.r_=e}onMessage(e){this.i_=e}close(){this.Yo()}send(e){this.Ho(e)}s_(){this.Xo()}o_(){this.t_()}__(e){this.r_(e)}a_(e){this.i_(e)}};var Gn="WebChannelConnection",BL=class extends UL{constructor(e){super(e),this.u_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}jo(e,n,r,i,o){let s=FL();return new Promise((a,c)=>{let l=new oO;l.setWithCredentials(!0),l.listenOnce(sO.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case Ag.NO_ERROR:let h=l.getResponseJson();z(Gn,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(h)),a(h);break;case Ag.TIMEOUT:z(Gn,`RPC '${e}' ${s} timed out`),c(new W(x.DEADLINE_EXCEEDED,"Request time out"));break;case Ag.HTTP_ERROR:let f=l.getStatus();if(z(Gn,`RPC '${e}' ${s} failed with status:`,f,"response text:",l.getResponseText()),f>0){let g=l.getResponseJson();Array.isArray(g)&&(g=g[0]);let E=g?.error;if(E&&E.status&&E.message){let I=(function(R){let U=R.toLowerCase().replace(/_/g,"-");return Object.values(x).indexOf(U)>=0?U:x.UNKNOWN})(E.status);c(new W(I,E.message))}else c(new W(x.UNKNOWN,"Server responded with status "+l.getStatus()))}else c(new W(x.UNAVAILABLE,"Connection failed."));break;default:ie(9055,{c_:e,streamId:s,l_:l.getLastErrorCode(),h_:l.getLastError()})}}finally{z(Gn,`RPC '${e}' ${s} completed.`)}});let d=JSON.stringify(i);z(Gn,`RPC '${e}' ${s} sending request:`,i),l.send(n,"POST",d,r,15)})}P_(e,n,r){let i=FL(),o=[this.$o,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=lO(),a=cO(),c={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(c.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(c.useFetchStreams=!0),this.zo(c.initMessageHeaders,n,r),c.encodeInitMessageHeaders=!0;let d=o.join("");z(Gn,`Creating RPC '${e}' stream ${i}: ${d}`,c);let h=s.createWebChannel(d,c);this.T_(h);let f=!1,g=!1,E=new VL({Ho:S=>{g?z(Gn,`Not sending because RPC '${e}' stream ${i} is closed:`,S):(f||(z(Gn,`Opening RPC '${e}' stream ${i} transport.`),h.open(),f=!0),z(Gn,`RPC '${e}' stream ${i} sending:`,S),h.send(S))},Yo:()=>h.close()}),I=(S,R,U)=>{S.listen(R,H=>{try{U(H)}catch(Q){setTimeout(()=>{throw Q},0)}})};return I(h,Bd.EventType.OPEN,()=>{g||(z(Gn,`RPC '${e}' stream ${i} transport opened.`),E.s_())}),I(h,Bd.EventType.CLOSE,()=>{g||(g=!0,z(Gn,`RPC '${e}' stream ${i} transport closed`),E.__(),this.I_(h))}),I(h,Bd.EventType.ERROR,S=>{g||(g=!0,ls(Gn,`RPC '${e}' stream ${i} transport errored. Name:`,S.name,"Message:",S.message),E.__(new W(x.UNAVAILABLE,"The operation could not be completed")))}),I(h,Bd.EventType.MESSAGE,S=>{var R;if(!g){let U=S.data[0];se(!!U,16349);let H=U,Q=H?.error||((R=H[0])===null||R===void 0?void 0:R.error);if(Q){z(Gn,`RPC '${e}' stream ${i} received error:`,Q);let ae=Q.status,ne=(function(C){let w=Ft[C];if(w!==void 0)return zW(w)})(ae),A=Q.message;ne===void 0&&(ne=x.INTERNAL,A="Unknown error status: "+ae+" with message "+Q.message),g=!0,E.__(new W(ne,A)),h.close()}else z(Gn,`RPC '${e}' stream ${i} received:`,U),E.a_(U)}}),I(a,aO.STAT_EVENT,S=>{S.stat===NI.PROXY?z(Gn,`RPC '${e}' stream ${i} detected buffering proxy`):S.stat===NI.NOPROXY&&z(Gn,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{E.o_()},0),E}terminate(){this.u_.forEach(e=>e.close()),this.u_=[]}T_(e){this.u_.push(e)}I_(e){this.u_=this.u_.filter(n=>n===e)}};function A6(){return typeof window<"u"?window:null}function GI(){return typeof document<"u"?document:null}function zv(t){return new ZO(t,!0)}var cm=class{constructor(e,n,r=1e3,i=1.5,o=6e4){this.Fi=e,this.timerId=n,this.d_=r,this.E_=i,this.A_=o,this.R_=0,this.V_=null,this.m_=Date.now(),this.reset()}reset(){this.R_=0}f_(){this.R_=this.A_}g_(e){this.cancel();let n=Math.floor(this.R_+this.p_()),r=Math.max(0,Date.now()-this.m_),i=Math.max(0,n-r);i>0&&z("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.R_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.V_=this.Fi.enqueueAfterDelay(this.timerId,i,()=>(this.m_=Date.now(),e())),this.R_*=this.E_,this.R_<this.d_&&(this.R_=this.d_),this.R_>this.A_&&(this.R_=this.A_)}y_(){this.V_!==null&&(this.V_.skipDelay(),this.V_=null)}cancel(){this.V_!==null&&(this.V_.cancel(),this.V_=null)}p_(){return(Math.random()-.5)*this.R_}};var F3="PersistentStream",Av=class{constructor(e,n,r,i,o,s,a,c){this.Fi=e,this.w_=r,this.S_=i,this.connection=o,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=a,this.listener=c,this.state=0,this.b_=0,this.D_=null,this.v_=null,this.stream=null,this.C_=0,this.F_=new cm(e,n)}M_(){return this.state===1||this.state===5||this.x_()}x_(){return this.state===2||this.state===3}start(){this.C_=0,this.state!==4?this.auth():this.O_()}stop(){return y(this,null,function*(){this.M_()&&(yield this.close(0))})}N_(){this.state=0,this.F_.reset()}B_(){this.x_()&&this.D_===null&&(this.D_=this.Fi.enqueueAfterDelay(this.w_,6e4,()=>this.L_()))}k_(e){this.q_(),this.stream.send(e)}L_(){return y(this,null,function*(){if(this.x_())return this.close(0)})}q_(){this.D_&&(this.D_.cancel(),this.D_=null)}Q_(){this.v_&&(this.v_.cancel(),this.v_=null)}close(e,n){return y(this,null,function*(){this.q_(),this.Q_(),this.F_.cancel(),this.b_++,e!==4?this.F_.reset():n&&n.code===x.RESOURCE_EXHAUSTED?(wt(n.toString()),wt("Using maximum backoff delay to prevent overloading the backend."),this.F_.f_()):n&&n.code===x.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.U_(),this.stream.close(),this.stream=null),this.state=e,yield this.listener.n_(n)})}U_(){}auth(){this.state=1;let e=this.K_(this.b_),n=this.b_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.b_===n&&this.W_(r,i)},r=>{e(()=>{let i=new W(x.UNKNOWN,"Fetching auth token failed: "+r.message);return this.G_(i)})})}W_(e,n){let r=this.K_(this.b_);this.stream=this.z_(e,n),this.stream.Zo(()=>{r(()=>this.listener.Zo())}),this.stream.e_(()=>{r(()=>(this.state=2,this.v_=this.Fi.enqueueAfterDelay(this.S_,1e4,()=>(this.x_()&&(this.state=3),Promise.resolve())),this.listener.e_()))}),this.stream.n_(i=>{r(()=>this.G_(i))}),this.stream.onMessage(i=>{r(()=>++this.C_==1?this.j_(i):this.onNext(i))})}O_(){this.state=5,this.F_.g_(()=>y(this,null,function*(){this.state=0,this.start()}))}G_(e){return z(F3,`close with error: ${e}`),this.stream=null,this.close(4,e)}K_(e){return n=>{this.Fi.enqueueAndForget(()=>this.b_===e?n():(z(F3,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}},GL=class extends Av{constructor(e,n,r,i,o,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,s),this.serializer=o}z_(e,n){return this.connection.P_("Listen",e,n)}j_(e){return this.onNext(e)}onNext(e){this.F_.reset();let n=Xae(this.serializer,e),r=(function(o){if(!("targetChange"in o))return ue.min();let s=o.targetChange;return s.targetIds&&s.targetIds.length?ue.min():s.readTime?En(s.readTime):ue.min()})(e);return this.listener.J_(n,r)}H_(e){let n={};n.database=nL(this.serializer),n.addTarget=(function(o,s){let a,c=s.target;if(a=ev(c)?{documents:JW(o,c)}:{query:B0(o,c).Vt},a.targetId=s.targetId,s.resumeToken.approximateByteSize()>0){a.resumeToken=qW(o,s.resumeToken);let l=eL(o,s.expectedCount);l!==null&&(a.expectedCount=l)}else if(s.snapshotVersion.compareTo(ue.min())>0){a.readTime=mh(o,s.snapshotVersion.toTimestamp());let l=eL(o,s.expectedCount);l!==null&&(a.expectedCount=l)}return a})(this.serializer,e);let r=Zae(this.serializer,e);r&&(n.labels=r),this.k_(n)}Y_(e){let n={};n.database=nL(this.serializer),n.removeTarget=e,this.k_(n)}},jL=class extends Av{constructor(e,n,r,i,o,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,s),this.serializer=o}get Z_(){return this.C_>0}start(){this.lastStreamToken=void 0,super.start()}U_(){this.Z_&&this.X_([])}z_(e,n){return this.connection.P_("Write",e,n)}j_(e){return se(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,se(!e.writeResults||e.writeResults.length===0,55816),this.listener.ea()}onNext(e){se(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.F_.reset();let n=Qae(e.writeResults,e.commitTime),r=En(e.commitTime);return this.listener.ta(r,n)}na(){let e={};e.database=nL(this.serializer),this.k_(e)}X_(e){let n={streamToken:this.lastStreamToken,writes:e.map(r=>rm(this.serializer,r))};this.k_(n)}};var HL=class{},$L=class extends HL{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.ra=!1}ia(){if(this.ra)throw new W(x.FAILED_PRECONDITION,"The client has already been terminated.")}Wo(e,n,r,i){return this.ia(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,s])=>this.connection.Wo(e,tL(n,r),i,o,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===x.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new W(x.UNKNOWN,o.toString())})}Jo(e,n,r,i,o){return this.ia(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,a])=>this.connection.Jo(e,tL(n,r),i,s,a,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===x.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new W(x.UNKNOWN,s.toString())})}terminate(){this.ra=!0,this.connection.terminate()}},WL=class{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.sa=0,this.oa=null,this._a=!0}aa(){this.sa===0&&(this.ua("Unknown"),this.oa=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.oa=null,this.ca("Backend didn't respond within 10 seconds."),this.ua("Offline"),Promise.resolve())))}la(e){this.state==="Online"?this.ua("Unknown"):(this.sa++,this.sa>=1&&(this.ha(),this.ca(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ua("Offline")))}set(e){this.ha(),this.sa=0,e==="Online"&&(this._a=!1),this.ua(e)}ua(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}ca(e){let n=`Could not reach Cloud Firestore backend. ${e}
|
|
170
|
+
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this._a?(wt(n),this._a=!1):z("OnlineStateTracker",n)}ha(){this.oa!==null&&(this.oa.cancel(),this.oa=null)}};var Hl="RemoteStore",zL=class{constructor(e,n,r,i,o){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Pa=[],this.Ta=new Map,this.Ia=new Set,this.da=[],this.Ea=o,this.Ea.xo(s=>{r.enqueueAndForget(()=>y(this,null,function*(){ql(this)&&(z(Hl,"Restarting streams for network reachability change."),yield(function(c){return y(this,null,function*(){let l=oe(c);l.Ia.add(4),yield ym(l),l.Aa.set("Unknown"),l.Ia.delete(4),yield qv(l)})})(this))}))}),this.Aa=new WL(r,i)}};function qv(t){return y(this,null,function*(){if(ql(t))for(let e of t.da)yield e(!0)})}function ym(t){return y(this,null,function*(){for(let e of t.da)yield e(!1)})}function Kv(t,e){let n=oe(t);n.Ta.has(e.targetId)||(n.Ta.set(e.targetId,e),W0(n)?$0(n):Nh(n).x_()&&H0(n,e))}function yh(t,e){let n=oe(t),r=Nh(n);n.Ta.delete(e),r.x_()&&C6(n,e),n.Ta.size===0&&(r.x_()?r.B_():ql(n)&&n.Aa.set("Unknown"))}function H0(t,e){if(t.Ra.$e(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(ue.min())>0){let n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}Nh(t).H_(e)}function C6(t,e){t.Ra.$e(e),Nh(t).Y_(e)}function $0(t){t.Ra=new JO({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Et:e=>t.Ta.get(e)||null,lt:()=>t.datastore.serializer.databaseId}),Nh(t).start(),t.Aa.aa()}function W0(t){return ql(t)&&!Nh(t).M_()&&t.Ta.size>0}function ql(t){return oe(t).Ia.size===0}function D6(t){t.Ra=void 0}function pce(t){return y(this,null,function*(){t.Aa.set("Online")})}function gce(t){return y(this,null,function*(){t.Ta.forEach((e,n)=>{H0(t,e)})})}function mce(t,e){return y(this,null,function*(){D6(t),W0(t)?(t.Aa.la(e),$0(t)):t.Aa.set("Unknown")})}function Ece(t,e,n){return y(this,null,function*(){if(t.Aa.set("Online"),e instanceof iv&&e.state===2&&e.cause)try{yield(function(i,o){return y(this,null,function*(){let s=o.cause;for(let a of o.targetIds)i.Ta.has(a)&&(yield i.remoteSyncer.rejectListen(a,s),i.Ta.delete(a),i.Ra.removeTarget(a))})})(t,e)}catch(r){z(Hl,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),yield Cv(t,r)}else if(e instanceof eh?t.Ra.Ye(e):e instanceof rv?t.Ra.it(e):t.Ra.et(e),!n.isEqual(ue.min()))try{let r=yield E6(t.localStore);n.compareTo(r)>=0&&(yield(function(o,s){let a=o.Ra.Pt(s);return a.targetChanges.forEach((c,l)=>{if(c.resumeToken.approximateByteSize()>0){let d=o.Ta.get(l);d&&o.Ta.set(l,d.withResumeToken(c.resumeToken,s))}}),a.targetMismatches.forEach((c,l)=>{let d=o.Ta.get(c);if(!d)return;o.Ta.set(c,d.withResumeToken(Gt.EMPTY_BYTE_STRING,d.snapshotVersion)),C6(o,c);let h=new Eh(d.target,c,l,d.sequenceNumber);H0(o,h)}),o.remoteSyncer.applyRemoteEvent(a)})(t,n))}catch(r){z(Hl,"Failed to raise snapshot:",r),yield Cv(t,r)}})}function Cv(t,e,n){return y(this,null,function*(){if(!Fa(e))throw e;t.Ia.add(1),yield ym(t),t.Aa.set("Offline"),n||(n=()=>E6(t.localStore)),t.asyncQueue.enqueueRetryable(()=>y(null,null,function*(){z(Hl,"Retrying IndexedDB access"),yield n(),t.Ia.delete(1),yield qv(t)}))})}function R6(t,e){return e().catch(n=>Cv(t,n,e))}function Rh(t){return y(this,null,function*(){let e=oe(t),n=Pa(e),r=e.Pa.length>0?e.Pa[e.Pa.length-1].batchId:Ll;for(;_ce(e);)try{let i=yield hce(e.localStore,r);if(i===null){e.Pa.length===0&&n.B_();break}r=i.batchId,Tce(e,i)}catch(i){yield Cv(e,i)}N6(e)&&b6(e)})}function _ce(t){return ql(t)&&t.Pa.length<10}function Tce(t,e){t.Pa.push(e);let n=Pa(t);n.x_()&&n.Z_&&n.X_(e.mutations)}function N6(t){return ql(t)&&!Pa(t).M_()&&t.Pa.length>0}function b6(t){Pa(t).start()}function yce(t){return y(this,null,function*(){Pa(t).na()})}function Ice(t){return y(this,null,function*(){let e=Pa(t);for(let n of t.Pa)e.X_(n.mutations)})}function vce(t,e,n){return y(this,null,function*(){let r=t.Pa.shift(),i=KO.from(r,e,n);yield R6(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),yield Rh(t)})}function Sce(t,e){return y(this,null,function*(){e&&Pa(t).Z_&&(yield(function(r,i){return y(this,null,function*(){if((function(s){return WW(s)&&s!==x.ABORTED})(i.code)){let o=r.Pa.shift();Pa(r).N_(),yield R6(r,()=>r.remoteSyncer.rejectFailedWrite(o.batchId,i)),yield Rh(r)}})})(t,e)),N6(t)&&b6(t)})}function U3(t,e){return y(this,null,function*(){let n=oe(t);n.asyncQueue.verifyOperationInProgress(),z(Hl,"RemoteStore received new credentials");let r=ql(n);n.Ia.add(3),yield ym(n),r&&n.Aa.set("Unknown"),yield n.remoteSyncer.handleCredentialChange(e),n.Ia.delete(3),yield qv(n)})}function qL(t,e){return y(this,null,function*(){let n=oe(t);e?(n.Ia.delete(2),yield qv(n)):e||(n.Ia.add(2),yield ym(n),n.Aa.set("Unknown"))})}function Nh(t){return t.Va||(t.Va=(function(n,r,i){let o=oe(n);return o.ia(),new GL(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)})(t.datastore,t.asyncQueue,{Zo:pce.bind(null,t),e_:gce.bind(null,t),n_:mce.bind(null,t),J_:Ece.bind(null,t)}),t.da.push(e=>y(null,null,function*(){e?(t.Va.N_(),W0(t)?$0(t):t.Aa.set("Unknown")):(yield t.Va.stop(),D6(t))}))),t.Va}function Pa(t){return t.ma||(t.ma=(function(n,r,i){let o=oe(n);return o.ia(),new jL(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)})(t.datastore,t.asyncQueue,{Zo:()=>Promise.resolve(),e_:yce.bind(null,t),n_:Sce.bind(null,t),ea:Ice.bind(null,t),ta:vce.bind(null,t)}),t.da.push(e=>y(null,null,function*(){e?(t.ma.N_(),yield Rh(t)):(yield t.ma.stop(),t.Pa.length>0&&(z(Hl,`Stopping write stream with ${t.Pa.length} pending writes`),t.Pa=[]))}))),t.ma}var KL=class t{constructor(e,n,r,i,o){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new cr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(s=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,o){let s=Date.now()+r,a=new t(e,n,s,i,o);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new W(x.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}};function z0(t,e){if(wt("AsyncQueue",`${e}: ${t}`),Fa(t))return new W(x.UNAVAILABLE,`${e}: ${t}`);throw t}var Dv=class t{static emptySet(e){return new t(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||te.comparator(n.key,r.key):(n,r)=>te.comparator(n.key,r.key),this.keyedMap=bg(),this.sortedSet=new pt(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){let n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){let n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){let n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof t)||this.size!==e.size)return!1;let n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){let i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0}toString(){let e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
|
|
171
|
+
`+e.join(`
|
|
172
|
+
`)+`
|
|
173
|
+
)`}copy(e,n){let r=new t;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}};var Rv=class{constructor(){this.fa=new pt(te.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}):ie(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}},Ih=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,Dv.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)&&Wv(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 YL=class{constructor(){this.ya=void 0,this.wa=[]}Sa(){return this.wa.some(e=>e.ba())}},XL=class{constructor(){this.queries=V3(),this.onlineState="Unknown",this.Da=new Set}terminate(){(function(n,r){let i=oe(n),o=i.queries;i.queries=V3(),o.forEach((s,a)=>{for(let c of a.wa)c.onError(r)})})(this,new W(x.ABORTED,"Firestore shutting down"))}};function V3(){return new vi(t=>LW(t),Wv)}function q0(t,e){return y(this,null,function*(){let n=oe(t),r=3,i=e.query,o=n.queries.get(i);o?!o.Sa()&&e.ba()&&(r=2):(o=new YL,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=z0(s,`Initialization of query '${Kd(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)&&Y0(n)})}function K0(t,e){return y(this,null,function*(){let n=oe(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 Ace(t,e){let n=oe(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&&Y0(n)}function Cce(t,e,n){let r=oe(t),i=r.queries.get(e);if(i)for(let o of i.wa)o.onError(n);r.queries.delete(e)}function Y0(t){t.Da.forEach(e=>{e.next()})}var QL,B3;(B3=QL||(QL={})).Fa="default",B3.Cache="cache";var lm=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 Ih(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=Ih.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.xa=!0,this.Ma.next(e)}ba(){return this.options.source!==QL.Cache}};var Nv=class{constructor(e){this.key=e}},bv=class{constructor(e){this.key=e}},JL=class{constructor(e,n){this.query=e,this.Ha=n,this.Ya=null,this.hasCachedResults=!1,this.current=!1,this.Za=Oe(),this.mutatedKeys=Oe(),this.Xa=PW(e),this.eu=new Dv(this.Xa)}get tu(){return this.Ha}nu(e,n){let r=n?n.ru:new Rv,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=Tm(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 ie(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 Ih(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 Rv,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=Oe(),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 bv(r))}),this.Za.forEach(r=>{e.has(r)||n.push(new Nv(r))}),n}uu(e){this.Ha=e.qs,this.Za=Oe();let n=this.nu(e.documents);return this.applyChanges(n,!0)}cu(){return Ih.fromInitialDocuments(this.query,this.eu,this.mutatedKeys,this.Ya===0,this.hasCachedResults)}},bh="SyncEngine",ZL=class{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}},e0=class{constructor(e){this.key=e,this.lu=!1}},t0=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 vi(a=>LW(a),Wv),this.Tu=new Map,this.Iu=new Set,this.du=new pt(te.comparator),this.Eu=new Map,this.Au=new om,this.Ru={},this.Vu=new Map,this.mu=_h.ur(),this.onlineState="Unknown",this.fu=void 0}get isPrimaryClient(){return this.fu===!0}};function Dce(t,e,n=!0){return y(this,null,function*(){let r=Yv(t),i,o=r.Pu.get(e);return o?(r.sharedClientState.addLocalQueryTarget(o.targetId),i=o.view.cu()):i=yield w6(r,e,n,!0),i})}function Rce(t,e){return y(this,null,function*(){let n=Yv(t);yield w6(n,e,!0,!1)})}function w6(t,e,n,r){return y(this,null,function*(){let i=yield Tv(t.localStore,br(e)),o=i.targetId,s=t.sharedClientState.addLocalQueryTarget(o,n),a;return r&&(a=yield X0(t,e,o,s==="current",i.resumeToken)),t.isPrimaryClient&&n&&Kv(t.remoteStore,i),a})}function X0(t,e,n,r,i){return y(this,null,function*(){t.gu=(h,f,g)=>(function(I,S,R,U){return y(this,null,function*(){let H=S.view.nu(R);H.Ds&&(H=yield PL(I.localStore,S.query,!1).then(({documents:A})=>S.view.nu(A,H)));let Q=U&&U.targetChanges.get(S.targetId),ae=U&&U.targetMismatches.get(S.targetId)!=null,ne=S.view.applyChanges(H,I.isPrimaryClient,Q,ae);return n0(I,S.targetId,ne._u),ne.snapshot})})(t,h,f,g);let o=yield PL(t.localStore,e,!0),s=new JL(e,o.qs),a=s.nu(o.documents),c=tm.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),l=s.applyChanges(a,t.isPrimaryClient,c);n0(t,n,l._u);let d=new ZL(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 Nce(t,e,n){return y(this,null,function*(){let r=oe(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=>!Wv(s,e))),void r.Pu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||(yield Th(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&yh(r.remoteStore,i.targetId),vh(r,i.targetId)}).catch(ka))):(vh(r,i.targetId),yield Th(r.localStore,i.targetId,!0))})}function bce(t,e){return y(this,null,function*(){let n=oe(t),r=n.Pu.get(e),i=n.Tu.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),yh(n.remoteStore,r.targetId))})}function wce(t,e,n){return y(this,null,function*(){let r=eM(t);try{let i=yield(function(s,a){let c=oe(s),l=_t.now(),d=a.reduce((g,E)=>g.add(E.key),Oe()),h,f;return c.persistence.runTransaction("Locally write mutations","readwrite",g=>{let E=Nr(),I=Oe();return c.Os.getEntries(g,d).next(S=>{E=S,E.forEach((R,U)=>{U.isValidDocument()||(I=I.add(R))})}).next(()=>c.localDocuments.getOverlayedDocuments(g,E)).next(S=>{h=S;let R=[];for(let U of a){let H=jae(U,h.get(U.key).overlayedDocument);H!=null&&R.push(new Si(U.key,H,AW(H.value.mapValue),Sn.exists(!0)))}return c.mutationQueue.addMutationBatch(g,l,R,a)}).next(S=>{f=S;let R=S.applyToLocalDocumentSet(h,I);return c.documentOverlayCache.saveOverlays(g,S.batchId,R)})}).then(()=>({batchId:f.batchId,changes:kW(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 Va(r,i.changes),yield Rh(r.remoteStore)}catch(i){let o=z0(i,"Failed to persist write");n.reject(o)}})}function O6(t,e){return y(this,null,function*(){let n=oe(t);try{let r=yield uce(n.localStore,e);e.targetChanges.forEach((i,o)=>{let s=n.Eu.get(o);s&&(se(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?s.lu=!0:i.modifiedDocuments.size>0?se(s.lu,14607):i.removedDocuments.size>0&&(se(s.lu,42227),s.lu=!1))}),yield Va(n,r,e)}catch(r){yield ka(r)}})}function G3(t,e,n){let r=oe(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=oe(s);c.onlineState=a;let l=!1;c.queries.forEach((d,h)=>{for(let f of h.wa)f.va(a)&&(l=!0)}),l&&Y0(c)})(r.eventManager,e),i.length&&r.hu.J_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}function Oce(t,e,n){return y(this,null,function*(){let r=oe(t);r.sharedClientState.updateQueryState(e,"rejected",n);let i=r.Eu.get(e),o=i&&i.key;if(o){let s=new pt(te.comparator);s=s.insert(o,nn.newNoDocument(o,ue.min()));let a=Oe().add(o),c=new em(ue.min(),new Map,new pt(Ie),s,a);yield O6(r,c),r.du=r.du.remove(o),r.Eu.delete(e),Z0(r)}else yield Th(r.localStore,e,!1).then(()=>vh(r,e,n)).catch(ka)})}function Lce(t,e){return y(this,null,function*(){let n=oe(t),r=e.batch.batchId;try{let i=yield lce(n.localStore,e);J0(n,r,null),Q0(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),yield Va(n,i)}catch(i){yield ka(i)}})}function Mce(t,e,n){return y(this,null,function*(){let r=oe(t);try{let i=yield(function(s,a){let c=oe(s);return c.persistence.runTransaction("Reject batch","readwrite-primary",l=>{let d;return c.mutationQueue.lookupMutationBatch(l,a).next(h=>(se(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);J0(r,e,n),Q0(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),yield Va(r,i)}catch(i){yield ka(i)}})}function Q0(t,e){(t.Vu.get(e)||[]).forEach(n=>{n.resolve()}),t.Vu.delete(e)}function J0(t,e,n){let r=oe(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 vh(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)||L6(t,r)})}function L6(t,e){t.Iu.delete(e.path.canonicalString());let n=t.du.get(e);n!==null&&(yh(t.remoteStore,n),t.du=t.du.remove(e),t.Eu.delete(n),Z0(t))}function n0(t,e,n){for(let r of n)r instanceof Nv?(t.Au.addReference(r.key,e),Pce(t,r)):r instanceof bv?(z(bh,"Document no longer in limbo: "+r.key),t.Au.removeReference(r.key,e),t.Au.containsKey(r.key)||L6(t,r.key)):ie(19791,{yu:r})}function Pce(t,e){let n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Iu.has(r)||(z(bh,"New document in limbo: "+n),t.Iu.add(r),Z0(t))}function Z0(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 te(ke.fromString(e)),r=t.mu.next();t.Eu.set(r,new e0(n)),t.du=t.du.insert(n,r),Kv(t.remoteStore,new Eh(br(_m(n.path)),r,"TargetPurposeLimboResolution",Dr.ue))}}function Va(t,e,n){return y(this,null,function*(){let r=oe(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=OL.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=oe(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(!Fa(h))throw h;z(j0,"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 xce(t,e){return y(this,null,function*(){let n=oe(t);if(!n.currentUser.isEqual(e)){z(bh,"User change. New user:",e.toKey());let r=yield m6(n.localStore,e);n.currentUser=e,(function(o,s){o.Vu.forEach(a=>{a.forEach(c=>{c.reject(new W(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 Va(n,r.Bs)}})}function kce(t,e){let n=oe(t),r=n.Eu.get(e);if(r&&r.lu)return Oe().add(r.key);{let i=Oe(),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 Fce(t,e){return y(this,null,function*(){let n=oe(t),r=yield PL(n.localStore,e.query,!0),i=e.view.uu(r);return n.isPrimaryClient&&n0(n,e.targetId,i._u),i})}function Uce(t,e){return y(this,null,function*(){let n=oe(t);return T6(n.localStore,e).then(r=>Va(n,r))})}function Vce(t,e,n,r){return y(this,null,function*(){let i=oe(t),o=yield(function(a,c){let l=oe(a),d=oe(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 Rh(i.remoteStore):n==="acknowledged"||n==="rejected"?(J0(i,e,r||null),Q0(i,e),(function(a,c){oe(oe(a).mutationQueue).rr(c)})(i.localStore,e)):ie(6720,"Unknown batchState",{wu:n}),yield Va(i,o)):z(bh,"Cannot apply mutation batch with id: "+e)})}function Bce(t,e){return y(this,null,function*(){let n=oe(t);if(Yv(n),eM(n),e===!0&&n.fu!==!0){let r=n.sharedClientState.getAllActiveQueryTargets(),i=yield j3(n,r.toArray());n.fu=!0,yield qL(n.remoteStore,!0);for(let o of i)Kv(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(()=>(vh(n,s),Th(n.localStore,s,!0))),yh(n.remoteStore,s)}),yield i,yield j3(n,r),(function(s){let a=oe(s);a.Eu.forEach((c,l)=>{yh(a.remoteStore,l)}),a.Au.jr(),a.Eu=new Map,a.du=new pt(te.comparator)})(n),n.fu=!1,yield qL(n.remoteStore,!1)}})}function j3(t,e,n){return y(this,null,function*(){let r=oe(t),i=[],o=[];for(let s of e){let a,c=r.Tu.get(s);if(c&&c.length!==0){a=yield Tv(r.localStore,br(c[0]));for(let l of c){let d=r.Pu.get(l),h=yield Fce(r,d);h.snapshot&&o.push(h.snapshot)}}else{let l=yield _6(r.localStore,s);a=yield Tv(r.localStore,l),yield X0(r,M6(l),s,!1,a.resumeToken)}i.push(a)}return r.hu.J_(o),i})}function M6(t){return wW(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function Gce(t){return(function(n){return oe(oe(n).persistence).Ps()})(oe(t).localStore)}function jce(t,e,n,r){return y(this,null,function*(){let i=oe(t);if(i.fu)return void z(bh,"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 T6(i.localStore,MW(o[0])),a=em.createSynthesizedRemoteEventForCurrentChange(e,n==="current",Gt.EMPTY_BYTE_STRING);yield Va(i,s,a);break}case"rejected":yield Th(i.localStore,e,!0),vh(i,e,r);break;default:ie(64155,n)}})}function Hce(t,e,n){return y(this,null,function*(){let r=Yv(t);if(r.fu){for(let i of e){if(r.Tu.has(i)&&r.sharedClientState.isActiveQueryTarget(i)){z(bh,"Adding an already active target "+i);continue}let o=yield _6(r.localStore,i),s=yield Tv(r.localStore,o);yield X0(r,M6(o),s.targetId,!1,s.resumeToken),Kv(r.remoteStore,s)}for(let i of n)r.Tu.has(i)&&(yield Th(r.localStore,i,!1).then(()=>{yh(r.remoteStore,i),vh(r,i)}).catch(ka))}})}function Yv(t){let e=oe(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=O6.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=kce.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Oce.bind(null,e),e.hu.J_=Ace.bind(null,e.eventManager),e.hu.pu=Cce.bind(null,e.eventManager),e}function eM(t){let e=oe(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Lce.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=Mce.bind(null,e),e}var tM=(()=>{class t{constructor(){this.kind="memory",this.synchronizeTabs=!1}initialize(n){return y(this,null,function*(){this.serializer=zv(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 g6(this.persistence,new _v,n.initialUser,this.serializer)}Du(n){return new sm(mv.Vi,this.serializer)}bu(n){return new vv}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})(),r0=class extends tM{constructor(e){super(),this.cacheSizeBytes=e}Cu(e,n){se(this.persistence.referenceDelegate instanceof Ev,46915);let r=this.persistence.referenceDelegate.garbageCollector;return new fv(r,e.asyncQueue,n)}Du(e){let n=this.cacheSizeBytes!==void 0?ar.withCacheSize(this.cacheSizeBytes):ar.DEFAULT;return new sm(r=>Ev.Vi(r,n),this.serializer)}},wv=class t extends tM{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 ec(t.prototype,this,"initialize").call(this,e),yield this.Mu.initialize(this,e),yield eM(this.Mu.syncEngine),yield Rh(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 g6(this.persistence,new _v,e.initialUser,this.serializer)}Cu(e,n){let r=this.persistence.referenceDelegate.garbageCollector;return new fv(r,e.asyncQueue,n)}Fu(e,n){let r=new NO(n,this.persistence);return new RO(e.asyncQueue,r)}Du(e){let n=p6(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=this.cacheSizeBytes!==void 0?ar.withCacheSize(this.cacheSizeBytes):ar.DEFAULT;return new wL(this.synchronizeTabs,n,e.clientId,r,e.asyncQueue,A6(),GI(),this.serializer,this.sharedClientState,!!this.forceOwnership)}bu(e){return new vv}},i0=class t extends wv{constructor(e,n){super(e,n,!1),this.Mu=e,this.cacheSizeBytes=n,this.synchronizeTabs=!0}initialize(e){return y(this,null,function*(){yield ec(t.prototype,this,"initialize").call(this,e);let n=this.Mu.syncEngine;this.sharedClientState instanceof Vg&&(this.sharedClientState.syncEngine={Do:Vce.bind(null,n),vo:jce.bind(null,n),Co:Hce.bind(null,n),Ps:Gce.bind(null,n),bo:Uce.bind(null,n)},yield this.sharedClientState.start()),yield this.persistence.ji(r=>y(this,null,function*(){yield Bce(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=A6();if(!Vg.C(n))throw new W(x.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");let r=p6(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new Vg(n,e.asyncQueue,r,e.clientId,e.initialUser)}},nM=(()=>{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=>G3(this.syncEngine,i,1),this.remoteStore.remoteSyncer.handleCredentialChange=xce.bind(null,this.syncEngine),yield qL(this.remoteStore,this.syncEngine.isPrimaryClient))})}createEventManager(n){return(function(){return new XL})()}createDatastore(n){let r=zv(n.databaseInfo.databaseId),i=(function(s){return new BL(s)})(n.databaseInfo);return(function(s,a,c,l){return new $L(s,a,c,l)})(n.authCredentials,n.appCheckCredentials,i,r)}createRemoteStore(n){return(function(i,o,s,a,c){return new zL(i,o,s,a,c)})(this.localStore,this.datastore,n.asyncQueue,r=>G3(this.syncEngine,r,0),(function(){return Sv.C()?new Sv:new kL})())}createSyncEngine(n,r){return(function(o,s,a,c,l,d,h){let f=new t0(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=oe(o);z(Hl,"RemoteStore shutting down."),s.Ia.add(5),yield ym(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 um=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):wt("Uncaught Error in snapshot listener:",e.toString()))}Ou(){this.muted=!0}xu(e,n){setTimeout(()=>{this.muted||e(n)},0)}};var o0=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 W(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=oe(i),a={documents:o.map(h=>nm(s.serializer,h))},c=yield s.Jo("BatchGetDocuments",s.serializer.databaseId,ke.emptyPath(),a,o.length),l=new Map;c.forEach(h=>{let f=Yae(s.serializer,h);l.set(f.key.toString(),f)});let d=[];return o.forEach(h=>{let f=l.get(h.toString());se(!!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 Bl(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=te.fromPath(r);this.mutations.push(new Qg(i,this.precondition(i)))}),yield(function(r,i){return y(this,null,function*(){let o=oe(r),s={writes:i.map(a=>rm(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 ie(50498,{Wu:e.constructor.name});n=ue.min()}let r=this.readVersions.get(e.key.toString());if(r){if(!n.isEqual(r))throw new W(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(ue.min())?Sn.exists(!1):Sn.updateTime(n):Sn.none()}preconditionForUpdate(e){let n=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&n){if(n.isEqual(ue.min()))throw new W(x.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Sn.updateTime(n)}return Sn.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}};var s0=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 cm(this.asyncQueue,"transaction_retry")}zu(){this.Gu-=1,this.ju()}ju(){this.F_.g_(()=>y(this,null,function*(){let e=new o0(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!gm(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"||!WW(n)}return!1}};var xa="FirestoreClient",a0=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=Bg.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=o,this.authCredentials.start(r,s=>y(this,null,function*(){z(xa,"Received user=",s.uid),yield this.authCredentialListener(s),this.user=s})),this.appCheckCredentials.start(r,s=>(z(xa,"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 cr;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=z0(n,"Failed to shutdown persistence");e.reject(r)}})),e.promise}};function mO(t,e){return y(this,null,function*(){t.asyncQueue.verifyOperationInProgress(),z(xa,"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 m6(e.localStore,i),r=i)})),e.persistence.setDatabaseDeletedListener(()=>{ls("Terminating Firestore due to IndexedDb database deletion"),t.terminate().then(()=>{z("Terminating Firestore due to IndexedDb database deletion completed successfully")}).catch(i=>{ls("Terminating Firestore due to IndexedDb database deletion failed",i)})}),t._offlineComponents=e})}function H3(t,e){return y(this,null,function*(){t.asyncQueue.verifyOperationInProgress();let n=yield $ce(t);z(xa,"Initializing OnlineComponentProvider"),yield e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>U3(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>U3(e.remoteStore,i)),t._onlineComponents=e})}function $ce(t){return y(this,null,function*(){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){z(xa,"Using user provided OfflineComponentProvider");try{yield mO(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;ls("Error using user provided cache. Falling back to memory cache: "+n),yield mO(t,new tM)}}else z(xa,"Using default OfflineComponentProvider"),yield mO(t,new r0(void 0));return t._offlineComponents})}function rM(t){return y(this,null,function*(){return t._onlineComponents||(t._uninitializedComponentsProvider?(z(xa,"Using user provided OnlineComponentProvider"),yield H3(t,t._uninitializedComponentsProvider._online)):(z(xa,"Using default OnlineComponentProvider"),yield H3(t,new nM))),t._onlineComponents})}function Wce(t){return rM(t).then(e=>e.syncEngine)}function P6(t){return rM(t).then(e=>e.datastore)}function Ov(t){return y(this,null,function*(){let e=yield rM(t),n=e.eventManager;return n.onListen=Dce.bind(null,e.syncEngine),n.onUnlisten=Nce.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=Rce.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=bce.bind(null,e.syncEngine),n})}function zce(t,e,n={}){let r=new cr;return t.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return(function(o,s,a,c,l){let d=new um({next:f=>{d.Ou(),s.enqueueAndForget(()=>K0(o,h));let g=f.docs.has(a);!g&&f.fromCache?l.reject(new W(x.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&f.fromCache&&c&&c.source==="server"?l.reject(new W(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 lm(_m(a.path),d,{includeMetadataChanges:!0,ka:!0});return q0(o,h)})(yield Ov(t),t.asyncQueue,e,n,r)})),r.promise}function qce(t,e,n={}){let r=new cr;return t.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return(function(o,s,a,c,l){let d=new um({next:f=>{d.Ou(),s.enqueueAndForget(()=>K0(o,h)),f.fromCache&&c.source==="server"?l.reject(new W(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 lm(a,d,{includeMetadataChanges:!0,ka:!0});return q0(o,h)})(yield Ov(t),t.asyncQueue,e,n,r)})),r.promise}function Kce(t,e,n){let r=new cr;return t.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){try{let i=yield P6(t);r.resolve((function(s,a,c){return y(this,null,function*(){var l;let d=oe(s),{request:h,ft:f,parent:g}=Jae(d.serializer,Oae(a),c);d.connection.Qo||delete h.parent;let E=(yield d.Jo("RunAggregationQuery",d.serializer.databaseId,g,h,1)).filter(S=>!!S.result);se(E.length===1,64727);let I=(l=E[0].result)===null||l===void 0?void 0:l.aggregateFields;return Object.keys(I).reduce((S,R)=>(S[f[R]]=I[R],S),{})})})(i,e,n))}catch(i){r.reject(i)}})),r.promise}function x6(t){let e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}var $3=new Map;var k6="firestore.googleapis.com",W3=!0,Lv=class{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new W(x.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=k6,this.ssl=W3}else this.host=e.host,this.ssl=(n=e.ssl)!==null&&n!==void 0?n:W3;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=a6;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<d6)throw new W(x.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}Jse("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=x6((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),(function(o){if(o.timeoutSeconds!==void 0){if(isNaN(o.timeoutSeconds))throw new W(x.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new W(x.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new W(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}},$l=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 Lv({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new W(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 W(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 Lv(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(r){if(!r)return new EO;switch(r.type){case"firstParty":return new IO(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new W(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=$3.get(n);r&&(z("ComponentProvider","Removing Datastore"),$3.delete(n),r.terminate())})(this),Promise.resolve()}};function F6(t,e,n,r={}){var i;t=lr(t,$l);let o=vr(e),s=t._getSettings(),a=Object.assign(Object.assign({},s),{emulatorOptions:t._getEmulatorOptions()}),c=`${e}:${n}`;o&&(Ys(`https://${c}`),Kc("Firestore",!0)),s.host!==k6&&s.host!==c&&ls("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(!fi(l,a)&&(t._setSettings(l),r.mockUserToken)){let d,h;if(typeof r.mockUserToken=="string")d=r.mockUserToken,h=Vt.MOCK_USER;else{d=YT(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 W(x.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new Vt(f)}t._authCredentials=new _O(new jI(d,h))}}var Ai=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)}},rn=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 Aa(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(pm(n,t._jsonSchema))return new t(e,r||null,new te(ke.fromString(n.referencePath)))}};rn._jsonSchemaVersion="firestore/documentReference/1.0",rn._jsonSchema={type:Bt("string",rn._jsonSchemaVersion),referencePath:Bt("string")};var Aa=class t extends Ai{constructor(e,n,r){super(e,n,_m(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 rn(this.firestore,null,new te(e))}withConverter(e){return new t(this.firestore,e,this._path)}};function U6(t,e,...n){if(t=Me(t),D0("collection","path",e),t instanceof $l){let r=ke.fromString(e,...n);return B$(r),new Aa(t,null,r)}{if(!(t instanceof rn||t instanceof Aa))throw new W(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 B$(r),new Aa(t.firestore,null,r)}}function V6(t,e){if(t=lr(t,$l),D0("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new W(x.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new Ai(t,null,(function(r){return new yo(ke.emptyPath(),r)})(e))}function B6(t,e,...n){if(t=Me(t),arguments.length===1&&(e=Bg.newId()),D0("doc","path",e),t instanceof $l){let r=ke.fromString(e,...n);return V$(r),new rn(t,null,new te(r))}{if(!(t instanceof rn||t instanceof Aa))throw new W(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 V$(r),new rn(t.firestore,t instanceof Aa?t.converter:null,new te(r))}}var z3="AsyncQueue",Mv=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 cm(this,"async_queue_retry"),this.oc=()=>{let r=GI();r&&z(z3,"Visibility state changed to "+r.visibilityState),this.F_.y_()},this._c=e;let n=GI();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=GI();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.oc)}}enqueue(e){if(this.ac(),this.Xu)return new Promise(()=>{});let n=new cr;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(!Fa(e))throw e;z(z3,"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,wt("INTERNAL UNHANDLED ERROR: ",q3(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=KL.createAndSchedule(this,e,n,r,o=>this.lc(o));return this.ec.push(i),i}ac(){this.tc&&ie(47125,{hc:q3(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 q3(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+`
|
|
174
|
+
`+t.stack),e}function K3(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 Ci=class extends $l{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new Mv,this._persistenceKey=i?.name||"[DEFAULT]"}_terminate(){return y(this,null,function*(){if(this._firestoreClient){let e=this._firestoreClient.terminate();this._queue=new Mv(e),this._firestoreClient=void 0,yield e}})}};function Xv(t,e,n){n||(n=Kg);let r=co(t,"firestore");if(r.isInitialized(n)){let i=r.getImmediate({identifier:n}),o=r.getOptions(n);if(fi(o,e))return i;throw new W(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 W(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<d6)throw new W(x.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return e.host&&vr(e.host)&&Ys(e.host),r.initialize({options:e,instanceIdentifier:n})}function wh(t,e){let n=typeof t=="object"?t:or(),r=typeof t=="string"?t:e||Kg,i=co(n,"firestore").getImmediate({identifier:r});if(!i._initialized){let o=pd("firestore");o&&F6(i,...o)}return i}function Oh(t){if(t._terminated)throw new W(x.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||Yce(t),t._firestoreClient}function Yce(t){var e,n,r;let i=t._freezeSettings(),o=(function(a,c,l,d){return new LO(a,c,l,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,x6(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 a0(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 c0=class{constructor(e="count",n){this._internalFieldPath=n,this.type="AggregateField",this.aggregateType=e}},l0=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 cs=class t{constructor(e){this._byteString=e}static fromBase64String(e){try{return new t(Gt.fromBase64String(e))}catch(n){throw new W(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(pm(e,t._jsonSchema))return t.fromBase64String(e.bytes)}};cs._jsonSchemaVersion="firestore/bytes/1.0",cs._jsonSchema={type:Bt("string",cs._jsonSchemaVersion),bytes:Bt("string")};var Sh=class{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new W(x.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new tn(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}};var dm=class{constructor(e){this._methodName=e}};var Ca=class t{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new W(x.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new W(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(pm(e,t._jsonSchema))return new t(e.latitude,e.longitude)}};Ca._jsonSchemaVersion="firestore/geoPoint/1.0",Ca._jsonSchema={type:Bt("string",Ca._jsonSchemaVersion),latitude:Bt("number"),longitude:Bt("number")};var Da=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(pm(e,t._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(n=>typeof n=="number"))return new t(e.vectorValues);throw new W(x.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}};Da._jsonSchemaVersion="firestore/vectorValue/1.0",Da._jsonSchema={type:Bt("string",Da._jsonSchemaVersion),vectorValues:Bt("object")};var Xce=/^__.*__$/,u0=class{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new Si(e,this.data,this.fieldMask,n,this.fieldTransforms):new Ma(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 Si(e,this.data,this.fieldMask,n,this.fieldTransforms)}};function G6(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ie(40011,{Ec:t})}}var d0=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 kv(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(G6(this.Ec)&&Xce.test(e))throw this.wc('Document fields cannot begin and end with "__"')}},h0=class{constructor(e,n,r){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=r||zv(e)}Dc(e,n,r,i=!1){return new d0({Ec:e,methodName:n,bc:r,path:tn.emptyPath(),mc:!1,Sc:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}};function Qv(t){let e=t._freezeSettings(),n=zv(t._databaseId);return new h0(t._databaseId,!!e.ignoreUndefinedProperties,n)}function j6(t,e,n,r,i,o={}){let s=t.Dc(o.merge||o.mergeFields?2:0,e,n,i);iM("Data must be an object, but it was:",s,r);let a=$6(r,s),c,l;if(o.merge)c=new Rr(s.fieldMask),l=s.fieldTransforms;else if(o.mergeFields){let d=[];for(let h of o.mergeFields){let f=f0(e,h,n);if(!s.contains(f))throw new W(x.INVALID_ARGUMENT,`Field '${f}' is specified in your field mask but missing from your input data.`);z6(d,f)||d.push(f)}c=new Rr(d),l=s.fieldTransforms.filter(h=>c.covers(h.field))}else c=null,l=s.fieldTransforms;return new u0(new jn(a),c,l)}var xv=class t extends dm{_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 Qce(t,e,n,r){let i=t.Dc(1,e,n);iM("Data must be an object, but it was:",i,r);let o=[],s=jn.empty();Ua(r,(c,l)=>{let d=oM(e,c,n);l=Me(l);let h=i.gc(d);if(l instanceof xv)o.push(d);else{let f=Im(l,h);f!=null&&(o.push(d),s.set(d,f))}});let a=new Rr(o);return new Pv(s,a,i.fieldTransforms)}function Jce(t,e,n,r,i,o){let s=t.Dc(1,e,n),a=[f0(e,r,n)],c=[i];if(o.length%2!=0)throw new W(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(f0(e,o[f])),c.push(o[f+1]);let l=[],d=jn.empty();for(let f=a.length-1;f>=0;--f)if(!z6(l,a[f])){let g=a[f],E=c[f];E=Me(E);let I=s.gc(g);if(E instanceof xv)l.push(g);else{let S=Im(E,I);S!=null&&(l.push(g),d.set(g,S))}}let h=new Rr(l);return new Pv(d,h,s.fieldTransforms)}function H6(t,e,n,r=!1){return Im(n,t.Dc(r?4:3,e))}function Im(t,e){if(W6(t=Me(t)))return iM("Unsupported field value:",e,t),$6(t,e);if(t instanceof dm)return(function(r,i){if(!G6(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=Im(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 Fae(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){let o=_t.fromDate(r);return{timestampValue:mh(i.serializer,o)}}if(r instanceof _t){let o=new _t(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:mh(i.serializer,o)}}if(r instanceof Ca)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof cs)return{bytesValue:qW(i.serializer,r._byteString)};if(r instanceof rn){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:V0(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof Da)return(function(s,a){return{mapValue:{fields:{[M0]:{stringValue:P0},[dh]:{arrayValue:{values:s.toArray().map(l=>{if(typeof l!="number")throw a.wc("VectorValues must only contain numeric values.");return U0(a.serializer,l)})}}}}}})(r,i);throw i.wc(`Unsupported field value: ${Uv(r)}`)})(t,e)}function $6(t,e){let n={};return mW(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ua(t,(r,i)=>{let o=Im(i,e.Vc(r));o!=null&&(n[r]=o)}),{mapValue:{fields:n}}}function W6(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof _t||t instanceof Ca||t instanceof cs||t instanceof rn||t instanceof dm||t instanceof Da)}function iM(t,e,n){if(!W6(n)||!eW(n)){let r=Uv(n);throw r==="an object"?e.wc(t+" a custom object"):e.wc(t+" "+r)}}function f0(t,e,n){if((e=Me(e))instanceof Sh)return e._internalPath;if(typeof e=="string")return oM(t,e);throw kv("Field path arguments must be of type string or ",t,!1,void 0,n)}var Zce=new RegExp("[~\\*/\\[\\]]");function oM(t,e,n){if(e.search(Zce)>=0)throw kv(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Sh(...e.split("."))._internalPath}catch{throw kv(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function kv(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 W(x.INVALID_ARGUMENT,a+t+c)}function z6(t,e){return t.some(n=>n.isEqual(e))}var Wl=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 rn(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){let e=new p0(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(Jv("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}},p0=class extends Wl{data(){return super.data()}};function Jv(t,e){return typeof e=="string"?oM(t,e):e instanceof Sh?e._internalPath:e._delegate._internalPath}function q6(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new W(x.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var hm=class{},Ah=class extends hm{};function K6(t,e,...n){let r=[];e instanceof hm&&r.push(e),r=r.concat(n),(function(o){let s=o.filter(c=>c instanceof Ch).length,a=o.filter(c=>c instanceof fm).length;if(s>1||s>0&&a>0)throw new W(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 fm=class t extends Ah{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 t4(e._query,n),new Ai(e.firestore,e.converter,WO(e._query,n))}_parse(e){let n=Qv(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 W(x.INVALID_ARGUMENT,`Invalid Query. You can't perform '${d}' queries on documentId().`);if(d==="in"||d==="not-in"){X3(h,d);let E=[];for(let I of h)E.push(Y3(c,o,I));f={arrayValue:{values:E}}}else f=Y3(c,o,h)}else d!=="in"&&d!=="not-in"&&d!=="array-contains-any"||X3(h,d),f=H6(a,s,h,d==="in"||d==="not-in");return Pe.create(l,d,f)})(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}};function Y6(t,e,n){let r=e,i=Jv("where",t);return fm._create(i,r,n)}var Ch=class t extends hm{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]:Je.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)t4(s,c),s=WO(s,c)})(e._query,n),new Ai(e.firestore,e.converter,WO(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}};function X6(...t){return t.forEach(e=>n4("or",e)),Ch._create("or",t)}function Q6(...t){return t.forEach(e=>n4("and",e)),Ch._create("and",t)}var g0=class t extends Ah{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 W(x.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new W(x.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new kl(o,s)})(e._query,this._field,this._direction);return new Ai(e.firestore,e.converter,(function(i,o){let s=i.explicitOrderBy.concat([o]);return new yo(i.path,i.collectionGroup,s,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)})(e._query,n))}};function J6(t,e="asc"){let n=e,r=Jv("orderBy",t);return g0._create(r,n)}var m0=class t extends Ah{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 Ai(e.firestore,e.converter,nv(e._query,this._limit,this._limitType))}};function Z6(t){return Zse("limit",t),m0._create("limit",t,"F")}var E0=class t extends Ah{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=ele(e,this.type,this._docOrFields,this._inclusive);return new Ai(e.firestore,e.converter,(function(i,o){return new yo(i.path,i.collectionGroup,i.explicitOrderBy.slice(),i.filters.slice(),i.limit,i.limitType,o,i.endAt)})(e._query,n))}};function e4(...t){return E0._create("startAfter",t,!1)}function ele(t,e,n,r){if(n[0]=Me(n[0]),n[0]instanceof Wl)return(function(o,s,a,c,l){if(!c)throw new W(x.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${a}().`);let d=[];for(let h of Zd(o))if(h.field.isKeyField())d.push(xl(s,c.key));else{let f=c.data.field(h.field);if(jv(f))throw new W(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 W(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 To(d,l)})(t._query,t.firestore._databaseId,e,n[0]._document,r);{let i=Qv(t.firestore);return(function(s,a,c,l,d,h){let f=s.explicitOrderBy;if(d.length>f.length)throw new W(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 W(x.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${l}(), but got a ${typeof I}`);if(!k0(s)&&I.indexOf("/")!==-1)throw new W(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(!te.isDocumentKey(S))throw new W(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 R=new te(S);g.push(xl(a,R))}else{let S=H6(c,l,I);g.push(S)}}return new To(g,h)})(t._query,t.firestore._databaseId,i,e,n,r)}}function Y3(t,e,n){if(typeof(n=Me(n))=="string"){if(n==="")throw new W(x.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!k0(e)&&n.indexOf("/")!==-1)throw new W(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(!te.isDocumentKey(r))throw new W(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 xl(t,new te(r))}if(n instanceof rn)return xl(t,n._key);throw new W(x.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Uv(n)}.`)}function X3(t,e){if(!Array.isArray(t)||t.length===0)throw new W(x.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function t4(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 W(x.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new W(x.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}function n4(t,e){if(!(e instanceof fm||e instanceof Ch))throw new W(x.INVALID_ARGUMENT,`Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}var Fv=class{convertValue(e,n="none"){switch(ba(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Et(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(ds(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 ie(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){let r={};return Ua(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[dh].arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.map(s=>Et(s.doubleValue));return new Da(o)}convertGeoPoint(e){return new Ca(Et(e.latitude),Et(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":let r=Hv(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(qg(e));default:return null}}convertTimestamp(e){let n=us(e);return new _t(n.seconds,n.nanos)}convertDocumentKey(e,n){let r=ke.fromString(e);se(n6(r),9688,{name:e});let i=new uh(r.get(1),r.get(3)),o=new te(r.popFirst(5));return i.isEqual(n)||wt(`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 r4(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}var _0=class extends Fv{constructor(e){super(),this.firestore=e}convertBytes(e){return new cs(e)}convertReference(e){let n=this.convertDocumentKey(e,this.firestore._databaseId);return new rn(this.firestore,null,n)}};function tle(){return new c0("count")}var Sa=class{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}},Ra=class t extends Wl{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 th(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(Jv("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new W(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)}};Ra._jsonSchemaVersion="firestore/documentSnapshot/1.0",Ra._jsonSchema={type:Bt("string",Ra._jsonSchemaVersion),bundleSource:Bt("string","DocumentSnapshot"),bundleName:Bt("string"),bundle:Bt("string")};var th=class extends Ra{data(e={}){return super.data(e)}},Pl=class t{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new Sa(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 th(this._firestore,this._userDataWriter,r.key,r,new Sa(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 W(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 th(i._firestore,i._userDataWriter,a.doc.key,a.doc,new Sa(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 th(i._firestore,i._userDataWriter,a.doc.key,a.doc,new Sa(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:nle(a.type),doc:c,oldIndex:l,newIndex:d}})}})(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new W(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=Bg.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 nle(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ie(61501,{type:t})}}function i4(t){t=lr(t,rn);let e=lr(t.firestore,Ci);return zce(Oh(e),t._key).then(n=>u4(e,t,n))}Pl._jsonSchemaVersion="firestore/querySnapshot/1.0",Pl._jsonSchema={type:Bt("string",Pl._jsonSchemaVersion),bundleSource:Bt("string","QuerySnapshot"),bundleName:Bt("string"),bundle:Bt("string")};var zl=class extends Fv{constructor(e){super(),this.firestore=e}convertBytes(e){return new cs(e)}convertReference(e){let n=this.convertDocumentKey(e,this.firestore._databaseId);return new rn(this.firestore,null,n)}};function o4(t){t=lr(t,Ai);let e=lr(t.firestore,Ci),n=Oh(e),r=new zl(e);return q6(t._query),qce(n,t._query).then(i=>new Pl(e,r,t,i))}function s4(t,e,n){t=lr(t,rn);let r=lr(t.firestore,Ci),i=r4(t.converter,e,n);return l4(r,[j6(Qv(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,Sn.none())])}function a4(t){return l4(lr(t.firestore,Ci),[new Bl(t._key,Sn.none())])}function c4(t,...e){var n,r,i;t=Me(t);let o={includeMetadataChanges:!1,source:"default"},s=0;typeof e[s]!="object"||K3(e[s])||(o=e[s++]);let a={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(K3(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 rn)l=lr(t.firestore,Ci),d=_m(t._key.path),c={next:h=>{e[s]&&e[s](u4(l,t,h))},error:e[s+1],complete:e[s+2]};else{let h=lr(t,Ai);l=lr(h.firestore,Ci),d=h._query;let f=new zl(l);c={next:g=>{e[s]&&e[s](new Pl(l,f,h,g))},error:e[s+1],complete:e[s+2]},q6(t._query)}return(function(f,g,E,I){let S=new um(I),R=new lm(g,S,E);return f.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return q0(yield Ov(f),R)})),()=>{S.Ou(),f.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return K0(yield Ov(f),R)}))}})(Oh(l),d,a,c)}function l4(t,e){return(function(r,i){let o=new cr;return r.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){return wce(yield Wce(r),i,o)})),o.promise})(Oh(t),e)}function u4(t,e,n){let r=n.docs.get(e._key),i=new zl(t);return new Ra(t,i,e._key,r,new Sa(n.hasPendingWrites,n.fromCache),e.converter)}function d4(t){return h4(t,{count:tle()})}function h4(t,e){let n=lr(t.firestore,Ci),r=Oh(n),i=Dae(e,(o,s)=>new YO(s,o.aggregateType,o._internalFieldPath));return Kce(r,t._query,i).then(o=>(function(a,c,l){let d=new zl(a);return new l0(c,d,l)})(n,t,o))}var T0=class{constructor(e){let n;this.kind="persistent",e?.tabManager?(e.tabManager._initialize(e),n=e.tabManager):(n=rle(void 0),n._initialize(e)),this._onlineComponentProvider=n._onlineComponentProvider,this._offlineComponentProvider=n._offlineComponentProvider}toJSON(){return{kind:this.kind}}};function sM(t){return new T0(t)}var y0=class{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=nM.provider,this._offlineComponentProvider={build:n=>new wv(n,e?.cacheSizeBytes,this.forceOwnership)}}},I0=class{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=nM.provider,this._offlineComponentProvider={build:n=>new i0(n,e?.cacheSizeBytes)}}};function rle(t){return new y0(t?.forceOwnership)}function aM(){return new I0}var ile={maxAttempts:5};function Og(t,e){if((t=Me(t)).firestore!==e)throw new W(x.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}var v0=class{constructor(e,n){this._firestore=e,this._transaction=n,this._dataReader=Qv(e)}get(e){let n=Og(e,this._firestore),r=new _0(this._firestore);return this._transaction.lookup([n._key]).then(i=>{if(!i||i.length!==1)return ie(24041);let o=i[0];if(o.isFoundDocument())return new Wl(this._firestore,r,o.key,o,n.converter);if(o.isNoDocument())return new Wl(this._firestore,r,n._key,null,n.converter);throw ie(18433,{doc:o})})}set(e,n,r){let i=Og(e,this._firestore),o=r4(i.converter,n,r),s=j6(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=Og(e,this._firestore),s;return s=typeof(n=Me(n))=="string"||n instanceof Sh?Jce(this._dataReader,"Transaction.update",o._key,n,r,i):Qce(this._dataReader,"Transaction.update",o._key,n),this._transaction.update(o._key,s),this}delete(e){let n=Og(e,this._firestore);return this._transaction.delete(n._key),this}};var S0=class extends v0{constructor(e,n){super(e,n),this._firestore=e}get(e){let n=Og(e,this._firestore),r=new zl(this._firestore);return super.get(e).then(i=>new Ra(this._firestore,r,n._key,i._document,new Sa(!1,!1),n.converter))}};function f4(t,e,n){t=lr(t,Ci);let r=Object.assign(Object.assign({},ile),n);return(function(o){if(o.maxAttempts<1)throw new W(x.INVALID_ARGUMENT,"Max attempts must be at least 1")})(r),(function(o,s,a){let c=new cr;return o.asyncQueue.enqueueAndForget(()=>y(null,null,function*(){let l=yield P6(o);new s0(o.asyncQueue,l,a,s,c).zu()})),c.promise})(Oh(t),i=>e(new S0(t,i)),r)}(function(e,n=!0){(function(i){Dh=i})(Zs),Kn(new en("firestore",(r,{instanceIdentifier:i,options:o})=>{let s=r.getProvider("app").getImmediate(),a=new Ci(new TO(r.getProvider("auth-internal")),new vO(s,r.getProvider("app-check-internal")),(function(l,d){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new W(x.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new uh(l.options.projectId,d)})(s,i),s);return o=Object.assign({useFetchStreams:n},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),je(x$,k$,e),je(x$,k$,"esm2017")})();var tBe=fe(Q6,!0,2);var Zv=fe(U6,!0,2),p4=fe(V6,!0,2);var g4=fe(a4,!0,2);var vm=fe(B6,!0,2);var m4=fe(d4,!0),cM=fe(i4,!0);var E4=fe(o4,!0);var nBe=fe(Z6,!0,2);var _4=fe(c4,!0);var rBe=fe(X6,!0,2),iBe=fe(J6,!0,2),T4=fe(K6,!0,2);var y4=fe(f4,!0),I4=fe(s4,!0,2);var oBe=fe(e4,!0,2);var sBe=fe(Y6,!0,2);var eS=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 O.error("Error in isTestingDb:",n),!1}}};var v4=(()=>{let e=class e{constructor(r,i,o){this.configService=r,this.authService=i,this.loggingService=o,this.firestore$=new de(null);try{ac([this.authService.getFirebaseConfig$(),this.configService.getApiKey$(),this.configService.getFirestorePersistentCacheEnabled$()]).pipe(Tn(([s,a])=>!!s&&!!a),yn(1)).subscribe(([s,a,c])=>{if(s&&a&&s?.firebaseOptions?.storeDbId){try{let h=sessionStorage?.getItem("veltFirestoreLogLevel")||Xt?.firebaseLogLevel||"silent";A0(h)}catch(h){this.loggingService.catch("Error in FirestoreService setLogLevel: ",h)}let l=eS.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=sM({tabManager:aM()}));try{this.firestore$.next(Xv(or(),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(wh(l))}}else if(c)try{let h=or(),f=Xv(h,{localCache:sM({tabManager:aM()})},l);this.firestore$.next(f)}catch{this.firestore$.next(wh(l))}else this.firestore$.next(wh(l))}},s=>{})}catch{}}getFirestore(){return this.firestore$.asObservable()}getFirestoreValue(){return this.firestore$.value}generateFirestoreDocumentId(){try{let r=this.getFirestoreValue()||wh("DocumentIdDb");if(r){let i=Zv(r,"generateDocumentId");return vm(i).id}return}catch(r){this.loggingService.catch("Error in FirestoreService generateFirestoreDocumentId: ",r);return}}};e.\u0275fac=function(i){return new(i||e)(q(uo),q(Id),q(Rt))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var tS=(()=>{let e=class e{constructor(r,i,o){this.authService=r,this.configService=i,this.loggingService=o,this.db$=new de(null);try{this.authService.getFirebaseConfig$().subscribe(s=>{if(s){let a=this.configService.getProxyConfig(),c=s.firebaseOptions.databaseURL;a?.v1DbHost&&c&&(c=eB(c,a.v1DbHost),a?.forceLongPolling&&Jw());let l=Ud(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)(q(Id),q(uo),q(Rt))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var wr={doc:vm,collection:Zv,collectionGroup:p4,query:T4,getDoc:cM,getDocs:E4,getCountFromServer:m4,setDoc:I4,deleteDoc:g4,onSnapshot:_4,runTransaction:y4},A4=(()=>{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 Sg(Vd(a,r.location)))?.val()}:{data:void 0}}let o=this.firestoreService.getFirestoreValue();return o?{data:(yield cM(vm(o,r.location)))?.data()}:{data:void 0}})}runTransaction(r){return y(this,null,function*(){return r()})}firestoreDoc(r,i){return wr.doc(r,i)}firestoreCollection(r,i){return wr.collection(r,i)}firestoreCollectionGroup(r,i){return wr.collectionGroup(r,i)}firestoreQuery(r,...i){return wr.query(r,...i)}firestoreGetDoc(r){return wr.getDoc(r)}firestoreGetDocs(r){return wr.getDocs(r)}firestoreGetCountFromServer(r){return wr.getCountFromServer(r)}firestoreSetDoc(r,i,o){return o?wr.setDoc(r,i,o):wr.setDoc(r,i)}firestoreDeleteDoc(r){return wr.deleteDoc(r)}firestoreOnSnapshot(r,i,o){return o?wr.onSnapshot(r,i,o):wr.onSnapshot(r,i)}firestoreRunTransaction(r,i){return wr.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")}addArea(r){return this.deferred("addArea")}deleteArea(r){return this.deferred("deleteArea")}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")}searchOrganizationUsers(r){return this.deferred("searchOrganizationUsers")}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")}getUserPermissions(r){return this.deferred("getUserPermissions")}setUserConfig(r){return this.deferred("setUserConfig")}addMultiThread(r){return this.deferred("addMultiThread")}editMultiThread(r){return this.deferred("editMultiThread")}deleteMultiThread(r){return this.deferred("deleteMultiThread")}getUploadUrl(r){return this.deferred("getUploadUrl")}getDownloadUrl(r){return this.deferred("getDownloadUrl")}deleteAttachment(r){return this.deferred("deleteAttachment")}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)(q(v4),q(tS),q(Rt))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var sle={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"},area:{mode:"persistent",scope:"doc"},lastActivityTimestamp:{mode:"persistent",scope:"org"},lastNotificationTimestamp:{mode:"persistent",scope:"org"},documentViews:{mode:"persistent",scope:"doc"},commentViews:{mode:"persistent",scope:"doc"},organizationCommentViews:{mode:"persistent",scope:"org"},folderCommentViews:{mode:"persistent",scope:"org"},userConfig:{mode:"persistent",scope:"user"},organizationUserConfig:{mode:"persistent",scope:"user"},organizationUsers:{mode:"persistent",scope:"org"},organizationGroups:{mode:"persistent",scope:"org"},customerMetadata:{mode:"persistent",scope:"org"},multiThread:{mode:"persistent",scope:"doc"}};function C4(t){return sle[t]}var Ze={getDatabase:Ud,ref:Vd,query:N$,get:Sg,set:O$,update:L$,remove:b$,push:R$,runTransaction:w$,onValue:rO,onChildAdded:S$,onChildChanged:A$,onChildRemoved:C$,off:v$,objectVal:y$,listVal:T$,stateChanges:I$,onDisconnect:D$},D4=(()=>{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 Sg(Vd(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=Vd(s,e.SERVER_TIME_OFFSET_PATH);i=rO(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 C4(r)}getDatabaseInstance(r){return r?Ze.getDatabase(void 0,r):Ze.getDatabase()}rtdbRef(r,i){return Ze.ref(r,i)}rtdbQueryRef(r,...i){return Ze.query(r,...i)}rtdbGet(r){return Ze.get(r)}rtdbSet(r,i,o){return this.getChannelTag(r),Ze.set(i,o)}rtdbUpdate(r,i,o){return this.getChannelTag(r),Ze.update(i,o)}rtdbRemove(r,i){return this.getChannelTag(r),Ze.remove(i)}rtdbPush(r,i,o){return this.getChannelTag(r),o===void 0?Ze.push(i):Ze.push(i,o)}rtdbRunTransaction(r,i,o){return this.getChannelTag(r),Ze.runTransaction(i,o)}rtdbOnValue(r,i,o,s,a){return this.getChannelTag(r),typeof s=="function"?a?Ze.onValue(i,o,s,a):Ze.onValue(i,o,s):s?Ze.onValue(i,o,s):Ze.onValue(i,o)}rtdbOnChildAdded(r,i,o,s){return this.getChannelTag(r),s?Ze.onChildAdded(i,o,s):Ze.onChildAdded(i,o)}rtdbOnChildChanged(r,i,o,s){return this.getChannelTag(r),s?Ze.onChildChanged(i,o,s):Ze.onChildChanged(i,o)}rtdbOnChildRemoved(r,i,o,s){return this.getChannelTag(r),s?Ze.onChildRemoved(i,o,s):Ze.onChildRemoved(i,o)}rtdbOff(r,i,o){Ze.off(r,i,o)}rtdbObjectVal$(r,i){return this.getChannelTag(r),Ze.objectVal(i)}rtdbListVal$(r,i){return this.getChannelTag(r),Ze.listVal(i)}rtdbStateChanges$(r,i){return this.getChannelTag(r),Ze.stateChanges(i)}rtdbOnDisconnectSet(r,i,o){return this.getChannelTag(r),Ze.onDisconnect(i).set(o)}rtdbOnDisconnectUpdate(r,i,o){return this.getChannelTag(r),Ze.onDisconnect(i).update(o)}rtdbOnDisconnectRemove(r,i){return this.getChannelTag(r),Ze.onDisconnect(i).remove()}rtdbOnDisconnectCancel(r,i){return this.getChannelTag(r),Ze.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)(q(tS),q(Rt))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function kBe(t,e,n){let r=t?.[e];return typeof r!="function"?Promise.resolve({ok:!1,code:"unimplemented",message:`the portable adapter does not implement '${e}'`}):r.call(t,n)}var Ba=null,rS=null,nS,R4;function ale(t){if(!(t&&t===R4&&nS)){R4=t;try{nS?.()}catch(e){O.catch("Error releasing the portable capability tracker: ",e)}nS=void 0,rS=null;try{nS=t?.onCapabilitiesChanged?.(e=>{rS=e?.size?new Set(e):null})}catch(e){O.catch("Error binding the portable capability tracker: ",e)}}}function FBe(t,e,n,r={data:{},operation:null}){return t.portableCapability$(e).pipe(er(i=>i?t.dbListener(n):it(r)))}var lM=new Set;function uM(t){return lM.add(t),()=>lM.delete(t)}function UBe(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=uM(i),Ba&&i()})}function VBe(t){return lf(()=>{let e=!1;try{if(t.isPortableFeedActive())return it(null)}catch(r){e=!0,t.onError("portable check",r)}let n=new he(r=>uM(()=>{try{(e||t.isPortableFeedActive())&&r.next(null)}catch(i){e=!0,r.next(null),t.onError("registration re-check",i)}}));return Rs(t.firebaseDb$().pipe(Tn(r=>!!r)),n)})}function cle(t){let e=t?.message;return typeof e=="string"&&/^NG0205(?!\d)/.test(e)}function BBe(t){if(Ba=t??null,ale(Ba?.realtime),Ba)for(let e of Array.from(lM))try{e()}catch(n){O.catch("Error in portable adapter registration listener: ",n)}}function pj(){return Ba}var GBe=(()=>{let e=class e{constructor(r){this.injector=r}get configService(){return this._configService??=this.injector.get(uo)}get authService(){return this._authService??=this.injector.get(Id)}isPortableBackendActive(){return this.isPortableActive()}evaluatePortableGates(){try{return{chunkRegistered:!!Ba,flagOn:this.configService.getEnablePortableBackend()===!0,identifyRecorded:!!this.authService.getPortableBackend()}}catch(r){return cle(r)||O.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}portableConnectionAnnounces(r){try{return this.resolveRealtimeAdapter()?.hasCapability?.(r)===!0}catch(i){return O.catch("Error in AdapterSelectorService portableConnectionAnnounces: ",i),!1}}portableCapability$(r){return this.portableConnectionChanges$().pipe(Ce(()=>this.portableConnectionAnnounces(r)),ri())}portableCapabilityState(r){try{return!this.isPortableBackendActive()||!rS?"unknown":this.portableConnectionAnnounces(r)?"announced":rS.has(r)?"unknown":"absent"}catch(i){return O.catch("Error in AdapterSelectorService portableCapabilityState: ",i),"unknown"}}portableConnectionChanges$(){return new he(r=>{let i,o=()=>{try{i?.(),i=void 0,this.isPortableBackendActive()&&(i=this.resolveRealtimeAdapter()?.onCapabilitiesChanged?.(()=>r.next()))}catch(a){O.catch("Error in AdapterSelectorService portableConnectionChanges$ bind: ",a)}r.next()};o();let s=uM(o);return()=>{s(),i?.()}})}resolveDbAdapter(){return this.isPortableActive()?Ba.db:this.injector.get(A4)}resolveRealtimeAdapter(){return this.isPortableActive()?Ba.realtime:this.injector.get(D4)}};e.\u0275fac=function(i){return new(i||e)(q(Ke))},e.\u0275prov=J({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function HBe(t){if(!t||typeof t!="object")return!1;let e=t;return e.ok?!1:e.code==="unimplemented"?!0:e.code==="invalid-argument"&&/^unsupported operation\b/i.test(String(e.message??""))}var qBe=new Set(x2);function KBe(t){try{let e=t?.reasonCode;return typeof e!="string"||!e.trim()?"":` [reason: ${e.trim()}]`}catch{return""}}var XBe="portable transport not connected",QBe="portable transport disconnected",JBe="portable transport send failed",lle="portable publish op '",ule="' requires a channel on the OperationRequest";function ZBe(t){return`${lle}${t}${ule}`}var eGe="portable request timed out",tGe="portable request failed in transport",nGe="portable session not established",rGe="portable apiEndpoint is not a secure URL; request not sent",iGe="portable request body could not be serialized; request not sent",oGe="portable request failed before it was sent";export{V as a,le as b,vS as c,dle as d,hle as e,fle as f,y as g,gt as h,he as i,FS as j,Ue as k,de as l,lc as m,Az as n,Cz as o,ic as p,hr as q,it as r,Dz as s,Rz as t,dz as u,Ce as v,ac as w,lf as x,Nz as y,ji as z,xz as A,wo as B,oz as C,Rs as D,Tn as E,K4 as F,MS as G,PS as H,rz as I,lE as J,yn as K,kS as L,ri as M,of as N,cc as O,uE as P,VS as Q,sz as R,dE as S,az as T,cn as U,er as V,Ds as W,cz as X,hE as Y,lz as Z,fz as _,ee as $,xE as aa,J as ba,Mo as ca,K as da,q as ea,Y as fa,tr as ga,Mn as ha,Hi as ia,$P as ja,WP as ka,nx as la,rx as ma,Ke as na,qt as oa,qn as pa,fr as qa,Yi as ra,bc as sa,xr as ta,f8 as ua,Yt as va,YC as wa,L8 as xa,Bs as ya,m_ as za,L_ as Aa,B8 as Ba,S5 as Ca,A5 as Da,C5 as Ea,N5 as Fa,b5 as Ga,z5 as Ha,Fo as Ia,De as Ja,eq as Ka,Hq as La,$q as Ma,Ji as Na,Ff as Oa,Bo as Pa,W_ as Qa,st as Ra,e9 as Sa,to as Ta,Pc as Ua,L1 as Va,j9 as Wa,Gs as Xa,no as Ya,Vf as Za,U1 as _a,J9 as $a,G1 as ab,j1 as bb,K_ as cb,js as db,K1 as eb,Y1 as fb,oK as gb,aK as hb,cK as ib,lK as jb,uK as kb,dK as lb,hK as mb,X1 as nb,PD as ob,xD as pb,Q1 as qb,kD as rb,FD as sb,J1 as tb,UD as ub,VD as vb,eF as wb,_K as xb,tF as yb,rF as zb,iF as Ab,SK as Bb,CK as Cb,DK as Db,NK as Eb,bK as Fb,wK as Gb,OK as Hb,LK as Ib,MK as Jb,PK as Kb,uF as Lb,dF as Mb,qK as Nb,YK as Ob,oY as Pb,yF as Qb,BD as Rb,IF as Sb,vF as Tb,SF as Ub,lY as Vb,AF as Wb,DF as Xb,uY as Yb,dY as Zb,hY as _b,fY as $b,_Y as ac,TY as bc,yY as cc,IY as dc,vY as ec,SY as fc,AY as gc,CY as hc,DY as ic,RY as jc,NY as kc,bY as lc,OY as mc,MY as nc,PY as oc,xY as pc,kY as qc,FY as rc,BY as sc,Wf as tc,zf as uc,WD as vc,$Ae as wc,WAe as xc,zAe as yc,m7 as zc,rR as Ac,qAe as Bc,KAe as Cc,YAe as Dc,ro as Ec,rU as Fc,F7 as Gc,yU as Hc,U7 as Ic,lR as Jc,V7 as Kc,B7 as Lc,G7 as Mc,j7 as Nc,$7 as Oc,z7 as Pc,K7 as Qc,uR as Rc,fT as Sc,pT as Tc,uX as Uc,fX as Vc,HU as Wc,kX as Xc,FX as Yc,vR as Zc,nV as _c,DR as $c,pd as ad,vr as bd,Ys as cd,YT as dd,Kc as ed,rr as fd,Me as gd,en as hd,Kn as id,co as jd,ir as kd,Zs as ld,or as md,je as nd,RZ as od,vPe as pd,SPe as qd,APe as rd,pi as sd,ea as td,Qo as ud,gi as vd,fe as wd,mi as xd,Jo as yd,jPe as zd,HPe as Ad,$Pe as Bd,na as Cd,Xee as Dd,Jee as Ed,dte as Fd,el as Gd,tl as Hd,Dke as Id,Rke as Jd,zUe as Kd,qUe as Ld,KUe as Md,YUe as Nd,XUe as Od,QUe as Pd,Zo as Qd,Wke as Rd,zke as Sd,qke as Td,oV as Ud,rQ as Vd,lp as Wd,Xt as Xd,O as Yd,vRe as Zd,SRe as _d,ARe as $d,CRe as ae,DRe as be,RRe as ce,NRe as de,di as ee,bRe as fe,wRe as ge,ORe as he,LRe as ie,BX as je,GX as ke,jX as le,HX as me,$X as ne,WX as oe,MRe as pe,zX as qe,SR as re,qX as se,Ir as te,vT as ue,KX as ve,id as we,Fn as xe,YX as ye,ST as ze,XX as Ae,QX as Be,JX as Ce,PRe as De,xRe as Ee,kRe as Fe,ZX as Ge,k as He,eV as Ie,_Ne as Je,TNe as Ke,yNe as Le,INe as Me,od as Ne,CNe as Oe,DNe as Pe,RNe as Qe,Br as Re,mt as Se,sV as Te,aV as Ue,nbe as Ve,rbe as We,cV as Xe,RR as Ye,lV as Ze,NR as _e,MT as $e,iQ as af,oQ as bf,sQ as cf,aQ as df,cQ as ef,lQ as ff,uQ as gf,dQ as hf,hQ as if,fQ as jf,pQ as kf,gQ as lf,fV as mf,pV as nf,gV as of,mV as pf,EV as qf,io as rf,Nbe as sf,PT as tf,_V as uf,TV as vf,yV as wf,IV as xf,vV as yf,SV as zf,AV as Af,CV as Bf,DV as Cf,RV as Df,NV as Ef,bV as Ff,wV as Gf,uwe as Hf,dwe as If,OV as Jf,bR as Kf,LV as Lf,MV as Mf,xV as Nf,kV as Of,$we as Pf,Wwe as Qf,mQ as Rf,EQ as Sf,YLe as Tf,xT as Uf,xR as Vf,ad as Wf,eB as Xf,s0e as Yf,Hc as Zf,Yo as _f,a0e as $f,c0e as ag,l0e as bg,nB as cg,u0e as dg,d0e as eg,h0e as fg,f0e as gg,p0e as hg,g0e as ig,m0e as jg,rB as kg,iB as lg,E0e as mg,_0e as ng,TQ as og,T0e as pg,y0e as qg,I0e as rg,v0e as sg,S0e as tg,oB as ug,Wc as vg,A0e as wg,sB as xg,cB as yg,jV as zg,HV as Ag,yQ as Bg,IQ as Cg,GT as Dg,fp as Eg,C0e as Fg,D0e as Gg,oo as Hg,R0e as Ig,cd as Jg,AQ as Kg,N0e as Lg,GR as Mg,WV as Ng,CQ as Og,UT as Pg,b0e as Qg,w0e as Rg,lB as Sg,uB as Tg,DQ as Ug,zs as Vg,RQ as Wg,wQ as Xg,O0e as Yg,fB as Zg,L0e as _g,M0e as $g,OQ as ah,LQ as bh,MQ as ch,PQ as dh,zc as eh,P0e as fh,x0e as gh,k0e as hh,FR as ih,F0e as jh,kQ as kh,U0e as lh,V0e as mh,gB as nh,B0e as oh,G0e as ph,j0e as qh,H0e as rh,$0e as sh,W0e as th,z0e as uh,kT as vh,q0e as wh,K0e as xh,Y0e as yh,jR as zh,X0e as Ah,XV as Bh,Q0e as Ch,J0e as Dh,Z0e as Eh,eMe as Fh,tMe as Gh,nMe as Hh,rMe as Ih,iMe as Jh,oMe as Kh,sMe as Lh,aMe as Mh,cMe as Nh,lMe as Oh,uMe as Ph,dMe as Qh,hMe as Rh,fMe as Sh,pMe as Th,gMe as Uh,mMe as Vh,EMe as Wh,_Me as Xh,BQ as Yh,TMe as Zh,yMe as _h,IMe as $h,QV as ai,vMe as bi,SMe as ci,gp as di,GQ as ei,AMe as fi,CMe as gi,DMe as hi,RMe as ii,jQ as ji,NMe as ki,bMe as li,vB as mi,$R as ni,ud as oi,wMe as pi,hp as qi,OMe as ri,LMe as si,MMe as ti,VR as ui,PMe as vi,KQ as wi,xMe as xi,kMe as yi,aJ as zi,FMe as Ai,UMe as Bi,VMe as Ci,JV as Di,BMe as Ei,cJ as Fi,vJ as Gi,SJ as Hi,yt as Ii,Td as Ji,GRe as Ki,jRe as Li,HRe as Mi,$Re as Ni,WRe as Oi,zRe as Pi,qRe as Qi,KRe as Ri,YRe as Si,XRe as Ti,QRe as Ui,JRe as Vi,AT as Wi,ZRe as Xi,eNe as Yi,tNe as Zi,CT as _i,nNe as $i,rNe as aj,iNe as bj,oNe as cj,sNe as dj,aNe as ej,cNe as fj,DT as gj,lNe as hj,uNe as ij,RT as jj,KU as kj,YU as lj,XU as mj,QU as nj,NT as oj,oa as pj,Rt as qj,uo as rj,rl as sj,Lne as tj,Bne as uj,d1e as vj,vy as wj,y2 as xj,L1e as yj,$e as zj,M1e as Aj,R2 as Bj,F1e as Cj,U1e as Dj,V1e as Ej,Qne as Fj,H1e as Gj,$1e as Hj,tBe as Ij,nBe as Jj,rBe as Kj,iBe as Lj,oBe as Mj,sBe as Nj,eS as Oj,v4 as Pj,tS as Qj,A4 as Rj,C4 as Sj,D4 as Tj,kBe as Uj,FBe as Vj,uM as Wj,UBe as Xj,VBe as Yj,BBe as Zj,pj as _j,GBe as $j,x2 as ak,Q1e as bk,J1e as ck,Z1e as dk,eFe as ek,tFe as fk,nFe as gk,rFe as hk,iFe as ik,oFe as jk,sFe as kk,aFe as lk,cFe as mk,lFe as nk,HBe as ok,KBe as pk,XBe as qk,QBe as rk,JBe as sk,lle as tk,ule as uk,ZBe as vk,eGe as wk,tGe as xk,nGe as yk,rGe as zk,iGe as Ak,oGe as Bk,G2 as Ck,j2 as Dk,My as Ek,TFe as Fk,yFe as Gk,hj as Hk,Id as Ik};
|