@iebh/tera-fy 1.15.8 → 2.0.0

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.
@@ -1,6 +1,61 @@
1
- var Tr=Object.defineProperty;var Or=(t,e,r)=>e in t?Tr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Q=(t,e,r)=>Or(t,typeof e!="symbol"?e+"":e,r);var Ar=typeof global=="object"&&global&&global.Object===Object&&global,tt=Ar;var _r=typeof self=="object"&&self&&self.Object===Object&&self,Sr=tt||_r||Function("return this")(),m=Sr;var Ir=m.Symbol,j=Ir;var Nt=Object.prototype,wr=Nt.hasOwnProperty,Pr=Nt.toString,J=j?j.toStringTag:void 0;function Cr(t){var e=wr.call(t,J),r=t[J];try{t[J]=void 0;var o=!0}catch{}var a=Pr.call(t);return o&&(e?t[J]=r:delete t[J]),a}var Ft=Cr;var Er=Object.prototype,Lr=Er.toString;function Br(t){return Lr.call(t)}var Dt=Br;var Mr="[object Null]",Nr="[object Undefined]",Rt=j?j.toStringTag:void 0;function Fr(t){return t==null?t===void 0?Nr:Mr:Rt&&Rt in Object(t)?Ft(t):Dt(t)}var h=Fr;function Dr(t){return t!=null&&typeof t=="object"}var x=Dr;var Rr="[object Symbol]";function Wr(t){return typeof t=="symbol"||x(t)&&h(t)==Rr}var Wt=Wr;var Ur=Array.isArray,M=Ur;var Gr=/\s/;function Vr(t){for(var e=t.length;e--&&Gr.test(t.charAt(e)););return e}var Ut=Vr;var Kr=/^\s+/;function kr(t){return t&&t.slice(0,Ut(t)+1).replace(Kr,"")}var Gt=kr;function zr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var c=zr;var Vt=NaN,qr=/^[-+]0x[0-9a-f]+$/i,Hr=/^0b[01]+$/i,$r=/^0o[0-7]+$/i,Jr=parseInt;function Xr(t){if(typeof t=="number")return t;if(Wt(t))return Vt;if(c(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=c(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Gt(t);var r=Hr.test(t);return r||$r.test(t)?Jr(t.slice(2),r?2:8):qr.test(t)?Vt:+t}var At=Xr;var Yr="[object AsyncFunction]",Zr="[object Function]",Qr="[object GeneratorFunction]",to="[object Proxy]";function eo(t){if(!c(t))return!1;var e=h(t);return e==Zr||e==Qr||e==Yr||e==to}var et=eo;var ro=m["__core-js_shared__"],rt=ro;var Kt=function(){var t=/[^.]+$/.exec(rt&&rt.keys&&rt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function oo(t){return!!Kt&&Kt in t}var kt=oo;var ao=Function.prototype,fo=ao.toString;function so(t){if(t!=null){try{return fo.call(t)}catch{}try{return t+""}catch{}}return""}var T=so;var io=/[\\^$.*+?()[\]{}|]/g,no=/^\[object .+?Constructor\]$/,po=Function.prototype,uo=Object.prototype,mo=po.toString,lo=uo.hasOwnProperty,co=RegExp("^"+mo.call(lo).replace(io,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xo(t){if(!c(t)||kt(t))return!1;var e=et(t)?co:no;return e.test(T(t))}var zt=xo;function go(t,e){return t==null?void 0:t[e]}var qt=go;function ho(t,e){var r=qt(t,e);return zt(r)?r:void 0}var g=ho;var bo=g(m,"WeakMap"),ot=bo;var Ht=Object.create,yo=function(){function t(){}return function(e){if(!c(e))return{};if(Ht)return Ht(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),$t=yo;function vo(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var Jt=vo;var jo=function(){try{var t=g(Object,"defineProperty");return t({},"",{}),t}catch{}}(),_t=jo;function To(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}var Xt=To;var Oo=9007199254740991,Ao=/^(?:0|[1-9]\d*)$/;function _o(t,e){var r=typeof t;return e=e==null?Oo:e,!!e&&(r=="number"||r!="symbol"&&Ao.test(t))&&t>-1&&t%1==0&&t<e}var Yt=_o;function So(t,e,r){e=="__proto__"&&_t?_t(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var at=So;function Io(t,e){return t===e||t!==t&&e!==e}var ft=Io;var wo=Object.prototype,Po=wo.hasOwnProperty;function Co(t,e,r){var o=t[e];(!(Po.call(t,e)&&ft(o,r))||r===void 0&&!(e in t))&&at(t,e,r)}var st=Co;function Eo(t,e,r,o){var a=!r;r||(r={});for(var f=-1,s=e.length;++f<s;){var i=e[f],u=o?o(r[i],t[i],i,r,t):void 0;u===void 0&&(u=t[i]),a?at(r,i,u):st(r,i,u)}return r}var S=Eo;var Lo=9007199254740991;function Bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Lo}var it=Bo;function Mo(t){return t!=null&&it(t.length)&&!et(t)}var nt=Mo;var No=Object.prototype;function Fo(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||No;return t===r}var N=Fo;function Do(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Zt=Do;var Ro="[object Arguments]";function Wo(t){return x(t)&&h(t)==Ro}var St=Wo;var Qt=Object.prototype,Uo=Qt.hasOwnProperty,Go=Qt.propertyIsEnumerable,Vo=St(function(){return arguments}())?St:function(t){return x(t)&&Uo.call(t,"callee")&&!Go.call(t,"callee")},te=Vo;function Ko(){return!1}var ee=Ko;var ae=typeof exports=="object"&&exports&&!exports.nodeType&&exports,re=ae&&typeof module=="object"&&module&&!module.nodeType&&module,ko=re&&re.exports===ae,oe=ko?m.Buffer:void 0,zo=oe?oe.isBuffer:void 0,qo=zo||ee,pt=qo;var Ho="[object Arguments]",$o="[object Array]",Jo="[object Boolean]",Xo="[object Date]",Yo="[object Error]",Zo="[object Function]",Qo="[object Map]",ta="[object Number]",ea="[object Object]",ra="[object RegExp]",oa="[object Set]",aa="[object String]",fa="[object WeakMap]",sa="[object ArrayBuffer]",ia="[object DataView]",na="[object Float32Array]",pa="[object Float64Array]",ua="[object Int8Array]",ma="[object Int16Array]",la="[object Int32Array]",da="[object Uint8Array]",ca="[object Uint8ClampedArray]",xa="[object Uint16Array]",ga="[object Uint32Array]",p={};p[na]=p[pa]=p[ua]=p[ma]=p[la]=p[da]=p[ca]=p[xa]=p[ga]=!0;p[Ho]=p[$o]=p[sa]=p[Jo]=p[ia]=p[Xo]=p[Yo]=p[Zo]=p[Qo]=p[ta]=p[ea]=p[ra]=p[oa]=p[aa]=p[fa]=!1;function ha(t){return x(t)&&it(t.length)&&!!p[h(t)]}var fe=ha;function ba(t){return function(e){return t(e)}}var F=ba;var se=typeof exports=="object"&&exports&&!exports.nodeType&&exports,X=se&&typeof module=="object"&&module&&!module.nodeType&&module,ya=X&&X.exports===se,It=ya&&tt.process,va=function(){try{var t=X&&X.require&&X.require("util").types;return t||It&&It.binding&&It.binding("util")}catch{}}(),O=va;var ie=O&&O.isTypedArray,ja=ie?F(ie):fe,ne=ja;var Ta=Object.prototype,Oa=Ta.hasOwnProperty;function Aa(t,e){var r=M(t),o=!r&&te(t),a=!r&&!o&&pt(t),f=!r&&!o&&!a&&ne(t),s=r||o||a||f,i=s?Zt(t.length,String):[],u=i.length;for(var d in t)(e||Oa.call(t,d))&&!(s&&(d=="length"||a&&(d=="offset"||d=="parent")||f&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Yt(d,u)))&&i.push(d);return i}var ut=Aa;function _a(t,e){return function(r){return t(e(r))}}var mt=_a;var Sa=mt(Object.keys,Object),pe=Sa;var Ia=Object.prototype,wa=Ia.hasOwnProperty;function Pa(t){if(!N(t))return pe(t);var e=[];for(var r in Object(t))wa.call(t,r)&&r!="constructor"&&e.push(r);return e}var ue=Pa;function Ca(t){return nt(t)?ut(t):ue(t)}var D=Ca;function Ea(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var me=Ea;var La=Object.prototype,Ba=La.hasOwnProperty;function Ma(t){if(!c(t))return me(t);var e=N(t),r=[];for(var o in t)o=="constructor"&&(e||!Ba.call(t,o))||r.push(o);return r}var le=Ma;function Na(t){return nt(t)?ut(t,!0):le(t)}var R=Na;var Fa=g(Object,"create"),A=Fa;function Da(){this.__data__=A?A(null):{},this.size=0}var de=Da;function Ra(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ce=Ra;var Wa="__lodash_hash_undefined__",Ua=Object.prototype,Ga=Ua.hasOwnProperty;function Va(t){var e=this.__data__;if(A){var r=e[t];return r===Wa?void 0:r}return Ga.call(e,t)?e[t]:void 0}var xe=Va;var Ka=Object.prototype,ka=Ka.hasOwnProperty;function za(t){var e=this.__data__;return A?e[t]!==void 0:ka.call(e,t)}var ge=za;var qa="__lodash_hash_undefined__";function Ha(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=A&&e===void 0?qa:e,this}var he=Ha;function W(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}W.prototype.clear=de;W.prototype.delete=ce;W.prototype.get=xe;W.prototype.has=ge;W.prototype.set=he;var wt=W;function $a(){this.__data__=[],this.size=0}var be=$a;function Ja(t,e){for(var r=t.length;r--;)if(ft(t[r][0],e))return r;return-1}var I=Ja;var Xa=Array.prototype,Ya=Xa.splice;function Za(t){var e=this.__data__,r=I(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Ya.call(e,r,1),--this.size,!0}var ye=Za;function Qa(t){var e=this.__data__,r=I(e,t);return r<0?void 0:e[r][1]}var ve=Qa;function tf(t){return I(this.__data__,t)>-1}var je=tf;function ef(t,e){var r=this.__data__,o=I(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var Te=ef;function U(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}U.prototype.clear=be;U.prototype.delete=ye;U.prototype.get=ve;U.prototype.has=je;U.prototype.set=Te;var w=U;var rf=g(m,"Map"),P=rf;function of(){this.size=0,this.__data__={hash:new wt,map:new(P||w),string:new wt}}var Oe=of;function af(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ae=af;function ff(t,e){var r=t.__data__;return Ae(e)?r[typeof e=="string"?"string":"hash"]:r.map}var C=ff;function sf(t){var e=C(this,t).delete(t);return this.size-=e?1:0,e}var _e=sf;function nf(t){return C(this,t).get(t)}var Se=nf;function pf(t){return C(this,t).has(t)}var Ie=pf;function uf(t,e){var r=C(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var we=uf;function G(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}G.prototype.clear=Oe;G.prototype.delete=_e;G.prototype.get=Se;G.prototype.has=Ie;G.prototype.set=we;var Pe=G;function mf(t,e){for(var r=-1,o=e.length,a=t.length;++r<o;)t[a+r]=e[r];return t}var lt=mf;var lf=mt(Object.getPrototypeOf,Object),V=lf;var df="[object Object]",cf=Function.prototype,xf=Object.prototype,Ce=cf.toString,gf=xf.hasOwnProperty,hf=Ce.call(Object);function bf(t){if(!x(t)||h(t)!=df)return!1;var e=V(t);if(e===null)return!0;var r=gf.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ce.call(r)==hf}var Pt=bf;function yf(){this.__data__=new w,this.size=0}var Ee=yf;function vf(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Le=vf;function jf(t){return this.__data__.get(t)}var Be=jf;function Tf(t){return this.__data__.has(t)}var Me=Tf;var Of=200;function Af(t,e){var r=this.__data__;if(r instanceof w){var o=r.__data__;if(!P||o.length<Of-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new Pe(o)}return r.set(t,e),this.size=r.size,this}var Ne=Af;function K(t){var e=this.__data__=new w(t);this.size=e.size}K.prototype.clear=Ee;K.prototype.delete=Le;K.prototype.get=Be;K.prototype.has=Me;K.prototype.set=Ne;var Fe=K;function _f(t,e){return t&&S(e,D(e),t)}var De=_f;function Sf(t,e){return t&&S(e,R(e),t)}var Re=Sf;var Ve=typeof exports=="object"&&exports&&!exports.nodeType&&exports,We=Ve&&typeof module=="object"&&module&&!module.nodeType&&module,If=We&&We.exports===Ve,Ue=If?m.Buffer:void 0,Ge=Ue?Ue.allocUnsafe:void 0;function wf(t,e){if(e)return t.slice();var r=t.length,o=Ge?Ge(r):new t.constructor(r);return t.copy(o),o}var Ke=wf;function Pf(t,e){for(var r=-1,o=t==null?0:t.length,a=0,f=[];++r<o;){var s=t[r];e(s,r,t)&&(f[a++]=s)}return f}var ke=Pf;function Cf(){return[]}var dt=Cf;var Ef=Object.prototype,Lf=Ef.propertyIsEnumerable,ze=Object.getOwnPropertySymbols,Bf=ze?function(t){return t==null?[]:(t=Object(t),ke(ze(t),function(e){return Lf.call(t,e)}))}:dt,k=Bf;function Mf(t,e){return S(t,k(t),e)}var qe=Mf;var Nf=Object.getOwnPropertySymbols,Ff=Nf?function(t){for(var e=[];t;)lt(e,k(t)),t=V(t);return e}:dt,ct=Ff;function Df(t,e){return S(t,ct(t),e)}var He=Df;function Rf(t,e,r){var o=e(t);return M(t)?o:lt(o,r(t))}var xt=Rf;function Wf(t){return xt(t,D,k)}var $e=Wf;function Uf(t){return xt(t,R,ct)}var Je=Uf;var Gf=g(m,"DataView"),gt=Gf;var Vf=g(m,"Promise"),ht=Vf;var Kf=g(m,"Set"),bt=Kf;var Xe="[object Map]",kf="[object Object]",Ye="[object Promise]",Ze="[object Set]",Qe="[object WeakMap]",tr="[object DataView]",zf=T(gt),qf=T(P),Hf=T(ht),$f=T(bt),Jf=T(ot),E=h;(gt&&E(new gt(new ArrayBuffer(1)))!=tr||P&&E(new P)!=Xe||ht&&E(ht.resolve())!=Ye||bt&&E(new bt)!=Ze||ot&&E(new ot)!=Qe)&&(E=function(t){var e=h(t),r=e==kf?t.constructor:void 0,o=r?T(r):"";if(o)switch(o){case zf:return tr;case qf:return Xe;case Hf:return Ye;case $f:return Ze;case Jf:return Qe}return e});var z=E;var Xf=Object.prototype,Yf=Xf.hasOwnProperty;function Zf(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Yf.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var er=Zf;var Qf=m.Uint8Array,Ct=Qf;function ts(t){var e=new t.constructor(t.byteLength);return new Ct(e).set(new Ct(t)),e}var q=ts;function es(t,e){var r=e?q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var rr=es;var rs=/\w*$/;function os(t){var e=new t.constructor(t.source,rs.exec(t));return e.lastIndex=t.lastIndex,e}var or=os;var ar=j?j.prototype:void 0,fr=ar?ar.valueOf:void 0;function as(t){return fr?Object(fr.call(t)):{}}var sr=as;function fs(t,e){var r=e?q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ir=fs;var ss="[object Boolean]",is="[object Date]",ns="[object Map]",ps="[object Number]",us="[object RegExp]",ms="[object Set]",ls="[object String]",ds="[object Symbol]",cs="[object ArrayBuffer]",xs="[object DataView]",gs="[object Float32Array]",hs="[object Float64Array]",bs="[object Int8Array]",ys="[object Int16Array]",vs="[object Int32Array]",js="[object Uint8Array]",Ts="[object Uint8ClampedArray]",Os="[object Uint16Array]",As="[object Uint32Array]";function _s(t,e,r){var o=t.constructor;switch(e){case cs:return q(t);case ss:case is:return new o(+t);case xs:return rr(t,r);case gs:case hs:case bs:case ys:case vs:case js:case Ts:case Os:case As:return ir(t,r);case ns:return new o;case ps:case ls:return new o(t);case us:return or(t);case ms:return new o;case ds:return sr(t)}}var nr=_s;function Ss(t){return typeof t.constructor=="function"&&!N(t)?$t(V(t)):{}}var pr=Ss;var Is="[object Map]";function ws(t){return x(t)&&z(t)==Is}var ur=ws;var mr=O&&O.isMap,Ps=mr?F(mr):ur,lr=Ps;var Cs="[object Set]";function Es(t){return x(t)&&z(t)==Cs}var dr=Es;var cr=O&&O.isSet,Ls=cr?F(cr):dr,xr=Ls;var Bs=1,Ms=2,Ns=4,gr="[object Arguments]",Fs="[object Array]",Ds="[object Boolean]",Rs="[object Date]",Ws="[object Error]",hr="[object Function]",Us="[object GeneratorFunction]",Gs="[object Map]",Vs="[object Number]",br="[object Object]",Ks="[object RegExp]",ks="[object Set]",zs="[object String]",qs="[object Symbol]",Hs="[object WeakMap]",$s="[object ArrayBuffer]",Js="[object DataView]",Xs="[object Float32Array]",Ys="[object Float64Array]",Zs="[object Int8Array]",Qs="[object Int16Array]",ti="[object Int32Array]",ei="[object Uint8Array]",ri="[object Uint8ClampedArray]",oi="[object Uint16Array]",ai="[object Uint32Array]",n={};n[gr]=n[Fs]=n[$s]=n[Js]=n[Ds]=n[Rs]=n[Xs]=n[Ys]=n[Zs]=n[Qs]=n[ti]=n[Gs]=n[Vs]=n[br]=n[Ks]=n[ks]=n[zs]=n[qs]=n[ei]=n[ri]=n[oi]=n[ai]=!0;n[Ws]=n[hr]=n[Hs]=!1;function yt(t,e,r,o,a,f){var s,i=e&Bs,u=e&Ms,d=e&Ns;if(r&&(s=a?r(t,o,a,f):r(t)),s!==void 0)return s;if(!c(t))return t;var H=M(t);if(H){if(s=er(t),!i)return Jt(t,s)}else{var b=z(t),L=b==hr||b==Us;if(pt(t))return Ke(t,i);if(b==br||b==gr||L&&!a){if(s=u||L?{}:pr(t),!i)return u?He(t,Re(s,t)):qe(t,De(s,t))}else{if(!n[b])return a?t:{};s=nr(t,b,i)}}f||(f=new Fe);var B=f.get(t);if(B)return B;f.set(t,s),xr(t)?t.forEach(function(v){s.add(yt(v,e,r,v,t,f))}):lr(t)&&t.forEach(function(v,y){s.set(y,yt(v,e,r,y,t,f))});var Tt=d?u?Je:$e:u?R:D,Z=H?void 0:Tt(t);return Xt(Z||t,function(v,y){Z&&(y=v,v=t[y]),st(s,y,yt(v,e,r,y,t,f))}),s}var yr=yt;var fi=1,si=4;function ii(t){return yr(t,fi|si)}var vt=ii;var ni=function(){return m.Date.now()},jt=ni;var pi="Expected a function",ui=Math.max,mi=Math.min;function li(t,e,r){var o,a,f,s,i,u,d=0,H=!1,b=!1,L=!0;if(typeof t!="function")throw new TypeError(pi);e=At(e)||0,c(r)&&(H=!!r.leading,b="maxWait"in r,f=b?ui(At(r.maxWait)||0,e):f,L="trailing"in r?!!r.trailing:L);function B(l){var _=o,$=a;return o=a=void 0,d=l,s=t.apply($,_),s}function Tt(l){return d=l,i=setTimeout(y,e),H?B(l):s}function Z(l){var _=l-u,$=l-d,Mt=e-_;return b?mi(Mt,f-$):Mt}function v(l){var _=l-u,$=l-d;return u===void 0||_>=e||_<0||b&&$>=f}function y(){var l=jt();if(v(l))return Bt(l);i=setTimeout(y,Z(l))}function Bt(l){return i=void 0,L&&o?B(l):(o=a=void 0,s)}function vr(){i!==void 0&&clearTimeout(i),d=0,o=u=a=i=void 0}function jr(){return i===void 0?s:Bt(jt())}function Ot(){var l=jt(),_=v(l);if(o=arguments,a=this,u=l,_){if(i===void 0)return Tt(u);if(b)return clearTimeout(i),i=setTimeout(y,e),B(u)}return i===void 0&&(i=setTimeout(y,e)),s}return Ot.cancel=vr,Ot.flush=jr,Ot}var Et=li;var Y=class{init(){}constructor(e,r){}};var Lt=class extends Y{constructor(){super(...arguments);Q(this,"Vue");Q(this,"projects");Q(this,"state",null)}bindProjectState(r){let o={component:null,componentKey:null,autoRequire:!0,read:!0,write:!0,throttle:{wait:200,maxWait:2e3,leading:!1,trailing:!0},...r};return Promise.resolve().then(()=>Promise.all([this.getProjectState({autoRequire:o.autoRequire}),(()=>{if(!o.componentKey){for(let a=0;a<50;a++){let f=`terafy_${a}`;if(!Object.hasOwnProperty(o.component,f)){o.componentKey=f;return}}throw new Error("Unable to find unique key to allocate against Vue2 component")}})()])).then(([a])=>{this.debug("INFO",2,"Got project snapshot",a);let f=this.Vue.observable(a);if(o.component[o.componentKey]=f,o.read&&this.events.on(`update:projects/${f.id}`,s=>{var i;(i=s==null?void 0:s.lastPatch)!=null&&i.session&&s.lastPatch.session==this.settings.session||(this.debug("INFO",5,"Update Vue2 Remote->Local",{new:s,old:f}),this.merge(f,s))}),o.write){if(!o.component)throw new Error("bindProjectState requires a VueComponent specified as `component`");let s=vt(a),i=u=>{this.debug("INFO",5,"Update Vue2 Local->Remote",{new:u,old:s}),this.createProjectStatePatch(u,s),s=vt(a)};o.component.$watch(o.componentKey,o.throttle?Et(i,o.throttle.wait,o.throttle):i,{deep:!0})}return f})}merge(r,...o){return o.forEach(a=>Object.keys(a).forEach(f=>{Pt(a[f])?(f in r||this.Vue.set(r,f,{}),this.merge(r[f],a[f])):this.Vue.set(r,f,a[f])})),r}init(r){let o={app:null,Vue:null,globalName:"$tera",requireProject:!0,subscribeState:!0,subscribeProjects:!0,stateOptions:{read:!0,write:!0},...r};if(!o.Vue)throw new Error("Vue instance to use must be specified in init options as `Vue`");if(this.Vue=r.Vue,!this.settings.app)throw new Error("Need to specify the root level Vue2 app during init");return o.stateOptions.app=this.settings.app,this.projects=this.Vue.observable([]),o.globalName&&(this.Vue.prototype[o.globalName]=this),this.state=null,Promise.resolve().then(()=>o.requireProject&&this.requireProject()).then(()=>Promise.all([o.subscribeState&&this.bindProjectState({...o.stateOptions,component:this.settings.app.$root}).then(a=>this.state=a).then(()=>this.debug("INFO",1,"Loaded initial project state",this.state)),o.subscribeProjects&&this.getProjects().then(a=>this.projects=this.Vue.observable(a)).then(()=>this.debug("INFO",2,"Loaded project list",this.projects))])).then(()=>this.debug("INFO",1,"Ready"))}};export{Lt as default};
1
+ var FP=Object.create;var Xa=Object.defineProperty;var UP=Object.getOwnPropertyDescriptor;var BP=Object.getOwnPropertyNames;var jP=Object.getPrototypeOf,$P=Object.prototype.hasOwnProperty;var qP=(n,e,t)=>e in n?Xa(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var zP=(n,e)=>()=>(n&&(e=n(n=0)),e);var cn=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),GP=(n,e)=>{for(var t in e)Xa(n,t,{get:e[t],enumerable:!0})},$y=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of BP(e))!$P.call(n,s)&&s!==t&&Xa(n,s,{get:()=>e[s],enumerable:!(r=UP(e,s))||r.enumerable});return n};var Cd=(n,e,t)=>(t=n!=null?FP(jP(n)):{},$y(e||!n||!n.__esModule?Xa(t,"default",{value:n,enumerable:!0}):t,n)),KP=n=>$y(Xa({},"__esModule",{value:!0}),n);var jt=(n,e,t)=>qP(n,typeof e!="symbol"?e+"":e,t);var gs={};GP(gs,{Headers:()=>bg,Request:()=>OF,Response:()=>kF,default:()=>wg,fetch:()=>DF});var CF,ea,DF,wg,bg,OF,kF,Ei=zP(()=>{"use strict";CF=function(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("unable to locate global object")},ea=CF(),DF=ea.fetch,wg=ea.fetch.bind(ea),bg=ea.Headers,OF=ea.Request,kF=ea.Response});var Ig=cn(Eg=>{"use strict";Object.defineProperty(Eg,"__esModule",{value:!0});var Tg=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};Eg.default=Tg});var Ag=cn(ku=>{"use strict";var iE=ku&&ku.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ku,"__esModule",{value:!0});var VF=iE((Ei(),KP(gs))),LF=iE(Ig()),xg=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch=="undefined"?this.fetch=VF.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Object.assign({},this.headers),this.headers[e]=t,this}then(e,t){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let r=this.fetch,s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{var c,h,f;let m=null,_=null,E=null,I=a.status,k=a.statusText;if(a.ok){if(this.method!=="HEAD"){let J=await a.text();J===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?_=J:_=JSON.parse(J))}let G=(c=this.headers.Prefer)===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),j=(h=a.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");G&&j&&j.length>1&&(E=parseInt(j[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(_)&&(_.length>1?(m={code:"PGRST116",details:`Results contain ${_.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},_=null,E=null,I=406,k="Not Acceptable"):_.length===1?_=_[0]:_=null)}else{let G=await a.text();try{m=JSON.parse(G),Array.isArray(m)&&a.status===404&&(_=[],m=null,I=200,k="OK")}catch{a.status===404&&G===""?(I=204,k="No Content"):m={message:G}}if(m&&this.isMaybeSingle&&(!((f=m==null?void 0:m.details)===null||f===void 0)&&f.includes("0 rows"))&&(m=null,I=200,k="OK"),m&&this.shouldThrowOnError)throw new LF.default(m)}return{error:m,data:_,count:E,status:I,statusText:k}});return this.shouldThrowOnError||(s=s.catch(a=>{var c,h,f;return{error:{message:`${(c=a==null?void 0:a.name)!==null&&c!==void 0?c:"FetchError"}: ${a==null?void 0:a.message}`,details:`${(h=a==null?void 0:a.stack)!==null&&h!==void 0?h:""}`,hint:"",code:`${(f=a==null?void 0:a.code)!==null&&f!==void 0?f:""}`},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}};ku.default=xg});var Rg=cn(Nu=>{"use strict";var MF=Nu&&Nu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Nu,"__esModule",{value:!0});var FF=MF(Ag()),Sg=class extends FF.default{select(e){let t=!1,r=(e!=null?e:"*").split("").map(s=>/\s/.test(s)&&!t?"":(s==='"'&&(t=!t),s)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:s,referencedTable:a=s}={}){let c=a?`${a}.order`:"order",h=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${h?`${h},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let s=typeof r=="undefined"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:s=r}={}){let a=typeof s=="undefined"?"offset":`${s}.offset`,c=typeof s=="undefined"?"limit":`${s}.limit`;return this.url.searchParams.set(a,`${e}`),this.url.searchParams.set(c,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:s=!1,wal:a=!1,format:c="text"}={}){var h;let f=[e?"analyze":null,t?"verbose":null,r?"settings":null,s?"buffers":null,a?"wal":null].filter(Boolean).join("|"),m=(h=this.headers.Accept)!==null&&h!==void 0?h:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${c}; for="${m}"; options=${f};`,c==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Nu.default=Sg});var ef=cn(Vu=>{"use strict";var UF=Vu&&Vu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Vu,"__esModule",{value:!0});var BF=UF(Rg()),Pg=class extends BF.default{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(s=>typeof s=="string"&&new RegExp("[,()]").test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:s}={}){let a="";s==="plain"?a="pl":s==="phrase"?a="ph":s==="websearch"&&(a="w");let c=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${a}fts${c}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let s=r?`${r}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}};Vu.default=Pg});var Dg=cn(Mu=>{"use strict";var jF=Mu&&Mu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Mu,"__esModule",{value:!0});var Lu=jF(ef()),Cg=class{constructor(e,{headers:t={},schema:r,fetch:s}){this.url=e,this.headers=t,this.schema=r,this.fetch=s}select(e,{head:t=!1,count:r}={}){let s=t?"HEAD":"GET",a=!1,c=(e!=null?e:"*").split("").map(h=>/\s/.test(h)&&!a?"":(h==='"'&&(a=!a),h)).join("");return this.url.searchParams.set("select",c),r&&(this.headers.Prefer=`count=${r}`),new Lu.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:r=!0}={}){let s="POST",a=[];if(this.headers.Prefer&&a.push(this.headers.Prefer),t&&a.push(`count=${t}`),r||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let c=e.reduce((h,f)=>h.concat(Object.keys(f)),[]);if(c.length>0){let h=[...new Set(c)].map(f=>`"${f}"`);this.url.searchParams.set("columns",h.join(","))}}return new Lu.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:s,defaultToNull:a=!0}={}){let c="POST",h=[`resolution=${r?"ignore":"merge"}-duplicates`];if(t!==void 0&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&h.push(this.headers.Prefer),s&&h.push(`count=${s}`),a||h.push("missing=default"),this.headers.Prefer=h.join(","),Array.isArray(e)){let f=e.reduce((m,_)=>m.concat(Object.keys(_)),[]);if(f.length>0){let m=[...new Set(f)].map(_=>`"${_}"`);this.url.searchParams.set("columns",m.join(","))}}return new Lu.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){let r="PATCH",s=[];return this.headers.Prefer&&s.push(this.headers.Prefer),t&&s.push(`count=${t}`),this.headers.Prefer=s.join(","),new Lu.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let t="DELETE",r=[];return e&&r.push(`count=${e}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new Lu.default({method:t,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Mu.default=Cg});var sE=cn(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.version=void 0;tf.version="0.0.0-automated"});var oE=cn(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.DEFAULT_HEADERS=void 0;var $F=sE();nf.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${$F.version}`}});var uE=cn(Fu=>{"use strict";var aE=Fu&&Fu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Fu,"__esModule",{value:!0});var qF=aE(Dg()),zF=aE(ef()),GF=oE(),Og=class n{constructor(e,{headers:t={},schema:r,fetch:s}={}){this.url=e,this.headers=Object.assign(Object.assign({},GF.DEFAULT_HEADERS),t),this.schemaName=r,this.fetch=s}from(e){let t=new URL(`${this.url}/${e}`);return new qF.default(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new n(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:r=!1,get:s=!1,count:a}={}){let c,h=new URL(`${this.url}/rpc/${e}`),f;r||s?(c=r?"HEAD":"GET",Object.entries(t).filter(([_,E])=>E!==void 0).map(([_,E])=>[_,Array.isArray(E)?`{${E.join(",")}}`:`${E}`]).forEach(([_,E])=>{h.searchParams.append(_,E)})):(c="POST",f=t);let m=Object.assign({},this.headers);return a&&(m.Prefer=`count=${a}`),new zF.default({method:c,url:h,headers:m,schema:this.schemaName,body:f,fetch:this.fetch,allowEmpty:!1})}};Fu.default=Og});var mE=cn(vt=>{"use strict";var ta=vt&&vt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(vt,"__esModule",{value:!0});vt.PostgrestError=vt.PostgrestBuilder=vt.PostgrestTransformBuilder=vt.PostgrestFilterBuilder=vt.PostgrestQueryBuilder=vt.PostgrestClient=void 0;var cE=ta(uE());vt.PostgrestClient=cE.default;var lE=ta(Dg());vt.PostgrestQueryBuilder=lE.default;var hE=ta(ef());vt.PostgrestFilterBuilder=hE.default;var fE=ta(Rg());vt.PostgrestTransformBuilder=fE.default;var dE=ta(Ag());vt.PostgrestBuilder=dE.default;var pE=ta(Ig());vt.PostgrestError=pE.default;vt.default={PostgrestClient:cE.default,PostgrestQueryBuilder:lE.default,PostgrestFilterBuilder:hE.default,PostgrestTransformBuilder:fE.default,PostgrestBuilder:dE.default,PostgrestError:pE.default}});var IE=cn((XK,EE)=>{"use strict";EE.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var aI=cn((ha,tc)=>{(function(){var n,e="4.17.21",t=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",h=500,f="__lodash_placeholder__",m=1,_=2,E=4,I=1,k=2,B=1,G=2,j=4,J=8,ee=16,ne=32,le=64,de=128,ie=256,C=512,A=30,R="...",D=800,V=16,M=1,S=2,pn=3,Kt=1/0,Cn=9007199254740991,Ai=17976931348623157e292,Dn=NaN,Nt=4294967295,sc=Nt-1,yf=Nt>>>1,On=[["ary",de],["bind",B],["bindKey",G],["curry",J],["curryRight",ee],["flip",C],["partial",ne],["partialRight",le],["rearg",ie]],Ge="[object Arguments]",Cs="[object Array]",Si="[object AsyncFunction]",Ri="[object Boolean]",mn="[object Date]",vf="[object DOMException]",Ds="[object Error]",rr="[object Function]",Pi="[object GeneratorFunction]",St="[object Map]",ir="[object Number]",da="[object Null]",Wt="[object Object]",pa="[object Promise]",oc="[object Proxy]",Ci="[object RegExp]",Vt="[object Set]",Lr="[object String]",Mr="[object Symbol]",ac="[object Undefined]",Di="[object WeakMap]",ma="[object WeakSet]",sr="[object ArrayBuffer]",kn="[object DataView]",nt="[object Float32Array]",at="[object Float64Array]",Fr="[object Int8Array]",Os="[object Int16Array]",ks="[object Int32Array]",ga="[object Uint8Array]",or="[object Uint8ClampedArray]",Ns="[object Uint16Array]",Vs="[object Uint32Array]",_a=/\b__p \+= '';/g,wf=/\b(__p \+=) '' \+/g,bf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ls=/&(?:amp|lt|gt|quot|#39);/g,ya=/[&<>"']/g,uc=RegExp(Ls.source),Oi=RegExp(ya.source),va=/<%-([\s\S]+?)%>/g,wa=/<%([\s\S]+?)%>/g,Nn=/<%=([\s\S]+?)%>/g,cc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ms=/^\w*$/,lc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ar=/[\\^$.*+?()[\]{}|]/g,hc=RegExp(ar.source),ut=/^\s+/,fc=/\s/,ki=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ni=/\{\n\/\* \[wrapped with (.+)\] \*/,Tf=/,? & /,Ef=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ur=/[()=,{}\[\]\/\s]/,If=/\\(\\)?/g,xf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Vi=/\w*$/,dc=/^[-+]0x[0-9a-f]+$/i,ba=/^0b[01]+$/i,Fs=/^\[object .+?Constructor\]$/,Vn=/^0o[0-7]+$/i,pc=/^(?:0|[1-9]\d*)$/,mc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Br=/($^)/,Ta=/['\n\r\u2028\u2029\\]/g,Li="\\ud800-\\udfff",gc="\\u0300-\\u036f",Af="\\ufe20-\\ufe2f",Us="\\u20d0-\\u20ff",Ea=gc+Af+Us,Bs="\\u2700-\\u27bf",jr="a-z\\xdf-\\xf6\\xf8-\\xff",ur="\\xac\\xb1\\xd7\\xf7",Ia="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sf="\\u2000-\\u206f",_c=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",xa="A-Z\\xc0-\\xd6\\xd8-\\xde",Aa="\\ufe0e\\ufe0f",js=ur+Ia+Sf+_c,Mi="['\u2019]",yc="["+Li+"]",Sa="["+js+"]",$s="["+Ea+"]",vc="\\d+",wc="["+Bs+"]",Ra="["+jr+"]",bc="[^"+Li+js+vc+Bs+jr+xa+"]",gn="\\ud83c[\\udffb-\\udfff]",_n="(?:"+$s+"|"+gn+")",Fi="[^"+Li+"]",$r="(?:\\ud83c[\\udde6-\\uddff]){2}",qs="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="["+xa+"]",Ui="\\u200d",qr="(?:"+Ra+"|"+bc+")",Bi="(?:"+Ce+"|"+bc+")",Tc="(?:"+Mi+"(?:d|ll|m|re|s|t|ve))?",Pa="(?:"+Mi+"(?:D|LL|M|RE|S|T|VE))?",Ec=_n+"?",Ic="["+Aa+"]?",Rf="(?:"+Ui+"(?:"+[Fi,$r,qs].join("|")+")"+Ic+Ec+")*",Pf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ji="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",yn=Ic+Ec+Rf,xc="(?:"+[wc,$r,qs].join("|")+")"+yn,Ac="(?:"+[Fi+$s+"?",$s,$r,qs,yc].join("|")+")",Sc=RegExp(Mi,"g"),zr=RegExp($s,"g"),Ca=RegExp(gn+"(?="+gn+")|"+Ac+yn,"g"),Cf=RegExp([Ce+"?"+Ra+"+"+Tc+"(?="+[Sa,Ce,"$"].join("|")+")",Bi+"+"+Pa+"(?="+[Sa,Ce+qr,"$"].join("|")+")",Ce+"?"+qr+"+"+Tc,Ce+"+"+Pa,ji,Pf,vc,xc].join("|"),"g"),Df=RegExp("["+Ui+Li+Ea+Aa+"]"),Ln=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Of=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],kf=-1,Oe={};Oe[nt]=Oe[at]=Oe[Fr]=Oe[Os]=Oe[ks]=Oe[ga]=Oe[or]=Oe[Ns]=Oe[Vs]=!0,Oe[Ge]=Oe[Cs]=Oe[sr]=Oe[Ri]=Oe[kn]=Oe[mn]=Oe[Ds]=Oe[rr]=Oe[St]=Oe[ir]=Oe[Wt]=Oe[Ci]=Oe[Vt]=Oe[Lr]=Oe[Di]=!1;var ke={};ke[Ge]=ke[Cs]=ke[sr]=ke[kn]=ke[Ri]=ke[mn]=ke[nt]=ke[at]=ke[Fr]=ke[Os]=ke[ks]=ke[St]=ke[ir]=ke[Wt]=ke[Ci]=ke[Vt]=ke[Lr]=ke[Mr]=ke[ga]=ke[or]=ke[Ns]=ke[Vs]=!0,ke[Ds]=ke[rr]=ke[Di]=!1;var Rc={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},$i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qi={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Pc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Da=parseFloat,qe=parseInt,Cc=typeof global=="object"&&global&&global.Object===Object&&global,Nf=typeof self=="object"&&self&&self.Object===Object&&self,Ye=Cc||Nf||Function("return this")(),zs=typeof ha=="object"&&ha&&!ha.nodeType&&ha,Mn=zs&&typeof tc=="object"&&tc&&!tc.nodeType&&tc,zi=Mn&&Mn.exports===zs,Gs=zi&&Cc.process,We=function(){try{var O=Mn&&Mn.require&&Mn.require("util").types;return O||Gs&&Gs.binding&&Gs.binding("util")}catch{}}(),Oa=We&&We.isArrayBuffer,Dc=We&&We.isDate,Gr=We&&We.isMap,ka=We&&We.isRegExp,Ks=We&&We.isSet,Gi=We&&We.isTypedArray;function bt(O,$,U){switch(U.length){case 0:return O.call($);case 1:return O.call($,U[0]);case 2:return O.call($,U[0],U[1]);case 3:return O.call($,U[0],U[1],U[2])}return O.apply($,U)}function Ws(O,$,U,Z){for(var he=-1,Ne=O==null?0:O.length;++he<Ne;){var ht=O[he];$(Z,ht,U(ht),O)}return Z}function Lt(O,$){for(var U=-1,Z=O==null?0:O.length;++U<Z&&$(O[U],U,O)!==!1;);return O}function Oc(O,$){for(var U=O==null?0:O.length;U--&&$(O[U],U,O)!==!1;);return O}function Kr(O,$){for(var U=-1,Z=O==null?0:O.length;++U<Z;)if(!$(O[U],U,O))return!1;return!0}function vn(O,$){for(var U=-1,Z=O==null?0:O.length,he=0,Ne=[];++U<Z;){var ht=O[U];$(ht,U,O)&&(Ne[he++]=ht)}return Ne}function Ki(O,$){var U=O==null?0:O.length;return!!U&&bn(O,$,0)>-1}function Wi(O,$,U){for(var Z=-1,he=O==null?0:O.length;++Z<he;)if(U($,O[Z]))return!0;return!1}function Fe(O,$){for(var U=-1,Z=O==null?0:O.length,he=Array(Z);++U<Z;)he[U]=$(O[U],U,O);return he}function wn(O,$){for(var U=-1,Z=$.length,he=O.length;++U<Z;)O[he+U]=$[U];return O}function Wr(O,$,U,Z){var he=-1,Ne=O==null?0:O.length;for(Z&&Ne&&(U=O[++he]);++he<Ne;)U=$(U,O[he],he,O);return U}function kc(O,$,U,Z){var he=O==null?0:O.length;for(Z&&he&&(U=O[--he]);he--;)U=$(U,O[he],he,O);return U}function Hs(O,$){for(var U=-1,Z=O==null?0:O.length;++U<Z;)if($(O[U],U,O))return!0;return!1}var cr=Fn("length");function Nc(O){return O.split("")}function Vc(O){return O.match(Ef)||[]}function Na(O,$,U){var Z;return U(O,function(he,Ne,ht){if($(he,Ne,ht))return Z=Ne,!1}),Z}function Hi(O,$,U,Z){for(var he=O.length,Ne=U+(Z?1:-1);Z?Ne--:++Ne<he;)if($(O[Ne],Ne,O))return Ne;return-1}function bn(O,$,U){return $===$?II(O,$,U):Hi(O,Va,U)}function Rt(O,$,U,Z){for(var he=U-1,Ne=O.length;++he<Ne;)if(Z(O[he],$))return he;return-1}function Va(O){return O!==O}function La(O,$){var U=O==null?0:O.length;return U?b(O,$)/U:Dn}function Fn(O){return function($){return $==null?n:$[O]}}function u(O){return function($){return O==null?n:O[$]}}function d(O,$,U,Z,he){return he(O,function(Ne,ht,Ue){U=Z?(Z=!1,Ne):$(U,Ne,ht,Ue)}),U}function g(O,$){var U=O.length;for(O.sort($);U--;)O[U]=O[U].value;return O}function b(O,$){for(var U,Z=-1,he=O.length;++Z<he;){var Ne=$(O[Z]);Ne!==n&&(U=U===n?Ne:U+Ne)}return U}function L(O,$){for(var U=-1,Z=Array(O);++U<O;)Z[U]=$(U);return Z}function F(O,$){return Fe($,function(U){return[U,O[U]]})}function Q(O){return O&&O.slice(0,Xg(O)+1).replace(ut,"")}function _e(O){return function($){return O($)}}function Xe(O,$){return Fe($,function(U){return O[U]})}function be(O,$){return O.has($)}function ct(O,$){for(var U=-1,Z=O.length;++U<Z&&bn($,O[U],0)>-1;);return U}function lt(O,$){for(var U=O.length;U--&&bn($,O[U],0)>-1;);return U}function Hr(O,$){for(var U=O.length,Z=0;U--;)O[U]===$&&++Z;return Z}var Ht=u(Rc),Qs=u($i);function Ma(O){return"\\"+Pc[O]}function wI(O,$){return O==null?n:O[$]}function Js(O){return Df.test(O)}function bI(O){return Ln.test(O)}function TI(O){for(var $,U=[];!($=O.next()).done;)U.push($.value);return U}function Vf(O){var $=-1,U=Array(O.size);return O.forEach(function(Z,he){U[++$]=[he,Z]}),U}function Yg(O,$){return function(U){return O($(U))}}function Qr(O,$){for(var U=-1,Z=O.length,he=0,Ne=[];++U<Z;){var ht=O[U];(ht===$||ht===f)&&(O[U]=f,Ne[he++]=U)}return Ne}function Lc(O){var $=-1,U=Array(O.size);return O.forEach(function(Z){U[++$]=Z}),U}function EI(O){var $=-1,U=Array(O.size);return O.forEach(function(Z){U[++$]=[Z,Z]}),U}function II(O,$,U){for(var Z=U-1,he=O.length;++Z<he;)if(O[Z]===$)return Z;return-1}function xI(O,$,U){for(var Z=U+1;Z--;)if(O[Z]===$)return Z;return Z}function Ys(O){return Js(O)?SI(O):cr(O)}function Tn(O){return Js(O)?RI(O):Nc(O)}function Xg(O){for(var $=O.length;$--&&fc.test(O.charAt($)););return $}var AI=u(qi);function SI(O){for(var $=Ca.lastIndex=0;Ca.test(O);)++$;return $}function RI(O){return O.match(Ca)||[]}function PI(O){return O.match(Cf)||[]}var CI=function O($){$=$==null?Ye:Jr.defaults(Ye.Object(),$,Jr.pick(Ye,Of));var U=$.Array,Z=$.Date,he=$.Error,Ne=$.Function,ht=$.Math,Ue=$.Object,Lf=$.RegExp,DI=$.String,nn=$.TypeError,Mc=U.prototype,OI=Ne.prototype,Xs=Ue.prototype,Fc=$["__core-js_shared__"],Uc=OI.toString,Me=Xs.hasOwnProperty,kI=0,Zg=function(){var i=/[^.]+$/.exec(Fc&&Fc.keys&&Fc.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Bc=Xs.toString,NI=Uc.call(Ue),VI=Ye._,LI=Lf("^"+Uc.call(Me).replace(ar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jc=zi?$.Buffer:n,Yr=$.Symbol,$c=$.Uint8Array,e_=jc?jc.allocUnsafe:n,qc=Yg(Ue.getPrototypeOf,Ue),t_=Ue.create,n_=Xs.propertyIsEnumerable,zc=Mc.splice,r_=Yr?Yr.isConcatSpreadable:n,Fa=Yr?Yr.iterator:n,Qi=Yr?Yr.toStringTag:n,Gc=function(){try{var i=es(Ue,"defineProperty");return i({},"",{}),i}catch{}}(),MI=$.clearTimeout!==Ye.clearTimeout&&$.clearTimeout,FI=Z&&Z.now!==Ye.Date.now&&Z.now,UI=$.setTimeout!==Ye.setTimeout&&$.setTimeout,Kc=ht.ceil,Wc=ht.floor,Mf=Ue.getOwnPropertySymbols,BI=jc?jc.isBuffer:n,i_=$.isFinite,jI=Mc.join,$I=Yg(Ue.keys,Ue),ft=ht.max,Tt=ht.min,qI=Z.now,zI=$.parseInt,s_=ht.random,GI=Mc.reverse,Ff=es($,"DataView"),Ua=es($,"Map"),Uf=es($,"Promise"),Zs=es($,"Set"),Ba=es($,"WeakMap"),ja=es(Ue,"create"),Hc=Ba&&new Ba,eo={},KI=ts(Ff),WI=ts(Ua),HI=ts(Uf),QI=ts(Zs),JI=ts(Ba),Qc=Yr?Yr.prototype:n,$a=Qc?Qc.valueOf:n,o_=Qc?Qc.toString:n;function w(i){if(He(i)&&!pe(i)&&!(i instanceof Ie)){if(i instanceof rn)return i;if(Me.call(i,"__wrapped__"))return ay(i)}return new rn(i)}var to=function(){function i(){}return function(o){if(!Ke(o))return{};if(t_)return t_(o);i.prototype=o;var l=new i;return i.prototype=n,l}}();function Jc(){}function rn(i,o){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=n}w.templateSettings={escape:va,evaluate:wa,interpolate:Nn,variable:"",imports:{_:w}},w.prototype=Jc.prototype,w.prototype.constructor=w,rn.prototype=to(Jc.prototype),rn.prototype.constructor=rn;function Ie(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Nt,this.__views__=[]}function YI(){var i=new Ie(this.__wrapped__);return i.__actions__=Mt(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Mt(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Mt(this.__views__),i}function XI(){if(this.__filtered__){var i=new Ie(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function ZI(){var i=this.__wrapped__.value(),o=this.__dir__,l=pe(i),p=o<0,y=l?i.length:0,T=hA(0,y,this.__views__),x=T.start,P=T.end,N=P-x,q=p?P:x-1,z=this.__iteratees__,K=z.length,Y=0,te=Tt(N,this.__takeCount__);if(!l||!p&&y==N&&te==N)return C_(i,this.__actions__);var oe=[];e:for(;N--&&Y<te;){q+=o;for(var ve=-1,ae=i[q];++ve<K;){var Te=z[ve],Ae=Te.iteratee,Yt=Te.type,Dt=Ae(ae);if(Yt==S)ae=Dt;else if(!Dt){if(Yt==M)continue e;break e}}oe[Y++]=ae}return oe}Ie.prototype=to(Jc.prototype),Ie.prototype.constructor=Ie;function Ji(i){var o=-1,l=i==null?0:i.length;for(this.clear();++o<l;){var p=i[o];this.set(p[0],p[1])}}function ex(){this.__data__=ja?ja(null):{},this.size=0}function tx(i){var o=this.has(i)&&delete this.__data__[i];return this.size-=o?1:0,o}function nx(i){var o=this.__data__;if(ja){var l=o[i];return l===c?n:l}return Me.call(o,i)?o[i]:n}function rx(i){var o=this.__data__;return ja?o[i]!==n:Me.call(o,i)}function ix(i,o){var l=this.__data__;return this.size+=this.has(i)?0:1,l[i]=ja&&o===n?c:o,this}Ji.prototype.clear=ex,Ji.prototype.delete=tx,Ji.prototype.get=nx,Ji.prototype.has=rx,Ji.prototype.set=ix;function lr(i){var o=-1,l=i==null?0:i.length;for(this.clear();++o<l;){var p=i[o];this.set(p[0],p[1])}}function sx(){this.__data__=[],this.size=0}function ox(i){var o=this.__data__,l=Yc(o,i);if(l<0)return!1;var p=o.length-1;return l==p?o.pop():zc.call(o,l,1),--this.size,!0}function ax(i){var o=this.__data__,l=Yc(o,i);return l<0?n:o[l][1]}function ux(i){return Yc(this.__data__,i)>-1}function cx(i,o){var l=this.__data__,p=Yc(l,i);return p<0?(++this.size,l.push([i,o])):l[p][1]=o,this}lr.prototype.clear=sx,lr.prototype.delete=ox,lr.prototype.get=ax,lr.prototype.has=ux,lr.prototype.set=cx;function hr(i){var o=-1,l=i==null?0:i.length;for(this.clear();++o<l;){var p=i[o];this.set(p[0],p[1])}}function lx(){this.size=0,this.__data__={hash:new Ji,map:new(Ua||lr),string:new Ji}}function hx(i){var o=cl(this,i).delete(i);return this.size-=o?1:0,o}function fx(i){return cl(this,i).get(i)}function dx(i){return cl(this,i).has(i)}function px(i,o){var l=cl(this,i),p=l.size;return l.set(i,o),this.size+=l.size==p?0:1,this}hr.prototype.clear=lx,hr.prototype.delete=hx,hr.prototype.get=fx,hr.prototype.has=dx,hr.prototype.set=px;function Yi(i){var o=-1,l=i==null?0:i.length;for(this.__data__=new hr;++o<l;)this.add(i[o])}function mx(i){return this.__data__.set(i,c),this}function gx(i){return this.__data__.has(i)}Yi.prototype.add=Yi.prototype.push=mx,Yi.prototype.has=gx;function En(i){var o=this.__data__=new lr(i);this.size=o.size}function _x(){this.__data__=new lr,this.size=0}function yx(i){var o=this.__data__,l=o.delete(i);return this.size=o.size,l}function vx(i){return this.__data__.get(i)}function wx(i){return this.__data__.has(i)}function bx(i,o){var l=this.__data__;if(l instanceof lr){var p=l.__data__;if(!Ua||p.length<t-1)return p.push([i,o]),this.size=++l.size,this;l=this.__data__=new hr(p)}return l.set(i,o),this.size=l.size,this}En.prototype.clear=_x,En.prototype.delete=yx,En.prototype.get=vx,En.prototype.has=wx,En.prototype.set=bx;function a_(i,o){var l=pe(i),p=!l&&ns(i),y=!l&&!p&&ni(i),T=!l&&!p&&!y&&so(i),x=l||p||y||T,P=x?L(i.length,DI):[],N=P.length;for(var q in i)(o||Me.call(i,q))&&!(x&&(q=="length"||y&&(q=="offset"||q=="parent")||T&&(q=="buffer"||q=="byteLength"||q=="byteOffset")||mr(q,N)))&&P.push(q);return P}function u_(i){var o=i.length;return o?i[Jf(0,o-1)]:n}function Tx(i,o){return ll(Mt(i),Xi(o,0,i.length))}function Ex(i){return ll(Mt(i))}function Bf(i,o,l){(l!==n&&!In(i[o],l)||l===n&&!(o in i))&&fr(i,o,l)}function qa(i,o,l){var p=i[o];(!(Me.call(i,o)&&In(p,l))||l===n&&!(o in i))&&fr(i,o,l)}function Yc(i,o){for(var l=i.length;l--;)if(In(i[l][0],o))return l;return-1}function Ix(i,o,l,p){return Xr(i,function(y,T,x){o(p,y,l(y),x)}),p}function c_(i,o){return i&&Bn(o,pt(o),i)}function xx(i,o){return i&&Bn(o,Ut(o),i)}function fr(i,o,l){o=="__proto__"&&Gc?Gc(i,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):i[o]=l}function jf(i,o){for(var l=-1,p=o.length,y=U(p),T=i==null;++l<p;)y[l]=T?n:bd(i,o[l]);return y}function Xi(i,o,l){return i===i&&(l!==n&&(i=i<=l?i:l),o!==n&&(i=i>=o?i:o)),i}function sn(i,o,l,p,y,T){var x,P=o&m,N=o&_,q=o&E;if(l&&(x=y?l(i,p,y,T):l(i)),x!==n)return x;if(!Ke(i))return i;var z=pe(i);if(z){if(x=dA(i),!P)return Mt(i,x)}else{var K=Et(i),Y=K==rr||K==Pi;if(ni(i))return k_(i,P);if(K==Wt||K==Ge||Y&&!y){if(x=N||Y?{}:X_(i),!P)return N?nA(i,xx(x,i)):tA(i,c_(x,i))}else{if(!ke[K])return y?i:{};x=pA(i,K,P)}}T||(T=new En);var te=T.get(i);if(te)return te;T.set(i,x),Sy(i)?i.forEach(function(ae){x.add(sn(ae,o,l,ae,i,T))}):xy(i)&&i.forEach(function(ae,Te){x.set(Te,sn(ae,o,l,Te,i,T))});var oe=q?N?ad:od:N?Ut:pt,ve=z?n:oe(i);return Lt(ve||i,function(ae,Te){ve&&(Te=ae,ae=i[Te]),qa(x,Te,sn(ae,o,l,Te,i,T))}),x}function Ax(i){var o=pt(i);return function(l){return l_(l,i,o)}}function l_(i,o,l){var p=l.length;if(i==null)return!p;for(i=Ue(i);p--;){var y=l[p],T=o[y],x=i[y];if(x===n&&!(y in i)||!T(x))return!1}return!0}function h_(i,o,l){if(typeof i!="function")throw new nn(s);return Ja(function(){i.apply(n,l)},o)}function za(i,o,l,p){var y=-1,T=Ki,x=!0,P=i.length,N=[],q=o.length;if(!P)return N;l&&(o=Fe(o,_e(l))),p?(T=Wi,x=!1):o.length>=t&&(T=be,x=!1,o=new Yi(o));e:for(;++y<P;){var z=i[y],K=l==null?z:l(z);if(z=p||z!==0?z:0,x&&K===K){for(var Y=q;Y--;)if(o[Y]===K)continue e;N.push(z)}else T(o,K,p)||N.push(z)}return N}var Xr=F_(Un),f_=F_(qf,!0);function Sx(i,o){var l=!0;return Xr(i,function(p,y,T){return l=!!o(p,y,T),l}),l}function Xc(i,o,l){for(var p=-1,y=i.length;++p<y;){var T=i[p],x=o(T);if(x!=null&&(P===n?x===x&&!Jt(x):l(x,P)))var P=x,N=T}return N}function Rx(i,o,l,p){var y=i.length;for(l=ye(l),l<0&&(l=-l>y?0:y+l),p=p===n||p>y?y:ye(p),p<0&&(p+=y),p=l>p?0:Py(p);l<p;)i[l++]=o;return i}function d_(i,o){var l=[];return Xr(i,function(p,y,T){o(p,y,T)&&l.push(p)}),l}function _t(i,o,l,p,y){var T=-1,x=i.length;for(l||(l=gA),y||(y=[]);++T<x;){var P=i[T];o>0&&l(P)?o>1?_t(P,o-1,l,p,y):wn(y,P):p||(y[y.length]=P)}return y}var $f=U_(),p_=U_(!0);function Un(i,o){return i&&$f(i,o,pt)}function qf(i,o){return i&&p_(i,o,pt)}function Zc(i,o){return vn(o,function(l){return gr(i[l])})}function Zi(i,o){o=ei(o,i);for(var l=0,p=o.length;i!=null&&l<p;)i=i[jn(o[l++])];return l&&l==p?i:n}function m_(i,o,l){var p=o(i);return pe(i)?p:wn(p,l(i))}function Pt(i){return i==null?i===n?ac:da:Qi&&Qi in Ue(i)?lA(i):EA(i)}function zf(i,o){return i>o}function Px(i,o){return i!=null&&Me.call(i,o)}function Cx(i,o){return i!=null&&o in Ue(i)}function Dx(i,o,l){return i>=Tt(o,l)&&i<ft(o,l)}function Gf(i,o,l){for(var p=l?Wi:Ki,y=i[0].length,T=i.length,x=T,P=U(T),N=1/0,q=[];x--;){var z=i[x];x&&o&&(z=Fe(z,_e(o))),N=Tt(z.length,N),P[x]=!l&&(o||y>=120&&z.length>=120)?new Yi(x&&z):n}z=i[0];var K=-1,Y=P[0];e:for(;++K<y&&q.length<N;){var te=z[K],oe=o?o(te):te;if(te=l||te!==0?te:0,!(Y?be(Y,oe):p(q,oe,l))){for(x=T;--x;){var ve=P[x];if(!(ve?be(ve,oe):p(i[x],oe,l)))continue e}Y&&Y.push(oe),q.push(te)}}return q}function Ox(i,o,l,p){return Un(i,function(y,T,x){o(p,l(y),T,x)}),p}function Ga(i,o,l){o=ei(o,i),i=ny(i,o);var p=i==null?i:i[jn(an(o))];return p==null?n:bt(p,i,l)}function g_(i){return He(i)&&Pt(i)==Ge}function kx(i){return He(i)&&Pt(i)==sr}function Nx(i){return He(i)&&Pt(i)==mn}function Ka(i,o,l,p,y){return i===o?!0:i==null||o==null||!He(i)&&!He(o)?i!==i&&o!==o:Vx(i,o,l,p,Ka,y)}function Vx(i,o,l,p,y,T){var x=pe(i),P=pe(o),N=x?Cs:Et(i),q=P?Cs:Et(o);N=N==Ge?Wt:N,q=q==Ge?Wt:q;var z=N==Wt,K=q==Wt,Y=N==q;if(Y&&ni(i)){if(!ni(o))return!1;x=!0,z=!1}if(Y&&!z)return T||(T=new En),x||so(i)?Q_(i,o,l,p,y,T):uA(i,o,N,l,p,y,T);if(!(l&I)){var te=z&&Me.call(i,"__wrapped__"),oe=K&&Me.call(o,"__wrapped__");if(te||oe){var ve=te?i.value():i,ae=oe?o.value():o;return T||(T=new En),y(ve,ae,l,p,T)}}return Y?(T||(T=new En),cA(i,o,l,p,y,T)):!1}function Lx(i){return He(i)&&Et(i)==St}function Kf(i,o,l,p){var y=l.length,T=y,x=!p;if(i==null)return!T;for(i=Ue(i);y--;){var P=l[y];if(x&&P[2]?P[1]!==i[P[0]]:!(P[0]in i))return!1}for(;++y<T;){P=l[y];var N=P[0],q=i[N],z=P[1];if(x&&P[2]){if(q===n&&!(N in i))return!1}else{var K=new En;if(p)var Y=p(q,z,N,i,o,K);if(!(Y===n?Ka(z,q,I|k,p,K):Y))return!1}}return!0}function __(i){if(!Ke(i)||yA(i))return!1;var o=gr(i)?LI:Fs;return o.test(ts(i))}function Mx(i){return He(i)&&Pt(i)==Ci}function Fx(i){return He(i)&&Et(i)==Vt}function Ux(i){return He(i)&&gl(i.length)&&!!Oe[Pt(i)]}function y_(i){return typeof i=="function"?i:i==null?Bt:typeof i=="object"?pe(i)?b_(i[0],i[1]):w_(i):By(i)}function Wf(i){if(!Qa(i))return $I(i);var o=[];for(var l in Ue(i))Me.call(i,l)&&l!="constructor"&&o.push(l);return o}function Bx(i){if(!Ke(i))return TA(i);var o=Qa(i),l=[];for(var p in i)p=="constructor"&&(o||!Me.call(i,p))||l.push(p);return l}function Hf(i,o){return i<o}function v_(i,o){var l=-1,p=Ft(i)?U(i.length):[];return Xr(i,function(y,T,x){p[++l]=o(y,T,x)}),p}function w_(i){var o=cd(i);return o.length==1&&o[0][2]?ey(o[0][0],o[0][1]):function(l){return l===i||Kf(l,i,o)}}function b_(i,o){return hd(i)&&Z_(o)?ey(jn(i),o):function(l){var p=bd(l,i);return p===n&&p===o?Td(l,i):Ka(o,p,I|k)}}function el(i,o,l,p,y){i!==o&&$f(o,function(T,x){if(y||(y=new En),Ke(T))jx(i,o,x,l,el,p,y);else{var P=p?p(dd(i,x),T,x+"",i,o,y):n;P===n&&(P=T),Bf(i,x,P)}},Ut)}function jx(i,o,l,p,y,T,x){var P=dd(i,l),N=dd(o,l),q=x.get(N);if(q){Bf(i,l,q);return}var z=T?T(P,N,l+"",i,o,x):n,K=z===n;if(K){var Y=pe(N),te=!Y&&ni(N),oe=!Y&&!te&&so(N);z=N,Y||te||oe?pe(P)?z=P:Ze(P)?z=Mt(P):te?(K=!1,z=k_(N,!0)):oe?(K=!1,z=N_(N,!0)):z=[]:Ya(N)||ns(N)?(z=P,ns(P)?z=Cy(P):(!Ke(P)||gr(P))&&(z=X_(N))):K=!1}K&&(x.set(N,z),y(z,N,p,T,x),x.delete(N)),Bf(i,l,z)}function T_(i,o){var l=i.length;if(l)return o+=o<0?l:0,mr(o,l)?i[o]:n}function E_(i,o,l){o.length?o=Fe(o,function(T){return pe(T)?function(x){return Zi(x,T.length===1?T[0]:T)}:T}):o=[Bt];var p=-1;o=Fe(o,_e(se()));var y=v_(i,function(T,x,P){var N=Fe(o,function(q){return q(T)});return{criteria:N,index:++p,value:T}});return g(y,function(T,x){return eA(T,x,l)})}function $x(i,o){return I_(i,o,function(l,p){return Td(i,p)})}function I_(i,o,l){for(var p=-1,y=o.length,T={};++p<y;){var x=o[p],P=Zi(i,x);l(P,x)&&Wa(T,ei(x,i),P)}return T}function qx(i){return function(o){return Zi(o,i)}}function Qf(i,o,l,p){var y=p?Rt:bn,T=-1,x=o.length,P=i;for(i===o&&(o=Mt(o)),l&&(P=Fe(i,_e(l)));++T<x;)for(var N=0,q=o[T],z=l?l(q):q;(N=y(P,z,N,p))>-1;)P!==i&&zc.call(P,N,1),zc.call(i,N,1);return i}function x_(i,o){for(var l=i?o.length:0,p=l-1;l--;){var y=o[l];if(l==p||y!==T){var T=y;mr(y)?zc.call(i,y,1):Zf(i,y)}}return i}function Jf(i,o){return i+Wc(s_()*(o-i+1))}function zx(i,o,l,p){for(var y=-1,T=ft(Kc((o-i)/(l||1)),0),x=U(T);T--;)x[p?T:++y]=i,i+=l;return x}function Yf(i,o){var l="";if(!i||o<1||o>Cn)return l;do o%2&&(l+=i),o=Wc(o/2),o&&(i+=i);while(o);return l}function we(i,o){return pd(ty(i,o,Bt),i+"")}function Gx(i){return u_(oo(i))}function Kx(i,o){var l=oo(i);return ll(l,Xi(o,0,l.length))}function Wa(i,o,l,p){if(!Ke(i))return i;o=ei(o,i);for(var y=-1,T=o.length,x=T-1,P=i;P!=null&&++y<T;){var N=jn(o[y]),q=l;if(N==="__proto__"||N==="constructor"||N==="prototype")return i;if(y!=x){var z=P[N];q=p?p(z,N,P):n,q===n&&(q=Ke(z)?z:mr(o[y+1])?[]:{})}qa(P,N,q),P=P[N]}return i}var A_=Hc?function(i,o){return Hc.set(i,o),i}:Bt,Wx=Gc?function(i,o){return Gc(i,"toString",{configurable:!0,enumerable:!1,value:Id(o),writable:!0})}:Bt;function Hx(i){return ll(oo(i))}function on(i,o,l){var p=-1,y=i.length;o<0&&(o=-o>y?0:y+o),l=l>y?y:l,l<0&&(l+=y),y=o>l?0:l-o>>>0,o>>>=0;for(var T=U(y);++p<y;)T[p]=i[p+o];return T}function Qx(i,o){var l;return Xr(i,function(p,y,T){return l=o(p,y,T),!l}),!!l}function tl(i,o,l){var p=0,y=i==null?p:i.length;if(typeof o=="number"&&o===o&&y<=yf){for(;p<y;){var T=p+y>>>1,x=i[T];x!==null&&!Jt(x)&&(l?x<=o:x<o)?p=T+1:y=T}return y}return Xf(i,o,Bt,l)}function Xf(i,o,l,p){var y=0,T=i==null?0:i.length;if(T===0)return 0;o=l(o);for(var x=o!==o,P=o===null,N=Jt(o),q=o===n;y<T;){var z=Wc((y+T)/2),K=l(i[z]),Y=K!==n,te=K===null,oe=K===K,ve=Jt(K);if(x)var ae=p||oe;else q?ae=oe&&(p||Y):P?ae=oe&&Y&&(p||!te):N?ae=oe&&Y&&!te&&(p||!ve):te||ve?ae=!1:ae=p?K<=o:K<o;ae?y=z+1:T=z}return Tt(T,sc)}function S_(i,o){for(var l=-1,p=i.length,y=0,T=[];++l<p;){var x=i[l],P=o?o(x):x;if(!l||!In(P,N)){var N=P;T[y++]=x===0?0:x}}return T}function R_(i){return typeof i=="number"?i:Jt(i)?Dn:+i}function Qt(i){if(typeof i=="string")return i;if(pe(i))return Fe(i,Qt)+"";if(Jt(i))return o_?o_.call(i):"";var o=i+"";return o=="0"&&1/i==-Kt?"-0":o}function Zr(i,o,l){var p=-1,y=Ki,T=i.length,x=!0,P=[],N=P;if(l)x=!1,y=Wi;else if(T>=t){var q=o?null:oA(i);if(q)return Lc(q);x=!1,y=be,N=new Yi}else N=o?[]:P;e:for(;++p<T;){var z=i[p],K=o?o(z):z;if(z=l||z!==0?z:0,x&&K===K){for(var Y=N.length;Y--;)if(N[Y]===K)continue e;o&&N.push(K),P.push(z)}else y(N,K,l)||(N!==P&&N.push(K),P.push(z))}return P}function Zf(i,o){return o=ei(o,i),i=ny(i,o),i==null||delete i[jn(an(o))]}function P_(i,o,l,p){return Wa(i,o,l(Zi(i,o)),p)}function nl(i,o,l,p){for(var y=i.length,T=p?y:-1;(p?T--:++T<y)&&o(i[T],T,i););return l?on(i,p?0:T,p?T+1:y):on(i,p?T+1:0,p?y:T)}function C_(i,o){var l=i;return l instanceof Ie&&(l=l.value()),Wr(o,function(p,y){return y.func.apply(y.thisArg,wn([p],y.args))},l)}function ed(i,o,l){var p=i.length;if(p<2)return p?Zr(i[0]):[];for(var y=-1,T=U(p);++y<p;)for(var x=i[y],P=-1;++P<p;)P!=y&&(T[y]=za(T[y]||x,i[P],o,l));return Zr(_t(T,1),o,l)}function D_(i,o,l){for(var p=-1,y=i.length,T=o.length,x={};++p<y;){var P=p<T?o[p]:n;l(x,i[p],P)}return x}function td(i){return Ze(i)?i:[]}function nd(i){return typeof i=="function"?i:Bt}function ei(i,o){return pe(i)?i:hd(i,o)?[i]:oy(Ve(i))}var Jx=we;function ti(i,o,l){var p=i.length;return l=l===n?p:l,!o&&l>=p?i:on(i,o,l)}var O_=MI||function(i){return Ye.clearTimeout(i)};function k_(i,o){if(o)return i.slice();var l=i.length,p=e_?e_(l):new i.constructor(l);return i.copy(p),p}function rd(i){var o=new i.constructor(i.byteLength);return new $c(o).set(new $c(i)),o}function Yx(i,o){var l=o?rd(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.byteLength)}function Xx(i){var o=new i.constructor(i.source,Vi.exec(i));return o.lastIndex=i.lastIndex,o}function Zx(i){return $a?Ue($a.call(i)):{}}function N_(i,o){var l=o?rd(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.length)}function V_(i,o){if(i!==o){var l=i!==n,p=i===null,y=i===i,T=Jt(i),x=o!==n,P=o===null,N=o===o,q=Jt(o);if(!P&&!q&&!T&&i>o||T&&x&&N&&!P&&!q||p&&x&&N||!l&&N||!y)return 1;if(!p&&!T&&!q&&i<o||q&&l&&y&&!p&&!T||P&&l&&y||!x&&y||!N)return-1}return 0}function eA(i,o,l){for(var p=-1,y=i.criteria,T=o.criteria,x=y.length,P=l.length;++p<x;){var N=V_(y[p],T[p]);if(N){if(p>=P)return N;var q=l[p];return N*(q=="desc"?-1:1)}}return i.index-o.index}function L_(i,o,l,p){for(var y=-1,T=i.length,x=l.length,P=-1,N=o.length,q=ft(T-x,0),z=U(N+q),K=!p;++P<N;)z[P]=o[P];for(;++y<x;)(K||y<T)&&(z[l[y]]=i[y]);for(;q--;)z[P++]=i[y++];return z}function M_(i,o,l,p){for(var y=-1,T=i.length,x=-1,P=l.length,N=-1,q=o.length,z=ft(T-P,0),K=U(z+q),Y=!p;++y<z;)K[y]=i[y];for(var te=y;++N<q;)K[te+N]=o[N];for(;++x<P;)(Y||y<T)&&(K[te+l[x]]=i[y++]);return K}function Mt(i,o){var l=-1,p=i.length;for(o||(o=U(p));++l<p;)o[l]=i[l];return o}function Bn(i,o,l,p){var y=!l;l||(l={});for(var T=-1,x=o.length;++T<x;){var P=o[T],N=p?p(l[P],i[P],P,l,i):n;N===n&&(N=i[P]),y?fr(l,P,N):qa(l,P,N)}return l}function tA(i,o){return Bn(i,ld(i),o)}function nA(i,o){return Bn(i,J_(i),o)}function rl(i,o){return function(l,p){var y=pe(l)?Ws:Ix,T=o?o():{};return y(l,i,se(p,2),T)}}function no(i){return we(function(o,l){var p=-1,y=l.length,T=y>1?l[y-1]:n,x=y>2?l[2]:n;for(T=i.length>3&&typeof T=="function"?(y--,T):n,x&&Ct(l[0],l[1],x)&&(T=y<3?n:T,y=1),o=Ue(o);++p<y;){var P=l[p];P&&i(o,P,p,T)}return o})}function F_(i,o){return function(l,p){if(l==null)return l;if(!Ft(l))return i(l,p);for(var y=l.length,T=o?y:-1,x=Ue(l);(o?T--:++T<y)&&p(x[T],T,x)!==!1;);return l}}function U_(i){return function(o,l,p){for(var y=-1,T=Ue(o),x=p(o),P=x.length;P--;){var N=x[i?P:++y];if(l(T[N],N,T)===!1)break}return o}}function rA(i,o,l){var p=o&B,y=Ha(i);function T(){var x=this&&this!==Ye&&this instanceof T?y:i;return x.apply(p?l:this,arguments)}return T}function B_(i){return function(o){o=Ve(o);var l=Js(o)?Tn(o):n,p=l?l[0]:o.charAt(0),y=l?ti(l,1).join(""):o.slice(1);return p[i]()+y}}function ro(i){return function(o){return Wr(Fy(My(o).replace(Sc,"")),i,"")}}function Ha(i){return function(){var o=arguments;switch(o.length){case 0:return new i;case 1:return new i(o[0]);case 2:return new i(o[0],o[1]);case 3:return new i(o[0],o[1],o[2]);case 4:return new i(o[0],o[1],o[2],o[3]);case 5:return new i(o[0],o[1],o[2],o[3],o[4]);case 6:return new i(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new i(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var l=to(i.prototype),p=i.apply(l,o);return Ke(p)?p:l}}function iA(i,o,l){var p=Ha(i);function y(){for(var T=arguments.length,x=U(T),P=T,N=io(y);P--;)x[P]=arguments[P];var q=T<3&&x[0]!==N&&x[T-1]!==N?[]:Qr(x,N);if(T-=q.length,T<l)return G_(i,o,il,y.placeholder,n,x,q,n,n,l-T);var z=this&&this!==Ye&&this instanceof y?p:i;return bt(z,this,x)}return y}function j_(i){return function(o,l,p){var y=Ue(o);if(!Ft(o)){var T=se(l,3);o=pt(o),l=function(P){return T(y[P],P,y)}}var x=i(o,l,p);return x>-1?y[T?o[x]:x]:n}}function $_(i){return pr(function(o){var l=o.length,p=l,y=rn.prototype.thru;for(i&&o.reverse();p--;){var T=o[p];if(typeof T!="function")throw new nn(s);if(y&&!x&&ul(T)=="wrapper")var x=new rn([],!0)}for(p=x?p:l;++p<l;){T=o[p];var P=ul(T),N=P=="wrapper"?ud(T):n;N&&fd(N[0])&&N[1]==(de|J|ne|ie)&&!N[4].length&&N[9]==1?x=x[ul(N[0])].apply(x,N[3]):x=T.length==1&&fd(T)?x[P]():x.thru(T)}return function(){var q=arguments,z=q[0];if(x&&q.length==1&&pe(z))return x.plant(z).value();for(var K=0,Y=l?o[K].apply(this,q):z;++K<l;)Y=o[K].call(this,Y);return Y}})}function il(i,o,l,p,y,T,x,P,N,q){var z=o&de,K=o&B,Y=o&G,te=o&(J|ee),oe=o&C,ve=Y?n:Ha(i);function ae(){for(var Te=arguments.length,Ae=U(Te),Yt=Te;Yt--;)Ae[Yt]=arguments[Yt];if(te)var Dt=io(ae),Xt=Hr(Ae,Dt);if(p&&(Ae=L_(Ae,p,y,te)),T&&(Ae=M_(Ae,T,x,te)),Te-=Xt,te&&Te<q){var et=Qr(Ae,Dt);return G_(i,o,il,ae.placeholder,l,Ae,et,P,N,q-Te)}var xn=K?l:this,yr=Y?xn[i]:i;return Te=Ae.length,P?Ae=IA(Ae,P):oe&&Te>1&&Ae.reverse(),z&&N<Te&&(Ae.length=N),this&&this!==Ye&&this instanceof ae&&(yr=ve||Ha(yr)),yr.apply(xn,Ae)}return ae}function q_(i,o){return function(l,p){return Ox(l,i,o(p),{})}}function sl(i,o){return function(l,p){var y;if(l===n&&p===n)return o;if(l!==n&&(y=l),p!==n){if(y===n)return p;typeof l=="string"||typeof p=="string"?(l=Qt(l),p=Qt(p)):(l=R_(l),p=R_(p)),y=i(l,p)}return y}}function id(i){return pr(function(o){return o=Fe(o,_e(se())),we(function(l){var p=this;return i(o,function(y){return bt(y,p,l)})})})}function ol(i,o){o=o===n?" ":Qt(o);var l=o.length;if(l<2)return l?Yf(o,i):o;var p=Yf(o,Kc(i/Ys(o)));return Js(o)?ti(Tn(p),0,i).join(""):p.slice(0,i)}function sA(i,o,l,p){var y=o&B,T=Ha(i);function x(){for(var P=-1,N=arguments.length,q=-1,z=p.length,K=U(z+N),Y=this&&this!==Ye&&this instanceof x?T:i;++q<z;)K[q]=p[q];for(;N--;)K[q++]=arguments[++P];return bt(Y,y?l:this,K)}return x}function z_(i){return function(o,l,p){return p&&typeof p!="number"&&Ct(o,l,p)&&(l=p=n),o=_r(o),l===n?(l=o,o=0):l=_r(l),p=p===n?o<l?1:-1:_r(p),zx(o,l,p,i)}}function al(i){return function(o,l){return typeof o=="string"&&typeof l=="string"||(o=un(o),l=un(l)),i(o,l)}}function G_(i,o,l,p,y,T,x,P,N,q){var z=o&J,K=z?x:n,Y=z?n:x,te=z?T:n,oe=z?n:T;o|=z?ne:le,o&=~(z?le:ne),o&j||(o&=~(B|G));var ve=[i,o,y,te,K,oe,Y,P,N,q],ae=l.apply(n,ve);return fd(i)&&ry(ae,ve),ae.placeholder=p,iy(ae,i,o)}function sd(i){var o=ht[i];return function(l,p){if(l=un(l),p=p==null?0:Tt(ye(p),292),p&&i_(l)){var y=(Ve(l)+"e").split("e"),T=o(y[0]+"e"+(+y[1]+p));return y=(Ve(T)+"e").split("e"),+(y[0]+"e"+(+y[1]-p))}return o(l)}}var oA=Zs&&1/Lc(new Zs([,-0]))[1]==Kt?function(i){return new Zs(i)}:Sd;function K_(i){return function(o){var l=Et(o);return l==St?Vf(o):l==Vt?EI(o):F(o,i(o))}}function dr(i,o,l,p,y,T,x,P){var N=o&G;if(!N&&typeof i!="function")throw new nn(s);var q=p?p.length:0;if(q||(o&=~(ne|le),p=y=n),x=x===n?x:ft(ye(x),0),P=P===n?P:ye(P),q-=y?y.length:0,o&le){var z=p,K=y;p=y=n}var Y=N?n:ud(i),te=[i,o,l,p,y,z,K,T,x,P];if(Y&&bA(te,Y),i=te[0],o=te[1],l=te[2],p=te[3],y=te[4],P=te[9]=te[9]===n?N?0:i.length:ft(te[9]-q,0),!P&&o&(J|ee)&&(o&=~(J|ee)),!o||o==B)var oe=rA(i,o,l);else o==J||o==ee?oe=iA(i,o,P):(o==ne||o==(B|ne))&&!y.length?oe=sA(i,o,l,p):oe=il.apply(n,te);var ve=Y?A_:ry;return iy(ve(oe,te),i,o)}function W_(i,o,l,p){return i===n||In(i,Xs[l])&&!Me.call(p,l)?o:i}function H_(i,o,l,p,y,T){return Ke(i)&&Ke(o)&&(T.set(o,i),el(i,o,n,H_,T),T.delete(o)),i}function aA(i){return Ya(i)?n:i}function Q_(i,o,l,p,y,T){var x=l&I,P=i.length,N=o.length;if(P!=N&&!(x&&N>P))return!1;var q=T.get(i),z=T.get(o);if(q&&z)return q==o&&z==i;var K=-1,Y=!0,te=l&k?new Yi:n;for(T.set(i,o),T.set(o,i);++K<P;){var oe=i[K],ve=o[K];if(p)var ae=x?p(ve,oe,K,o,i,T):p(oe,ve,K,i,o,T);if(ae!==n){if(ae)continue;Y=!1;break}if(te){if(!Hs(o,function(Te,Ae){if(!be(te,Ae)&&(oe===Te||y(oe,Te,l,p,T)))return te.push(Ae)})){Y=!1;break}}else if(!(oe===ve||y(oe,ve,l,p,T))){Y=!1;break}}return T.delete(i),T.delete(o),Y}function uA(i,o,l,p,y,T,x){switch(l){case kn:if(i.byteLength!=o.byteLength||i.byteOffset!=o.byteOffset)return!1;i=i.buffer,o=o.buffer;case sr:return!(i.byteLength!=o.byteLength||!T(new $c(i),new $c(o)));case Ri:case mn:case ir:return In(+i,+o);case Ds:return i.name==o.name&&i.message==o.message;case Ci:case Lr:return i==o+"";case St:var P=Vf;case Vt:var N=p&I;if(P||(P=Lc),i.size!=o.size&&!N)return!1;var q=x.get(i);if(q)return q==o;p|=k,x.set(i,o);var z=Q_(P(i),P(o),p,y,T,x);return x.delete(i),z;case Mr:if($a)return $a.call(i)==$a.call(o)}return!1}function cA(i,o,l,p,y,T){var x=l&I,P=od(i),N=P.length,q=od(o),z=q.length;if(N!=z&&!x)return!1;for(var K=N;K--;){var Y=P[K];if(!(x?Y in o:Me.call(o,Y)))return!1}var te=T.get(i),oe=T.get(o);if(te&&oe)return te==o&&oe==i;var ve=!0;T.set(i,o),T.set(o,i);for(var ae=x;++K<N;){Y=P[K];var Te=i[Y],Ae=o[Y];if(p)var Yt=x?p(Ae,Te,Y,o,i,T):p(Te,Ae,Y,i,o,T);if(!(Yt===n?Te===Ae||y(Te,Ae,l,p,T):Yt)){ve=!1;break}ae||(ae=Y=="constructor")}if(ve&&!ae){var Dt=i.constructor,Xt=o.constructor;Dt!=Xt&&"constructor"in i&&"constructor"in o&&!(typeof Dt=="function"&&Dt instanceof Dt&&typeof Xt=="function"&&Xt instanceof Xt)&&(ve=!1)}return T.delete(i),T.delete(o),ve}function pr(i){return pd(ty(i,n,ly),i+"")}function od(i){return m_(i,pt,ld)}function ad(i){return m_(i,Ut,J_)}var ud=Hc?function(i){return Hc.get(i)}:Sd;function ul(i){for(var o=i.name+"",l=eo[o],p=Me.call(eo,o)?l.length:0;p--;){var y=l[p],T=y.func;if(T==null||T==i)return y.name}return o}function io(i){var o=Me.call(w,"placeholder")?w:i;return o.placeholder}function se(){var i=w.iteratee||xd;return i=i===xd?y_:i,arguments.length?i(arguments[0],arguments[1]):i}function cl(i,o){var l=i.__data__;return _A(o)?l[typeof o=="string"?"string":"hash"]:l.map}function cd(i){for(var o=pt(i),l=o.length;l--;){var p=o[l],y=i[p];o[l]=[p,y,Z_(y)]}return o}function es(i,o){var l=wI(i,o);return __(l)?l:n}function lA(i){var o=Me.call(i,Qi),l=i[Qi];try{i[Qi]=n;var p=!0}catch{}var y=Bc.call(i);return p&&(o?i[Qi]=l:delete i[Qi]),y}var ld=Mf?function(i){return i==null?[]:(i=Ue(i),vn(Mf(i),function(o){return n_.call(i,o)}))}:Rd,J_=Mf?function(i){for(var o=[];i;)wn(o,ld(i)),i=qc(i);return o}:Rd,Et=Pt;(Ff&&Et(new Ff(new ArrayBuffer(1)))!=kn||Ua&&Et(new Ua)!=St||Uf&&Et(Uf.resolve())!=pa||Zs&&Et(new Zs)!=Vt||Ba&&Et(new Ba)!=Di)&&(Et=function(i){var o=Pt(i),l=o==Wt?i.constructor:n,p=l?ts(l):"";if(p)switch(p){case KI:return kn;case WI:return St;case HI:return pa;case QI:return Vt;case JI:return Di}return o});function hA(i,o,l){for(var p=-1,y=l.length;++p<y;){var T=l[p],x=T.size;switch(T.type){case"drop":i+=x;break;case"dropRight":o-=x;break;case"take":o=Tt(o,i+x);break;case"takeRight":i=ft(i,o-x);break}}return{start:i,end:o}}function fA(i){var o=i.match(Ni);return o?o[1].split(Tf):[]}function Y_(i,o,l){o=ei(o,i);for(var p=-1,y=o.length,T=!1;++p<y;){var x=jn(o[p]);if(!(T=i!=null&&l(i,x)))break;i=i[x]}return T||++p!=y?T:(y=i==null?0:i.length,!!y&&gl(y)&&mr(x,y)&&(pe(i)||ns(i)))}function dA(i){var o=i.length,l=new i.constructor(o);return o&&typeof i[0]=="string"&&Me.call(i,"index")&&(l.index=i.index,l.input=i.input),l}function X_(i){return typeof i.constructor=="function"&&!Qa(i)?to(qc(i)):{}}function pA(i,o,l){var p=i.constructor;switch(o){case sr:return rd(i);case Ri:case mn:return new p(+i);case kn:return Yx(i,l);case nt:case at:case Fr:case Os:case ks:case ga:case or:case Ns:case Vs:return N_(i,l);case St:return new p;case ir:case Lr:return new p(i);case Ci:return Xx(i);case Vt:return new p;case Mr:return Zx(i)}}function mA(i,o){var l=o.length;if(!l)return i;var p=l-1;return o[p]=(l>1?"& ":"")+o[p],o=o.join(l>2?", ":" "),i.replace(ki,`{
2
+ /* [wrapped with `+o+`] */
3
+ `)}function gA(i){return pe(i)||ns(i)||!!(r_&&i&&i[r_])}function mr(i,o){var l=typeof i;return o=o==null?Cn:o,!!o&&(l=="number"||l!="symbol"&&pc.test(i))&&i>-1&&i%1==0&&i<o}function Ct(i,o,l){if(!Ke(l))return!1;var p=typeof o;return(p=="number"?Ft(l)&&mr(o,l.length):p=="string"&&o in l)?In(l[o],i):!1}function hd(i,o){if(pe(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||Jt(i)?!0:Ms.test(i)||!cc.test(i)||o!=null&&i in Ue(o)}function _A(i){var o=typeof i;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?i!=="__proto__":i===null}function fd(i){var o=ul(i),l=w[o];if(typeof l!="function"||!(o in Ie.prototype))return!1;if(i===l)return!0;var p=ud(l);return!!p&&i===p[0]}function yA(i){return!!Zg&&Zg in i}var vA=Fc?gr:Pd;function Qa(i){var o=i&&i.constructor,l=typeof o=="function"&&o.prototype||Xs;return i===l}function Z_(i){return i===i&&!Ke(i)}function ey(i,o){return function(l){return l==null?!1:l[i]===o&&(o!==n||i in Ue(l))}}function wA(i){var o=pl(i,function(p){return l.size===h&&l.clear(),p}),l=o.cache;return o}function bA(i,o){var l=i[1],p=o[1],y=l|p,T=y<(B|G|de),x=p==de&&l==J||p==de&&l==ie&&i[7].length<=o[8]||p==(de|ie)&&o[7].length<=o[8]&&l==J;if(!(T||x))return i;p&B&&(i[2]=o[2],y|=l&B?0:j);var P=o[3];if(P){var N=i[3];i[3]=N?L_(N,P,o[4]):P,i[4]=N?Qr(i[3],f):o[4]}return P=o[5],P&&(N=i[5],i[5]=N?M_(N,P,o[6]):P,i[6]=N?Qr(i[5],f):o[6]),P=o[7],P&&(i[7]=P),p&de&&(i[8]=i[8]==null?o[8]:Tt(i[8],o[8])),i[9]==null&&(i[9]=o[9]),i[0]=o[0],i[1]=y,i}function TA(i){var o=[];if(i!=null)for(var l in Ue(i))o.push(l);return o}function EA(i){return Bc.call(i)}function ty(i,o,l){return o=ft(o===n?i.length-1:o,0),function(){for(var p=arguments,y=-1,T=ft(p.length-o,0),x=U(T);++y<T;)x[y]=p[o+y];y=-1;for(var P=U(o+1);++y<o;)P[y]=p[y];return P[o]=l(x),bt(i,this,P)}}function ny(i,o){return o.length<2?i:Zi(i,on(o,0,-1))}function IA(i,o){for(var l=i.length,p=Tt(o.length,l),y=Mt(i);p--;){var T=o[p];i[p]=mr(T,l)?y[T]:n}return i}function dd(i,o){if(!(o==="constructor"&&typeof i[o]=="function")&&o!="__proto__")return i[o]}var ry=sy(A_),Ja=UI||function(i,o){return Ye.setTimeout(i,o)},pd=sy(Wx);function iy(i,o,l){var p=o+"";return pd(i,mA(p,xA(fA(p),l)))}function sy(i){var o=0,l=0;return function(){var p=qI(),y=V-(p-l);if(l=p,y>0){if(++o>=D)return arguments[0]}else o=0;return i.apply(n,arguments)}}function ll(i,o){var l=-1,p=i.length,y=p-1;for(o=o===n?p:o;++l<o;){var T=Jf(l,y),x=i[T];i[T]=i[l],i[l]=x}return i.length=o,i}var oy=wA(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(lc,function(l,p,y,T){o.push(y?T.replace(If,"$1"):p||l)}),o});function jn(i){if(typeof i=="string"||Jt(i))return i;var o=i+"";return o=="0"&&1/i==-Kt?"-0":o}function ts(i){if(i!=null){try{return Uc.call(i)}catch{}try{return i+""}catch{}}return""}function xA(i,o){return Lt(On,function(l){var p="_."+l[0];o&l[1]&&!Ki(i,p)&&i.push(p)}),i.sort()}function ay(i){if(i instanceof Ie)return i.clone();var o=new rn(i.__wrapped__,i.__chain__);return o.__actions__=Mt(i.__actions__),o.__index__=i.__index__,o.__values__=i.__values__,o}function AA(i,o,l){(l?Ct(i,o,l):o===n)?o=1:o=ft(ye(o),0);var p=i==null?0:i.length;if(!p||o<1)return[];for(var y=0,T=0,x=U(Kc(p/o));y<p;)x[T++]=on(i,y,y+=o);return x}function SA(i){for(var o=-1,l=i==null?0:i.length,p=0,y=[];++o<l;){var T=i[o];T&&(y[p++]=T)}return y}function RA(){var i=arguments.length;if(!i)return[];for(var o=U(i-1),l=arguments[0],p=i;p--;)o[p-1]=arguments[p];return wn(pe(l)?Mt(l):[l],_t(o,1))}var PA=we(function(i,o){return Ze(i)?za(i,_t(o,1,Ze,!0)):[]}),CA=we(function(i,o){var l=an(o);return Ze(l)&&(l=n),Ze(i)?za(i,_t(o,1,Ze,!0),se(l,2)):[]}),DA=we(function(i,o){var l=an(o);return Ze(l)&&(l=n),Ze(i)?za(i,_t(o,1,Ze,!0),n,l):[]});function OA(i,o,l){var p=i==null?0:i.length;return p?(o=l||o===n?1:ye(o),on(i,o<0?0:o,p)):[]}function kA(i,o,l){var p=i==null?0:i.length;return p?(o=l||o===n?1:ye(o),o=p-o,on(i,0,o<0?0:o)):[]}function NA(i,o){return i&&i.length?nl(i,se(o,3),!0,!0):[]}function VA(i,o){return i&&i.length?nl(i,se(o,3),!0):[]}function LA(i,o,l,p){var y=i==null?0:i.length;return y?(l&&typeof l!="number"&&Ct(i,o,l)&&(l=0,p=y),Rx(i,o,l,p)):[]}function uy(i,o,l){var p=i==null?0:i.length;if(!p)return-1;var y=l==null?0:ye(l);return y<0&&(y=ft(p+y,0)),Hi(i,se(o,3),y)}function cy(i,o,l){var p=i==null?0:i.length;if(!p)return-1;var y=p-1;return l!==n&&(y=ye(l),y=l<0?ft(p+y,0):Tt(y,p-1)),Hi(i,se(o,3),y,!0)}function ly(i){var o=i==null?0:i.length;return o?_t(i,1):[]}function MA(i){var o=i==null?0:i.length;return o?_t(i,Kt):[]}function FA(i,o){var l=i==null?0:i.length;return l?(o=o===n?1:ye(o),_t(i,o)):[]}function UA(i){for(var o=-1,l=i==null?0:i.length,p={};++o<l;){var y=i[o];p[y[0]]=y[1]}return p}function hy(i){return i&&i.length?i[0]:n}function BA(i,o,l){var p=i==null?0:i.length;if(!p)return-1;var y=l==null?0:ye(l);return y<0&&(y=ft(p+y,0)),bn(i,o,y)}function jA(i){var o=i==null?0:i.length;return o?on(i,0,-1):[]}var $A=we(function(i){var o=Fe(i,td);return o.length&&o[0]===i[0]?Gf(o):[]}),qA=we(function(i){var o=an(i),l=Fe(i,td);return o===an(l)?o=n:l.pop(),l.length&&l[0]===i[0]?Gf(l,se(o,2)):[]}),zA=we(function(i){var o=an(i),l=Fe(i,td);return o=typeof o=="function"?o:n,o&&l.pop(),l.length&&l[0]===i[0]?Gf(l,n,o):[]});function GA(i,o){return i==null?"":jI.call(i,o)}function an(i){var o=i==null?0:i.length;return o?i[o-1]:n}function KA(i,o,l){var p=i==null?0:i.length;if(!p)return-1;var y=p;return l!==n&&(y=ye(l),y=y<0?ft(p+y,0):Tt(y,p-1)),o===o?xI(i,o,y):Hi(i,Va,y,!0)}function WA(i,o){return i&&i.length?T_(i,ye(o)):n}var HA=we(fy);function fy(i,o){return i&&i.length&&o&&o.length?Qf(i,o):i}function QA(i,o,l){return i&&i.length&&o&&o.length?Qf(i,o,se(l,2)):i}function JA(i,o,l){return i&&i.length&&o&&o.length?Qf(i,o,n,l):i}var YA=pr(function(i,o){var l=i==null?0:i.length,p=jf(i,o);return x_(i,Fe(o,function(y){return mr(y,l)?+y:y}).sort(V_)),p});function XA(i,o){var l=[];if(!(i&&i.length))return l;var p=-1,y=[],T=i.length;for(o=se(o,3);++p<T;){var x=i[p];o(x,p,i)&&(l.push(x),y.push(p))}return x_(i,y),l}function md(i){return i==null?i:GI.call(i)}function ZA(i,o,l){var p=i==null?0:i.length;return p?(l&&typeof l!="number"&&Ct(i,o,l)?(o=0,l=p):(o=o==null?0:ye(o),l=l===n?p:ye(l)),on(i,o,l)):[]}function eS(i,o){return tl(i,o)}function tS(i,o,l){return Xf(i,o,se(l,2))}function nS(i,o){var l=i==null?0:i.length;if(l){var p=tl(i,o);if(p<l&&In(i[p],o))return p}return-1}function rS(i,o){return tl(i,o,!0)}function iS(i,o,l){return Xf(i,o,se(l,2),!0)}function sS(i,o){var l=i==null?0:i.length;if(l){var p=tl(i,o,!0)-1;if(In(i[p],o))return p}return-1}function oS(i){return i&&i.length?S_(i):[]}function aS(i,o){return i&&i.length?S_(i,se(o,2)):[]}function uS(i){var o=i==null?0:i.length;return o?on(i,1,o):[]}function cS(i,o,l){return i&&i.length?(o=l||o===n?1:ye(o),on(i,0,o<0?0:o)):[]}function lS(i,o,l){var p=i==null?0:i.length;return p?(o=l||o===n?1:ye(o),o=p-o,on(i,o<0?0:o,p)):[]}function hS(i,o){return i&&i.length?nl(i,se(o,3),!1,!0):[]}function fS(i,o){return i&&i.length?nl(i,se(o,3)):[]}var dS=we(function(i){return Zr(_t(i,1,Ze,!0))}),pS=we(function(i){var o=an(i);return Ze(o)&&(o=n),Zr(_t(i,1,Ze,!0),se(o,2))}),mS=we(function(i){var o=an(i);return o=typeof o=="function"?o:n,Zr(_t(i,1,Ze,!0),n,o)});function gS(i){return i&&i.length?Zr(i):[]}function _S(i,o){return i&&i.length?Zr(i,se(o,2)):[]}function yS(i,o){return o=typeof o=="function"?o:n,i&&i.length?Zr(i,n,o):[]}function gd(i){if(!(i&&i.length))return[];var o=0;return i=vn(i,function(l){if(Ze(l))return o=ft(l.length,o),!0}),L(o,function(l){return Fe(i,Fn(l))})}function dy(i,o){if(!(i&&i.length))return[];var l=gd(i);return o==null?l:Fe(l,function(p){return bt(o,n,p)})}var vS=we(function(i,o){return Ze(i)?za(i,o):[]}),wS=we(function(i){return ed(vn(i,Ze))}),bS=we(function(i){var o=an(i);return Ze(o)&&(o=n),ed(vn(i,Ze),se(o,2))}),TS=we(function(i){var o=an(i);return o=typeof o=="function"?o:n,ed(vn(i,Ze),n,o)}),ES=we(gd);function IS(i,o){return D_(i||[],o||[],qa)}function xS(i,o){return D_(i||[],o||[],Wa)}var AS=we(function(i){var o=i.length,l=o>1?i[o-1]:n;return l=typeof l=="function"?(i.pop(),l):n,dy(i,l)});function py(i){var o=w(i);return o.__chain__=!0,o}function SS(i,o){return o(i),i}function hl(i,o){return o(i)}var RS=pr(function(i){var o=i.length,l=o?i[0]:0,p=this.__wrapped__,y=function(T){return jf(T,i)};return o>1||this.__actions__.length||!(p instanceof Ie)||!mr(l)?this.thru(y):(p=p.slice(l,+l+(o?1:0)),p.__actions__.push({func:hl,args:[y],thisArg:n}),new rn(p,this.__chain__).thru(function(T){return o&&!T.length&&T.push(n),T}))});function PS(){return py(this)}function CS(){return new rn(this.value(),this.__chain__)}function DS(){this.__values__===n&&(this.__values__=Ry(this.value()));var i=this.__index__>=this.__values__.length,o=i?n:this.__values__[this.__index__++];return{done:i,value:o}}function OS(){return this}function kS(i){for(var o,l=this;l instanceof Jc;){var p=ay(l);p.__index__=0,p.__values__=n,o?y.__wrapped__=p:o=p;var y=p;l=l.__wrapped__}return y.__wrapped__=i,o}function NS(){var i=this.__wrapped__;if(i instanceof Ie){var o=i;return this.__actions__.length&&(o=new Ie(this)),o=o.reverse(),o.__actions__.push({func:hl,args:[md],thisArg:n}),new rn(o,this.__chain__)}return this.thru(md)}function VS(){return C_(this.__wrapped__,this.__actions__)}var LS=rl(function(i,o,l){Me.call(i,l)?++i[l]:fr(i,l,1)});function MS(i,o,l){var p=pe(i)?Kr:Sx;return l&&Ct(i,o,l)&&(o=n),p(i,se(o,3))}function FS(i,o){var l=pe(i)?vn:d_;return l(i,se(o,3))}var US=j_(uy),BS=j_(cy);function jS(i,o){return _t(fl(i,o),1)}function $S(i,o){return _t(fl(i,o),Kt)}function qS(i,o,l){return l=l===n?1:ye(l),_t(fl(i,o),l)}function my(i,o){var l=pe(i)?Lt:Xr;return l(i,se(o,3))}function gy(i,o){var l=pe(i)?Oc:f_;return l(i,se(o,3))}var zS=rl(function(i,o,l){Me.call(i,l)?i[l].push(o):fr(i,l,[o])});function GS(i,o,l,p){i=Ft(i)?i:oo(i),l=l&&!p?ye(l):0;var y=i.length;return l<0&&(l=ft(y+l,0)),_l(i)?l<=y&&i.indexOf(o,l)>-1:!!y&&bn(i,o,l)>-1}var KS=we(function(i,o,l){var p=-1,y=typeof o=="function",T=Ft(i)?U(i.length):[];return Xr(i,function(x){T[++p]=y?bt(o,x,l):Ga(x,o,l)}),T}),WS=rl(function(i,o,l){fr(i,l,o)});function fl(i,o){var l=pe(i)?Fe:v_;return l(i,se(o,3))}function HS(i,o,l,p){return i==null?[]:(pe(o)||(o=o==null?[]:[o]),l=p?n:l,pe(l)||(l=l==null?[]:[l]),E_(i,o,l))}var QS=rl(function(i,o,l){i[l?0:1].push(o)},function(){return[[],[]]});function JS(i,o,l){var p=pe(i)?Wr:d,y=arguments.length<3;return p(i,se(o,4),l,y,Xr)}function YS(i,o,l){var p=pe(i)?kc:d,y=arguments.length<3;return p(i,se(o,4),l,y,f_)}function XS(i,o){var l=pe(i)?vn:d_;return l(i,ml(se(o,3)))}function ZS(i){var o=pe(i)?u_:Gx;return o(i)}function eR(i,o,l){(l?Ct(i,o,l):o===n)?o=1:o=ye(o);var p=pe(i)?Tx:Kx;return p(i,o)}function tR(i){var o=pe(i)?Ex:Hx;return o(i)}function nR(i){if(i==null)return 0;if(Ft(i))return _l(i)?Ys(i):i.length;var o=Et(i);return o==St||o==Vt?i.size:Wf(i).length}function rR(i,o,l){var p=pe(i)?Hs:Qx;return l&&Ct(i,o,l)&&(o=n),p(i,se(o,3))}var iR=we(function(i,o){if(i==null)return[];var l=o.length;return l>1&&Ct(i,o[0],o[1])?o=[]:l>2&&Ct(o[0],o[1],o[2])&&(o=[o[0]]),E_(i,_t(o,1),[])}),dl=FI||function(){return Ye.Date.now()};function sR(i,o){if(typeof o!="function")throw new nn(s);return i=ye(i),function(){if(--i<1)return o.apply(this,arguments)}}function _y(i,o,l){return o=l?n:o,o=i&&o==null?i.length:o,dr(i,de,n,n,n,n,o)}function yy(i,o){var l;if(typeof o!="function")throw new nn(s);return i=ye(i),function(){return--i>0&&(l=o.apply(this,arguments)),i<=1&&(o=n),l}}var _d=we(function(i,o,l){var p=B;if(l.length){var y=Qr(l,io(_d));p|=ne}return dr(i,p,o,l,y)}),vy=we(function(i,o,l){var p=B|G;if(l.length){var y=Qr(l,io(vy));p|=ne}return dr(o,p,i,l,y)});function wy(i,o,l){o=l?n:o;var p=dr(i,J,n,n,n,n,n,o);return p.placeholder=wy.placeholder,p}function by(i,o,l){o=l?n:o;var p=dr(i,ee,n,n,n,n,n,o);return p.placeholder=by.placeholder,p}function Ty(i,o,l){var p,y,T,x,P,N,q=0,z=!1,K=!1,Y=!0;if(typeof i!="function")throw new nn(s);o=un(o)||0,Ke(l)&&(z=!!l.leading,K="maxWait"in l,T=K?ft(un(l.maxWait)||0,o):T,Y="trailing"in l?!!l.trailing:Y);function te(et){var xn=p,yr=y;return p=y=n,q=et,x=i.apply(yr,xn),x}function oe(et){return q=et,P=Ja(Te,o),z?te(et):x}function ve(et){var xn=et-N,yr=et-q,jy=o-xn;return K?Tt(jy,T-yr):jy}function ae(et){var xn=et-N,yr=et-q;return N===n||xn>=o||xn<0||K&&yr>=T}function Te(){var et=dl();if(ae(et))return Ae(et);P=Ja(Te,ve(et))}function Ae(et){return P=n,Y&&p?te(et):(p=y=n,x)}function Yt(){P!==n&&O_(P),q=0,p=N=y=P=n}function Dt(){return P===n?x:Ae(dl())}function Xt(){var et=dl(),xn=ae(et);if(p=arguments,y=this,N=et,xn){if(P===n)return oe(N);if(K)return O_(P),P=Ja(Te,o),te(N)}return P===n&&(P=Ja(Te,o)),x}return Xt.cancel=Yt,Xt.flush=Dt,Xt}var oR=we(function(i,o){return h_(i,1,o)}),aR=we(function(i,o,l){return h_(i,un(o)||0,l)});function uR(i){return dr(i,C)}function pl(i,o){if(typeof i!="function"||o!=null&&typeof o!="function")throw new nn(s);var l=function(){var p=arguments,y=o?o.apply(this,p):p[0],T=l.cache;if(T.has(y))return T.get(y);var x=i.apply(this,p);return l.cache=T.set(y,x)||T,x};return l.cache=new(pl.Cache||hr),l}pl.Cache=hr;function ml(i){if(typeof i!="function")throw new nn(s);return function(){var o=arguments;switch(o.length){case 0:return!i.call(this);case 1:return!i.call(this,o[0]);case 2:return!i.call(this,o[0],o[1]);case 3:return!i.call(this,o[0],o[1],o[2])}return!i.apply(this,o)}}function cR(i){return yy(2,i)}var lR=Jx(function(i,o){o=o.length==1&&pe(o[0])?Fe(o[0],_e(se())):Fe(_t(o,1),_e(se()));var l=o.length;return we(function(p){for(var y=-1,T=Tt(p.length,l);++y<T;)p[y]=o[y].call(this,p[y]);return bt(i,this,p)})}),yd=we(function(i,o){var l=Qr(o,io(yd));return dr(i,ne,n,o,l)}),Ey=we(function(i,o){var l=Qr(o,io(Ey));return dr(i,le,n,o,l)}),hR=pr(function(i,o){return dr(i,ie,n,n,n,o)});function fR(i,o){if(typeof i!="function")throw new nn(s);return o=o===n?o:ye(o),we(i,o)}function dR(i,o){if(typeof i!="function")throw new nn(s);return o=o==null?0:ft(ye(o),0),we(function(l){var p=l[o],y=ti(l,0,o);return p&&wn(y,p),bt(i,this,y)})}function pR(i,o,l){var p=!0,y=!0;if(typeof i!="function")throw new nn(s);return Ke(l)&&(p="leading"in l?!!l.leading:p,y="trailing"in l?!!l.trailing:y),Ty(i,o,{leading:p,maxWait:o,trailing:y})}function mR(i){return _y(i,1)}function gR(i,o){return yd(nd(o),i)}function _R(){if(!arguments.length)return[];var i=arguments[0];return pe(i)?i:[i]}function yR(i){return sn(i,E)}function vR(i,o){return o=typeof o=="function"?o:n,sn(i,E,o)}function wR(i){return sn(i,m|E)}function bR(i,o){return o=typeof o=="function"?o:n,sn(i,m|E,o)}function TR(i,o){return o==null||l_(i,o,pt(o))}function In(i,o){return i===o||i!==i&&o!==o}var ER=al(zf),IR=al(function(i,o){return i>=o}),ns=g_(function(){return arguments}())?g_:function(i){return He(i)&&Me.call(i,"callee")&&!n_.call(i,"callee")},pe=U.isArray,xR=Oa?_e(Oa):kx;function Ft(i){return i!=null&&gl(i.length)&&!gr(i)}function Ze(i){return He(i)&&Ft(i)}function AR(i){return i===!0||i===!1||He(i)&&Pt(i)==Ri}var ni=BI||Pd,SR=Dc?_e(Dc):Nx;function RR(i){return He(i)&&i.nodeType===1&&!Ya(i)}function PR(i){if(i==null)return!0;if(Ft(i)&&(pe(i)||typeof i=="string"||typeof i.splice=="function"||ni(i)||so(i)||ns(i)))return!i.length;var o=Et(i);if(o==St||o==Vt)return!i.size;if(Qa(i))return!Wf(i).length;for(var l in i)if(Me.call(i,l))return!1;return!0}function CR(i,o){return Ka(i,o)}function DR(i,o,l){l=typeof l=="function"?l:n;var p=l?l(i,o):n;return p===n?Ka(i,o,n,l):!!p}function vd(i){if(!He(i))return!1;var o=Pt(i);return o==Ds||o==vf||typeof i.message=="string"&&typeof i.name=="string"&&!Ya(i)}function OR(i){return typeof i=="number"&&i_(i)}function gr(i){if(!Ke(i))return!1;var o=Pt(i);return o==rr||o==Pi||o==Si||o==oc}function Iy(i){return typeof i=="number"&&i==ye(i)}function gl(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Cn}function Ke(i){var o=typeof i;return i!=null&&(o=="object"||o=="function")}function He(i){return i!=null&&typeof i=="object"}var xy=Gr?_e(Gr):Lx;function kR(i,o){return i===o||Kf(i,o,cd(o))}function NR(i,o,l){return l=typeof l=="function"?l:n,Kf(i,o,cd(o),l)}function VR(i){return Ay(i)&&i!=+i}function LR(i){if(vA(i))throw new he(r);return __(i)}function MR(i){return i===null}function FR(i){return i==null}function Ay(i){return typeof i=="number"||He(i)&&Pt(i)==ir}function Ya(i){if(!He(i)||Pt(i)!=Wt)return!1;var o=qc(i);if(o===null)return!0;var l=Me.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&Uc.call(l)==NI}var wd=ka?_e(ka):Mx;function UR(i){return Iy(i)&&i>=-Cn&&i<=Cn}var Sy=Ks?_e(Ks):Fx;function _l(i){return typeof i=="string"||!pe(i)&&He(i)&&Pt(i)==Lr}function Jt(i){return typeof i=="symbol"||He(i)&&Pt(i)==Mr}var so=Gi?_e(Gi):Ux;function BR(i){return i===n}function jR(i){return He(i)&&Et(i)==Di}function $R(i){return He(i)&&Pt(i)==ma}var qR=al(Hf),zR=al(function(i,o){return i<=o});function Ry(i){if(!i)return[];if(Ft(i))return _l(i)?Tn(i):Mt(i);if(Fa&&i[Fa])return TI(i[Fa]());var o=Et(i),l=o==St?Vf:o==Vt?Lc:oo;return l(i)}function _r(i){if(!i)return i===0?i:0;if(i=un(i),i===Kt||i===-Kt){var o=i<0?-1:1;return o*Ai}return i===i?i:0}function ye(i){var o=_r(i),l=o%1;return o===o?l?o-l:o:0}function Py(i){return i?Xi(ye(i),0,Nt):0}function un(i){if(typeof i=="number")return i;if(Jt(i))return Dn;if(Ke(i)){var o=typeof i.valueOf=="function"?i.valueOf():i;i=Ke(o)?o+"":o}if(typeof i!="string")return i===0?i:+i;i=Q(i);var l=ba.test(i);return l||Vn.test(i)?qe(i.slice(2),l?2:8):dc.test(i)?Dn:+i}function Cy(i){return Bn(i,Ut(i))}function GR(i){return i?Xi(ye(i),-Cn,Cn):i===0?i:0}function Ve(i){return i==null?"":Qt(i)}var KR=no(function(i,o){if(Qa(o)||Ft(o)){Bn(o,pt(o),i);return}for(var l in o)Me.call(o,l)&&qa(i,l,o[l])}),Dy=no(function(i,o){Bn(o,Ut(o),i)}),yl=no(function(i,o,l,p){Bn(o,Ut(o),i,p)}),WR=no(function(i,o,l,p){Bn(o,pt(o),i,p)}),HR=pr(jf);function QR(i,o){var l=to(i);return o==null?l:c_(l,o)}var JR=we(function(i,o){i=Ue(i);var l=-1,p=o.length,y=p>2?o[2]:n;for(y&&Ct(o[0],o[1],y)&&(p=1);++l<p;)for(var T=o[l],x=Ut(T),P=-1,N=x.length;++P<N;){var q=x[P],z=i[q];(z===n||In(z,Xs[q])&&!Me.call(i,q))&&(i[q]=T[q])}return i}),YR=we(function(i){return i.push(n,H_),bt(Oy,n,i)});function XR(i,o){return Na(i,se(o,3),Un)}function ZR(i,o){return Na(i,se(o,3),qf)}function e1(i,o){return i==null?i:$f(i,se(o,3),Ut)}function t1(i,o){return i==null?i:p_(i,se(o,3),Ut)}function n1(i,o){return i&&Un(i,se(o,3))}function r1(i,o){return i&&qf(i,se(o,3))}function i1(i){return i==null?[]:Zc(i,pt(i))}function s1(i){return i==null?[]:Zc(i,Ut(i))}function bd(i,o,l){var p=i==null?n:Zi(i,o);return p===n?l:p}function o1(i,o){return i!=null&&Y_(i,o,Px)}function Td(i,o){return i!=null&&Y_(i,o,Cx)}var a1=q_(function(i,o,l){o!=null&&typeof o.toString!="function"&&(o=Bc.call(o)),i[o]=l},Id(Bt)),u1=q_(function(i,o,l){o!=null&&typeof o.toString!="function"&&(o=Bc.call(o)),Me.call(i,o)?i[o].push(l):i[o]=[l]},se),c1=we(Ga);function pt(i){return Ft(i)?a_(i):Wf(i)}function Ut(i){return Ft(i)?a_(i,!0):Bx(i)}function l1(i,o){var l={};return o=se(o,3),Un(i,function(p,y,T){fr(l,o(p,y,T),p)}),l}function h1(i,o){var l={};return o=se(o,3),Un(i,function(p,y,T){fr(l,y,o(p,y,T))}),l}var f1=no(function(i,o,l){el(i,o,l)}),Oy=no(function(i,o,l,p){el(i,o,l,p)}),d1=pr(function(i,o){var l={};if(i==null)return l;var p=!1;o=Fe(o,function(T){return T=ei(T,i),p||(p=T.length>1),T}),Bn(i,ad(i),l),p&&(l=sn(l,m|_|E,aA));for(var y=o.length;y--;)Zf(l,o[y]);return l});function p1(i,o){return ky(i,ml(se(o)))}var m1=pr(function(i,o){return i==null?{}:$x(i,o)});function ky(i,o){if(i==null)return{};var l=Fe(ad(i),function(p){return[p]});return o=se(o),I_(i,l,function(p,y){return o(p,y[0])})}function g1(i,o,l){o=ei(o,i);var p=-1,y=o.length;for(y||(y=1,i=n);++p<y;){var T=i==null?n:i[jn(o[p])];T===n&&(p=y,T=l),i=gr(T)?T.call(i):T}return i}function _1(i,o,l){return i==null?i:Wa(i,o,l)}function y1(i,o,l,p){return p=typeof p=="function"?p:n,i==null?i:Wa(i,o,l,p)}var Ny=K_(pt),Vy=K_(Ut);function v1(i,o,l){var p=pe(i),y=p||ni(i)||so(i);if(o=se(o,4),l==null){var T=i&&i.constructor;y?l=p?new T:[]:Ke(i)?l=gr(T)?to(qc(i)):{}:l={}}return(y?Lt:Un)(i,function(x,P,N){return o(l,x,P,N)}),l}function w1(i,o){return i==null?!0:Zf(i,o)}function b1(i,o,l){return i==null?i:P_(i,o,nd(l))}function T1(i,o,l,p){return p=typeof p=="function"?p:n,i==null?i:P_(i,o,nd(l),p)}function oo(i){return i==null?[]:Xe(i,pt(i))}function E1(i){return i==null?[]:Xe(i,Ut(i))}function I1(i,o,l){return l===n&&(l=o,o=n),l!==n&&(l=un(l),l=l===l?l:0),o!==n&&(o=un(o),o=o===o?o:0),Xi(un(i),o,l)}function x1(i,o,l){return o=_r(o),l===n?(l=o,o=0):l=_r(l),i=un(i),Dx(i,o,l)}function A1(i,o,l){if(l&&typeof l!="boolean"&&Ct(i,o,l)&&(o=l=n),l===n&&(typeof o=="boolean"?(l=o,o=n):typeof i=="boolean"&&(l=i,i=n)),i===n&&o===n?(i=0,o=1):(i=_r(i),o===n?(o=i,i=0):o=_r(o)),i>o){var p=i;i=o,o=p}if(l||i%1||o%1){var y=s_();return Tt(i+y*(o-i+Da("1e-"+((y+"").length-1))),o)}return Jf(i,o)}var S1=ro(function(i,o,l){return o=o.toLowerCase(),i+(l?Ly(o):o)});function Ly(i){return Ed(Ve(i).toLowerCase())}function My(i){return i=Ve(i),i&&i.replace(mc,Ht).replace(zr,"")}function R1(i,o,l){i=Ve(i),o=Qt(o);var p=i.length;l=l===n?p:Xi(ye(l),0,p);var y=l;return l-=o.length,l>=0&&i.slice(l,y)==o}function P1(i){return i=Ve(i),i&&Oi.test(i)?i.replace(ya,Qs):i}function C1(i){return i=Ve(i),i&&hc.test(i)?i.replace(ar,"\\$&"):i}var D1=ro(function(i,o,l){return i+(l?"-":"")+o.toLowerCase()}),O1=ro(function(i,o,l){return i+(l?" ":"")+o.toLowerCase()}),k1=B_("toLowerCase");function N1(i,o,l){i=Ve(i),o=ye(o);var p=o?Ys(i):0;if(!o||p>=o)return i;var y=(o-p)/2;return ol(Wc(y),l)+i+ol(Kc(y),l)}function V1(i,o,l){i=Ve(i),o=ye(o);var p=o?Ys(i):0;return o&&p<o?i+ol(o-p,l):i}function L1(i,o,l){i=Ve(i),o=ye(o);var p=o?Ys(i):0;return o&&p<o?ol(o-p,l)+i:i}function M1(i,o,l){return l||o==null?o=0:o&&(o=+o),zI(Ve(i).replace(ut,""),o||0)}function F1(i,o,l){return(l?Ct(i,o,l):o===n)?o=1:o=ye(o),Yf(Ve(i),o)}function U1(){var i=arguments,o=Ve(i[0]);return i.length<3?o:o.replace(i[1],i[2])}var B1=ro(function(i,o,l){return i+(l?"_":"")+o.toLowerCase()});function j1(i,o,l){return l&&typeof l!="number"&&Ct(i,o,l)&&(o=l=n),l=l===n?Nt:l>>>0,l?(i=Ve(i),i&&(typeof o=="string"||o!=null&&!wd(o))&&(o=Qt(o),!o&&Js(i))?ti(Tn(i),0,l):i.split(o,l)):[]}var $1=ro(function(i,o,l){return i+(l?" ":"")+Ed(o)});function q1(i,o,l){return i=Ve(i),l=l==null?0:Xi(ye(l),0,i.length),o=Qt(o),i.slice(l,l+o.length)==o}function z1(i,o,l){var p=w.templateSettings;l&&Ct(i,o,l)&&(o=n),i=Ve(i),o=yl({},o,p,W_);var y=yl({},o.imports,p.imports,W_),T=pt(y),x=Xe(y,T),P,N,q=0,z=o.interpolate||Br,K="__p += '",Y=Lf((o.escape||Br).source+"|"+z.source+"|"+(z===Nn?xf:Br).source+"|"+(o.evaluate||Br).source+"|$","g"),te="//# sourceURL="+(Me.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++kf+"]")+`
4
+ `;i.replace(Y,function(ae,Te,Ae,Yt,Dt,Xt){return Ae||(Ae=Yt),K+=i.slice(q,Xt).replace(Ta,Ma),Te&&(P=!0,K+=`' +
5
+ __e(`+Te+`) +
6
+ '`),Dt&&(N=!0,K+=`';
7
+ `+Dt+`;
8
+ __p += '`),Ae&&(K+=`' +
9
+ ((__t = (`+Ae+`)) == null ? '' : __t) +
10
+ '`),q=Xt+ae.length,ae}),K+=`';
11
+ `;var oe=Me.call(o,"variable")&&o.variable;if(!oe)K=`with (obj) {
12
+ `+K+`
13
+ }
14
+ `;else if(Ur.test(oe))throw new he(a);K=(N?K.replace(_a,""):K).replace(wf,"$1").replace(bf,"$1;"),K="function("+(oe||"obj")+`) {
15
+ `+(oe?"":`obj || (obj = {});
16
+ `)+"var __t, __p = ''"+(P?", __e = _.escape":"")+(N?`, __j = Array.prototype.join;
17
+ function print() { __p += __j.call(arguments, '') }
18
+ `:`;
19
+ `)+K+`return __p
20
+ }`;var ve=Uy(function(){return Ne(T,te+"return "+K).apply(n,x)});if(ve.source=K,vd(ve))throw ve;return ve}function G1(i){return Ve(i).toLowerCase()}function K1(i){return Ve(i).toUpperCase()}function W1(i,o,l){if(i=Ve(i),i&&(l||o===n))return Q(i);if(!i||!(o=Qt(o)))return i;var p=Tn(i),y=Tn(o),T=ct(p,y),x=lt(p,y)+1;return ti(p,T,x).join("")}function H1(i,o,l){if(i=Ve(i),i&&(l||o===n))return i.slice(0,Xg(i)+1);if(!i||!(o=Qt(o)))return i;var p=Tn(i),y=lt(p,Tn(o))+1;return ti(p,0,y).join("")}function Q1(i,o,l){if(i=Ve(i),i&&(l||o===n))return i.replace(ut,"");if(!i||!(o=Qt(o)))return i;var p=Tn(i),y=ct(p,Tn(o));return ti(p,y).join("")}function J1(i,o){var l=A,p=R;if(Ke(o)){var y="separator"in o?o.separator:y;l="length"in o?ye(o.length):l,p="omission"in o?Qt(o.omission):p}i=Ve(i);var T=i.length;if(Js(i)){var x=Tn(i);T=x.length}if(l>=T)return i;var P=l-Ys(p);if(P<1)return p;var N=x?ti(x,0,P).join(""):i.slice(0,P);if(y===n)return N+p;if(x&&(P+=N.length-P),wd(y)){if(i.slice(P).search(y)){var q,z=N;for(y.global||(y=Lf(y.source,Ve(Vi.exec(y))+"g")),y.lastIndex=0;q=y.exec(z);)var K=q.index;N=N.slice(0,K===n?P:K)}}else if(i.indexOf(Qt(y),P)!=P){var Y=N.lastIndexOf(y);Y>-1&&(N=N.slice(0,Y))}return N+p}function Y1(i){return i=Ve(i),i&&uc.test(i)?i.replace(Ls,AI):i}var X1=ro(function(i,o,l){return i+(l?" ":"")+o.toUpperCase()}),Ed=B_("toUpperCase");function Fy(i,o,l){return i=Ve(i),o=l?n:o,o===n?bI(i)?PI(i):Vc(i):i.match(o)||[]}var Uy=we(function(i,o){try{return bt(i,n,o)}catch(l){return vd(l)?l:new he(l)}}),Z1=pr(function(i,o){return Lt(o,function(l){l=jn(l),fr(i,l,_d(i[l],i))}),i});function eP(i){var o=i==null?0:i.length,l=se();return i=o?Fe(i,function(p){if(typeof p[1]!="function")throw new nn(s);return[l(p[0]),p[1]]}):[],we(function(p){for(var y=-1;++y<o;){var T=i[y];if(bt(T[0],this,p))return bt(T[1],this,p)}})}function tP(i){return Ax(sn(i,m))}function Id(i){return function(){return i}}function nP(i,o){return i==null||i!==i?o:i}var rP=$_(),iP=$_(!0);function Bt(i){return i}function xd(i){return y_(typeof i=="function"?i:sn(i,m))}function sP(i){return w_(sn(i,m))}function oP(i,o){return b_(i,sn(o,m))}var aP=we(function(i,o){return function(l){return Ga(l,i,o)}}),uP=we(function(i,o){return function(l){return Ga(i,l,o)}});function Ad(i,o,l){var p=pt(o),y=Zc(o,p);l==null&&!(Ke(o)&&(y.length||!p.length))&&(l=o,o=i,i=this,y=Zc(o,pt(o)));var T=!(Ke(l)&&"chain"in l)||!!l.chain,x=gr(i);return Lt(y,function(P){var N=o[P];i[P]=N,x&&(i.prototype[P]=function(){var q=this.__chain__;if(T||q){var z=i(this.__wrapped__),K=z.__actions__=Mt(this.__actions__);return K.push({func:N,args:arguments,thisArg:i}),z.__chain__=q,z}return N.apply(i,wn([this.value()],arguments))})}),i}function cP(){return Ye._===this&&(Ye._=VI),this}function Sd(){}function lP(i){return i=ye(i),we(function(o){return T_(o,i)})}var hP=id(Fe),fP=id(Kr),dP=id(Hs);function By(i){return hd(i)?Fn(jn(i)):qx(i)}function pP(i){return function(o){return i==null?n:Zi(i,o)}}var mP=z_(),gP=z_(!0);function Rd(){return[]}function Pd(){return!1}function _P(){return{}}function yP(){return""}function vP(){return!0}function wP(i,o){if(i=ye(i),i<1||i>Cn)return[];var l=Nt,p=Tt(i,Nt);o=se(o),i-=Nt;for(var y=L(p,o);++l<i;)o(l);return y}function bP(i){return pe(i)?Fe(i,jn):Jt(i)?[i]:Mt(oy(Ve(i)))}function TP(i){var o=++kI;return Ve(i)+o}var EP=sl(function(i,o){return i+o},0),IP=sd("ceil"),xP=sl(function(i,o){return i/o},1),AP=sd("floor");function SP(i){return i&&i.length?Xc(i,Bt,zf):n}function RP(i,o){return i&&i.length?Xc(i,se(o,2),zf):n}function PP(i){return La(i,Bt)}function CP(i,o){return La(i,se(o,2))}function DP(i){return i&&i.length?Xc(i,Bt,Hf):n}function OP(i,o){return i&&i.length?Xc(i,se(o,2),Hf):n}var kP=sl(function(i,o){return i*o},1),NP=sd("round"),VP=sl(function(i,o){return i-o},0);function LP(i){return i&&i.length?b(i,Bt):0}function MP(i,o){return i&&i.length?b(i,se(o,2)):0}return w.after=sR,w.ary=_y,w.assign=KR,w.assignIn=Dy,w.assignInWith=yl,w.assignWith=WR,w.at=HR,w.before=yy,w.bind=_d,w.bindAll=Z1,w.bindKey=vy,w.castArray=_R,w.chain=py,w.chunk=AA,w.compact=SA,w.concat=RA,w.cond=eP,w.conforms=tP,w.constant=Id,w.countBy=LS,w.create=QR,w.curry=wy,w.curryRight=by,w.debounce=Ty,w.defaults=JR,w.defaultsDeep=YR,w.defer=oR,w.delay=aR,w.difference=PA,w.differenceBy=CA,w.differenceWith=DA,w.drop=OA,w.dropRight=kA,w.dropRightWhile=NA,w.dropWhile=VA,w.fill=LA,w.filter=FS,w.flatMap=jS,w.flatMapDeep=$S,w.flatMapDepth=qS,w.flatten=ly,w.flattenDeep=MA,w.flattenDepth=FA,w.flip=uR,w.flow=rP,w.flowRight=iP,w.fromPairs=UA,w.functions=i1,w.functionsIn=s1,w.groupBy=zS,w.initial=jA,w.intersection=$A,w.intersectionBy=qA,w.intersectionWith=zA,w.invert=a1,w.invertBy=u1,w.invokeMap=KS,w.iteratee=xd,w.keyBy=WS,w.keys=pt,w.keysIn=Ut,w.map=fl,w.mapKeys=l1,w.mapValues=h1,w.matches=sP,w.matchesProperty=oP,w.memoize=pl,w.merge=f1,w.mergeWith=Oy,w.method=aP,w.methodOf=uP,w.mixin=Ad,w.negate=ml,w.nthArg=lP,w.omit=d1,w.omitBy=p1,w.once=cR,w.orderBy=HS,w.over=hP,w.overArgs=lR,w.overEvery=fP,w.overSome=dP,w.partial=yd,w.partialRight=Ey,w.partition=QS,w.pick=m1,w.pickBy=ky,w.property=By,w.propertyOf=pP,w.pull=HA,w.pullAll=fy,w.pullAllBy=QA,w.pullAllWith=JA,w.pullAt=YA,w.range=mP,w.rangeRight=gP,w.rearg=hR,w.reject=XS,w.remove=XA,w.rest=fR,w.reverse=md,w.sampleSize=eR,w.set=_1,w.setWith=y1,w.shuffle=tR,w.slice=ZA,w.sortBy=iR,w.sortedUniq=oS,w.sortedUniqBy=aS,w.split=j1,w.spread=dR,w.tail=uS,w.take=cS,w.takeRight=lS,w.takeRightWhile=hS,w.takeWhile=fS,w.tap=SS,w.throttle=pR,w.thru=hl,w.toArray=Ry,w.toPairs=Ny,w.toPairsIn=Vy,w.toPath=bP,w.toPlainObject=Cy,w.transform=v1,w.unary=mR,w.union=dS,w.unionBy=pS,w.unionWith=mS,w.uniq=gS,w.uniqBy=_S,w.uniqWith=yS,w.unset=w1,w.unzip=gd,w.unzipWith=dy,w.update=b1,w.updateWith=T1,w.values=oo,w.valuesIn=E1,w.without=vS,w.words=Fy,w.wrap=gR,w.xor=wS,w.xorBy=bS,w.xorWith=TS,w.zip=ES,w.zipObject=IS,w.zipObjectDeep=xS,w.zipWith=AS,w.entries=Ny,w.entriesIn=Vy,w.extend=Dy,w.extendWith=yl,Ad(w,w),w.add=EP,w.attempt=Uy,w.camelCase=S1,w.capitalize=Ly,w.ceil=IP,w.clamp=I1,w.clone=yR,w.cloneDeep=wR,w.cloneDeepWith=bR,w.cloneWith=vR,w.conformsTo=TR,w.deburr=My,w.defaultTo=nP,w.divide=xP,w.endsWith=R1,w.eq=In,w.escape=P1,w.escapeRegExp=C1,w.every=MS,w.find=US,w.findIndex=uy,w.findKey=XR,w.findLast=BS,w.findLastIndex=cy,w.findLastKey=ZR,w.floor=AP,w.forEach=my,w.forEachRight=gy,w.forIn=e1,w.forInRight=t1,w.forOwn=n1,w.forOwnRight=r1,w.get=bd,w.gt=ER,w.gte=IR,w.has=o1,w.hasIn=Td,w.head=hy,w.identity=Bt,w.includes=GS,w.indexOf=BA,w.inRange=x1,w.invoke=c1,w.isArguments=ns,w.isArray=pe,w.isArrayBuffer=xR,w.isArrayLike=Ft,w.isArrayLikeObject=Ze,w.isBoolean=AR,w.isBuffer=ni,w.isDate=SR,w.isElement=RR,w.isEmpty=PR,w.isEqual=CR,w.isEqualWith=DR,w.isError=vd,w.isFinite=OR,w.isFunction=gr,w.isInteger=Iy,w.isLength=gl,w.isMap=xy,w.isMatch=kR,w.isMatchWith=NR,w.isNaN=VR,w.isNative=LR,w.isNil=FR,w.isNull=MR,w.isNumber=Ay,w.isObject=Ke,w.isObjectLike=He,w.isPlainObject=Ya,w.isRegExp=wd,w.isSafeInteger=UR,w.isSet=Sy,w.isString=_l,w.isSymbol=Jt,w.isTypedArray=so,w.isUndefined=BR,w.isWeakMap=jR,w.isWeakSet=$R,w.join=GA,w.kebabCase=D1,w.last=an,w.lastIndexOf=KA,w.lowerCase=O1,w.lowerFirst=k1,w.lt=qR,w.lte=zR,w.max=SP,w.maxBy=RP,w.mean=PP,w.meanBy=CP,w.min=DP,w.minBy=OP,w.stubArray=Rd,w.stubFalse=Pd,w.stubObject=_P,w.stubString=yP,w.stubTrue=vP,w.multiply=kP,w.nth=WA,w.noConflict=cP,w.noop=Sd,w.now=dl,w.pad=N1,w.padEnd=V1,w.padStart=L1,w.parseInt=M1,w.random=A1,w.reduce=JS,w.reduceRight=YS,w.repeat=F1,w.replace=U1,w.result=g1,w.round=NP,w.runInContext=O,w.sample=ZS,w.size=nR,w.snakeCase=B1,w.some=rR,w.sortedIndex=eS,w.sortedIndexBy=tS,w.sortedIndexOf=nS,w.sortedLastIndex=rS,w.sortedLastIndexBy=iS,w.sortedLastIndexOf=sS,w.startCase=$1,w.startsWith=q1,w.subtract=VP,w.sum=LP,w.sumBy=MP,w.template=z1,w.times=wP,w.toFinite=_r,w.toInteger=ye,w.toLength=Py,w.toLower=G1,w.toNumber=un,w.toSafeInteger=GR,w.toString=Ve,w.toUpper=K1,w.trim=W1,w.trimEnd=H1,w.trimStart=Q1,w.truncate=J1,w.unescape=Y1,w.uniqueId=TP,w.upperCase=X1,w.upperFirst=Ed,w.each=my,w.eachRight=gy,w.first=hy,Ad(w,function(){var i={};return Un(w,function(o,l){Me.call(w.prototype,l)||(i[l]=o)}),i}(),{chain:!1}),w.VERSION=e,Lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){w[i].placeholder=w}),Lt(["drop","take"],function(i,o){Ie.prototype[i]=function(l){l=l===n?1:ft(ye(l),0);var p=this.__filtered__&&!o?new Ie(this):this.clone();return p.__filtered__?p.__takeCount__=Tt(l,p.__takeCount__):p.__views__.push({size:Tt(l,Nt),type:i+(p.__dir__<0?"Right":"")}),p},Ie.prototype[i+"Right"]=function(l){return this.reverse()[i](l).reverse()}}),Lt(["filter","map","takeWhile"],function(i,o){var l=o+1,p=l==M||l==pn;Ie.prototype[i]=function(y){var T=this.clone();return T.__iteratees__.push({iteratee:se(y,3),type:l}),T.__filtered__=T.__filtered__||p,T}}),Lt(["head","last"],function(i,o){var l="take"+(o?"Right":"");Ie.prototype[i]=function(){return this[l](1).value()[0]}}),Lt(["initial","tail"],function(i,o){var l="drop"+(o?"":"Right");Ie.prototype[i]=function(){return this.__filtered__?new Ie(this):this[l](1)}}),Ie.prototype.compact=function(){return this.filter(Bt)},Ie.prototype.find=function(i){return this.filter(i).head()},Ie.prototype.findLast=function(i){return this.reverse().find(i)},Ie.prototype.invokeMap=we(function(i,o){return typeof i=="function"?new Ie(this):this.map(function(l){return Ga(l,i,o)})}),Ie.prototype.reject=function(i){return this.filter(ml(se(i)))},Ie.prototype.slice=function(i,o){i=ye(i);var l=this;return l.__filtered__&&(i>0||o<0)?new Ie(l):(i<0?l=l.takeRight(-i):i&&(l=l.drop(i)),o!==n&&(o=ye(o),l=o<0?l.dropRight(-o):l.take(o-i)),l)},Ie.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ie.prototype.toArray=function(){return this.take(Nt)},Un(Ie.prototype,function(i,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),p=/^(?:head|last)$/.test(o),y=w[p?"take"+(o=="last"?"Right":""):o],T=p||/^find/.test(o);y&&(w.prototype[o]=function(){var x=this.__wrapped__,P=p?[1]:arguments,N=x instanceof Ie,q=P[0],z=N||pe(x),K=function(Te){var Ae=y.apply(w,wn([Te],P));return p&&Y?Ae[0]:Ae};z&&l&&typeof q=="function"&&q.length!=1&&(N=z=!1);var Y=this.__chain__,te=!!this.__actions__.length,oe=T&&!Y,ve=N&&!te;if(!T&&z){x=ve?x:new Ie(this);var ae=i.apply(x,P);return ae.__actions__.push({func:hl,args:[K],thisArg:n}),new rn(ae,Y)}return oe&&ve?i.apply(this,P):(ae=this.thru(K),oe?p?ae.value()[0]:ae.value():ae)})}),Lt(["pop","push","shift","sort","splice","unshift"],function(i){var o=Mc[i],l=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",p=/^(?:pop|shift)$/.test(i);w.prototype[i]=function(){var y=arguments;if(p&&!this.__chain__){var T=this.value();return o.apply(pe(T)?T:[],y)}return this[l](function(x){return o.apply(pe(x)?x:[],y)})}}),Un(Ie.prototype,function(i,o){var l=w[o];if(l){var p=l.name+"";Me.call(eo,p)||(eo[p]=[]),eo[p].push({name:o,func:l})}}),eo[il(n,G).name]=[{name:"wrapper",func:n}],Ie.prototype.clone=YI,Ie.prototype.reverse=XI,Ie.prototype.value=ZI,w.prototype.at=RS,w.prototype.chain=PS,w.prototype.commit=CS,w.prototype.next=DS,w.prototype.plant=kS,w.prototype.reverse=NS,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=VS,w.prototype.first=w.prototype.head,Fa&&(w.prototype[Fa]=OS),w},Jr=CI();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ye._=Jr,define(function(){return Jr})):Mn?((Mn.exports=Jr)._=Jr,zs._=Jr):Ye._=Jr}).call(ha)});var lI=cn((zW,cI)=>{var _f=aI();function uI(n,e){var t={};return Object.keys(n).sort(e||void 0).forEach(function(r){t[r]=n[r]}),t}function Hg(n,e){if(_f.isArray(n))return _f.map(n,function(r){return Hg(r,e)});if(_f.isObject(n)){var t=uI(n,e);return _f.forEach(t,function(r,s){t[s]=Hg(r)}),t}else return n}cI.exports={keyArrange:uI,keyArrangeDeep:Hg}});var WP=typeof global=="object"&&global&&global.Object===Object&&global,vl=WP;var HP=typeof self=="object"&&self&&self.Object===Object&&self,QP=vl||HP||Function("return this")(),Qe=QP;var JP=Qe.Symbol,Ot=JP;var qy=Object.prototype,YP=qy.hasOwnProperty,XP=qy.toString,Za=Ot?Ot.toStringTag:void 0;function ZP(n){var e=YP.call(n,Za),t=n[Za];try{n[Za]=void 0;var r=!0}catch{}var s=XP.call(n);return r&&(e?n[Za]=t:delete n[Za]),s}var zy=ZP;var eC=Object.prototype,tC=eC.toString;function nC(n){return tC.call(n)}var Gy=nC;var rC="[object Null]",iC="[object Undefined]",Ky=Ot?Ot.toStringTag:void 0;function sC(n){return n==null?n===void 0?iC:rC:Ky&&Ky in Object(n)?zy(n):Gy(n)}var An=sC;function oC(n){return n!=null&&typeof n=="object"}var kt=oC;var aC="[object Symbol]";function uC(n){return typeof n=="symbol"||kt(n)&&An(n)==aC}var ri=uC;function cC(n,e){for(var t=-1,r=n==null?0:n.length,s=Array(r);++t<r;)s[t]=e(n[t],t,n);return s}var Wy=cC;var lC=Array.isArray,tt=lC;var hC=1/0,Hy=Ot?Ot.prototype:void 0,Qy=Hy?Hy.toString:void 0;function Jy(n){if(typeof n=="string")return n;if(tt(n))return Wy(n,Jy)+"";if(ri(n))return Qy?Qy.call(n):"";var e=n+"";return e=="0"&&1/n==-hC?"-0":e}var Yy=Jy;var fC=/\s/;function dC(n){for(var e=n.length;e--&&fC.test(n.charAt(e)););return e}var Xy=dC;var pC=/^\s+/;function mC(n){return n&&n.slice(0,Xy(n)+1).replace(pC,"")}var Zy=mC;function gC(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var De=gC;var ev=NaN,_C=/^[-+]0x[0-9a-f]+$/i,yC=/^0b[01]+$/i,vC=/^0o[0-7]+$/i,wC=parseInt;function bC(n){if(typeof n=="number")return n;if(ri(n))return ev;if(De(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=De(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Zy(n);var t=yC.test(n);return t||vC.test(n)?wC(n.slice(2),t?2:8):_C.test(n)?ev:+n}var Dd=bC;function TC(n){return n}var ao=TC;var EC="[object AsyncFunction]",IC="[object Function]",xC="[object GeneratorFunction]",AC="[object Proxy]";function SC(n){if(!De(n))return!1;var e=An(n);return e==IC||e==xC||e==EC||e==AC}var wl=SC;var RC=Qe["__core-js_shared__"],bl=RC;var tv=function(){var n=/[^.]+$/.exec(bl&&bl.keys&&bl.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function PC(n){return!!tv&&tv in n}var nv=PC;var CC=Function.prototype,DC=CC.toString;function OC(n){if(n!=null){try{return DC.call(n)}catch{}try{return n+""}catch{}}return""}var vr=OC;var kC=/[\\^$.*+?()[\]{}|]/g,NC=/^\[object .+?Constructor\]$/,VC=Function.prototype,LC=Object.prototype,MC=VC.toString,FC=LC.hasOwnProperty,UC=RegExp("^"+MC.call(FC).replace(kC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function BC(n){if(!De(n)||nv(n))return!1;var e=wl(n)?UC:NC;return e.test(vr(n))}var rv=BC;function jC(n,e){return n==null?void 0:n[e]}var iv=jC;function $C(n,e){var t=iv(n,e);return rv(t)?t:void 0}var $t=$C;var qC=$t(Qe,"WeakMap"),Tl=qC;var sv=Object.create,zC=function(){function n(){}return function(e){if(!De(e))return{};if(sv)return sv(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}(),ov=zC;function GC(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}var av=GC;function KC(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var uv=KC;var WC=800,HC=16,QC=Date.now;function JC(n){var e=0,t=0;return function(){var r=QC(),s=HC-(r-t);if(t=r,s>0){if(++e>=WC)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}var cv=JC;function YC(n){return function(){return n}}var lv=YC;var XC=function(){try{var n=$t(Object,"defineProperty");return n({},"",{}),n}catch{}}(),uo=XC;var ZC=uo?function(n,e){return uo(n,"toString",{configurable:!0,enumerable:!1,value:lv(e),writable:!0})}:ao,hv=ZC;var eD=cv(hv),fv=eD;function tD(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var dv=tD;var nD=9007199254740991,rD=/^(?:0|[1-9]\d*)$/;function iD(n,e){var t=typeof n;return e=e==null?nD:e,!!e&&(t=="number"||t!="symbol"&&rD.test(n))&&n>-1&&n%1==0&&n<e}var ii=iD;function sD(n,e,t){e=="__proto__"&&uo?uo(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var co=sD;function oD(n,e){return n===e||n!==n&&e!==e}var $n=oD;var aD=Object.prototype,uD=aD.hasOwnProperty;function cD(n,e,t){var r=n[e];(!(uD.call(n,e)&&$n(r,t))||t===void 0&&!(e in n))&&co(n,e,t)}var lo=cD;function lD(n,e,t,r){var s=!t;t||(t={});for(var a=-1,c=e.length;++a<c;){var h=e[a],f=r?r(t[h],n[h],h,t,n):void 0;f===void 0&&(f=n[h]),s?co(t,h,f):lo(t,h,f)}return t}var si=lD;var pv=Math.max;function hD(n,e,t){return e=pv(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,a=pv(r.length-e,0),c=Array(a);++s<a;)c[s]=r[e+s];s=-1;for(var h=Array(e+1);++s<e;)h[s]=r[s];return h[e]=t(c),av(n,this,h)}}var mv=hD;function fD(n,e){return fv(mv(n,e,ao),n+"")}var gv=fD;var dD=9007199254740991;function pD(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=dD}var ho=pD;function mD(n){return n!=null&&ho(n.length)&&!wl(n)}var oi=mD;function gD(n,e,t){if(!De(t))return!1;var r=typeof e;return(r=="number"?oi(t)&&ii(e,t.length):r=="string"&&e in t)?$n(t[e],n):!1}var _v=gD;var _D=Object.prototype;function yD(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||_D;return n===t}var ai=yD;function vD(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var yv=vD;var wD="[object Arguments]";function bD(n){return kt(n)&&An(n)==wD}var Od=bD;var vv=Object.prototype,TD=vv.hasOwnProperty,ED=vv.propertyIsEnumerable,ID=Od(function(){return arguments}())?Od:function(n){return kt(n)&&TD.call(n,"callee")&&!ED.call(n,"callee")},fo=ID;function xD(){return!1}var wv=xD;var Ev=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bv=Ev&&typeof module=="object"&&module&&!module.nodeType&&module,AD=bv&&bv.exports===Ev,Tv=AD?Qe.Buffer:void 0,SD=Tv?Tv.isBuffer:void 0,RD=SD||wv,wr=RD;var PD="[object Arguments]",CD="[object Array]",DD="[object Boolean]",OD="[object Date]",kD="[object Error]",ND="[object Function]",VD="[object Map]",LD="[object Number]",MD="[object Object]",FD="[object RegExp]",UD="[object Set]",BD="[object String]",jD="[object WeakMap]",$D="[object ArrayBuffer]",qD="[object DataView]",zD="[object Float32Array]",GD="[object Float64Array]",KD="[object Int8Array]",WD="[object Int16Array]",HD="[object Int32Array]",QD="[object Uint8Array]",JD="[object Uint8ClampedArray]",YD="[object Uint16Array]",XD="[object Uint32Array]",$e={};$e[zD]=$e[GD]=$e[KD]=$e[WD]=$e[HD]=$e[QD]=$e[JD]=$e[YD]=$e[XD]=!0;$e[PD]=$e[CD]=$e[$D]=$e[DD]=$e[qD]=$e[OD]=$e[kD]=$e[ND]=$e[VD]=$e[LD]=$e[MD]=$e[FD]=$e[UD]=$e[BD]=$e[jD]=!1;function ZD(n){return kt(n)&&ho(n.length)&&!!$e[An(n)]}var Iv=ZD;function eO(n){return function(e){return n(e)}}var po=eO;var xv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,eu=xv&&typeof module=="object"&&module&&!module.nodeType&&module,tO=eu&&eu.exports===xv,kd=tO&&vl.process,nO=function(){try{var n=eu&&eu.require&&eu.require("util").types;return n||kd&&kd.binding&&kd.binding("util")}catch{}}(),br=nO;var Av=br&&br.isTypedArray,rO=Av?po(Av):Iv,mo=rO;var iO=Object.prototype,sO=iO.hasOwnProperty;function oO(n,e){var t=tt(n),r=!t&&fo(n),s=!t&&!r&&wr(n),a=!t&&!r&&!s&&mo(n),c=t||r||s||a,h=c?yv(n.length,String):[],f=h.length;for(var m in n)(e||sO.call(n,m))&&!(c&&(m=="length"||s&&(m=="offset"||m=="parent")||a&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||ii(m,f)))&&h.push(m);return h}var El=oO;function aO(n,e){return function(t){return n(e(t))}}var Il=aO;var uO=Il(Object.keys,Object),Sv=uO;var cO=Object.prototype,lO=cO.hasOwnProperty;function hO(n){if(!ai(n))return Sv(n);var e=[];for(var t in Object(n))lO.call(n,t)&&t!="constructor"&&e.push(t);return e}var xl=hO;function fO(n){return oi(n)?El(n):xl(n)}var It=fO;function dO(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var Rv=dO;var pO=Object.prototype,mO=pO.hasOwnProperty;function gO(n){if(!De(n))return Rv(n);var e=ai(n),t=[];for(var r in n)r=="constructor"&&(e||!mO.call(n,r))||t.push(r);return t}var Pv=gO;function _O(n){return oi(n)?El(n,!0):Pv(n)}var ui=_O;var yO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vO=/^\w*$/;function wO(n,e){if(tt(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||ri(n)?!0:vO.test(n)||!yO.test(n)||e!=null&&n in Object(e)}var go=wO;var bO=$t(Object,"create"),Tr=bO;function TO(){this.__data__=Tr?Tr(null):{},this.size=0}var Cv=TO;function EO(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var Dv=EO;var IO="__lodash_hash_undefined__",xO=Object.prototype,AO=xO.hasOwnProperty;function SO(n){var e=this.__data__;if(Tr){var t=e[n];return t===IO?void 0:t}return AO.call(e,n)?e[n]:void 0}var Ov=SO;var RO=Object.prototype,PO=RO.hasOwnProperty;function CO(n){var e=this.__data__;return Tr?e[n]!==void 0:PO.call(e,n)}var kv=CO;var DO="__lodash_hash_undefined__";function OO(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Tr&&e===void 0?DO:e,this}var Nv=OO;function _o(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}_o.prototype.clear=Cv;_o.prototype.delete=Dv;_o.prototype.get=Ov;_o.prototype.has=kv;_o.prototype.set=Nv;var Nd=_o;function kO(){this.__data__=[],this.size=0}var Vv=kO;function NO(n,e){for(var t=n.length;t--;)if($n(n[t][0],e))return t;return-1}var ci=NO;var VO=Array.prototype,LO=VO.splice;function MO(n){var e=this.__data__,t=ci(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():LO.call(e,t,1),--this.size,!0}var Lv=MO;function FO(n){var e=this.__data__,t=ci(e,n);return t<0?void 0:e[t][1]}var Mv=FO;function UO(n){return ci(this.__data__,n)>-1}var Fv=UO;function BO(n,e){var t=this.__data__,r=ci(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}var Uv=BO;function yo(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}yo.prototype.clear=Vv;yo.prototype.delete=Lv;yo.prototype.get=Mv;yo.prototype.has=Fv;yo.prototype.set=Uv;var li=yo;var jO=$t(Qe,"Map"),hi=jO;function $O(){this.size=0,this.__data__={hash:new Nd,map:new(hi||li),string:new Nd}}var Bv=$O;function qO(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}var jv=qO;function zO(n,e){var t=n.__data__;return jv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var fi=zO;function GO(n){var e=fi(this,n).delete(n);return this.size-=e?1:0,e}var $v=GO;function KO(n){return fi(this,n).get(n)}var qv=KO;function WO(n){return fi(this,n).has(n)}var zv=WO;function HO(n,e){var t=fi(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}var Gv=HO;function vo(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}vo.prototype.clear=Bv;vo.prototype.delete=$v;vo.prototype.get=qv;vo.prototype.has=zv;vo.prototype.set=Gv;var rs=vo;var QO="Expected a function";function Vd(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(QO);var t=function(){var r=arguments,s=e?e.apply(this,r):r[0],a=t.cache;if(a.has(s))return a.get(s);var c=n.apply(this,r);return t.cache=a.set(s,c)||a,c};return t.cache=new(Vd.Cache||rs),t}Vd.Cache=rs;var Kv=Vd;var JO=500;function YO(n){var e=Kv(n,function(r){return t.size===JO&&t.clear(),r}),t=e.cache;return e}var Wv=YO;var XO=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ZO=/\\(\\)?/g,ek=Wv(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(XO,function(t,r,s,a){e.push(s?a.replace(ZO,"$1"):r||t)}),e}),Hv=ek;function tk(n){return n==null?"":Yy(n)}var Qv=tk;function nk(n,e){return tt(n)?n:go(n,e)?[n]:Hv(Qv(n))}var wo=nk;var rk=1/0;function ik(n){if(typeof n=="string"||ri(n))return n;var e=n+"";return e=="0"&&1/n==-rk?"-0":e}var qn=ik;function sk(n,e){e=wo(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[qn(e[t++])];return t&&t==r?n:void 0}var Al=sk;function ok(n,e,t){var r=n==null?void 0:Al(n,e);return r===void 0?t:r}var tu=ok;function ak(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var Sl=ak;var uk=Il(Object.getPrototypeOf,Object),Rl=uk;function ck(){this.__data__=new li,this.size=0}var Jv=ck;function lk(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}var Yv=lk;function hk(n){return this.__data__.get(n)}var Xv=hk;function fk(n){return this.__data__.has(n)}var Zv=fk;var dk=200;function pk(n,e){var t=this.__data__;if(t instanceof li){var r=t.__data__;if(!hi||r.length<dk-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new rs(r)}return t.set(n,e),this.size=t.size,this}var ew=pk;function bo(n){var e=this.__data__=new li(n);this.size=e.size}bo.prototype.clear=Jv;bo.prototype.delete=Yv;bo.prototype.get=Xv;bo.prototype.has=Zv;bo.prototype.set=ew;var di=bo;function mk(n,e){return n&&si(e,It(e),n)}var tw=mk;function gk(n,e){return n&&si(e,ui(e),n)}var nw=gk;var ow=typeof exports=="object"&&exports&&!exports.nodeType&&exports,rw=ow&&typeof module=="object"&&module&&!module.nodeType&&module,_k=rw&&rw.exports===ow,iw=_k?Qe.Buffer:void 0,sw=iw?iw.allocUnsafe:void 0;function yk(n,e){if(e)return n.slice();var t=n.length,r=sw?sw(t):new n.constructor(t);return n.copy(r),r}var aw=yk;function vk(n,e){for(var t=-1,r=n==null?0:n.length,s=0,a=[];++t<r;){var c=n[t];e(c,t,n)&&(a[s++]=c)}return a}var uw=vk;function wk(){return[]}var Pl=wk;var bk=Object.prototype,Tk=bk.propertyIsEnumerable,cw=Object.getOwnPropertySymbols,Ek=cw?function(n){return n==null?[]:(n=Object(n),uw(cw(n),function(e){return Tk.call(n,e)}))}:Pl,To=Ek;function Ik(n,e){return si(n,To(n),e)}var lw=Ik;var xk=Object.getOwnPropertySymbols,Ak=xk?function(n){for(var e=[];n;)Sl(e,To(n)),n=Rl(n);return e}:Pl,Cl=Ak;function Sk(n,e){return si(n,Cl(n),e)}var hw=Sk;function Rk(n,e,t){var r=e(n);return tt(n)?r:Sl(r,t(n))}var Dl=Rk;function Pk(n){return Dl(n,It,To)}var nu=Pk;function Ck(n){return Dl(n,ui,Cl)}var fw=Ck;var Dk=$t(Qe,"DataView"),Ol=Dk;var Ok=$t(Qe,"Promise"),kl=Ok;var kk=$t(Qe,"Set"),Nl=kk;var dw="[object Map]",Nk="[object Object]",pw="[object Promise]",mw="[object Set]",gw="[object WeakMap]",_w="[object DataView]",Vk=vr(Ol),Lk=vr(hi),Mk=vr(kl),Fk=vr(Nl),Uk=vr(Tl),is=An;(Ol&&is(new Ol(new ArrayBuffer(1)))!=_w||hi&&is(new hi)!=dw||kl&&is(kl.resolve())!=pw||Nl&&is(new Nl)!=mw||Tl&&is(new Tl)!=gw)&&(is=function(n){var e=An(n),t=e==Nk?n.constructor:void 0,r=t?vr(t):"";if(r)switch(r){case Vk:return _w;case Lk:return dw;case Mk:return pw;case Fk:return mw;case Uk:return gw}return e});var Sn=is;var Bk=Object.prototype,jk=Bk.hasOwnProperty;function $k(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&jk.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var yw=$k;var qk=Qe.Uint8Array,Eo=qk;function zk(n){var e=new n.constructor(n.byteLength);return new Eo(e).set(new Eo(n)),e}var Io=zk;function Gk(n,e){var t=e?Io(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var vw=Gk;var Kk=/\w*$/;function Wk(n){var e=new n.constructor(n.source,Kk.exec(n));return e.lastIndex=n.lastIndex,e}var ww=Wk;var bw=Ot?Ot.prototype:void 0,Tw=bw?bw.valueOf:void 0;function Hk(n){return Tw?Object(Tw.call(n)):{}}var Ew=Hk;function Qk(n,e){var t=e?Io(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Iw=Qk;var Jk="[object Boolean]",Yk="[object Date]",Xk="[object Map]",Zk="[object Number]",eN="[object RegExp]",tN="[object Set]",nN="[object String]",rN="[object Symbol]",iN="[object ArrayBuffer]",sN="[object DataView]",oN="[object Float32Array]",aN="[object Float64Array]",uN="[object Int8Array]",cN="[object Int16Array]",lN="[object Int32Array]",hN="[object Uint8Array]",fN="[object Uint8ClampedArray]",dN="[object Uint16Array]",pN="[object Uint32Array]";function mN(n,e,t){var r=n.constructor;switch(e){case iN:return Io(n);case Jk:case Yk:return new r(+n);case sN:return vw(n,t);case oN:case aN:case uN:case cN:case lN:case hN:case fN:case dN:case pN:return Iw(n,t);case Xk:return new r;case Zk:case nN:return new r(n);case eN:return ww(n);case tN:return new r;case rN:return Ew(n)}}var xw=mN;function gN(n){return typeof n.constructor=="function"&&!ai(n)?ov(Rl(n)):{}}var Aw=gN;var _N="[object Map]";function yN(n){return kt(n)&&Sn(n)==_N}var Sw=yN;var Rw=br&&br.isMap,vN=Rw?po(Rw):Sw,Pw=vN;var wN="[object Set]";function bN(n){return kt(n)&&Sn(n)==wN}var Cw=bN;var Dw=br&&br.isSet,TN=Dw?po(Dw):Cw,Ow=TN;var EN=1,IN=2,xN=4,kw="[object Arguments]",AN="[object Array]",SN="[object Boolean]",RN="[object Date]",PN="[object Error]",Nw="[object Function]",CN="[object GeneratorFunction]",DN="[object Map]",ON="[object Number]",Vw="[object Object]",kN="[object RegExp]",NN="[object Set]",VN="[object String]",LN="[object Symbol]",MN="[object WeakMap]",FN="[object ArrayBuffer]",UN="[object DataView]",BN="[object Float32Array]",jN="[object Float64Array]",$N="[object Int8Array]",qN="[object Int16Array]",zN="[object Int32Array]",GN="[object Uint8Array]",KN="[object Uint8ClampedArray]",WN="[object Uint16Array]",HN="[object Uint32Array]",Be={};Be[kw]=Be[AN]=Be[FN]=Be[UN]=Be[SN]=Be[RN]=Be[BN]=Be[jN]=Be[$N]=Be[qN]=Be[zN]=Be[DN]=Be[ON]=Be[Vw]=Be[kN]=Be[NN]=Be[VN]=Be[LN]=Be[GN]=Be[KN]=Be[WN]=Be[HN]=!0;Be[PN]=Be[Nw]=Be[MN]=!1;function Vl(n,e,t,r,s,a){var c,h=e&EN,f=e&IN,m=e&xN;if(t&&(c=s?t(n,r,s,a):t(n)),c!==void 0)return c;if(!De(n))return n;var _=tt(n);if(_){if(c=yw(n),!h)return uv(n,c)}else{var E=Sn(n),I=E==Nw||E==CN;if(wr(n))return aw(n,h);if(E==Vw||E==kw||I&&!s){if(c=f||I?{}:Aw(n),!h)return f?hw(n,nw(c,n)):lw(n,tw(c,n))}else{if(!Be[E])return s?n:{};c=xw(n,E,h)}}a||(a=new di);var k=a.get(n);if(k)return k;a.set(n,c),Ow(n)?n.forEach(function(j){c.add(Vl(j,e,t,j,n,a))}):Pw(n)&&n.forEach(function(j,J){c.set(J,Vl(j,e,t,J,n,a))});var B=m?f?fw:nu:f?ui:It,G=_?void 0:B(n);return dv(G||n,function(j,J){G&&(J=j,j=n[J]),lo(c,J,Vl(j,e,t,J,n,a))}),c}var Lw=Vl;var QN=1,JN=4;function YN(n){return Lw(n,QN|JN)}var zn=YN;var XN="__lodash_hash_undefined__";function ZN(n){return this.__data__.set(n,XN),this}var Mw=ZN;function eV(n){return this.__data__.has(n)}var Fw=eV;function Ll(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new rs;++e<t;)this.add(n[e])}Ll.prototype.add=Ll.prototype.push=Mw;Ll.prototype.has=Fw;var Uw=Ll;function tV(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}var Bw=tV;function nV(n,e){return n.has(e)}var jw=nV;var rV=1,iV=2;function sV(n,e,t,r,s,a){var c=t&rV,h=n.length,f=e.length;if(h!=f&&!(c&&f>h))return!1;var m=a.get(n),_=a.get(e);if(m&&_)return m==e&&_==n;var E=-1,I=!0,k=t&iV?new Uw:void 0;for(a.set(n,e),a.set(e,n);++E<h;){var B=n[E],G=e[E];if(r)var j=c?r(G,B,E,e,n,a):r(B,G,E,n,e,a);if(j!==void 0){if(j)continue;I=!1;break}if(k){if(!Bw(e,function(J,ee){if(!jw(k,ee)&&(B===J||s(B,J,t,r,a)))return k.push(ee)})){I=!1;break}}else if(!(B===G||s(B,G,t,r,a))){I=!1;break}}return a.delete(n),a.delete(e),I}var Ml=sV;function oV(n){var e=-1,t=Array(n.size);return n.forEach(function(r,s){t[++e]=[s,r]}),t}var $w=oV;function aV(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var qw=aV;var uV=1,cV=2,lV="[object Boolean]",hV="[object Date]",fV="[object Error]",dV="[object Map]",pV="[object Number]",mV="[object RegExp]",gV="[object Set]",_V="[object String]",yV="[object Symbol]",vV="[object ArrayBuffer]",wV="[object DataView]",zw=Ot?Ot.prototype:void 0,Ld=zw?zw.valueOf:void 0;function bV(n,e,t,r,s,a,c){switch(t){case wV:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case vV:return!(n.byteLength!=e.byteLength||!a(new Eo(n),new Eo(e)));case lV:case hV:case pV:return $n(+n,+e);case fV:return n.name==e.name&&n.message==e.message;case mV:case _V:return n==e+"";case dV:var h=$w;case gV:var f=r&uV;if(h||(h=qw),n.size!=e.size&&!f)return!1;var m=c.get(n);if(m)return m==e;r|=cV,c.set(n,e);var _=Ml(h(n),h(e),r,s,a,c);return c.delete(n),_;case yV:if(Ld)return Ld.call(n)==Ld.call(e)}return!1}var Gw=bV;var TV=1,EV=Object.prototype,IV=EV.hasOwnProperty;function xV(n,e,t,r,s,a){var c=t&TV,h=nu(n),f=h.length,m=nu(e),_=m.length;if(f!=_&&!c)return!1;for(var E=f;E--;){var I=h[E];if(!(c?I in e:IV.call(e,I)))return!1}var k=a.get(n),B=a.get(e);if(k&&B)return k==e&&B==n;var G=!0;a.set(n,e),a.set(e,n);for(var j=c;++E<f;){I=h[E];var J=n[I],ee=e[I];if(r)var ne=c?r(ee,J,I,e,n,a):r(J,ee,I,n,e,a);if(!(ne===void 0?J===ee||s(J,ee,t,r,a):ne)){G=!1;break}j||(j=I=="constructor")}if(G&&!j){var le=n.constructor,de=e.constructor;le!=de&&"constructor"in n&&"constructor"in e&&!(typeof le=="function"&&le instanceof le&&typeof de=="function"&&de instanceof de)&&(G=!1)}return a.delete(n),a.delete(e),G}var Kw=xV;var AV=1,Ww="[object Arguments]",Hw="[object Array]",Fl="[object Object]",SV=Object.prototype,Qw=SV.hasOwnProperty;function RV(n,e,t,r,s,a){var c=tt(n),h=tt(e),f=c?Hw:Sn(n),m=h?Hw:Sn(e);f=f==Ww?Fl:f,m=m==Ww?Fl:m;var _=f==Fl,E=m==Fl,I=f==m;if(I&&wr(n)){if(!wr(e))return!1;c=!0,_=!1}if(I&&!_)return a||(a=new di),c||mo(n)?Ml(n,e,t,r,s,a):Gw(n,e,f,t,r,s,a);if(!(t&AV)){var k=_&&Qw.call(n,"__wrapped__"),B=E&&Qw.call(e,"__wrapped__");if(k||B){var G=k?n.value():n,j=B?e.value():e;return a||(a=new di),s(G,j,t,r,a)}}return I?(a||(a=new di),Kw(n,e,t,r,s,a)):!1}var Jw=RV;function Yw(n,e,t,r,s){return n===e?!0:n==null||e==null||!kt(n)&&!kt(e)?n!==n&&e!==e:Jw(n,e,t,r,Yw,s)}var Ul=Yw;var PV=1,CV=2;function DV(n,e,t,r){var s=t.length,a=s,c=!r;if(n==null)return!a;for(n=Object(n);s--;){var h=t[s];if(c&&h[2]?h[1]!==n[h[0]]:!(h[0]in n))return!1}for(;++s<a;){h=t[s];var f=h[0],m=n[f],_=h[1];if(c&&h[2]){if(m===void 0&&!(f in n))return!1}else{var E=new di;if(r)var I=r(m,_,f,n,e,E);if(!(I===void 0?Ul(_,m,PV|CV,r,E):I))return!1}}return!0}var Xw=DV;function OV(n){return n===n&&!De(n)}var Bl=OV;function kV(n){for(var e=It(n),t=e.length;t--;){var r=e[t],s=n[r];e[t]=[r,s,Bl(s)]}return e}var Zw=kV;function NV(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}var jl=NV;function VV(n){var e=Zw(n);return e.length==1&&e[0][2]?jl(e[0][0],e[0][1]):function(t){return t===n||Xw(t,n,e)}}var e0=VV;function LV(n,e){return n!=null&&e in Object(n)}var t0=LV;function MV(n,e,t){e=wo(e,n);for(var r=-1,s=e.length,a=!1;++r<s;){var c=qn(e[r]);if(!(a=n!=null&&t(n,c)))break;n=n[c]}return a||++r!=s?a:(s=n==null?0:n.length,!!s&&ho(s)&&ii(c,s)&&(tt(n)||fo(n)))}var n0=MV;function FV(n,e){return n!=null&&n0(n,e,t0)}var r0=FV;var UV=1,BV=2;function jV(n,e){return go(n)&&Bl(e)?jl(qn(n),e):function(t){var r=tu(t,n);return r===void 0&&r===e?r0(t,n):Ul(e,r,UV|BV)}}var i0=jV;function $V(n){return function(e){return e==null?void 0:e[n]}}var s0=$V;function qV(n){return function(e){return Al(e,n)}}var o0=qV;function zV(n){return go(n)?s0(qn(n)):o0(n)}var a0=zV;function GV(n){return typeof n=="function"?n:n==null?ao:typeof n=="object"?tt(n)?i0(n[0],n[1]):e0(n):a0(n)}var u0=GV;function KV(n){return function(e,t,r){for(var s=-1,a=Object(e),c=r(e),h=c.length;h--;){var f=c[n?h:++s];if(t(a[f],f,a)===!1)break}return e}}var c0=KV;var WV=c0(),l0=WV;function HV(n,e){return n&&l0(n,e,It)}var h0=HV;var QV=function(){return Qe.Date.now()},$l=QV;var JV="Expected a function",YV=Math.max,XV=Math.min;function ZV(n,e,t){var r,s,a,c,h,f,m=0,_=!1,E=!1,I=!0;if(typeof n!="function")throw new TypeError(JV);e=Dd(e)||0,De(t)&&(_=!!t.leading,E="maxWait"in t,a=E?YV(Dd(t.maxWait)||0,e):a,I="trailing"in t?!!t.trailing:I);function k(ie){var C=r,A=s;return r=s=void 0,m=ie,c=n.apply(A,C),c}function B(ie){return m=ie,h=setTimeout(J,e),_?k(ie):c}function G(ie){var C=ie-f,A=ie-m,R=e-C;return E?XV(R,a-A):R}function j(ie){var C=ie-f,A=ie-m;return f===void 0||C>=e||C<0||E&&A>=a}function J(){var ie=$l();if(j(ie))return ee(ie);h=setTimeout(J,G(ie))}function ee(ie){return h=void 0,I&&r?k(ie):(r=s=void 0,c)}function ne(){h!==void 0&&clearTimeout(h),m=0,r=f=s=h=void 0}function le(){return h===void 0?c:ee($l())}function de(){var ie=$l(),C=j(ie);if(r=arguments,s=this,f=ie,C){if(h===void 0)return B(f);if(E)return clearTimeout(h),h=setTimeout(J,e),k(f)}return h===void 0&&(h=setTimeout(J,e)),c}return de.cancel=ne,de.flush=le,de}var f0=ZV;var d0=Object.prototype,eL=d0.hasOwnProperty,tL=gv(function(n,e){n=Object(n);var t=-1,r=e.length,s=r>2?e[2]:void 0;for(s&&_v(e[0],e[1],s)&&(r=1);++t<r;)for(var a=e[t],c=ui(a),h=-1,f=c.length;++h<f;){var m=c[h],_=n[m];(_===void 0||$n(_,d0[m])&&!eL.call(n,m))&&(n[m]=a[m])}return n}),ql=tL;var nL="[object Map]",rL="[object Set]",iL=Object.prototype,sL=iL.hasOwnProperty;function oL(n){if(n==null)return!0;if(oi(n)&&(tt(n)||typeof n=="string"||typeof n.splice=="function"||wr(n)||mo(n)||fo(n)))return!n.length;var e=Sn(n);if(e==nL||e==rL)return!n.size;if(ai(n))return!xl(n).length;for(var t in n)if(sL.call(n,t))return!1;return!0}var Md=oL;function aL(n,e){var t={};return e=u0(e,3),h0(n,function(r,s,a){co(t,e(r,s,a),r)}),t}var Fd=aL;function uL(n,e,t,r){if(!De(n))return n;e=wo(e,n);for(var s=-1,a=e.length,c=a-1,h=n;h!=null&&++s<a;){var f=qn(e[s]),m=t;if(f==="__proto__"||f==="constructor"||f==="prototype")return n;if(s!=c){var _=h[f];m=r?r(_,f,h):void 0,m===void 0&&(m=De(_)?_:ii(e[s+1])?[]:{})}lo(h,f,m),h=h[f]}return n}var p0=uL;function cL(n,e,t){return n==null?n:p0(n,e,t)}var pi=cL;var lL="Expected a function";function hL(n,e,t){var r=!0,s=!0;if(typeof n!="function")throw new TypeError(lL);return De(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),f0(n,e,{leading:r,maxWait:e,trailing:s})}var Ud=hL;var g0=function(n){let e=[],t=0;for(let r=0;r<n.length;r++){let s=n.charCodeAt(r);s<128?e[t++]=s:s<2048?(e[t++]=s>>6|192,e[t++]=s&63|128):(s&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=s>>18|240,e[t++]=s>>12&63|128,e[t++]=s>>6&63|128,e[t++]=s&63|128):(e[t++]=s>>12|224,e[t++]=s>>6&63|128,e[t++]=s&63|128)}return e},fL=function(n){let e=[],t=0,r=0;for(;t<n.length;){let s=n[t++];if(s<128)e[r++]=String.fromCharCode(s);else if(s>191&&s<224){let a=n[t++];e[r++]=String.fromCharCode((s&31)<<6|a&63)}else if(s>239&&s<365){let a=n[t++],c=n[t++],h=n[t++],f=((s&7)<<18|(a&63)<<12|(c&63)<<6|h&63)-65536;e[r++]=String.fromCharCode(55296+(f>>10)),e[r++]=String.fromCharCode(56320+(f&1023))}else{let a=n[t++],c=n[t++];e[r++]=String.fromCharCode((s&15)<<12|(a&63)<<6|c&63)}}return e.join("")},_0={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(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<n.length;s+=3){let a=n[s],c=s+1<n.length,h=c?n[s+1]:0,f=s+2<n.length,m=f?n[s+2]:0,_=a>>2,E=(a&3)<<4|h>>4,I=(h&15)<<2|m>>6,k=m&63;f||(k=64,c||(I=64)),r.push(t[_],t[E],t[I],t[k])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(g0(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):fL(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<n.length;){let a=t[n.charAt(s++)],h=s<n.length?t[n.charAt(s)]:0;++s;let m=s<n.length?t[n.charAt(s)]:64;++s;let E=s<n.length?t[n.charAt(s)]:64;if(++s,a==null||h==null||m==null||E==null)throw new Bd;let I=a<<2|h>>4;if(r.push(I),m!==64){let k=h<<4&240|m>>2;if(r.push(k),E!==64){let B=m<<6&192|E;r.push(B)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},Bd=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},dL=function(n){let e=g0(n);return _0.encodeByteArray(e,!0)},ru=function(n){return dL(n).replace(/\./g,"")},y0=function(n){try{return _0.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function pL(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("Unable to locate global object.")}var mL=()=>pL().__FIREBASE_DEFAULTS__,gL=()=>{if(typeof process=="undefined"||typeof process.env=="undefined")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},_L=()=>{if(typeof document=="undefined")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&y0(n[1]);return e&&JSON.parse(e)},jd=()=>{try{return mL()||gL()||_L()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},yL=n=>{var e,t;return(t=(e=jd())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},v0=n=>{let e=yL(n);if(!e)return;let t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);let r=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),r]:[e.substring(0,t),r]},$d=()=>{var n;return(n=jd())===null||n===void 0?void 0:n.config};var zl=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}};function w0(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let t={alg:"none",type:"JWT"},r=e||"demo-project",s=n.iat||0,a=n.sub||n.user_id;if(!a)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");let c=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:a,user_id:a,firebase:{sign_in_provider:"custom",identities:{}}},n);return[ru(JSON.stringify(t)),ru(JSON.stringify(c)),""].join(".")}function b0(){return typeof navigator!="undefined"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function vL(){var n;let e=(n=jd())===null||n===void 0?void 0:n.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 T0(){return!vL()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function qd(){try{return typeof indexedDB=="object"}catch{return!1}}function E0(){return new Promise((n,e)=>{try{let t=!0,r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},s.onupgradeneeded=()=>{t=!1},s.onerror=()=>{var a;e(((a=s.error)===null||a===void 0?void 0:a.message)||"")}}catch(t){e(t)}})}var wL="FirebaseError",Er=class n extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=wL,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,iu.prototype.create)}},iu=class{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){let r=t[0]||{},s=`${this.service}/${e}`,a=this.errors[e],c=a?bL(a,r):"Error",h=`${this.serviceName}: ${c} (${s}).`;return new Er(s,h,r)}};function bL(n,e){return n.replace(TL,(t,r)=>{let s=e[r];return s!=null?String(s):`<${r}?>`})}var TL=/\{\$([^}]+)}/g;function su(n,e){if(n===e)return!0;let t=Object.keys(n),r=Object.keys(e);for(let s of t){if(!r.includes(s))return!1;let a=n[s],c=e[s];if(m0(a)&&m0(c)){if(!su(a,c))return!1}else if(a!==c)return!1}for(let s of r)if(!t.includes(s))return!1;return!0}function m0(n){return n!==null&&typeof n=="object"}var C6=4*60*60*1e3;function Ir(n){return n&&n._delegate?n._delegate:n}var xr=class{constructor(e,t,r){this.name=e,this.instanceFactory=t,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 ss="[DEFAULT]";var zd=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let r=new zl;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{let s=this.getOrInitializeService({instanceIdentifier:t});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),s=(t=e==null?void 0:e.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(a){if(s)return null;throw a}else{if(s)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(IL(e))try{this.getOrInitializeService({instanceIdentifier:ss})}catch{}for(let[t,r]of this.instancesDeferred.entries()){let s=this.normalizeInstanceIdentifier(t);try{let a=this.getOrInitializeService({instanceIdentifier:s});r.resolve(a)}catch{}}}}clearInstance(e=ss){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=ss){return this.instances.has(e)}getOptions(e=ss){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=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 s=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[a,c]of this.instancesDeferred.entries()){let h=this.normalizeInstanceIdentifier(a);r===h&&c.resolve(s)}return s}onInit(e,t){var r;let s=this.normalizeInstanceIdentifier(t),a=(r=this.onInitCallbacks.get(s))!==null&&r!==void 0?r:new Set;a.add(e),this.onInitCallbacks.set(s,a);let c=this.instances.get(s);return c&&e(c,s),()=>{a.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let s of r)try{s(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:EL(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=ss){return this.component?this.component.multipleInstances?e:ss:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function EL(n){return n===ss?void 0:n}function IL(n){return n.instantiationMode==="EAGER"}var Gl=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.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 t=new zd(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var xL=[],Se;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(Se||(Se={}));var AL={debug:Se.DEBUG,verbose:Se.VERBOSE,info:Se.INFO,warn:Se.WARN,error:Se.ERROR,silent:Se.SILENT},SL=Se.INFO,RL={[Se.DEBUG]:"log",[Se.VERBOSE]:"log",[Se.INFO]:"info",[Se.WARN]:"warn",[Se.ERROR]:"error"},PL=(n,e,...t)=>{if(e<n.logLevel)return;let r=new Date().toISOString(),s=RL[e];if(s)console[s](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},xo=class{constructor(e){this.name=e,this._logLevel=SL,this._logHandler=PL,this._userLogHandler=null,xL.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Se))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?AL[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,Se.DEBUG,...e),this._logHandler(this,Se.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Se.VERBOSE,...e),this._logHandler(this,Se.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Se.INFO,...e),this._logHandler(this,Se.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Se.WARN,...e),this._logHandler(this,Se.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Se.ERROR,...e),this._logHandler(this,Se.ERROR,...e)}};var CL=(n,e)=>e.some(t=>n instanceof t),I0,x0;function DL(){return I0||(I0=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function OL(){return x0||(x0=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var A0=new WeakMap,Kd=new WeakMap,S0=new WeakMap,Gd=new WeakMap,Hd=new WeakMap;function kL(n){let e=new Promise((t,r)=>{let s=()=>{n.removeEventListener("success",a),n.removeEventListener("error",c)},a=()=>{t(Gn(n.result)),s()},c=()=>{r(n.error),s()};n.addEventListener("success",a),n.addEventListener("error",c)});return e.then(t=>{t instanceof IDBCursor&&A0.set(t,n)}).catch(()=>{}),Hd.set(e,n),e}function NL(n){if(Kd.has(n))return;let e=new Promise((t,r)=>{let s=()=>{n.removeEventListener("complete",a),n.removeEventListener("error",c),n.removeEventListener("abort",c)},a=()=>{t(),s()},c=()=>{r(n.error||new DOMException("AbortError","AbortError")),s()};n.addEventListener("complete",a),n.addEventListener("error",c),n.addEventListener("abort",c)});Kd.set(n,e)}var Wd={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Kd.get(n);if(e==="objectStoreNames")return n.objectStoreNames||S0.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return Gn(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function R0(n){Wd=n(Wd)}function VL(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let r=n.call(Kl(this),e,...t);return S0.set(r,e.sort?e.sort():[e]),Gn(r)}:OL().includes(n)?function(...e){return n.apply(Kl(this),e),Gn(A0.get(this))}:function(...e){return Gn(n.apply(Kl(this),e))}}function LL(n){return typeof n=="function"?VL(n):(n instanceof IDBTransaction&&NL(n),CL(n,DL())?new Proxy(n,Wd):n)}function Gn(n){if(n instanceof IDBRequest)return kL(n);if(Gd.has(n))return Gd.get(n);let e=LL(n);return e!==n&&(Gd.set(n,e),Hd.set(e,n)),e}var Kl=n=>Hd.get(n);function C0(n,e,{blocked:t,upgrade:r,blocking:s,terminated:a}={}){let c=indexedDB.open(n,e),h=Gn(c);return r&&c.addEventListener("upgradeneeded",f=>{r(Gn(c.result),f.oldVersion,f.newVersion,Gn(c.transaction),f)}),t&&c.addEventListener("blocked",f=>t(f.oldVersion,f.newVersion,f)),h.then(f=>{a&&f.addEventListener("close",()=>a()),s&&f.addEventListener("versionchange",m=>s(m.oldVersion,m.newVersion,m))}).catch(()=>{}),h}var ML=["get","getKey","getAll","getAllKeys","count"],FL=["put","add","delete","clear"],Qd=new Map;function P0(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Qd.get(e))return Qd.get(e);let t=e.replace(/FromIndex$/,""),r=e!==t,s=FL.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(s||ML.includes(t)))return;let a=async function(c,...h){let f=this.transaction(c,s?"readwrite":"readonly"),m=f.store;return r&&(m=m.index(h.shift())),(await Promise.all([m[t](...h),s&&f.done]))[0]};return Qd.set(e,a),a}R0(n=>({...n,get:(e,t,r)=>P0(e,t)||n.get(e,t,r),has:(e,t)=>!!P0(e,t)||n.has(e,t)}));var Yd=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(UL(t)){let r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}};function UL(n){let e=n.getComponent();return(e==null?void 0:e.type)==="VERSION"}var Xd="@firebase/app",D0="0.11.1";var Ar=new xo("@firebase/app"),BL="@firebase/app-compat",jL="@firebase/analytics-compat",$L="@firebase/analytics",qL="@firebase/app-check-compat",zL="@firebase/app-check",GL="@firebase/auth",KL="@firebase/auth-compat",WL="@firebase/database",HL="@firebase/data-connect",QL="@firebase/database-compat",JL="@firebase/functions",YL="@firebase/functions-compat",XL="@firebase/installations",ZL="@firebase/installations-compat",e2="@firebase/messaging",t2="@firebase/messaging-compat",n2="@firebase/performance",r2="@firebase/performance-compat",i2="@firebase/remote-config",s2="@firebase/remote-config-compat",o2="@firebase/storage",a2="@firebase/storage-compat",u2="@firebase/firestore",c2="@firebase/vertexai",l2="@firebase/firestore-compat",h2="firebase",f2="11.3.1";var Zd="[DEFAULT]",d2={[Xd]:"fire-core",[BL]:"fire-core-compat",[$L]:"fire-analytics",[jL]:"fire-analytics-compat",[zL]:"fire-app-check",[qL]:"fire-app-check-compat",[GL]:"fire-auth",[KL]:"fire-auth-compat",[WL]:"fire-rtdb",[HL]:"fire-data-connect",[QL]:"fire-rtdb-compat",[JL]:"fire-fn",[YL]:"fire-fn-compat",[XL]:"fire-iid",[ZL]:"fire-iid-compat",[e2]:"fire-fcm",[t2]:"fire-fcm-compat",[n2]:"fire-perf",[r2]:"fire-perf-compat",[i2]:"fire-rc",[s2]:"fire-rc-compat",[o2]:"fire-gcs",[a2]:"fire-gcs-compat",[u2]:"fire-fst",[l2]:"fire-fst-compat",[c2]:"fire-vertex","fire-js":"fire-js",[h2]:"fire-js-all"};var Wl=new Map,p2=new Map,ep=new Map;function O0(n,e){try{n.container.addComponent(e)}catch(t){Ar.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function ou(n){let e=n.name;if(ep.has(e))return Ar.debug(`There were multiple attempts to register component ${e}.`),!1;ep.set(e,n);for(let t of Wl.values())O0(t,n);for(let t of p2.values())O0(t,n);return!0}function L0(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function M0(n){return n==null?!1:n.settings!==void 0}var m2={"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."},mi=new iu("app","Firebase",m2);var tp=class{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new xr("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 mi.create("app-deleted",{appName:this._name})}};var F0=f2;function ip(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let r=Object.assign({name:Zd,automaticDataCollectionEnabled:!1},e),s=r.name;if(typeof s!="string"||!s)throw mi.create("bad-app-name",{appName:String(s)});if(t||(t=$d()),!t)throw mi.create("no-options");let a=Wl.get(s);if(a){if(su(t,a.options)&&su(r,a.config))return a;throw mi.create("duplicate-app",{appName:s})}let c=new Gl(s);for(let f of ep.values())c.addComponent(f);let h=new tp(t,r,c);return Wl.set(s,h),h}function U0(n=Zd){let e=Wl.get(n);if(!e&&n===Zd&&$d())return ip();if(!e)throw mi.create("no-app",{appName:n});return e}function gi(n,e,t){var r;let s=(r=d2[n])!==null&&r!==void 0?r:n;t&&(s+=`-${t}`);let a=s.match(/\s|\//),c=e.match(/\s|\//);if(a||c){let h=[`Unable to register library "${s}" with version "${e}":`];a&&h.push(`library name "${s}" contains illegal characters (whitespace or "/")`),a&&c&&h.push("and"),c&&h.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Ar.warn(h.join(" "));return}ou(new xr(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}var g2="firebase-heartbeat-database",_2=1,au="firebase-heartbeat-store",Jd=null;function B0(){return Jd||(Jd=C0(g2,_2,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(au)}catch(t){console.warn(t)}}}}).catch(n=>{throw mi.create("idb-open",{originalErrorMessage:n.message})})),Jd}async function y2(n){try{let t=(await B0()).transaction(au),r=await t.objectStore(au).get(j0(n));return await t.done,r}catch(e){if(e instanceof Er)Ar.warn(e.message);else{let t=mi.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Ar.warn(t.message)}}}async function k0(n,e){try{let r=(await B0()).transaction(au,"readwrite");await r.objectStore(au).put(e,j0(n)),await r.done}catch(t){if(t instanceof Er)Ar.warn(t.message);else{let r=mi.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});Ar.warn(r.message)}}}function j0(n){return`${n.name}!${n.options.appId}`}var v2=1024,w2=30,np=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new rp(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,t;try{let s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),a=N0();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===a||this._heartbeatsCache.heartbeats.some(c=>c.date===a))return;if(this._heartbeatsCache.heartbeats.push({date:a,agent:s}),this._heartbeatsCache.heartbeats.length>w2){let c=T2(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(c,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Ar.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=N0(),{heartbeatsToSend:r,unsentEntries:s}=b2(this._heartbeatsCache.heartbeats),a=ru(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}catch(t){return Ar.warn(t),""}}};function N0(){return new Date().toISOString().substring(0,10)}function b2(n,e=v2){let t=[],r=n.slice();for(let s of n){let a=t.find(c=>c.agent===s.agent);if(a){if(a.dates.push(s.date),V0(t)>e){a.dates.pop();break}}else if(t.push({agent:s.agent,dates:[s.date]}),V0(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}var rp=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return qd()?E0().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){let t=await y2(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){let s=await this.read();return k0(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:s.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){let s=await this.read();return k0(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}else return}};function V0(n){return ru(JSON.stringify({version:2,heartbeats:n})).length}function T2(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let r=1;r<n.length;r++)n[r].date<t&&(t=n[r].date,e=r);return e}function E2(n){ou(new xr("platform-logger",e=>new Yd(e),"PRIVATE")),ou(new xr("heartbeat",e=>new np(e),"PRIVATE")),gi(Xd,D0,n),gi(Xd,D0,"esm2017"),gi("fire-js","")}E2("");var I2="firebase",x2="11.3.1";gi(I2,x2,"app");var $0=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},q0={};var Sr,sp;(function(){var n;function e(C,A){function R(){}R.prototype=A.prototype,C.D=A.prototype,C.prototype=new R,C.prototype.constructor=C,C.C=function(D,V,M){for(var S=Array(arguments.length-2),pn=2;pn<arguments.length;pn++)S[pn-2]=arguments[pn];return A.prototype[V].apply(D,S)}}function t(){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,t),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 s(C,A,R){R||(R=0);var D=Array(16);if(typeof A=="string")for(var V=0;16>V;++V)D[V]=A.charCodeAt(R++)|A.charCodeAt(R++)<<8|A.charCodeAt(R++)<<16|A.charCodeAt(R++)<<24;else for(V=0;16>V;++V)D[V]=A[R++]|A[R++]<<8|A[R++]<<16|A[R++]<<24;A=C.g[0],R=C.g[1],V=C.g[2];var M=C.g[3],S=A+(M^R&(V^M))+D[0]+3614090360&4294967295;A=R+(S<<7&4294967295|S>>>25),S=M+(V^A&(R^V))+D[1]+3905402710&4294967295,M=A+(S<<12&4294967295|S>>>20),S=V+(R^M&(A^R))+D[2]+606105819&4294967295,V=M+(S<<17&4294967295|S>>>15),S=R+(A^V&(M^A))+D[3]+3250441966&4294967295,R=V+(S<<22&4294967295|S>>>10),S=A+(M^R&(V^M))+D[4]+4118548399&4294967295,A=R+(S<<7&4294967295|S>>>25),S=M+(V^A&(R^V))+D[5]+1200080426&4294967295,M=A+(S<<12&4294967295|S>>>20),S=V+(R^M&(A^R))+D[6]+2821735955&4294967295,V=M+(S<<17&4294967295|S>>>15),S=R+(A^V&(M^A))+D[7]+4249261313&4294967295,R=V+(S<<22&4294967295|S>>>10),S=A+(M^R&(V^M))+D[8]+1770035416&4294967295,A=R+(S<<7&4294967295|S>>>25),S=M+(V^A&(R^V))+D[9]+2336552879&4294967295,M=A+(S<<12&4294967295|S>>>20),S=V+(R^M&(A^R))+D[10]+4294925233&4294967295,V=M+(S<<17&4294967295|S>>>15),S=R+(A^V&(M^A))+D[11]+2304563134&4294967295,R=V+(S<<22&4294967295|S>>>10),S=A+(M^R&(V^M))+D[12]+1804603682&4294967295,A=R+(S<<7&4294967295|S>>>25),S=M+(V^A&(R^V))+D[13]+4254626195&4294967295,M=A+(S<<12&4294967295|S>>>20),S=V+(R^M&(A^R))+D[14]+2792965006&4294967295,V=M+(S<<17&4294967295|S>>>15),S=R+(A^V&(M^A))+D[15]+1236535329&4294967295,R=V+(S<<22&4294967295|S>>>10),S=A+(V^M&(R^V))+D[1]+4129170786&4294967295,A=R+(S<<5&4294967295|S>>>27),S=M+(R^V&(A^R))+D[6]+3225465664&4294967295,M=A+(S<<9&4294967295|S>>>23),S=V+(A^R&(M^A))+D[11]+643717713&4294967295,V=M+(S<<14&4294967295|S>>>18),S=R+(M^A&(V^M))+D[0]+3921069994&4294967295,R=V+(S<<20&4294967295|S>>>12),S=A+(V^M&(R^V))+D[5]+3593408605&4294967295,A=R+(S<<5&4294967295|S>>>27),S=M+(R^V&(A^R))+D[10]+38016083&4294967295,M=A+(S<<9&4294967295|S>>>23),S=V+(A^R&(M^A))+D[15]+3634488961&4294967295,V=M+(S<<14&4294967295|S>>>18),S=R+(M^A&(V^M))+D[4]+3889429448&4294967295,R=V+(S<<20&4294967295|S>>>12),S=A+(V^M&(R^V))+D[9]+568446438&4294967295,A=R+(S<<5&4294967295|S>>>27),S=M+(R^V&(A^R))+D[14]+3275163606&4294967295,M=A+(S<<9&4294967295|S>>>23),S=V+(A^R&(M^A))+D[3]+4107603335&4294967295,V=M+(S<<14&4294967295|S>>>18),S=R+(M^A&(V^M))+D[8]+1163531501&4294967295,R=V+(S<<20&4294967295|S>>>12),S=A+(V^M&(R^V))+D[13]+2850285829&4294967295,A=R+(S<<5&4294967295|S>>>27),S=M+(R^V&(A^R))+D[2]+4243563512&4294967295,M=A+(S<<9&4294967295|S>>>23),S=V+(A^R&(M^A))+D[7]+1735328473&4294967295,V=M+(S<<14&4294967295|S>>>18),S=R+(M^A&(V^M))+D[12]+2368359562&4294967295,R=V+(S<<20&4294967295|S>>>12),S=A+(R^V^M)+D[5]+4294588738&4294967295,A=R+(S<<4&4294967295|S>>>28),S=M+(A^R^V)+D[8]+2272392833&4294967295,M=A+(S<<11&4294967295|S>>>21),S=V+(M^A^R)+D[11]+1839030562&4294967295,V=M+(S<<16&4294967295|S>>>16),S=R+(V^M^A)+D[14]+4259657740&4294967295,R=V+(S<<23&4294967295|S>>>9),S=A+(R^V^M)+D[1]+2763975236&4294967295,A=R+(S<<4&4294967295|S>>>28),S=M+(A^R^V)+D[4]+1272893353&4294967295,M=A+(S<<11&4294967295|S>>>21),S=V+(M^A^R)+D[7]+4139469664&4294967295,V=M+(S<<16&4294967295|S>>>16),S=R+(V^M^A)+D[10]+3200236656&4294967295,R=V+(S<<23&4294967295|S>>>9),S=A+(R^V^M)+D[13]+681279174&4294967295,A=R+(S<<4&4294967295|S>>>28),S=M+(A^R^V)+D[0]+3936430074&4294967295,M=A+(S<<11&4294967295|S>>>21),S=V+(M^A^R)+D[3]+3572445317&4294967295,V=M+(S<<16&4294967295|S>>>16),S=R+(V^M^A)+D[6]+76029189&4294967295,R=V+(S<<23&4294967295|S>>>9),S=A+(R^V^M)+D[9]+3654602809&4294967295,A=R+(S<<4&4294967295|S>>>28),S=M+(A^R^V)+D[12]+3873151461&4294967295,M=A+(S<<11&4294967295|S>>>21),S=V+(M^A^R)+D[15]+530742520&4294967295,V=M+(S<<16&4294967295|S>>>16),S=R+(V^M^A)+D[2]+3299628645&4294967295,R=V+(S<<23&4294967295|S>>>9),S=A+(V^(R|~M))+D[0]+4096336452&4294967295,A=R+(S<<6&4294967295|S>>>26),S=M+(R^(A|~V))+D[7]+1126891415&4294967295,M=A+(S<<10&4294967295|S>>>22),S=V+(A^(M|~R))+D[14]+2878612391&4294967295,V=M+(S<<15&4294967295|S>>>17),S=R+(M^(V|~A))+D[5]+4237533241&4294967295,R=V+(S<<21&4294967295|S>>>11),S=A+(V^(R|~M))+D[12]+1700485571&4294967295,A=R+(S<<6&4294967295|S>>>26),S=M+(R^(A|~V))+D[3]+2399980690&4294967295,M=A+(S<<10&4294967295|S>>>22),S=V+(A^(M|~R))+D[10]+4293915773&4294967295,V=M+(S<<15&4294967295|S>>>17),S=R+(M^(V|~A))+D[1]+2240044497&4294967295,R=V+(S<<21&4294967295|S>>>11),S=A+(V^(R|~M))+D[8]+1873313359&4294967295,A=R+(S<<6&4294967295|S>>>26),S=M+(R^(A|~V))+D[15]+4264355552&4294967295,M=A+(S<<10&4294967295|S>>>22),S=V+(A^(M|~R))+D[6]+2734768916&4294967295,V=M+(S<<15&4294967295|S>>>17),S=R+(M^(V|~A))+D[13]+1309151649&4294967295,R=V+(S<<21&4294967295|S>>>11),S=A+(V^(R|~M))+D[4]+4149444226&4294967295,A=R+(S<<6&4294967295|S>>>26),S=M+(R^(A|~V))+D[11]+3174756917&4294967295,M=A+(S<<10&4294967295|S>>>22),S=V+(A^(M|~R))+D[2]+718787259&4294967295,V=M+(S<<15&4294967295|S>>>17),S=R+(M^(V|~A))+D[9]+3951481745&4294967295,C.g[0]=C.g[0]+A&4294967295,C.g[1]=C.g[1]+(V+(S<<21&4294967295|S>>>11))&4294967295,C.g[2]=C.g[2]+V&4294967295,C.g[3]=C.g[3]+M&4294967295}r.prototype.u=function(C,A){A===void 0&&(A=C.length);for(var R=A-this.blockSize,D=this.B,V=this.h,M=0;M<A;){if(V==0)for(;M<=R;)s(this,C,M),M+=this.blockSize;if(typeof C=="string"){for(;M<A;)if(D[V++]=C.charCodeAt(M++),V==this.blockSize){s(this,D),V=0;break}}else for(;M<A;)if(D[V++]=C[M++],V==this.blockSize){s(this,D),V=0;break}}this.h=V,this.o+=A},r.prototype.v=function(){var C=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);C[0]=128;for(var A=1;A<C.length-8;++A)C[A]=0;var R=8*this.o;for(A=C.length-8;A<C.length;++A)C[A]=R&255,R/=256;for(this.u(C),C=Array(16),A=R=0;4>A;++A)for(var D=0;32>D;D+=8)C[R++]=this.g[A]>>>D&255;return C};function a(C,A){var R=h;return Object.prototype.hasOwnProperty.call(R,C)?R[C]:R[C]=A(C)}function c(C,A){this.h=A;for(var R=[],D=!0,V=C.length-1;0<=V;V--){var M=C[V]|0;D&&M==A||(R[V]=M,D=!1)}this.g=R}var h={};function f(C){return-128<=C&&128>C?a(C,function(A){return new c([A|0],0>A?-1:0)}):new c([C|0],0>C?-1:0)}function m(C){if(isNaN(C)||!isFinite(C))return E;if(0>C)return j(m(-C));for(var A=[],R=1,D=0;C>=R;D++)A[D]=C/R|0,R*=4294967296;return new c(A,0)}function _(C,A){if(C.length==0)throw Error("number format error: empty string");if(A=A||10,2>A||36<A)throw Error("radix out of range: "+A);if(C.charAt(0)=="-")return j(_(C.substring(1),A));if(0<=C.indexOf("-"))throw Error('number format error: interior "-" character');for(var R=m(Math.pow(A,8)),D=E,V=0;V<C.length;V+=8){var M=Math.min(8,C.length-V),S=parseInt(C.substring(V,V+M),A);8>M?(M=m(Math.pow(A,M)),D=D.j(M).add(m(S))):(D=D.j(R),D=D.add(m(S)))}return D}var E=f(0),I=f(1),k=f(16777216);n=c.prototype,n.m=function(){if(G(this))return-j(this).m();for(var C=0,A=1,R=0;R<this.g.length;R++){var D=this.i(R);C+=(0<=D?D:4294967296+D)*A,A*=4294967296}return C},n.toString=function(C){if(C=C||10,2>C||36<C)throw Error("radix out of range: "+C);if(B(this))return"0";if(G(this))return"-"+j(this).toString(C);for(var A=m(Math.pow(C,6)),R=this,D="";;){var V=le(R,A).g;R=J(R,V.j(A));var M=((0<R.g.length?R.g[0]:R.h)>>>0).toString(C);if(R=V,B(R))return M+D;for(;6>M.length;)M="0"+M;D=M+D}},n.i=function(C){return 0>C?0:C<this.g.length?this.g[C]:this.h};function B(C){if(C.h!=0)return!1;for(var A=0;A<C.g.length;A++)if(C.g[A]!=0)return!1;return!0}function G(C){return C.h==-1}n.l=function(C){return C=J(this,C),G(C)?-1:B(C)?0:1};function j(C){for(var A=C.g.length,R=[],D=0;D<A;D++)R[D]=~C.g[D];return new c(R,~C.h).add(I)}n.abs=function(){return G(this)?j(this):this},n.add=function(C){for(var A=Math.max(this.g.length,C.g.length),R=[],D=0,V=0;V<=A;V++){var M=D+(this.i(V)&65535)+(C.i(V)&65535),S=(M>>>16)+(this.i(V)>>>16)+(C.i(V)>>>16);D=S>>>16,M&=65535,S&=65535,R[V]=S<<16|M}return new c(R,R[R.length-1]&-2147483648?-1:0)};function J(C,A){return C.add(j(A))}n.j=function(C){if(B(this)||B(C))return E;if(G(this))return G(C)?j(this).j(j(C)):j(j(this).j(C));if(G(C))return j(this.j(j(C)));if(0>this.l(k)&&0>C.l(k))return m(this.m()*C.m());for(var A=this.g.length+C.g.length,R=[],D=0;D<2*A;D++)R[D]=0;for(D=0;D<this.g.length;D++)for(var V=0;V<C.g.length;V++){var M=this.i(D)>>>16,S=this.i(D)&65535,pn=C.i(V)>>>16,Kt=C.i(V)&65535;R[2*D+2*V]+=S*Kt,ee(R,2*D+2*V),R[2*D+2*V+1]+=M*Kt,ee(R,2*D+2*V+1),R[2*D+2*V+1]+=S*pn,ee(R,2*D+2*V+1),R[2*D+2*V+2]+=M*pn,ee(R,2*D+2*V+2)}for(D=0;D<A;D++)R[D]=R[2*D+1]<<16|R[2*D];for(D=A;D<2*A;D++)R[D]=0;return new c(R,0)};function ee(C,A){for(;(C[A]&65535)!=C[A];)C[A+1]+=C[A]>>>16,C[A]&=65535,A++}function ne(C,A){this.g=C,this.h=A}function le(C,A){if(B(A))throw Error("division by zero");if(B(C))return new ne(E,E);if(G(C))return A=le(j(C),A),new ne(j(A.g),j(A.h));if(G(A))return A=le(C,j(A)),new ne(j(A.g),A.h);if(30<C.g.length){if(G(C)||G(A))throw Error("slowDivide_ only works with positive integers.");for(var R=I,D=A;0>=D.l(C);)R=de(R),D=de(D);var V=ie(R,1),M=ie(D,1);for(D=ie(D,2),R=ie(R,2);!B(D);){var S=M.add(D);0>=S.l(C)&&(V=V.add(R),M=S),D=ie(D,1),R=ie(R,1)}return A=J(C,V.j(A)),new ne(V,A)}for(V=E;0<=C.l(A);){for(R=Math.max(1,Math.floor(C.m()/A.m())),D=Math.ceil(Math.log(R)/Math.LN2),D=48>=D?1:Math.pow(2,D-48),M=m(R),S=M.j(A);G(S)||0<S.l(C);)R-=D,M=m(R),S=M.j(A);B(M)&&(M=I),V=V.add(M),C=J(C,S)}return new ne(V,C)}n.A=function(C){return le(this,C).h},n.and=function(C){for(var A=Math.max(this.g.length,C.g.length),R=[],D=0;D<A;D++)R[D]=this.i(D)&C.i(D);return new c(R,this.h&C.h)},n.or=function(C){for(var A=Math.max(this.g.length,C.g.length),R=[],D=0;D<A;D++)R[D]=this.i(D)|C.i(D);return new c(R,this.h|C.h)},n.xor=function(C){for(var A=Math.max(this.g.length,C.g.length),R=[],D=0;D<A;D++)R[D]=this.i(D)^C.i(D);return new c(R,this.h^C.h)};function de(C){for(var A=C.g.length+1,R=[],D=0;D<A;D++)R[D]=C.i(D)<<1|C.i(D-1)>>>31;return new c(R,C.h)}function ie(C,A){var R=A>>5;A%=32;for(var D=C.g.length-R,V=[],M=0;M<D;M++)V[M]=0<A?C.i(M+R)>>>A|C.i(M+R+1)<<32-A:C.i(M+R);return new c(V,C.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,sp=q0.Md5=r,c.prototype.add=c.prototype.add,c.prototype.multiply=c.prototype.j,c.prototype.modulo=c.prototype.A,c.prototype.compare=c.prototype.l,c.prototype.toNumber=c.prototype.m,c.prototype.toString=c.prototype.toString,c.prototype.getBits=c.prototype.i,c.fromNumber=m,c.fromString=_,Sr=q0.Integer=c}).apply(typeof $0!="undefined"?$0:typeof self!="undefined"?self:typeof window!="undefined"?window:{});var Hl=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Rr={};var op,A2,Ao,ap,uu,Ql,up,cp,lp;(function(){var n,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(u,d,g){return u==Array.prototype||u==Object.prototype||(u[d]=g.value),u};function t(u){u=[typeof globalThis=="object"&&globalThis,u,typeof window=="object"&&window,typeof self=="object"&&self,typeof Hl=="object"&&Hl];for(var d=0;d<u.length;++d){var g=u[d];if(g&&g.Math==Math)return g}throw Error("Cannot find global object")}var r=t(this);function s(u,d){if(d)e:{var g=r;u=u.split(".");for(var b=0;b<u.length-1;b++){var L=u[b];if(!(L in g))break e;g=g[L]}u=u[u.length-1],b=g[u],d=d(b),d!=b&&d!=null&&e(g,u,{configurable:!0,writable:!0,value:d})}}function a(u,d){u instanceof String&&(u+="");var g=0,b=!1,L={next:function(){if(!b&&g<u.length){var F=g++;return{value:d(F,u[F]),done:!1}}return b=!0,{done:!0,value:void 0}}};return L[Symbol.iterator]=function(){return L},L}s("Array.prototype.values",function(u){return u||function(){return a(this,function(d,g){return g})}});var c=c||{},h=this||self;function f(u){var d=typeof u;return d=d!="object"?d:u?Array.isArray(u)?"array":d:"null",d=="array"||d=="object"&&typeof u.length=="number"}function m(u){var d=typeof u;return d=="object"&&u!=null||d=="function"}function _(u,d,g){return u.call.apply(u.bind,arguments)}function E(u,d,g){if(!u)throw Error();if(2<arguments.length){var b=Array.prototype.slice.call(arguments,2);return function(){var L=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(L,b),u.apply(d,L)}}return function(){return u.apply(d,arguments)}}function I(u,d,g){return I=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?_:E,I.apply(null,arguments)}function k(u,d){var g=Array.prototype.slice.call(arguments,1);return function(){var b=g.slice();return b.push.apply(b,arguments),u.apply(this,b)}}function B(u,d){function g(){}g.prototype=d.prototype,u.aa=d.prototype,u.prototype=new g,u.prototype.constructor=u,u.Qb=function(b,L,F){for(var Q=Array(arguments.length-2),_e=2;_e<arguments.length;_e++)Q[_e-2]=arguments[_e];return d.prototype[L].apply(b,Q)}}function G(u){let d=u.length;if(0<d){let g=Array(d);for(let b=0;b<d;b++)g[b]=u[b];return g}return[]}function j(u,d){for(let g=1;g<arguments.length;g++){let b=arguments[g];if(f(b)){let L=u.length||0,F=b.length||0;u.length=L+F;for(let Q=0;Q<F;Q++)u[L+Q]=b[Q]}else u.push(b)}}class J{constructor(d,g){this.i=d,this.j=g,this.h=0,this.g=null}get(){let d;return 0<this.h?(this.h--,d=this.g,this.g=d.next,d.next=null):d=this.i(),d}}function ee(u){return/^[\s\xa0]*$/.test(u)}function ne(){var u=h.navigator;return u&&(u=u.userAgent)?u:""}function le(u){return le[" "](u),u}le[" "]=function(){};var de=ne().indexOf("Gecko")!=-1&&!(ne().toLowerCase().indexOf("webkit")!=-1&&ne().indexOf("Edge")==-1)&&!(ne().indexOf("Trident")!=-1||ne().indexOf("MSIE")!=-1)&&ne().indexOf("Edge")==-1;function ie(u,d,g){for(let b in u)d.call(g,u[b],b,u)}function C(u,d){for(let g in u)d.call(void 0,u[g],g,u)}function A(u){let d={};for(let g in u)d[g]=u[g];return d}let R="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function D(u,d){let g,b;for(let L=1;L<arguments.length;L++){b=arguments[L];for(g in b)u[g]=b[g];for(let F=0;F<R.length;F++)g=R[F],Object.prototype.hasOwnProperty.call(b,g)&&(u[g]=b[g])}}function V(u){var d=1;u=u.split(":");let g=[];for(;0<d&&u.length;)g.push(u.shift()),d--;return u.length&&g.push(u.join(":")),g}function M(u){h.setTimeout(()=>{throw u},0)}function S(){var u=Nt;let d=null;return u.g&&(d=u.g,u.g=u.g.next,u.g||(u.h=null),d.next=null),d}class pn{constructor(){this.h=this.g=null}add(d,g){let b=Kt.get();b.set(d,g),this.h?this.h.next=b:this.g=b,this.h=b}}var Kt=new J(()=>new Cn,u=>u.reset());class Cn{constructor(){this.next=this.g=this.h=null}set(d,g){this.h=d,this.g=g,this.next=null}reset(){this.next=this.g=this.h=null}}let Ai,Dn=!1,Nt=new pn,sc=()=>{let u=h.Promise.resolve(void 0);Ai=()=>{u.then(yf)}};var yf=()=>{for(var u;u=S();){try{u.h.call(u.g)}catch(g){M(g)}var d=Kt;d.j(u),100>d.h&&(d.h++,u.next=d.g,d.g=u)}Dn=!1};function On(){this.s=this.s,this.C=this.C}On.prototype.s=!1,On.prototype.ma=function(){this.s||(this.s=!0,this.N())},On.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function Ge(u,d){this.type=u,this.g=this.target=d,this.defaultPrevented=!1}Ge.prototype.h=function(){this.defaultPrevented=!0};var Cs=function(){if(!h.addEventListener||!Object.defineProperty)return!1;var u=!1,d=Object.defineProperty({},"passive",{get:function(){u=!0}});try{let g=()=>{};h.addEventListener("test",g,d),h.removeEventListener("test",g,d)}catch{}return u}();function Si(u,d){if(Ge.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 g=this.type=u.type,b=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;if(this.target=u.target||u.srcElement,this.g=d,d=u.relatedTarget){if(de){e:{try{le(d.nodeName);var L=!0;break e}catch{}L=!1}L||(d=null)}}else g=="mouseover"?d=u.fromElement:g=="mouseout"&&(d=u.toElement);this.relatedTarget=d,b?(this.clientX=b.clientX!==void 0?b.clientX:b.pageX,this.clientY=b.clientY!==void 0?b.clientY:b.pageY,this.screenX=b.screenX||0,this.screenY=b.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:Ri[u.pointerType]||"",this.state=u.state,this.i=u,u.defaultPrevented&&Si.aa.h.call(this)}}B(Si,Ge);var Ri={2:"touch",3:"pen",4:"mouse"};Si.prototype.h=function(){Si.aa.h.call(this);var u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var mn="closure_listenable_"+(1e6*Math.random()|0),vf=0;function Ds(u,d,g,b,L){this.listener=u,this.proxy=null,this.src=d,this.type=g,this.capture=!!b,this.ha=L,this.key=++vf,this.da=this.fa=!1}function rr(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Pi(u){this.src=u,this.g={},this.h=0}Pi.prototype.add=function(u,d,g,b,L){var F=u.toString();u=this.g[F],u||(u=this.g[F]=[],this.h++);var Q=ir(u,d,b,L);return-1<Q?(d=u[Q],g||(d.fa=!1)):(d=new Ds(d,this.src,F,!!b,L),d.fa=g,u.push(d)),d};function St(u,d){var g=d.type;if(g in u.g){var b=u.g[g],L=Array.prototype.indexOf.call(b,d,void 0),F;(F=0<=L)&&Array.prototype.splice.call(b,L,1),F&&(rr(d),u.g[g].length==0&&(delete u.g[g],u.h--))}}function ir(u,d,g,b){for(var L=0;L<u.length;++L){var F=u[L];if(!F.da&&F.listener==d&&F.capture==!!g&&F.ha==b)return L}return-1}var da="closure_lm_"+(1e6*Math.random()|0),Wt={};function pa(u,d,g,b,L){if(b&&b.once)return Vt(u,d,g,b,L);if(Array.isArray(d)){for(var F=0;F<d.length;F++)pa(u,d[F],g,b,L);return null}return g=kn(g),u&&u[mn]?u.K(d,g,m(b)?!!b.capture:!!b,L):oc(u,d,g,!1,b,L)}function oc(u,d,g,b,L,F){if(!d)throw Error("Invalid event type");var Q=m(L)?!!L.capture:!!L,_e=ma(u);if(_e||(u[da]=_e=new Pi(u)),g=_e.add(d,g,b,Q,F),g.proxy)return g;if(b=Ci(),g.proxy=b,b.src=u,b.listener=g,u.addEventListener)Cs||(L=Q),L===void 0&&(L=!1),u.addEventListener(d.toString(),b,L);else if(u.attachEvent)u.attachEvent(ac(d.toString()),b);else if(u.addListener&&u.removeListener)u.addListener(b);else throw Error("addEventListener and attachEvent are unavailable.");return g}function Ci(){function u(g){return d.call(u.src,u.listener,g)}let d=Di;return u}function Vt(u,d,g,b,L){if(Array.isArray(d)){for(var F=0;F<d.length;F++)Vt(u,d[F],g,b,L);return null}return g=kn(g),u&&u[mn]?u.L(d,g,m(b)?!!b.capture:!!b,L):oc(u,d,g,!0,b,L)}function Lr(u,d,g,b,L){if(Array.isArray(d))for(var F=0;F<d.length;F++)Lr(u,d[F],g,b,L);else b=m(b)?!!b.capture:!!b,g=kn(g),u&&u[mn]?(u=u.i,d=String(d).toString(),d in u.g&&(F=u.g[d],g=ir(F,g,b,L),-1<g&&(rr(F[g]),Array.prototype.splice.call(F,g,1),F.length==0&&(delete u.g[d],u.h--)))):u&&(u=ma(u))&&(d=u.g[d.toString()],u=-1,d&&(u=ir(d,g,b,L)),(g=-1<u?d[u]:null)&&Mr(g))}function Mr(u){if(typeof u!="number"&&u&&!u.da){var d=u.src;if(d&&d[mn])St(d.i,u);else{var g=u.type,b=u.proxy;d.removeEventListener?d.removeEventListener(g,b,u.capture):d.detachEvent?d.detachEvent(ac(g),b):d.addListener&&d.removeListener&&d.removeListener(b),(g=ma(d))?(St(g,u),g.h==0&&(g.src=null,d[da]=null)):rr(u)}}}function ac(u){return u in Wt?Wt[u]:Wt[u]="on"+u}function Di(u,d){if(u.da)u=!0;else{d=new Si(d,this);var g=u.listener,b=u.ha||u.src;u.fa&&Mr(u),u=g.call(b,d)}return u}function ma(u){return u=u[da],u instanceof Pi?u:null}var sr="__closure_events_fn_"+(1e9*Math.random()>>>0);function kn(u){return typeof u=="function"?u:(u[sr]||(u[sr]=function(d){return u.handleEvent(d)}),u[sr])}function nt(){On.call(this),this.i=new Pi(this),this.M=this,this.F=null}B(nt,On),nt.prototype[mn]=!0,nt.prototype.removeEventListener=function(u,d,g,b){Lr(this,u,d,g,b)};function at(u,d){var g,b=u.F;if(b)for(g=[];b;b=b.F)g.push(b);if(u=u.M,b=d.type||d,typeof d=="string")d=new Ge(d,u);else if(d instanceof Ge)d.target=d.target||u;else{var L=d;d=new Ge(b,u),D(d,L)}if(L=!0,g)for(var F=g.length-1;0<=F;F--){var Q=d.g=g[F];L=Fr(Q,b,!0,d)&&L}if(Q=d.g=u,L=Fr(Q,b,!0,d)&&L,L=Fr(Q,b,!1,d)&&L,g)for(F=0;F<g.length;F++)Q=d.g=g[F],L=Fr(Q,b,!1,d)&&L}nt.prototype.N=function(){if(nt.aa.N.call(this),this.i){var u=this.i,d;for(d in u.g){for(var g=u.g[d],b=0;b<g.length;b++)rr(g[b]);delete u.g[d],u.h--}}this.F=null},nt.prototype.K=function(u,d,g,b){return this.i.add(String(u),d,!1,g,b)},nt.prototype.L=function(u,d,g,b){return this.i.add(String(u),d,!0,g,b)};function Fr(u,d,g,b){if(d=u.i.g[String(d)],!d)return!0;d=d.concat();for(var L=!0,F=0;F<d.length;++F){var Q=d[F];if(Q&&!Q.da&&Q.capture==g){var _e=Q.listener,Xe=Q.ha||Q.src;Q.fa&&St(u.i,Q),L=_e.call(Xe,b)!==!1&&L}}return L&&!b.defaultPrevented}function Os(u,d,g){if(typeof u=="function")g&&(u=I(u,g));else if(u&&typeof u.handleEvent=="function")u=I(u.handleEvent,u);else throw Error("Invalid listener argument");return 2147483647<Number(d)?-1:h.setTimeout(u,d||0)}function ks(u){u.g=Os(()=>{u.g=null,u.i&&(u.i=!1,ks(u))},u.l);let d=u.h;u.h=null,u.m.apply(null,d)}class ga extends On{constructor(d,g){super(),this.m=d,this.l=g,this.h=null,this.i=!1,this.g=null}j(d){this.h=arguments,this.g?this.i=!0:ks(this)}N(){super.N(),this.g&&(h.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function or(u){On.call(this),this.h=u,this.g={}}B(or,On);var Ns=[];function Vs(u){ie(u.g,function(d,g){this.g.hasOwnProperty(g)&&Mr(d)},u),u.g={}}or.prototype.N=function(){or.aa.N.call(this),Vs(this)},or.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var _a=h.JSON.stringify,wf=h.JSON.parse,bf=class{stringify(u){return h.JSON.stringify(u,void 0)}parse(u){return h.JSON.parse(u,void 0)}};function Ls(){}Ls.prototype.h=null;function ya(u){return u.h||(u.h=u.i())}function uc(){}var Oi={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function va(){Ge.call(this,"d")}B(va,Ge);function wa(){Ge.call(this,"c")}B(wa,Ge);var Nn={},cc=null;function Ms(){return cc=cc||new nt}Nn.La="serverreachability";function lc(u){Ge.call(this,Nn.La,u)}B(lc,Ge);function ar(u){let d=Ms();at(d,new lc(d))}Nn.STAT_EVENT="statevent";function hc(u,d){Ge.call(this,Nn.STAT_EVENT,u),this.stat=d}B(hc,Ge);function ut(u){let d=Ms();at(d,new hc(d,u))}Nn.Ma="timingevent";function fc(u,d){Ge.call(this,Nn.Ma,u),this.size=d}B(fc,Ge);function ki(u,d){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return h.setTimeout(function(){u()},d)}function Ni(){this.g=!0}Ni.prototype.xa=function(){this.g=!1};function Tf(u,d,g,b,L,F){u.info(function(){if(u.g)if(F)for(var Q="",_e=F.split("&"),Xe=0;Xe<_e.length;Xe++){var be=_e[Xe].split("=");if(1<be.length){var ct=be[0];be=be[1];var lt=ct.split("_");Q=2<=lt.length&&lt[1]=="type"?Q+(ct+"="+be+"&"):Q+(ct+"=redacted&")}}else Q=null;else Q=F;return"XMLHTTP REQ ("+b+") [attempt "+L+"]: "+d+`
21
+ `+g+`
22
+ `+Q})}function Ef(u,d,g,b,L,F,Q){u.info(function(){return"XMLHTTP RESP ("+b+") [ attempt "+L+"]: "+d+`
23
+ `+g+`
24
+ `+F+" "+Q})}function Ur(u,d,g,b){u.info(function(){return"XMLHTTP TEXT ("+d+"): "+xf(u,g)+(b?" "+b:"")})}function If(u,d){u.info(function(){return"TIMEOUT: "+d})}Ni.prototype.info=function(){};function xf(u,d){if(!u.g)return d;if(!d)return null;try{var g=JSON.parse(d);if(g){for(u=0;u<g.length;u++)if(Array.isArray(g[u])){var b=g[u];if(!(2>b.length)){var L=b[1];if(Array.isArray(L)&&!(1>L.length)){var F=L[0];if(F!="noop"&&F!="stop"&&F!="close")for(var Q=1;Q<L.length;Q++)L[Q]=""}}}}return _a(g)}catch{return d}}var Vi={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},dc={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},ba;function Fs(){}B(Fs,Ls),Fs.prototype.g=function(){return new XMLHttpRequest},Fs.prototype.i=function(){return{}},ba=new Fs;function Vn(u,d,g,b){this.j=u,this.i=d,this.l=g,this.R=b||1,this.U=new or(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 pc}function pc(){this.i=null,this.g="",this.h=!1}var mc={},Br={};function Ta(u,d,g){u.L=1,u.v=Ui(_n(d)),u.m=g,u.P=!0,Li(u,null)}function Li(u,d){u.F=Date.now(),Us(u),u.A=_n(u.v);var g=u.A,b=u.R;Array.isArray(b)||(b=[String(b)]),Sc(g.i,"t",b),u.C=0,g=u.j.J,u.h=new pc,u.g=Na(u.j,g?d:null,!u.m),0<u.O&&(u.M=new ga(I(u.Y,u,u.g),u.O)),d=u.U,g=u.g,b=u.ca;var L="readystatechange";Array.isArray(L)||(L&&(Ns[0]=L.toString()),L=Ns);for(var F=0;F<L.length;F++){var Q=pa(g,L[F],b||d.handleEvent,!1,d.h||d);if(!Q)break;d.g[Q.key]=Q}d=u.H?A(u.H):{},u.m?(u.u||(u.u="POST"),d["Content-Type"]="application/x-www-form-urlencoded",u.g.ea(u.A,u.u,u.m,d)):(u.u="GET",u.g.ea(u.A,u.u,null,d)),ar(),Tf(u.i,u.u,u.A,u.l,u.R,u.m)}Vn.prototype.ca=function(u){u=u.target;let d=this.M;d&&We(u)==3?d.j():this.Y(u)},Vn.prototype.Y=function(u){try{if(u==this.g)e:{let lt=We(this.g);var d=this.g.Ba();let Hr=this.g.Z();if(!(3>lt)&&(lt!=3||this.g&&(this.h.h||this.g.oa()||Oa(this.g)))){this.J||lt!=4||d==7||(d==8||0>=Hr?ar(3):ar(2)),Bs(this);var g=this.g.Z();this.X=g;t:if(gc(this)){var b=Oa(this.g);u="";var L=b.length,F=We(this.g)==4;if(!this.h.i){if(typeof TextDecoder=="undefined"){ur(this),jr(this);var Q="";break t}this.h.i=new h.TextDecoder}for(d=0;d<L;d++)this.h.h=!0,u+=this.h.i.decode(b[d],{stream:!(F&&d==L-1)});b.length=0,this.h.g+=u,this.C=0,Q=this.h.g}else Q=this.g.oa();if(this.o=g==200,Ef(this.i,this.u,this.A,this.l,this.R,lt,g),this.o){if(this.T&&!this.K){t:{if(this.g){var _e,Xe=this.g;if((_e=Xe.g?Xe.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!ee(_e)){var be=_e;break t}}be=null}if(g=be)Ur(this.i,this.l,g,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,Ia(this,g);else{this.o=!1,this.s=3,ut(12),ur(this),jr(this);break e}}if(this.P){g=!0;let Ht;for(;!this.J&&this.C<Q.length;)if(Ht=Af(this,Q),Ht==Br){lt==4&&(this.s=4,ut(14),g=!1),Ur(this.i,this.l,null,"[Incomplete Response]");break}else if(Ht==mc){this.s=4,ut(15),Ur(this.i,this.l,Q,"[Invalid Chunk]"),g=!1;break}else Ur(this.i,this.l,Ht,null),Ia(this,Ht);if(gc(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),lt!=4||Q.length!=0||this.h.h||(this.s=1,ut(16),g=!1),this.o=this.o&&g,!g)Ur(this.i,this.l,Q,"[Invalid Chunked Response]"),ur(this),jr(this);else if(0<Q.length&&!this.W){this.W=!0;var ct=this.j;ct.g==this&&ct.ba&&!ct.M&&(ct.j.info("Great, no buffering proxy detected. Bytes received: "+Q.length),Fe(ct),ct.M=!0,ut(11))}}else Ur(this.i,this.l,Q,null),Ia(this,Q);lt==4&&ur(this),this.o&&!this.J&&(lt==4?kc(this.j,this):(this.o=!1,Us(this)))}else Dc(this.g),g==400&&0<Q.indexOf("Unknown SID")?(this.s=3,ut(12)):(this.s=0,ut(13)),ur(this),jr(this)}}}catch{}finally{}};function gc(u){return u.g?u.u=="GET"&&u.L!=2&&u.j.Ca:!1}function Af(u,d){var g=u.C,b=d.indexOf(`
25
+ `,g);return b==-1?Br:(g=Number(d.substring(g,b)),isNaN(g)?mc:(b+=1,b+g>d.length?Br:(d=d.slice(b,b+g),u.C=b+g,d)))}Vn.prototype.cancel=function(){this.J=!0,ur(this)};function Us(u){u.S=Date.now()+u.I,Ea(u,u.I)}function Ea(u,d){if(u.B!=null)throw Error("WatchDog timer not null");u.B=ki(I(u.ba,u),d)}function Bs(u){u.B&&(h.clearTimeout(u.B),u.B=null)}Vn.prototype.ba=function(){this.B=null;let u=Date.now();0<=u-this.S?(If(this.i,this.A),this.L!=2&&(ar(),ut(17)),ur(this),this.s=2,jr(this)):Ea(this,this.S-u)};function jr(u){u.j.G==0||u.J||kc(u.j,u)}function ur(u){Bs(u);var d=u.M;d&&typeof d.ma=="function"&&d.ma(),u.M=null,Vs(u.U),u.g&&(d=u.g,u.g=null,d.abort(),d.ma())}function Ia(u,d){try{var g=u.j;if(g.G!=0&&(g.g==u||js(g.h,u))){if(!u.K&&js(g.h,u)&&g.G==3){try{var b=g.Da.g.parse(d)}catch{b=null}if(Array.isArray(b)&&b.length==3){var L=b;if(L[0]==0){e:if(!g.u){if(g.g)if(g.g.F+3e3<u.F)Wr(g),Gi(g);else break e;Wi(g),ut(18)}}else g.za=L[1],0<g.za-g.T&&37500>L[2]&&g.F&&g.v==0&&!g.C&&(g.C=ki(I(g.Za,g),6e3));if(1>=Aa(g.h)&&g.ca){try{g.ca()}catch{}g.ca=void 0}}else cr(g,11)}else if((u.K||g.g==u)&&Wr(g),!ee(d))for(L=g.Da.g.parse(d),d=0;d<L.length;d++){let be=L[d];if(g.T=be[0],be=be[1],g.G==2)if(be[0]=="c"){g.K=be[1],g.ia=be[2];let ct=be[3];ct!=null&&(g.la=ct,g.j.info("VER="+g.la));let lt=be[4];lt!=null&&(g.Aa=lt,g.j.info("SVER="+g.Aa));let Hr=be[5];Hr!=null&&typeof Hr=="number"&&0<Hr&&(b=1.5*Hr,g.L=b,g.j.info("backChannelRequestTimeoutMs_="+b)),b=g;let Ht=u.g;if(Ht){let Qs=Ht.g?Ht.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Qs){var F=b.h;F.g||Qs.indexOf("spdy")==-1&&Qs.indexOf("quic")==-1&&Qs.indexOf("h2")==-1||(F.j=F.l,F.g=new Set,F.h&&(Mi(F,F.h),F.h=null))}if(b.D){let Ma=Ht.g?Ht.g.getResponseHeader("X-HTTP-Session-Id"):null;Ma&&(b.ya=Ma,Ce(b.I,b.D,Ma))}}g.G=3,g.l&&g.l.ua(),g.ba&&(g.R=Date.now()-u.F,g.j.info("Handshake RTT: "+g.R+"ms")),b=g;var Q=u;if(b.qa=Vc(b,b.J?b.ia:null,b.W),Q.K){yc(b.h,Q);var _e=Q,Xe=b.L;Xe&&(_e.I=Xe),_e.B&&(Bs(_e),Us(_e)),b.g=Q}else Ki(b);0<g.i.length&&Ws(g)}else be[0]!="stop"&&be[0]!="close"||cr(g,7);else g.G==3&&(be[0]=="stop"||be[0]=="close"?be[0]=="stop"?cr(g,7):Ks(g):be[0]!="noop"&&g.l&&g.l.ta(be),g.v=0)}}ar(4)}catch{}}var Sf=class{constructor(u,d){this.g=u,this.map=d}};function _c(u){this.l=u||10,h.PerformanceNavigationTiming?(u=h.performance.getEntriesByType("navigation"),u=0<u.length&&(u[0].nextHopProtocol=="hq"||u[0].nextHopProtocol=="h2")):u=!!(h.chrome&&h.chrome.loadTimes&&h.chrome.loadTimes()&&h.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 xa(u){return u.h?!0:u.g?u.g.size>=u.j:!1}function Aa(u){return u.h?1:u.g?u.g.size:0}function js(u,d){return u.h?u.h==d:u.g?u.g.has(d):!1}function Mi(u,d){u.g?u.g.add(d):u.h=d}function yc(u,d){u.h&&u.h==d?u.h=null:u.g&&u.g.has(d)&&u.g.delete(d)}_c.prototype.cancel=function(){if(this.i=Sa(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 Sa(u){if(u.h!=null)return u.i.concat(u.h.D);if(u.g!=null&&u.g.size!==0){let d=u.i;for(let g of u.g.values())d=d.concat(g.D);return d}return G(u.i)}function $s(u){if(u.V&&typeof u.V=="function")return u.V();if(typeof Map!="undefined"&&u instanceof Map||typeof Set!="undefined"&&u instanceof Set)return Array.from(u.values());if(typeof u=="string")return u.split("");if(f(u)){for(var d=[],g=u.length,b=0;b<g;b++)d.push(u[b]);return d}d=[],g=0;for(b in u)d[g++]=u[b];return d}function vc(u){if(u.na&&typeof u.na=="function")return u.na();if(!u.V||typeof u.V!="function"){if(typeof Map!="undefined"&&u instanceof Map)return Array.from(u.keys());if(!(typeof Set!="undefined"&&u instanceof Set)){if(f(u)||typeof u=="string"){var d=[];u=u.length;for(var g=0;g<u;g++)d.push(g);return d}d=[],g=0;for(let b in u)d[g++]=b;return d}}}function wc(u,d){if(u.forEach&&typeof u.forEach=="function")u.forEach(d,void 0);else if(f(u)||typeof u=="string")Array.prototype.forEach.call(u,d,void 0);else for(var g=vc(u),b=$s(u),L=b.length,F=0;F<L;F++)d.call(void 0,b[F],g&&g[F],u)}var Ra=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function bc(u,d){if(u){u=u.split("&");for(var g=0;g<u.length;g++){var b=u[g].indexOf("="),L=null;if(0<=b){var F=u[g].substring(0,b);L=u[g].substring(b+1)}else F=u[g];d(F,L?decodeURIComponent(L.replace(/\+/g," ")):"")}}}function gn(u){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,u instanceof gn){this.h=u.h,Fi(this,u.j),this.o=u.o,this.g=u.g,$r(this,u.s),this.l=u.l;var d=u.i,g=new ji;g.i=d.i,d.g&&(g.g=new Map(d.g),g.h=d.h),qs(this,g),this.m=u.m}else u&&(d=String(u).match(Ra))?(this.h=!1,Fi(this,d[1]||"",!0),this.o=qr(d[2]||""),this.g=qr(d[3]||"",!0),$r(this,d[4]),this.l=qr(d[5]||"",!0),qs(this,d[6]||"",!0),this.m=qr(d[7]||"")):(this.h=!1,this.i=new ji(null,this.h))}gn.prototype.toString=function(){var u=[],d=this.j;d&&u.push(Bi(d,Pa,!0),":");var g=this.g;return(g||d=="file")&&(u.push("//"),(d=this.o)&&u.push(Bi(d,Pa,!0),"@"),u.push(encodeURIComponent(String(g)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),g=this.s,g!=null&&u.push(":",String(g))),(g=this.l)&&(this.g&&g.charAt(0)!="/"&&u.push("/"),u.push(Bi(g,g.charAt(0)=="/"?Ic:Ec,!0))),(g=this.i.toString())&&u.push("?",g),(g=this.m)&&u.push("#",Bi(g,Pf)),u.join("")};function _n(u){return new gn(u)}function Fi(u,d,g){u.j=g?qr(d,!0):d,u.j&&(u.j=u.j.replace(/:$/,""))}function $r(u,d){if(d){if(d=Number(d),isNaN(d)||0>d)throw Error("Bad port number "+d);u.s=d}else u.s=null}function qs(u,d,g){d instanceof ji?(u.i=d,Ca(u.i,u.h)):(g||(d=Bi(d,Rf)),u.i=new ji(d,u.h))}function Ce(u,d,g){u.i.set(d,g)}function Ui(u){return Ce(u,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),u}function qr(u,d){return u?d?decodeURI(u.replace(/%25/g,"%2525")):decodeURIComponent(u):""}function Bi(u,d,g){return typeof u=="string"?(u=encodeURI(u).replace(d,Tc),g&&(u=u.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),u):null}function Tc(u){return u=u.charCodeAt(0),"%"+(u>>4&15).toString(16)+(u&15).toString(16)}var Pa=/[#\/\?@]/g,Ec=/[#\?:]/g,Ic=/[#\?]/g,Rf=/[#\?@]/g,Pf=/#/g;function ji(u,d){this.h=this.g=null,this.i=u||null,this.j=!!d}function yn(u){u.g||(u.g=new Map,u.h=0,u.i&&bc(u.i,function(d,g){u.add(decodeURIComponent(d.replace(/\+/g," ")),g)}))}n=ji.prototype,n.add=function(u,d){yn(this),this.i=null,u=zr(this,u);var g=this.g.get(u);return g||this.g.set(u,g=[]),g.push(d),this.h+=1,this};function xc(u,d){yn(u),d=zr(u,d),u.g.has(d)&&(u.i=null,u.h-=u.g.get(d).length,u.g.delete(d))}function Ac(u,d){return yn(u),d=zr(u,d),u.g.has(d)}n.forEach=function(u,d){yn(this),this.g.forEach(function(g,b){g.forEach(function(L){u.call(d,L,b,this)},this)},this)},n.na=function(){yn(this);let u=Array.from(this.g.values()),d=Array.from(this.g.keys()),g=[];for(let b=0;b<d.length;b++){let L=u[b];for(let F=0;F<L.length;F++)g.push(d[b])}return g},n.V=function(u){yn(this);let d=[];if(typeof u=="string")Ac(this,u)&&(d=d.concat(this.g.get(zr(this,u))));else{u=Array.from(this.g.values());for(let g=0;g<u.length;g++)d=d.concat(u[g])}return d},n.set=function(u,d){return yn(this),this.i=null,u=zr(this,u),Ac(this,u)&&(this.h-=this.g.get(u).length),this.g.set(u,[d]),this.h+=1,this},n.get=function(u,d){return u?(u=this.V(u),0<u.length?String(u[0]):d):d};function Sc(u,d,g){xc(u,d),0<g.length&&(u.i=null,u.g.set(zr(u,d),G(g)),u.h+=g.length)}n.toString=function(){if(this.i)return this.i;if(!this.g)return"";let u=[],d=Array.from(this.g.keys());for(var g=0;g<d.length;g++){var b=d[g];let F=encodeURIComponent(String(b)),Q=this.V(b);for(b=0;b<Q.length;b++){var L=F;Q[b]!==""&&(L+="="+encodeURIComponent(String(Q[b]))),u.push(L)}}return this.i=u.join("&")};function zr(u,d){return d=String(d),u.j&&(d=d.toLowerCase()),d}function Ca(u,d){d&&!u.j&&(yn(u),u.i=null,u.g.forEach(function(g,b){var L=b.toLowerCase();b!=L&&(xc(this,b),Sc(this,L,g))},u)),u.j=d}function Cf(u,d){let g=new Ni;if(h.Image){let b=new Image;b.onload=k(Ln,g,"TestLoadImage: loaded",!0,d,b),b.onerror=k(Ln,g,"TestLoadImage: error",!1,d,b),b.onabort=k(Ln,g,"TestLoadImage: abort",!1,d,b),b.ontimeout=k(Ln,g,"TestLoadImage: timeout",!1,d,b),h.setTimeout(function(){b.ontimeout&&b.ontimeout()},1e4),b.src=u}else d(!1)}function Df(u,d){let g=new Ni,b=new AbortController,L=setTimeout(()=>{b.abort(),Ln(g,"TestPingServer: timeout",!1,d)},1e4);fetch(u,{signal:b.signal}).then(F=>{clearTimeout(L),F.ok?Ln(g,"TestPingServer: ok",!0,d):Ln(g,"TestPingServer: server error",!1,d)}).catch(()=>{clearTimeout(L),Ln(g,"TestPingServer: error",!1,d)})}function Ln(u,d,g,b,L){try{L&&(L.onload=null,L.onerror=null,L.onabort=null,L.ontimeout=null),b(g)}catch{}}function Of(){this.g=new bf}function kf(u,d,g){let b=g||"";try{wc(u,function(L,F){let Q=L;m(L)&&(Q=_a(L)),d.push(b+F+"="+encodeURIComponent(Q))})}catch(L){throw d.push(b+"type="+encodeURIComponent("_badmap")),L}}function Oe(u){this.l=u.Ub||null,this.j=u.eb||!1}B(Oe,Ls),Oe.prototype.g=function(){return new ke(this.l,this.j)},Oe.prototype.i=function(u){return function(){return u}}({});function ke(u,d){nt.call(this),this.D=u,this.o=d,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}B(ke,nt),n=ke.prototype,n.open=function(u,d){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=u,this.A=d,this.readyState=1,qi(this)},n.send=function(u){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;let d={headers:this.u,method:this.B,credentials:this.m,cache:void 0};u&&(d.body=u),(this.D||h).fetch(new Request(this.A,d)).then(this.Sa.bind(this),this.ga.bind(this))},n.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,$i(this)),this.readyState=0},n.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,qi(this)),this.g&&(this.readyState=3,qi(this),this.g)))if(this.responseType==="arraybuffer")u.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof h.ReadableStream!="undefined"&&"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;Rc(this)}else u.text().then(this.Ra.bind(this),this.ga.bind(this))};function Rc(u){u.j.read().then(u.Pa.bind(u)).catch(u.ga.bind(u))}n.Pa=function(u){if(this.g){if(this.o&&u.value)this.response.push(u.value);else if(!this.o){var d=u.value?u.value:new Uint8Array(0);(d=this.v.decode(d,{stream:!u.done}))&&(this.response=this.responseText+=d)}u.done?$i(this):qi(this),this.readyState==3&&Rc(this)}},n.Ra=function(u){this.g&&(this.response=this.responseText=u,$i(this))},n.Qa=function(u){this.g&&(this.response=u,$i(this))},n.ga=function(){this.g&&$i(this)};function $i(u){u.readyState=4,u.l=null,u.j=null,u.v=null,qi(u)}n.setRequestHeader=function(u,d){this.u.append(u,d)},n.getResponseHeader=function(u){return this.h&&this.h.get(u.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";let u=[],d=this.h.entries();for(var g=d.next();!g.done;)g=g.value,u.push(g[0]+": "+g[1]),g=d.next();return u.join(`\r
26
+ `)};function qi(u){u.onreadystatechange&&u.onreadystatechange.call(u)}Object.defineProperty(ke.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(u){this.m=u?"include":"same-origin"}});function Pc(u){let d="";return ie(u,function(g,b){d+=b,d+=":",d+=g,d+=`\r
27
+ `}),d}function Da(u,d,g){e:{for(b in g){var b=!1;break e}b=!0}b||(g=Pc(g),typeof u=="string"?g!=null&&encodeURIComponent(String(g)):Ce(u,d,g))}function qe(u){nt.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}B(qe,nt);var Cc=/^https?$/i,Nf=["POST","PUT"];n=qe.prototype,n.Ha=function(u){this.J=u},n.ea=function(u,d,g,b){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+u);d=d?d.toUpperCase():"GET",this.D=u,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():ba.g(),this.v=this.o?ya(this.o):ya(ba),this.g.onreadystatechange=I(this.Ea,this);try{this.B=!0,this.g.open(d,String(u),!0),this.B=!1}catch(F){Ye(this,F);return}if(u=g||"",g=new Map(this.headers),b)if(Object.getPrototypeOf(b)===Object.prototype)for(var L in b)g.set(L,b[L]);else if(typeof b.keys=="function"&&typeof b.get=="function")for(let F of b.keys())g.set(F,b.get(F));else throw Error("Unknown input type for opt_headers: "+String(b));b=Array.from(g.keys()).find(F=>F.toLowerCase()=="content-type"),L=h.FormData&&u instanceof h.FormData,!(0<=Array.prototype.indexOf.call(Nf,d,void 0))||b||L||g.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(let[F,Q]of g)this.g.setRequestHeader(F,Q);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Gs(this),this.u=!0,this.g.send(u),this.u=!1}catch(F){Ye(this,F)}};function Ye(u,d){u.h=!1,u.g&&(u.j=!0,u.g.abort(),u.j=!1),u.l=d,u.m=5,zs(u),zi(u)}function zs(u){u.A||(u.A=!0,at(u,"complete"),at(u,"error"))}n.abort=function(u){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=u||7,at(this,"complete"),at(this,"abort"),zi(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),zi(this,!0)),qe.aa.N.call(this)},n.Ea=function(){this.s||(this.B||this.u||this.j?Mn(this):this.bb())},n.bb=function(){Mn(this)};function Mn(u){if(u.h&&typeof c!="undefined"&&(!u.v[1]||We(u)!=4||u.Z()!=2)){if(u.u&&We(u)==4)Os(u.Ea,0,u);else if(at(u,"readystatechange"),We(u)==4){u.h=!1;try{let Q=u.Z();e:switch(Q){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var d=!0;break e;default:d=!1}var g;if(!(g=d)){var b;if(b=Q===0){var L=String(u.D).match(Ra)[1]||null;!L&&h.self&&h.self.location&&(L=h.self.location.protocol.slice(0,-1)),b=!Cc.test(L?L.toLowerCase():"")}g=b}if(g)at(u,"complete"),at(u,"success");else{u.m=6;try{var F=2<We(u)?u.g.statusText:""}catch{F=""}u.l=F+" ["+u.Z()+"]",zs(u)}}finally{zi(u)}}}}function zi(u,d){if(u.g){Gs(u);let g=u.g,b=u.v[0]?()=>{}:null;u.g=null,u.v=null,d||at(u,"ready");try{g.onreadystatechange=b}catch{}}}function Gs(u){u.I&&(h.clearTimeout(u.I),u.I=null)}n.isActive=function(){return!!this.g};function We(u){return u.g?u.g.readyState:0}n.Z=function(){try{return 2<We(this)?this.g.status:-1}catch{return-1}},n.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},n.Oa=function(u){if(this.g){var d=this.g.responseText;return u&&d.indexOf(u)==0&&(d=d.substring(u.length)),wf(d)}};function Oa(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 Dc(u){let d={};u=(u.g&&2<=We(u)&&u.g.getAllResponseHeaders()||"").split(`\r
28
+ `);for(let b=0;b<u.length;b++){if(ee(u[b]))continue;var g=V(u[b]);let L=g[0];if(g=g[1],typeof g!="string")continue;g=g.trim();let F=d[L]||[];d[L]=F,F.push(g)}C(d,function(b){return b.join(", ")})}n.Ba=function(){return this.m},n.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Gr(u,d,g){return g&&g.internalChannelParams&&g.internalChannelParams[u]||d}function ka(u){this.Aa=0,this.i=[],this.j=new Ni,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=Gr("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=Gr("baseRetryDelayMs",5e3,u),this.cb=Gr("retryDelaySeedMs",1e4,u),this.Wa=Gr("forwardChannelMaxRetries",2,u),this.wa=Gr("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 _c(u&&u.concurrentRequestLimit),this.Da=new Of,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}n=ka.prototype,n.la=8,n.G=1,n.connect=function(u,d,g,b){ut(0),this.W=u,this.H=d||{},g&&b!==void 0&&(this.H.OSID=g,this.H.OAID=b),this.F=this.X,this.I=Vc(this,null,this.W),Ws(this)};function Ks(u){if(bt(u),u.G==3){var d=u.U++,g=_n(u.I);if(Ce(g,"SID",u.K),Ce(g,"RID",d),Ce(g,"TYPE","terminate"),Kr(u,g),d=new Vn(u,u.j,d),d.L=2,d.v=Ui(_n(g)),g=!1,h.navigator&&h.navigator.sendBeacon)try{g=h.navigator.sendBeacon(d.v.toString(),"")}catch{}!g&&h.Image&&(new Image().src=d.v,g=!0),g||(d.g=Na(d.j,null),d.g.ea(d.v)),d.F=Date.now(),Us(d)}Nc(u)}function Gi(u){u.g&&(Fe(u),u.g.cancel(),u.g=null)}function bt(u){Gi(u),u.u&&(h.clearTimeout(u.u),u.u=null),Wr(u),u.h.cancel(),u.s&&(typeof u.s=="number"&&h.clearTimeout(u.s),u.s=null)}function Ws(u){if(!xa(u.h)&&!u.s){u.s=!0;var d=u.Ga;Ai||sc(),Dn||(Ai(),Dn=!0),Nt.add(d,u),u.B=0}}function Lt(u,d){return Aa(u.h)>=u.h.j-(u.s?1:0)?!1:u.s?(u.i=d.D.concat(u.i),!0):u.G==1||u.G==2||u.B>=(u.Va?0:u.Wa)?!1:(u.s=ki(I(u.Ga,u,d),Hs(u,u.B)),u.B++,!0)}n.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 L=new Vn(this,this.j,u),F=this.o;if(this.S&&(F?(F=A(F),D(F,this.S)):F=this.S),this.m!==null||this.O||(L.H=F,F=null),this.P)e:{for(var d=0,g=0;g<this.i.length;g++){t:{var b=this.i[g];if("__data__"in b.map&&(b=b.map.__data__,typeof b=="string")){b=b.length;break t}b=void 0}if(b===void 0)break;if(d+=b,4096<d){d=g;break e}if(d===4096||g===this.i.length-1){d=g+1;break e}}d=1e3}else d=1e3;d=vn(this,L,d),g=_n(this.I),Ce(g,"RID",u),Ce(g,"CVER",22),this.D&&Ce(g,"X-HTTP-Session-Id",this.D),Kr(this,g),F&&(this.O?d="headers="+encodeURIComponent(String(Pc(F)))+"&"+d:this.m&&Da(g,this.m,F)),Mi(this.h,L),this.Ua&&Ce(g,"TYPE","init"),this.P?(Ce(g,"$req",d),Ce(g,"SID","null"),L.T=!0,Ta(L,g,null)):Ta(L,g,d),this.G=2}}else this.G==3&&(u?Oc(this,u):this.i.length==0||xa(this.h)||Oc(this))};function Oc(u,d){var g;d?g=d.l:g=u.U++;let b=_n(u.I);Ce(b,"SID",u.K),Ce(b,"RID",g),Ce(b,"AID",u.T),Kr(u,b),u.m&&u.o&&Da(b,u.m,u.o),g=new Vn(u,u.j,g,u.B+1),u.m===null&&(g.H=u.o),d&&(u.i=d.D.concat(u.i)),d=vn(u,g,1e3),g.I=Math.round(.5*u.wa)+Math.round(.5*u.wa*Math.random()),Mi(u.h,g),Ta(g,b,d)}function Kr(u,d){u.H&&ie(u.H,function(g,b){Ce(d,b,g)}),u.l&&wc({},function(g,b){Ce(d,b,g)})}function vn(u,d,g){g=Math.min(u.i.length,g);var b=u.l?I(u.l.Na,u.l,u):null;e:{var L=u.i;let F=-1;for(;;){let Q=["count="+g];F==-1?0<g?(F=L[0].g,Q.push("ofs="+F)):F=0:Q.push("ofs="+F);let _e=!0;for(let Xe=0;Xe<g;Xe++){let be=L[Xe].g,ct=L[Xe].map;if(be-=F,0>be)F=Math.max(0,L[Xe].g-100),_e=!1;else try{kf(ct,Q,"req"+be+"_")}catch{b&&b(ct)}}if(_e){b=Q.join("&");break e}}}return u=u.i.splice(0,g),d.D=u,b}function Ki(u){if(!u.g&&!u.u){u.Y=1;var d=u.Fa;Ai||sc(),Dn||(Ai(),Dn=!0),Nt.add(d,u),u.v=0}}function Wi(u){return u.g||u.u||3<=u.v?!1:(u.Y++,u.u=ki(I(u.Fa,u),Hs(u,u.v)),u.v++,!0)}n.Fa=function(){if(this.u=null,wn(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=ki(I(this.ab,this),u)}},n.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,ut(10),Gi(this),wn(this))};function Fe(u){u.A!=null&&(h.clearTimeout(u.A),u.A=null)}function wn(u){u.g=new Vn(u,u.j,"rpc",u.Y),u.m===null&&(u.g.H=u.o),u.g.O=0;var d=_n(u.qa);Ce(d,"RID","rpc"),Ce(d,"SID",u.K),Ce(d,"AID",u.T),Ce(d,"CI",u.F?"0":"1"),!u.F&&u.ja&&Ce(d,"TO",u.ja),Ce(d,"TYPE","xmlhttp"),Kr(u,d),u.m&&u.o&&Da(d,u.m,u.o),u.L&&(u.g.I=u.L);var g=u.g;u=u.ia,g.L=1,g.v=Ui(_n(d)),g.m=null,g.P=!0,Li(g,u)}n.Za=function(){this.C!=null&&(this.C=null,Gi(this),Wi(this),ut(19))};function Wr(u){u.C!=null&&(h.clearTimeout(u.C),u.C=null)}function kc(u,d){var g=null;if(u.g==d){Wr(u),Fe(u),u.g=null;var b=2}else if(js(u.h,d))g=d.D,yc(u.h,d),b=1;else return;if(u.G!=0){if(d.o)if(b==1){g=d.m?d.m.length:0,d=Date.now()-d.F;var L=u.B;b=Ms(),at(b,new fc(b,g)),Ws(u)}else Ki(u);else if(L=d.s,L==3||L==0&&0<d.X||!(b==1&&Lt(u,d)||b==2&&Wi(u)))switch(g&&0<g.length&&(d=u.h,d.i=d.i.concat(g)),L){case 1:cr(u,5);break;case 4:cr(u,10);break;case 3:cr(u,6);break;default:cr(u,2)}}}function Hs(u,d){let g=u.Ta+Math.floor(Math.random()*u.cb);return u.isActive()||(g*=2),g*d}function cr(u,d){if(u.j.info("Error code "+d),d==2){var g=I(u.fb,u),b=u.Xa;let L=!b;b=new gn(b||"//www.google.com/images/cleardot.gif"),h.location&&h.location.protocol=="http"||Fi(b,"https"),Ui(b),L?Cf(b.toString(),g):Df(b.toString(),g)}else ut(2);u.G=0,u.l&&u.l.sa(d),Nc(u),bt(u)}n.fb=function(u){u?(this.j.info("Successfully pinged google.com"),ut(2)):(this.j.info("Failed to ping google.com"),ut(1))};function Nc(u){if(u.G=0,u.ka=[],u.l){let d=Sa(u.h);(d.length!=0||u.i.length!=0)&&(j(u.ka,d),j(u.ka,u.i),u.h.i.length=0,G(u.i),u.i.length=0),u.l.ra()}}function Vc(u,d,g){var b=g instanceof gn?_n(g):new gn(g);if(b.g!="")d&&(b.g=d+"."+b.g),$r(b,b.s);else{var L=h.location;b=L.protocol,d=d?d+"."+L.hostname:L.hostname,L=+L.port;var F=new gn(null);b&&Fi(F,b),d&&(F.g=d),L&&$r(F,L),g&&(F.l=g),b=F}return g=u.D,d=u.ya,g&&d&&Ce(b,g,d),Ce(b,"VER",u.la),Kr(u,b),b}function Na(u,d,g){if(d&&!u.J)throw Error("Can't create secondary domain capable XhrIo object.");return d=u.Ca&&!u.pa?new qe(new Oe({eb:g})):new qe(u.pa),d.Ha(u.J),d}n.isActive=function(){return!!this.l&&this.l.isActive(this)};function Hi(){}n=Hi.prototype,n.ua=function(){},n.ta=function(){},n.sa=function(){},n.ra=function(){},n.isActive=function(){return!0},n.Na=function(){};function bn(){}bn.prototype.g=function(u,d){return new Rt(u,d)};function Rt(u,d){nt.call(this),this.g=new ka(d),this.l=u,this.h=d&&d.messageUrlParams||null,u=d&&d.messageHeaders||null,d&&d.clientProtocolHeaderRequired&&(u?u["X-Client-Protocol"]="webchannel":u={"X-Client-Protocol":"webchannel"}),this.g.o=u,u=d&&d.initMessageHeaders||null,d&&d.messageContentType&&(u?u["X-WebChannel-Content-Type"]=d.messageContentType:u={"X-WebChannel-Content-Type":d.messageContentType}),d&&d.va&&(u?u["X-WebChannel-Client-Profile"]=d.va:u={"X-WebChannel-Client-Profile":d.va}),this.g.S=u,(u=d&&d.Sb)&&!ee(u)&&(this.g.m=u),this.v=d&&d.supportsCrossDomainXhr||!1,this.u=d&&d.sendRawJson||!1,(d=d&&d.httpSessionIdParam)&&!ee(d)&&(this.g.D=d,u=this.h,u!==null&&d in u&&(u=this.h,d in u&&delete u[d])),this.j=new Fn(this)}B(Rt,nt),Rt.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},Rt.prototype.close=function(){Ks(this.g)},Rt.prototype.o=function(u){var d=this.g;if(typeof u=="string"){var g={};g.__data__=u,u=g}else this.u&&(g={},g.__data__=_a(u),u=g);d.i.push(new Sf(d.Ya++,u)),d.G==3&&Ws(d)},Rt.prototype.N=function(){this.g.l=null,delete this.j,Ks(this.g),delete this.g,Rt.aa.N.call(this)};function Va(u){va.call(this),u.__headers__&&(this.headers=u.__headers__,this.statusCode=u.__status__,delete u.__headers__,delete u.__status__);var d=u.__sm__;if(d){e:{for(let g in d){u=g;break e}u=void 0}(this.i=u)&&(u=this.i,d=d!==null&&u in d?d[u]:void 0),this.data=d}else this.data=u}B(Va,va);function La(){wa.call(this),this.status=1}B(La,wa);function Fn(u){this.g=u}B(Fn,Hi),Fn.prototype.ua=function(){at(this.g,"a")},Fn.prototype.ta=function(u){at(this.g,new Va(u))},Fn.prototype.sa=function(u){at(this.g,new La)},Fn.prototype.ra=function(){at(this.g,"b")},bn.prototype.createWebChannel=bn.prototype.g,Rt.prototype.send=Rt.prototype.o,Rt.prototype.open=Rt.prototype.m,Rt.prototype.close=Rt.prototype.close,lp=Rr.createWebChannelTransport=function(){return new bn},cp=Rr.getStatEventTarget=function(){return Ms()},up=Rr.Event=Nn,Ql=Rr.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},Vi.NO_ERROR=0,Vi.TIMEOUT=8,Vi.HTTP_ERROR=6,uu=Rr.ErrorCode=Vi,dc.COMPLETE="complete",ap=Rr.EventType=dc,uc.EventType=Oi,Oi.OPEN="a",Oi.CLOSE="b",Oi.ERROR="c",Oi.MESSAGE="d",nt.prototype.listen=nt.prototype.K,Ao=Rr.WebChannel=uc,A2=Rr.FetchXmlHttpFactory=Oe,qe.prototype.listenOnce=qe.prototype.L,qe.prototype.getLastError=qe.prototype.Ka,qe.prototype.getLastErrorCode=qe.prototype.Ba,qe.prototype.getStatus=qe.prototype.Z,qe.prototype.getResponseJson=qe.prototype.Oa,qe.prototype.getResponseText=qe.prototype.oa,qe.prototype.send=qe.prototype.ea,qe.prototype.setWithCredentials=qe.prototype.Ha,op=Rr.XhrIo=qe}).apply(typeof Hl!="undefined"?Hl:typeof self!="undefined"?self:typeof window!="undefined"?window:{});var z0="@firebase/firestore",G0="4.7.8";var mt=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}};mt.UNAUTHENTICATED=new mt(null),mt.GOOGLE_CREDENTIALS=new mt("google-credentials-uid"),mt.FIRST_PARTY=new mt("first-party-uid"),mt.MOCK_USER=new mt("mock-user");var Jo="11.3.1";var cs=new xo("@firebase/firestore");function So(){return cs.logLevel}function X(n,...e){if(cs.logLevel<=Se.DEBUG){let t=e.map(Jm);cs.debug(`Firestore (${Jo}): ${n}`,...t)}}function Pr(n,...e){if(cs.logLevel<=Se.ERROR){let t=e.map(Jm);cs.error(`Firestore (${Jo}): ${n}`,...t)}}function No(n,...e){if(cs.logLevel<=Se.WARN){let t=e.map(Jm);cs.warn(`Firestore (${Jo}): ${n}`,...t)}}function Jm(n){if(typeof n=="string")return n;try{return function(t){return JSON.stringify(t)}(n)}catch{return n}}function ue(n="Unexpected state"){let e=`FIRESTORE (${Jo}) INTERNAL ASSERTION FAILED: `+n;throw Pr(e),new Error(e)}function Le(n,e){n||ue()}function fe(n,e){return n}var H={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"},re=class extends Er{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}};var Kn=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};var nh=class{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}},mp=class{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(mt.UNAUTHENTICATED))}shutdown(){}},gp=class{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}},_p=class{constructor(e){this.t=e,this.currentUser=mt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){Le(this.o===void 0);let r=this.i,s=f=>this.i!==r?(r=this.i,t(f)):Promise.resolve(),a=new Kn;this.o=()=>{this.i++,this.currentUser=this.u(),a.resolve(),a=new Kn,e.enqueueRetryable(()=>s(this.currentUser))};let c=()=>{let f=a;e.enqueueRetryable(async()=>{await f.promise,await s(this.currentUser)})},h=f=>{X("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=f,this.o&&(this.auth.addAuthTokenListener(this.o),c())};this.t.onInit(f=>h(f)),setTimeout(()=>{if(!this.auth){let f=this.t.getImmediate({optional:!0});f?h(f):(X("FirebaseAuthCredentialsProvider","Auth not yet detected"),a.resolve(),a=new Kn)}},0),c()}getToken(){let e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(r=>this.i!==e?(X("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Le(typeof r.accessToken=="string"),new nh(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 Le(e===null||typeof e=="string"),new mt(e)}},yp=class{constructor(e,t,r){this.l=e,this.h=t,this.P=r,this.type="FirstParty",this.user=mt.FIRST_PARTY,this.T=new Map}I(){return this.P?this.P():null}get headers(){this.T.set("X-Goog-AuthUser",this.l);let e=this.I();return e&&this.T.set("Authorization",e),this.h&&this.T.set("X-Goog-Iam-Authorization-Token",this.h),this.T}},vp=class{constructor(e,t,r){this.l=e,this.h=t,this.P=r}getToken(){return Promise.resolve(new yp(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(mt.FIRST_PARTY))}shutdown(){}invalidateToken(){}},rh=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)}},wp=class{constructor(e,t){this.A=t,this.forceRefresh=!1,this.appCheck=null,this.R=null,this.V=null,M0(e)&&e.settings.appCheckToken&&(this.V=e.settings.appCheckToken)}start(e,t){Le(this.o===void 0);let r=a=>{a.error!=null&&X("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${a.error.message}`);let c=a.token!==this.R;return this.R=a.token,X("FirebaseAppCheckTokenProvider",`Received ${c?"new":"existing"} token.`),c?t(a.token):Promise.resolve()};this.o=a=>{e.enqueueRetryable(()=>r(a))};let s=a=>{X("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=a,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(a=>s(a)),setTimeout(()=>{if(!this.appCheck){let a=this.A.getImmediate({optional:!0});a?s(a):X("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.V)return Promise.resolve(new rh(this.V));let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(Le(typeof t.token=="string"),this.R=t.token,new rh(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}};function S2(n){let e=typeof self!="undefined"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<n;r++)t[r]=Math.floor(256*Math.random());return t}var ih=class{static newId(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(4.129032258064516),r="";for(;r.length<20;){let s=S2(40);for(let a=0;a<s.length;++a)r.length<20&&s[a]<t&&(r+=e.charAt(s[a]%62))}return r}};function Re(n,e){return n<e?-1:n>e?1:0}function Vo(n,e,t){return n.length===e.length&&n.every((r,s)=>t(r,e[s]))}var K0=-62135596800,W0=1e6,yt=class n{static now(){return n.fromMillis(Date.now())}static fromDate(e){return n.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3),r=Math.floor((e-1e3*t)*W0);return new n(t,r)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new re(H.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new re(H.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<K0)throw new re(H.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new re(H.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/W0}_compareTo(e){return this.seconds===e.seconds?Re(this.nanoseconds,e.nanoseconds):Re(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{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){let e=this.seconds-K0;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}};var me=class n{static fromTimestamp(e){return new n(e)}static min(){return new n(new yt(0,0))}static max(){return new n(new yt(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 H0="__name__",sh=class n{constructor(e,t,r){t===void 0?t=0:t>e.length&&ue(),r===void 0?r=e.length-t:r>e.length-t&&ue(),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return n.comparator(this,e)===0}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof n?e.forEach(r=>{t.push(r)}):t.push(e),this.construct(t)}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 t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,r=this.limit();t<r;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){let r=Math.min(e.length,t.length);for(let s=0;s<r;s++){let a=n.compareSegments(e.get(s),t.get(s));if(a!==0)return a}return Math.sign(e.length-t.length)}static compareSegments(e,t){let r=n.isNumericId(e),s=n.isNumericId(t);return r&&!s?-1:!r&&s?1:r&&s?n.extractNumericId(e).compare(n.extractNumericId(t)):e<t?-1:e>t?1:0}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Sr.fromString(e.substring(4,e.length-2))}},st=class n extends sh{construct(e,t,r){return new n(e,t,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){let t=[];for(let r of e){if(r.indexOf("//")>=0)throw new re(H.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter(s=>s.length>0))}return new n(t)}static emptyPath(){return new n([])}},R2=/^[_a-zA-Z][_a-zA-Z0-9]*$/,en=class n extends sh{construct(e,t,r){return new n(e,t,r)}static isValidIdentifier(e){return R2.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),n.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===H0}static keyField(){return new n([H0])}static fromServerFormat(e){let t=[],r="",s=0,a=()=>{if(r.length===0)throw new re(H.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(r),r=""},c=!1;for(;s<e.length;){let h=e[s];if(h==="\\"){if(s+1===e.length)throw new re(H.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let f=e[s+1];if(f!=="\\"&&f!=="."&&f!=="`")throw new re(H.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=f,s+=2}else h==="`"?(c=!c,s++):h!=="."||c?(r+=h,s++):(a(),s++)}if(a(),c)throw new re(H.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new n(t)}static emptyPath(){return new n([])}};var ce=class n{constructor(e){this.path=e}static fromPath(e){return new n(st.fromString(e))}static fromName(e){return new n(st.fromString(e).popFirst(5))}static empty(){return new n(st.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&&st.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,t){return st.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new n(new st(e.slice()))}};var pu=-1,bp=class{constructor(e,t,r,s){this.indexId=e,this.collectionGroup=t,this.fields=r,this.indexState=s}};bp.UNKNOWN_ID=-1;function P2(n,e){let t=n.toTimestamp().seconds,r=n.toTimestamp().nanoseconds+1,s=me.fromTimestamp(r===1e9?new yt(t+1,0):new yt(t,r));return new ls(s,ce.empty(),e)}function C2(n){return new ls(n.readTime,n.key,pu)}var ls=class n{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new n(me.min(),ce.empty(),pu)}static max(){return new n(me.max(),ce.empty(),pu)}};function D2(n,e){let t=n.readTime.compareTo(e.readTime);return t!==0?t:(t=ce.comparator(n.documentKey,e.documentKey),t!==0?t:Re(n.largestBatchId,e.largestBatchId))}var O2="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",Tp=class{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}};async function Yo(n){if(n.code!==H.FAILED_PRECONDITION||n.message!==O2)throw n;X("LocalStore","Unexpectedly lost primary lease")}var W=class n{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&ue(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new n((r,s)=>{this.nextCallback=a=>{this.wrapSuccess(e,a).next(r,s)},this.catchCallback=a=>{this.wrapFailure(t,a).next(r,s)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{let t=e();return t instanceof n?t:n.resolve(t)}catch(t){return n.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):n.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):n.reject(t)}static resolve(e){return new n((t,r)=>{t(e)})}static reject(e){return new n((t,r)=>{r(e)})}static waitFor(e){return new n((t,r)=>{let s=0,a=0,c=!1;e.forEach(h=>{++s,h.next(()=>{++a,c&&a===s&&t()},f=>r(f))}),c=!0,a===s&&t()})}static or(e){let t=n.resolve(!1);for(let r of e)t=t.next(s=>s?n.resolve(s):r());return t}static forEach(e,t){let r=[];return e.forEach((s,a)=>{r.push(t.call(this,s,a))}),this.waitFor(r)}static mapArray(e,t){return new n((r,s)=>{let a=e.length,c=new Array(a),h=0;for(let f=0;f<a;f++){let m=f;t(e[m]).next(_=>{c[m]=_,++h,h===a&&r(c)},_=>s(_))}})}static doWhile(e,t){return new n((r,s)=>{let a=()=>{e()===!0?t().next(()=>{a()},s):r()};a()})}};function k2(n){let e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}function Xo(n){return n.name==="IndexedDbTransactionError"}var Lo=class{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=r=>this.oe(r),this._e=r=>t.writeSequenceNumber(r))}oe(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this._e&&this._e(e),e}};Lo.ae=-1;var Ym=-1;function Bh(n){return n==null}function mu(n){return n===0&&1/n==-1/0}function N2(n){return typeof n=="number"&&Number.isInteger(n)&&!mu(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}var Db="";function V2(n){let e="";for(let t=0;t<n.length;t++)e.length>0&&(e=Q0(e)),e=L2(n.get(t),e);return Q0(e)}function L2(n,e){let t=e,r=n.length;for(let s=0;s<r;s++){let a=n.charAt(s);switch(a){case"\0":t+="";break;case Db:t+="";break;default:t+=a}}return t}function Q0(n){return n+Db+""}var M2="remoteDocuments",Ob="owner";var kb="mutationQueues";var Nb="mutations";var Vb="documentMutations",F2="remoteDocumentsV14";var Lb="remoteDocumentGlobal";var Mb="targets";var Fb="targetDocuments";var Ub="targetGlobal",Bb="collectionParents";var jb="clientMetadata";var $b="bundles";var qb="namedQueries";var U2="indexConfiguration";var B2="indexState";var j2="indexEntries";var zb="documentOverlays";var $2="globals";var q2=[kb,Nb,Vb,M2,Mb,Ob,Ub,Fb,jb,Lb,Bb,$b,qb],cK=[...q2,zb],z2=[kb,Nb,Vb,F2,Mb,Ob,Ub,Fb,jb,Lb,Bb,$b,qb,zb],G2=z2,K2=[...G2,U2,B2,j2];var lK=[...K2,$2];function J0(n){let e=0;for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e}function Ti(n,e){for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])}function Gb(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}var Je=class n{constructor(e,t){this.comparator=e,this.root=t||Wn.EMPTY}insert(e,t){return new n(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Wn.BLACK,null,null))}remove(e){return new n(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Wn.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){let r=this.comparator(e,t.key);if(r===0)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){let s=this.comparator(e,r.key);if(s===0)return t+r.left.size;s<0?r=r.left:(t+=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((t,r)=>(e(t,r),!1))}toString(){let e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Do(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Do(this.root,e,this.comparator,!1)}getReverseIterator(){return new Do(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Do(this.root,e,this.comparator,!0)}},Do=class{constructor(e,t,r,s){this.isReverse=s,this.nodeStack=[];let a=1;for(;!e.isEmpty();)if(a=t?r(e.key,t):1,t&&s&&(a*=-1),a<0)e=this.isReverse?e.left:e.right;else{if(a===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),t={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 t}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}}},Wn=class n{constructor(e,t,r,s,a){this.key=e,this.value=t,this.color=r!=null?r:n.RED,this.left=s!=null?s:n.EMPTY,this.right=a!=null?a:n.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,s,a){return new n(e!=null?e:this.key,t!=null?t:this.value,r!=null?r:this.color,s!=null?s:this.left,a!=null?a: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,t,r){let s=this,a=r(e,s.key);return s=a<0?s.copy(null,null,null,s.left.insert(e,t,r),null):a===0?s.copy(null,t,null,null,null):s.copy(null,null,null,null,s.right.insert(e,t,r)),s.fixUp()}removeMin(){if(this.left.isEmpty())return n.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,t){let r,s=this;if(t(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,t),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),t(e,s.key)===0){if(s.right.isEmpty())return n.EMPTY;r=s.right.min(),s=s.copy(r.key,r.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,t))}return s.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,n.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,n.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),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){let e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ue();let e=this.left.check();if(e!==this.right.check())throw ue();return e+(this.isRed()?0:1)}};Wn.EMPTY=null,Wn.RED=!0,Wn.BLACK=!1;Wn.EMPTY=new class{constructor(){this.size=0}get key(){throw ue()}get value(){throw ue()}get color(){throw ue()}get left(){throw ue()}get right(){throw ue()}copy(e,t,r,s,a){return this}insert(e,t,r){return new Wn(e,t)}remove(e,t){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 gt=class n{constructor(e){this.comparator=e,this.data=new Je(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((t,r)=>(e(t),!1))}forEachInRange(e,t){let r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){let s=r.getNext();if(this.comparator(s.key,e[1])>=0)return;t(s.key)}}forEachWhile(e,t){let r;for(r=t!==void 0?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){let t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new oh(this.data.getIterator())}getIteratorFrom(e){return new oh(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 t=this;return t.size<e.size&&(t=e,e=this),e.forEach(r=>{t=t.add(r)}),t}isEqual(e){if(!(e instanceof n)||this.size!==e.size)return!1;let t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){let s=t.getNext().key,a=r.getNext().key;if(this.comparator(s,a)!==0)return!1}return!0}toArray(){let e=[];return this.forEach(t=>{e.push(t)}),e}toString(){let e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){let t=new n(this.comparator);return t.data=e,t}},oh=class{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}};var hn=class n{constructor(e){this.fields=e,e.sort(en.comparator)}static empty(){return new n([])}unionWith(e){let t=new gt(en.comparator);for(let r of this.fields)t=t.add(r);for(let r of e)t=t.add(r);return new n(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Vo(this.fields,e.fields,(t,r)=>t.isEqual(r))}};var ah=class extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}};var At=class n{constructor(e){this.binaryString=e}static fromBase64String(e){let t=function(s){try{return atob(s)}catch(a){throw typeof DOMException!="undefined"&&a instanceof DOMException?new ah("Invalid base64 string: "+a):a}}(e);return new n(t)}static fromUint8Array(e){let t=function(s){let a="";for(let c=0;c<s.length;++c)a+=String.fromCharCode(s[c]);return a}(e);return new n(t)}[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(t){return btoa(t)}(this.binaryString)}toUint8Array(){return function(t){let r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Re(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}};At.EMPTY_BYTE_STRING=new At("");var W2=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Cr(n){if(Le(!!n),typeof n=="string"){let e=0,t=W2.exec(n);if(Le(!!t),t[1]){let s=t[1];s=(s+"000000000").substr(0,9),e=Number(s)}let r=new Date(n);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:ze(n.seconds),nanos:ze(n.nanos)}}function ze(n){return typeof n=="number"?n:typeof n=="string"?Number(n):0}function Dr(n){return typeof n=="string"?At.fromBase64String(n):At.fromUint8Array(n)}var Kb="server_timestamp",Wb="__type__",Hb="__previous_value__",Qb="__local_write_time__";function Xm(n){var e,t;return((t=(((e=n==null?void 0:n.mapValue)===null||e===void 0?void 0:e.fields)||{})[Wb])===null||t===void 0?void 0:t.stringValue)===Kb}function jh(n){let e=n.mapValue.fields[Hb];return Xm(e)?jh(e):e}function gu(n){let e=Cr(n.mapValue.fields[Qb].timestampValue);return new yt(e.seconds,e.nanos)}var Ep=class{constructor(e,t,r,s,a,c,h,f,m){this.databaseId=e,this.appId=t,this.persistenceKey=r,this.host=s,this.ssl=a,this.forceLongPolling=c,this.autoDetectLongPolling=h,this.longPollingOptions=f,this.useFetchStreams=m}},uh="(default)",ch=class n{constructor(e,t){this.projectId=e,this.database=t||uh}static empty(){return new n("","")}get isDefaultDatabase(){return this.database===uh}isEqual(e){return e instanceof n&&e.projectId===this.projectId&&e.database===this.database}};var Zm="__type__",Jb="__max__",Jl={mapValue:{fields:{__type__:{stringValue:Jb}}}},eg="__vector__",Mo="value";function yi(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?Xm(n)?4:Xb(n)?9007199254740991:Yb(n)?10:11:ue()}function Yn(n,e){if(n===e)return!0;let t=yi(n);if(t!==yi(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return n.booleanValue===e.booleanValue;case 4:return gu(n).isEqual(gu(e));case 3:return function(s,a){if(typeof s.timestampValue=="string"&&typeof a.timestampValue=="string"&&s.timestampValue.length===a.timestampValue.length)return s.timestampValue===a.timestampValue;let c=Cr(s.timestampValue),h=Cr(a.timestampValue);return c.seconds===h.seconds&&c.nanos===h.nanos}(n,e);case 5:return n.stringValue===e.stringValue;case 6:return function(s,a){return Dr(s.bytesValue).isEqual(Dr(a.bytesValue))}(n,e);case 7:return n.referenceValue===e.referenceValue;case 8:return function(s,a){return ze(s.geoPointValue.latitude)===ze(a.geoPointValue.latitude)&&ze(s.geoPointValue.longitude)===ze(a.geoPointValue.longitude)}(n,e);case 2:return function(s,a){if("integerValue"in s&&"integerValue"in a)return ze(s.integerValue)===ze(a.integerValue);if("doubleValue"in s&&"doubleValue"in a){let c=ze(s.doubleValue),h=ze(a.doubleValue);return c===h?mu(c)===mu(h):isNaN(c)&&isNaN(h)}return!1}(n,e);case 9:return Vo(n.arrayValue.values||[],e.arrayValue.values||[],Yn);case 10:case 11:return function(s,a){let c=s.mapValue.fields||{},h=a.mapValue.fields||{};if(J0(c)!==J0(h))return!1;for(let f in c)if(c.hasOwnProperty(f)&&(h[f]===void 0||!Yn(c[f],h[f])))return!1;return!0}(n,e);default:return ue()}}function _u(n,e){return(n.values||[]).find(t=>Yn(t,e))!==void 0}function Fo(n,e){if(n===e)return 0;let t=yi(n),r=yi(e);if(t!==r)return Re(t,r);switch(t){case 0:case 9007199254740991:return 0;case 1:return Re(n.booleanValue,e.booleanValue);case 2:return function(a,c){let h=ze(a.integerValue||a.doubleValue),f=ze(c.integerValue||c.doubleValue);return h<f?-1:h>f?1:h===f?0:isNaN(h)?isNaN(f)?0:-1:1}(n,e);case 3:return Y0(n.timestampValue,e.timestampValue);case 4:return Y0(gu(n),gu(e));case 5:return Re(n.stringValue,e.stringValue);case 6:return function(a,c){let h=Dr(a),f=Dr(c);return h.compareTo(f)}(n.bytesValue,e.bytesValue);case 7:return function(a,c){let h=a.split("/"),f=c.split("/");for(let m=0;m<h.length&&m<f.length;m++){let _=Re(h[m],f[m]);if(_!==0)return _}return Re(h.length,f.length)}(n.referenceValue,e.referenceValue);case 8:return function(a,c){let h=Re(ze(a.latitude),ze(c.latitude));return h!==0?h:Re(ze(a.longitude),ze(c.longitude))}(n.geoPointValue,e.geoPointValue);case 9:return X0(n.arrayValue,e.arrayValue);case 10:return function(a,c){var h,f,m,_;let E=a.fields||{},I=c.fields||{},k=(h=E[Mo])===null||h===void 0?void 0:h.arrayValue,B=(f=I[Mo])===null||f===void 0?void 0:f.arrayValue,G=Re(((m=k==null?void 0:k.values)===null||m===void 0?void 0:m.length)||0,((_=B==null?void 0:B.values)===null||_===void 0?void 0:_.length)||0);return G!==0?G:X0(k,B)}(n.mapValue,e.mapValue);case 11:return function(a,c){if(a===Jl.mapValue&&c===Jl.mapValue)return 0;if(a===Jl.mapValue)return 1;if(c===Jl.mapValue)return-1;let h=a.fields||{},f=Object.keys(h),m=c.fields||{},_=Object.keys(m);f.sort(),_.sort();for(let E=0;E<f.length&&E<_.length;++E){let I=Re(f[E],_[E]);if(I!==0)return I;let k=Fo(h[f[E]],m[_[E]]);if(k!==0)return k}return Re(f.length,_.length)}(n.mapValue,e.mapValue);default:throw ue()}}function Y0(n,e){if(typeof n=="string"&&typeof e=="string"&&n.length===e.length)return Re(n,e);let t=Cr(n),r=Cr(e),s=Re(t.seconds,r.seconds);return s!==0?s:Re(t.nanos,r.nanos)}function X0(n,e){let t=n.values||[],r=e.values||[];for(let s=0;s<t.length&&s<r.length;++s){let a=Fo(t[s],r[s]);if(a)return a}return Re(t.length,r.length)}function Uo(n){return Ip(n)}function Ip(n){return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?function(t){let r=Cr(t);return`time(${r.seconds},${r.nanos})`}(n.timestampValue):"stringValue"in n?n.stringValue:"bytesValue"in n?function(t){return Dr(t).toBase64()}(n.bytesValue):"referenceValue"in n?function(t){return ce.fromName(t).toString()}(n.referenceValue):"geoPointValue"in n?function(t){return`geo(${t.latitude},${t.longitude})`}(n.geoPointValue):"arrayValue"in n?function(t){let r="[",s=!0;for(let a of t.values||[])s?s=!1:r+=",",r+=Ip(a);return r+"]"}(n.arrayValue):"mapValue"in n?function(t){let r=Object.keys(t.fields||{}).sort(),s="{",a=!0;for(let c of r)a?a=!1:s+=",",s+=`${c}:${Ip(t.fields[c])}`;return s+"}"}(n.mapValue):ue()}function Zl(n){switch(yi(n)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:let e=jh(n);return e?16+Zl(e):16;case 5:return 2*n.stringValue.length;case 6:return Dr(n.bytesValue).approximateByteSize();case 7:return n.referenceValue.length;case 9:return function(r){return(r.values||[]).reduce((s,a)=>s+Zl(a),0)}(n.arrayValue);case 10:case 11:return function(r){let s=0;return Ti(r.fields,(a,c)=>{s+=a.length+Zl(c)}),s}(n.mapValue);default:throw ue()}}function xp(n){return!!n&&"integerValue"in n}function tg(n){return!!n&&"arrayValue"in n}function Z0(n){return!!n&&"nullValue"in n}function eb(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function eh(n){return!!n&&"mapValue"in n}function Yb(n){var e,t;return((t=(((e=n==null?void 0:n.mapValue)===null||e===void 0?void 0:e.fields)||{})[Zm])===null||t===void 0?void 0:t.stringValue)===eg}function lu(n){if(n.geoPointValue)return{geoPointValue:Object.assign({},n.geoPointValue)};if(n.timestampValue&&typeof n.timestampValue=="object")return{timestampValue:Object.assign({},n.timestampValue)};if(n.mapValue){let e={mapValue:{fields:{}}};return Ti(n.mapValue.fields,(t,r)=>e.mapValue.fields[t]=lu(r)),e}if(n.arrayValue){let e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=lu(n.arrayValue.values[t]);return e}return Object.assign({},n)}function Xb(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===Jb}var fK={mapValue:{fields:{[Zm]:{stringValue:eg},[Mo]:{arrayValue:{}}}}};var Zt=class n{constructor(e){this.value=e}static empty(){return new n({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r<e.length-1;++r)if(t=(t.mapValue.fields||{})[e.get(r)],!eh(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=lu(t)}setAll(e){let t=en.emptyPath(),r={},s=[];e.forEach((c,h)=>{if(!t.isImmediateParentOf(h)){let f=this.getFieldsMap(t);this.applyChanges(f,r,s),r={},s=[],t=h.popLast()}c?r[h.lastSegment()]=lu(c):s.push(h.lastSegment())});let a=this.getFieldsMap(t);this.applyChanges(a,r,s)}delete(e){let t=this.field(e.popLast());eh(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Yn(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;r<e.length;++r){let s=t.mapValue.fields[e.get(r)];eh(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},t.mapValue.fields[e.get(r)]=s),t=s}return t.mapValue.fields}applyChanges(e,t,r){Ti(t,(s,a)=>e[s]=a);for(let s of r)delete e[s]}clone(){return new n(lu(this.value))}};function Zb(n){let e=[];return Ti(n.fields,(t,r)=>{let s=new en([t]);if(eh(r)){let a=Zb(r.mapValue).fields;if(a.length===0)e.push(s);else for(let c of a)e.push(s.child(c))}else e.push(s)}),new hn(e)}var Rn=class n{constructor(e,t,r,s,a,c,h){this.key=e,this.documentType=t,this.version=r,this.readTime=s,this.createTime=a,this.data=c,this.documentState=h}static newInvalidDocument(e){return new n(e,0,me.min(),me.min(),me.min(),Zt.empty(),0)}static newFoundDocument(e,t,r,s){return new n(e,1,t,me.min(),r,s,0)}static newNoDocument(e,t){return new n(e,2,t,me.min(),me.min(),Zt.empty(),0)}static newUnknownDocument(e,t){return new n(e,3,t,me.min(),me.min(),Zt.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(me.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Zt.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Zt.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=me.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 n&&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 n(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 Bo=class{constructor(e,t){this.position=e,this.inclusive=t}};function tb(n,e,t){let r=0;for(let s=0;s<n.position.length;s++){let a=e[s],c=n.position[s];if(a.field.isKeyField()?r=ce.comparator(ce.fromName(c.referenceValue),t.key):r=Fo(c,t.data.field(a.field)),a.dir==="desc"&&(r*=-1),r!==0)break}return r}function nb(n,e){if(n===null)return e===null;if(e===null||n.inclusive!==e.inclusive||n.position.length!==e.position.length)return!1;for(let t=0;t<n.position.length;t++)if(!Yn(n.position[t],e.position[t]))return!1;return!0}var jo=class{constructor(e,t="asc"){this.field=e,this.dir=t}};function H2(n,e){return n.dir===e.dir&&n.field.isEqual(e.field)}var lh=class{},dt=class n extends lh{constructor(e,t,r){super(),this.field=e,this.op=t,this.value=r}static create(e,t,r){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,r):new Sp(e,t,r):t==="array-contains"?new Cp(e,r):t==="in"?new Dp(e,r):t==="not-in"?new Op(e,r):t==="array-contains-any"?new kp(e,r):new n(e,t,r)}static createKeyFieldInFilter(e,t,r){return t==="in"?new Rp(e,r):new Pp(e,r)}matches(e){let t=e.data.field(this.field);return this.op==="!="?t!==null&&this.matchesComparison(Fo(t,this.value)):t!==null&&yi(this.value)===yi(t)&&this.matchesComparison(Fo(t,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 ue()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}},Xn=class n extends lh{constructor(e,t){super(),this.filters=e,this.op=t,this.ce=null}static create(e,t){return new n(e,t)}matches(e){return eT(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.ce!==null||(this.ce=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ce}getFilters(){return Object.assign([],this.filters)}};function eT(n){return n.op==="and"}function tT(n){return Q2(n)&&eT(n)}function Q2(n){for(let e of n.filters)if(e instanceof Xn)return!1;return!0}function Ap(n){if(n instanceof dt)return n.field.canonicalString()+n.op.toString()+Uo(n.value);if(tT(n))return n.filters.map(e=>Ap(e)).join(",");{let e=n.filters.map(t=>Ap(t)).join(",");return`${n.op}(${e})`}}function nT(n,e){return n instanceof dt?function(r,s){return s instanceof dt&&r.op===s.op&&r.field.isEqual(s.field)&&Yn(r.value,s.value)}(n,e):n instanceof Xn?function(r,s){return s instanceof Xn&&r.op===s.op&&r.filters.length===s.filters.length?r.filters.reduce((a,c,h)=>a&&nT(c,s.filters[h]),!0):!1}(n,e):void ue()}function rT(n){return n instanceof dt?function(t){return`${t.field.canonicalString()} ${t.op} ${Uo(t.value)}`}(n):n instanceof Xn?function(t){return t.op.toString()+" {"+t.getFilters().map(rT).join(" ,")+"}"}(n):"Filter"}var Sp=class extends dt{constructor(e,t,r){super(e,t,r),this.key=ce.fromName(r.referenceValue)}matches(e){let t=ce.comparator(e.key,this.key);return this.matchesComparison(t)}},Rp=class extends dt{constructor(e,t){super(e,"in",t),this.keys=iT("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}},Pp=class extends dt{constructor(e,t){super(e,"not-in",t),this.keys=iT("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}};function iT(n,e){var t;return(((t=e.arrayValue)===null||t===void 0?void 0:t.values)||[]).map(r=>ce.fromName(r.referenceValue))}var Cp=class extends dt{constructor(e,t){super(e,"array-contains",t)}matches(e){let t=e.data.field(this.field);return tg(t)&&_u(t.arrayValue,this.value)}},Dp=class extends dt{constructor(e,t){super(e,"in",t)}matches(e){let t=e.data.field(this.field);return t!==null&&_u(this.value.arrayValue,t)}},Op=class extends dt{constructor(e,t){super(e,"not-in",t)}matches(e){if(_u(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let t=e.data.field(this.field);return t!==null&&!_u(this.value.arrayValue,t)}},kp=class extends dt{constructor(e,t){super(e,"array-contains-any",t)}matches(e){let t=e.data.field(this.field);return!(!tg(t)||!t.arrayValue.values)&&t.arrayValue.values.some(r=>_u(this.value.arrayValue,r))}};var Np=class{constructor(e,t=null,r=[],s=[],a=null,c=null,h=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=s,this.limit=a,this.startAt=c,this.endAt=h,this.le=null}};function rb(n,e=null,t=[],r=[],s=null,a=null,c=null){return new Np(n,e,t,r,s,a,c)}function ng(n){let e=fe(n);if(e.le===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(r=>Ap(r)).join(","),t+="|ob:",t+=e.orderBy.map(r=>function(a){return a.field.canonicalString()+a.dir}(r)).join(","),Bh(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(r=>Uo(r)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(r=>Uo(r)).join(",")),e.le=t}return e.le}function rg(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<n.orderBy.length;t++)if(!H2(n.orderBy[t],e.orderBy[t]))return!1;if(n.filters.length!==e.filters.length)return!1;for(let t=0;t<n.filters.length;t++)if(!nT(n.filters[t],e.filters[t]))return!1;return n.collectionGroup===e.collectionGroup&&!!n.path.isEqual(e.path)&&!!nb(n.startAt,e.startAt)&&nb(n.endAt,e.endAt)}function Vp(n){return ce.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}var $o=class{constructor(e,t=null,r=[],s=[],a=null,c="F",h=null,f=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=s,this.limit=a,this.limitType=c,this.startAt=h,this.endAt=f,this.he=null,this.Pe=null,this.Te=null,this.startAt,this.endAt}};function J2(n,e,t,r,s,a,c,h){return new $o(n,e,t,r,s,a,c,h)}function $h(n){return new $o(n)}function ib(n){return n.filters.length===0&&n.limit===null&&n.startAt==null&&n.endAt==null&&(n.explicitOrderBy.length===0||n.explicitOrderBy.length===1&&n.explicitOrderBy[0].field.isKeyField())}function Y2(n){return n.collectionGroup!==null}function hu(n){let e=fe(n);if(e.he===null){e.he=[];let t=new Set;for(let a of e.explicitOrderBy)e.he.push(a),t.add(a.field.canonicalString());let r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(c){let h=new gt(en.comparator);return c.filters.forEach(f=>{f.getFlattenedFilters().forEach(m=>{m.isInequality()&&(h=h.add(m.field))})}),h})(e).forEach(a=>{t.has(a.canonicalString())||a.isKeyField()||e.he.push(new jo(a,r))}),t.has(en.keyField().canonicalString())||e.he.push(new jo(en.keyField(),r))}return e.he}function Hn(n){let e=fe(n);return e.Pe||(e.Pe=X2(e,hu(n))),e.Pe}function X2(n,e){if(n.limitType==="F")return rb(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map(s=>{let a=s.dir==="desc"?"asc":"desc";return new jo(s.field,a)});let t=n.endAt?new Bo(n.endAt.position,n.endAt.inclusive):null,r=n.startAt?new Bo(n.startAt.position,n.startAt.inclusive):null;return rb(n.path,n.collectionGroup,e,n.filters,n.limit,t,r)}}function Lp(n,e,t){return new $o(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function qh(n,e){return rg(Hn(n),Hn(e))&&n.limitType===e.limitType}function sT(n){return`${ng(Hn(n))}|lt:${n.limitType}`}function Ro(n){return`Query(target=${function(t){let r=t.path.canonicalString();return t.collectionGroup!==null&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(s=>rT(s)).join(", ")}]`),Bh(t.limit)||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(s=>function(c){return`${c.field.canonicalString()} (${c.dir})`}(s)).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(s=>Uo(s)).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(s=>Uo(s)).join(",")),`Target(${r})`}(Hn(n))}; limitType=${n.limitType})`}function zh(n,e){return e.isFoundDocument()&&function(r,s){let a=s.key.path;return r.collectionGroup!==null?s.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(a):ce.isDocumentKey(r.path)?r.path.isEqual(a):r.path.isImmediateParentOf(a)}(n,e)&&function(r,s){for(let a of hu(r))if(!a.field.isKeyField()&&s.data.field(a.field)===null)return!1;return!0}(n,e)&&function(r,s){for(let a of r.filters)if(!a.matches(s))return!1;return!0}(n,e)&&function(r,s){return!(r.startAt&&!function(c,h,f){let m=tb(c,h,f);return c.inclusive?m<=0:m<0}(r.startAt,hu(r),s)||r.endAt&&!function(c,h,f){let m=tb(c,h,f);return c.inclusive?m>=0:m>0}(r.endAt,hu(r),s))}(n,e)}function Z2(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}function oT(n){return(e,t)=>{let r=!1;for(let s of hu(n)){let a=eM(s,e,t);if(a!==0)return a;r=r||s.field.isKeyField()}return 0}}function eM(n,e,t){let r=n.field.isKeyField()?ce.comparator(e.key,t.key):function(a,c,h){let f=c.data.field(a),m=h.data.field(a);return f!==null&&m!==null?Fo(f,m):ue()}(n.field,e,t);switch(n.dir){case"asc":return r;case"desc":return-1*r;default:return ue()}}var Or=class{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){let t=this.mapKeyFn(e),r=this.inner[t];if(r!==void 0){for(let[s,a]of r)if(this.equalsFn(s,e))return a}}has(e){return this.get(e)!==void 0}set(e,t){let r=this.mapKeyFn(e),s=this.inner[r];if(s===void 0)return this.inner[r]=[[e,t]],void this.innerSize++;for(let a=0;a<s.length;a++)if(this.equalsFn(s[a][0],e))return void(s[a]=[e,t]);s.push([e,t]),this.innerSize++}delete(e){let t=this.mapKeyFn(e),r=this.inner[t];if(r===void 0)return!1;for(let s=0;s<r.length;s++)if(this.equalsFn(r[s][0],e))return r.length===1?delete this.inner[t]:r.splice(s,1),this.innerSize--,!0;return!1}forEach(e){Ti(this.inner,(t,r)=>{for(let[s,a]of r)e(s,a)})}isEmpty(){return Gb(this.inner)}size(){return this.innerSize}};var tM=new Je(ce.comparator);function kr(){return tM}var aT=new Je(ce.comparator);function cu(...n){let e=aT;for(let t of n)e=e.insert(t.key,t);return e}function uT(n){let e=aT;return n.forEach((t,r)=>e=e.insert(t,r.overlayedDocument)),e}function os(){return fu()}function cT(){return fu()}function fu(){return new Or(n=>n.toString(),(n,e)=>n.isEqual(e))}var nM=new Je(ce.comparator),rM=new gt(ce.comparator);function xe(...n){let e=rM;for(let t of n)e=e.add(t);return e}var iM=new gt(Re);function sM(){return iM}function ig(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:mu(e)?"-0":e}}function lT(n){return{integerValue:""+n}}function oM(n,e){return N2(e)?lT(e):ig(n,e)}var qo=class{constructor(){this._=void 0}};function aM(n,e,t){return n instanceof zo?function(s,a){let c={fields:{[Wb]:{stringValue:Kb},[Qb]:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return a&&Xm(a)&&(a=jh(a)),a&&(c.fields[Hb]=a),{mapValue:c}}(t,e):n instanceof hs?fT(n,e):n instanceof fs?dT(n,e):function(s,a){let c=hT(s,a),h=sb(c)+sb(s.Ie);return xp(c)&&xp(s.Ie)?lT(h):ig(s.serializer,h)}(n,e)}function uM(n,e,t){return n instanceof hs?fT(n,e):n instanceof fs?dT(n,e):t}function hT(n,e){return n instanceof Go?function(r){return xp(r)||function(a){return!!a&&"doubleValue"in a}(r)}(e)?e:{integerValue:0}:null}var zo=class extends qo{},hs=class extends qo{constructor(e){super(),this.elements=e}};function fT(n,e){let t=pT(e);for(let r of n.elements)t.some(s=>Yn(s,r))||t.push(r);return{arrayValue:{values:t}}}var fs=class extends qo{constructor(e){super(),this.elements=e}};function dT(n,e){let t=pT(e);for(let r of n.elements)t=t.filter(s=>!Yn(s,r));return{arrayValue:{values:t}}}var Go=class extends qo{constructor(e,t){super(),this.serializer=e,this.Ie=t}};function sb(n){return ze(n.integerValue||n.doubleValue)}function pT(n){return tg(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}function cM(n,e){return n.field.isEqual(e.field)&&function(r,s){return r instanceof hs&&s instanceof hs||r instanceof fs&&s instanceof fs?Vo(r.elements,s.elements,Yn):r instanceof Go&&s instanceof Go?Yn(r.Ie,s.Ie):r instanceof zo&&s instanceof zo}(n.transform,e.transform)}var Mp=class{constructor(e,t){this.version=e,this.transformResults=t}},_i=class n{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new n}static exists(e){return new n(void 0,e)}static updateTime(e){return new n(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 th(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}var Ko=class{};function mT(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new hh(n.key,_i.none()):new ds(n.key,n.data,_i.none());{let t=n.data,r=Zt.empty(),s=new gt(en.comparator);for(let a of e.fields)if(!s.has(a)){let c=t.field(a);c===null&&a.length>1&&(a=a.popLast(),c=t.field(a)),c===null?r.delete(a):r.set(a,c),s=s.add(a)}return new Zn(n.key,r,new hn(s.toArray()),_i.none())}}function lM(n,e,t){n instanceof ds?function(s,a,c){let h=s.value.clone(),f=ab(s.fieldTransforms,a,c.transformResults);h.setAll(f),a.convertToFoundDocument(c.version,h).setHasCommittedMutations()}(n,e,t):n instanceof Zn?function(s,a,c){if(!th(s.precondition,a))return void a.convertToUnknownDocument(c.version);let h=ab(s.fieldTransforms,a,c.transformResults),f=a.data;f.setAll(gT(s)),f.setAll(h),a.convertToFoundDocument(c.version,f).setHasCommittedMutations()}(n,e,t):function(s,a,c){a.convertToNoDocument(c.version).setHasCommittedMutations()}(0,e,t)}function du(n,e,t,r){return n instanceof ds?function(a,c,h,f){if(!th(a.precondition,c))return h;let m=a.value.clone(),_=ub(a.fieldTransforms,f,c);return m.setAll(_),c.convertToFoundDocument(c.version,m).setHasLocalMutations(),null}(n,e,t,r):n instanceof Zn?function(a,c,h,f){if(!th(a.precondition,c))return h;let m=ub(a.fieldTransforms,f,c),_=c.data;return _.setAll(gT(a)),_.setAll(m),c.convertToFoundDocument(c.version,_).setHasLocalMutations(),h===null?null:h.unionWith(a.fieldMask.fields).unionWith(a.fieldTransforms.map(E=>E.field))}(n,e,t,r):function(a,c,h){return th(a.precondition,c)?(c.convertToNoDocument(c.version).setHasLocalMutations(),null):h}(n,e,t)}function hM(n,e){let t=null;for(let r of n.fieldTransforms){let s=e.data.field(r.field),a=hT(r.transform,s||null);a!=null&&(t===null&&(t=Zt.empty()),t.set(r.field,a))}return t||null}function ob(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&!!function(r,s){return r===void 0&&s===void 0||!(!r||!s)&&Vo(r,s,(a,c)=>cM(a,c))}(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}var ds=class extends Ko{constructor(e,t,r,s=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}},Zn=class extends Ko{constructor(e,t,r,s,a=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=s,this.fieldTransforms=a,this.type=1}getFieldMask(){return this.fieldMask}};function gT(n){let e=new Map;return n.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){let r=n.data.field(t);e.set(t,r)}}),e}function ab(n,e,t){let r=new Map;Le(n.length===t.length);for(let s=0;s<t.length;s++){let a=n[s],c=a.transform,h=e.data.field(a.field);r.set(a.field,uM(c,h,t[s]))}return r}function ub(n,e,t){let r=new Map;for(let s of n){let a=s.transform,c=t.data.field(s.field);r.set(s.field,aM(a,c,e))}return r}var hh=class extends Ko{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}},Fp=class extends Ko{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}};var Up=class{constructor(e,t,r,s){this.batchId=e,this.localWriteTime=t,this.baseMutations=r,this.mutations=s}applyToRemoteDocument(e,t){let r=t.mutationResults;for(let s=0;s<this.mutations.length;s++){let a=this.mutations[s];a.key.isEqual(e.key)&&lM(a,e,r[s])}}applyToLocalView(e,t){for(let r of this.baseMutations)r.key.isEqual(e.key)&&(t=du(r,e,t,this.localWriteTime));for(let r of this.mutations)r.key.isEqual(e.key)&&(t=du(r,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){let r=cT();return this.mutations.forEach(s=>{let a=e.get(s.key),c=a.overlayedDocument,h=this.applyToLocalView(c,a.mutatedFields);h=t.has(s.key)?null:h;let f=mT(c,h);f!==null&&r.set(s.key,f),c.isValidDocument()||c.convertToNoDocument(me.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),xe())}isEqual(e){return this.batchId===e.batchId&&Vo(this.mutations,e.mutations,(t,r)=>ob(t,r))&&Vo(this.baseMutations,e.baseMutations,(t,r)=>ob(t,r))}},Bp=class n{constructor(e,t,r,s){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=s}static from(e,t,r){Le(e.mutations.length===r.length);let s=function(){return nM}(),a=e.mutations;for(let c=0;c<a.length;c++)s=s.insert(a[c].key,r[c].version);return new n(e,t,r,s)}};var jp=class{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
29
+ largestBatchId: ${this.largestBatchId},
30
+ mutation: ${this.mutation.toString()}
31
+ }`}};var $p=class{constructor(e,t){this.count=e,this.unchangedNames=t}};var rt,Pe;function fM(n){switch(n){case H.OK:return ue();case H.CANCELLED:case H.UNKNOWN:case H.DEADLINE_EXCEEDED:case H.RESOURCE_EXHAUSTED:case H.INTERNAL:case H.UNAVAILABLE:case H.UNAUTHENTICATED:return!1;case H.INVALID_ARGUMENT:case H.NOT_FOUND:case H.ALREADY_EXISTS:case H.PERMISSION_DENIED:case H.FAILED_PRECONDITION:case H.ABORTED:case H.OUT_OF_RANGE:case H.UNIMPLEMENTED:case H.DATA_LOSS:return!0;default:return ue()}}function _T(n){if(n===void 0)return Pr("GRPC error has no .code"),H.UNKNOWN;switch(n){case rt.OK:return H.OK;case rt.CANCELLED:return H.CANCELLED;case rt.UNKNOWN:return H.UNKNOWN;case rt.DEADLINE_EXCEEDED:return H.DEADLINE_EXCEEDED;case rt.RESOURCE_EXHAUSTED:return H.RESOURCE_EXHAUSTED;case rt.INTERNAL:return H.INTERNAL;case rt.UNAVAILABLE:return H.UNAVAILABLE;case rt.UNAUTHENTICATED:return H.UNAUTHENTICATED;case rt.INVALID_ARGUMENT:return H.INVALID_ARGUMENT;case rt.NOT_FOUND:return H.NOT_FOUND;case rt.ALREADY_EXISTS:return H.ALREADY_EXISTS;case rt.PERMISSION_DENIED:return H.PERMISSION_DENIED;case rt.FAILED_PRECONDITION:return H.FAILED_PRECONDITION;case rt.ABORTED:return H.ABORTED;case rt.OUT_OF_RANGE:return H.OUT_OF_RANGE;case rt.UNIMPLEMENTED:return H.UNIMPLEMENTED;case rt.DATA_LOSS:return H.DATA_LOSS;default:return ue()}}(Pe=rt||(rt={}))[Pe.OK=0]="OK",Pe[Pe.CANCELLED=1]="CANCELLED",Pe[Pe.UNKNOWN=2]="UNKNOWN",Pe[Pe.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Pe[Pe.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Pe[Pe.NOT_FOUND=5]="NOT_FOUND",Pe[Pe.ALREADY_EXISTS=6]="ALREADY_EXISTS",Pe[Pe.PERMISSION_DENIED=7]="PERMISSION_DENIED",Pe[Pe.UNAUTHENTICATED=16]="UNAUTHENTICATED",Pe[Pe.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Pe[Pe.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Pe[Pe.ABORTED=10]="ABORTED",Pe[Pe.OUT_OF_RANGE=11]="OUT_OF_RANGE",Pe[Pe.UNIMPLEMENTED=12]="UNIMPLEMENTED",Pe[Pe.INTERNAL=13]="INTERNAL",Pe[Pe.UNAVAILABLE=14]="UNAVAILABLE",Pe[Pe.DATA_LOSS=15]="DATA_LOSS";var cb=null;function dM(){return new TextEncoder}var pM=new Sr([4294967295,4294967295],0);function lb(n){let e=dM().encode(n),t=new sp;return t.update(e),new Uint8Array(t.digest())}function hb(n){let e=new DataView(n.buffer),t=e.getUint32(0,!0),r=e.getUint32(4,!0),s=e.getUint32(8,!0),a=e.getUint32(12,!0);return[new Sr([t,r],0),new Sr([s,a],0)]}var qp=class n{constructor(e,t,r){if(this.bitmap=e,this.padding=t,this.hashCount=r,t<0||t>=8)throw new as(`Invalid padding: ${t}`);if(r<0)throw new as(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new as(`Invalid hash count: ${r}`);if(e.length===0&&t!==0)throw new as(`Invalid padding when bitmap length is 0: ${t}`);this.Ee=8*e.length-t,this.de=Sr.fromNumber(this.Ee)}Ae(e,t,r){let s=e.add(t.multiply(Sr.fromNumber(r)));return s.compare(pM)===1&&(s=new Sr([s.getBits(0),s.getBits(1)],0)),s.modulo(this.de).toNumber()}Re(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.Ee===0)return!1;let t=lb(e),[r,s]=hb(t);for(let a=0;a<this.hashCount;a++){let c=this.Ae(r,s,a);if(!this.Re(c))return!1}return!0}static create(e,t,r){let s=e%8==0?0:8-e%8,a=new Uint8Array(Math.ceil(e/8)),c=new n(a,s,t);return r.forEach(h=>c.insert(h)),c}insert(e){if(this.Ee===0)return;let t=lb(e),[r,s]=hb(t);for(let a=0;a<this.hashCount;a++){let c=this.Ae(r,s,a);this.Ve(c)}}Ve(e){let t=Math.floor(e/8),r=e%8;this.bitmap[t]|=1<<r}},as=class extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}};var fh=class n{constructor(e,t,r,s,a){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=r,this.documentUpdates=s,this.resolvedLimboDocuments=a}static createSynthesizedRemoteEventForCurrentChange(e,t,r){let s=new Map;return s.set(e,yu.createSynthesizedTargetChangeForCurrentChange(e,t,r)),new n(me.min(),s,new Je(Re),kr(),xe())}},yu=class n{constructor(e,t,r,s,a){this.resumeToken=e,this.current=t,this.addedDocuments=r,this.modifiedDocuments=s,this.removedDocuments=a}static createSynthesizedTargetChangeForCurrentChange(e,t,r){return new n(r,t,xe(),xe(),xe())}};var Oo=class{constructor(e,t,r,s){this.me=e,this.removedTargetIds=t,this.key=r,this.fe=s}},dh=class{constructor(e,t){this.targetId=e,this.ge=t}},ph=class{constructor(e,t,r=At.EMPTY_BYTE_STRING,s=null){this.state=e,this.targetIds=t,this.resumeToken=r,this.cause=s}},mh=class{constructor(){this.pe=0,this.ye=fb(),this.we=At.EMPTY_BYTE_STRING,this.Se=!1,this.be=!0}get current(){return this.Se}get resumeToken(){return this.we}get De(){return this.pe!==0}get ve(){return this.be}Ce(e){e.approximateByteSize()>0&&(this.be=!0,this.we=e)}Fe(){let e=xe(),t=xe(),r=xe();return this.ye.forEach((s,a)=>{switch(a){case 0:e=e.add(s);break;case 2:t=t.add(s);break;case 1:r=r.add(s);break;default:ue()}}),new yu(this.we,this.Se,e,t,r)}Me(){this.be=!1,this.ye=fb()}xe(e,t){this.be=!0,this.ye=this.ye.insert(e,t)}Oe(e){this.be=!0,this.ye=this.ye.remove(e)}Ne(){this.pe+=1}Be(){this.pe-=1,Le(this.pe>=0)}Le(){this.be=!0,this.Se=!0}},zp=class{constructor(e){this.ke=e,this.qe=new Map,this.Qe=kr(),this.$e=Yl(),this.Ke=Yl(),this.Ue=new Je(Re)}We(e){for(let t of e.me)e.fe&&e.fe.isFoundDocument()?this.Ge(t,e.fe):this.ze(t,e.key,e.fe);for(let t of e.removedTargetIds)this.ze(t,e.key,e.fe)}je(e){this.forEachTarget(e,t=>{let r=this.He(t);switch(e.state){case 0:this.Je(t)&&r.Ce(e.resumeToken);break;case 1:r.Be(),r.De||r.Me(),r.Ce(e.resumeToken);break;case 2:r.Be(),r.De||this.removeTarget(t);break;case 3:this.Je(t)&&(r.Le(),r.Ce(e.resumeToken));break;case 4:this.Je(t)&&(this.Ye(t),r.Ce(e.resumeToken));break;default:ue()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.qe.forEach((r,s)=>{this.Je(s)&&t(s)})}Ze(e){let t=e.targetId,r=e.ge.count,s=this.Xe(t);if(s){let a=s.target;if(Vp(a))if(r===0){let c=new ce(a.path);this.ze(t,c,Rn.newNoDocument(c,me.min()))}else Le(r===1);else{let c=this.et(t);if(c!==r){let h=this.tt(e),f=h?this.nt(h,e,c):1;if(f!==0){this.Ye(t);let m=f===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ue=this.Ue.insert(t,m)}cb==null||cb.rt(function(_,E,I,k,B){var G,j,J,ee,ne,le;let de={localCacheCount:_,existenceFilterCount:E.count,databaseId:I.database,projectId:I.projectId},ie=E.unchangedNames;return ie&&(de.bloomFilter={applied:B===0,hashCount:(G=ie==null?void 0:ie.hashCount)!==null&&G!==void 0?G:0,bitmapLength:(ee=(J=(j=ie==null?void 0:ie.bits)===null||j===void 0?void 0:j.bitmap)===null||J===void 0?void 0:J.length)!==null&&ee!==void 0?ee:0,padding:(le=(ne=ie==null?void 0:ie.bits)===null||ne===void 0?void 0:ne.padding)!==null&&le!==void 0?le:0,mightContain:C=>{var A;return(A=k==null?void 0:k.mightContain(C))!==null&&A!==void 0&&A}}),de}(c,e.ge,this.ke.it(),h,f))}}}}tt(e){let t=e.ge.unchangedNames;if(!t||!t.bits)return null;let{bits:{bitmap:r="",padding:s=0},hashCount:a=0}=t,c,h;try{c=Dr(r).toUint8Array()}catch(f){if(f instanceof ah)return No("Decoding the base64 bloom filter in existence filter failed ("+f.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw f}try{h=new qp(c,s,a)}catch(f){return No(f instanceof as?"BloomFilter error: ":"Applying bloom filter failed: ",f),null}return h.Ee===0?null:h}nt(e,t,r){return t.ge.count===r-this.st(e,t.targetId)?0:2}st(e,t){let r=this.ke.getRemoteKeysForTarget(t),s=0;return r.forEach(a=>{let c=this.ke.it(),h=`projects/${c.projectId}/databases/${c.database}/documents/${a.path.canonicalString()}`;e.mightContain(h)||(this.ze(t,a,null),s++)}),s}ot(e){let t=new Map;this.qe.forEach((a,c)=>{let h=this.Xe(c);if(h){if(a.current&&Vp(h.target)){let f=new ce(h.target.path);this._t(f).has(c)||this.ut(c,f)||this.ze(c,f,Rn.newNoDocument(f,e))}a.ve&&(t.set(c,a.Fe()),a.Me())}});let r=xe();this.Ke.forEach((a,c)=>{let h=!0;c.forEachWhile(f=>{let m=this.Xe(f);return!m||m.purpose==="TargetPurposeLimboResolution"||(h=!1,!1)}),h&&(r=r.add(a))}),this.Qe.forEach((a,c)=>c.setReadTime(e));let s=new fh(e,t,this.Ue,this.Qe,r);return this.Qe=kr(),this.$e=Yl(),this.Ke=Yl(),this.Ue=new Je(Re),s}Ge(e,t){if(!this.Je(e))return;let r=this.ut(e,t.key)?2:0;this.He(e).xe(t.key,r),this.Qe=this.Qe.insert(t.key,t),this.$e=this.$e.insert(t.key,this._t(t.key).add(e)),this.Ke=this.Ke.insert(t.key,this.ct(t.key).add(e))}ze(e,t,r){if(!this.Je(e))return;let s=this.He(e);this.ut(e,t)?s.xe(t,1):s.Oe(t),this.Ke=this.Ke.insert(t,this.ct(t).delete(e)),this.Ke=this.Ke.insert(t,this.ct(t).add(e)),r&&(this.Qe=this.Qe.insert(t,r))}removeTarget(e){this.qe.delete(e)}et(e){let t=this.He(e).Fe();return this.ke.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Ne(e){this.He(e).Ne()}He(e){let t=this.qe.get(e);return t||(t=new mh,this.qe.set(e,t)),t}ct(e){let t=this.Ke.get(e);return t||(t=new gt(Re),this.Ke=this.Ke.insert(e,t)),t}_t(e){let t=this.$e.get(e);return t||(t=new gt(Re),this.$e=this.$e.insert(e,t)),t}Je(e){let t=this.Xe(e)!==null;return t||X("WatchChangeAggregator","Detected inactive target",e),t}Xe(e){let t=this.qe.get(e);return t&&t.De?null:this.ke.lt(e)}Ye(e){this.qe.set(e,new mh),this.ke.getRemoteKeysForTarget(e).forEach(t=>{this.ze(e,t,null)})}ut(e,t){return this.ke.getRemoteKeysForTarget(e).has(t)}};function Yl(){return new Je(ce.comparator)}function fb(){return new Je(ce.comparator)}var mM={asc:"ASCENDING",desc:"DESCENDING"},gM={"<":"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"},_M={and:"AND",or:"OR"},Gp=class{constructor(e,t){this.databaseId=e,this.useProto3Json=t}};function Kp(n,e){return n.useProto3Json||Bh(e)?e:{value:e}}function gh(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function yT(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function yM(n,e){return gh(n,e.toTimestamp())}function Qn(n){return Le(!!n),me.fromTimestamp(function(t){let r=Cr(t);return new yt(r.seconds,r.nanos)}(n))}function sg(n,e){return Wp(n,e).canonicalString()}function Wp(n,e){let t=function(s){return new st(["projects",s.projectId,"databases",s.database])}(n).child("documents");return e===void 0?t:t.child(e)}function vT(n){let e=st.fromString(n);return Le(IT(e)),e}function Hp(n,e){return sg(n.databaseId,e.path)}function hp(n,e){let t=vT(e);if(t.get(1)!==n.databaseId.projectId)throw new re(H.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new re(H.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new ce(bT(t))}function wT(n,e){return sg(n.databaseId,e)}function vM(n){let e=vT(n);return e.length===4?st.emptyPath():bT(e)}function Qp(n){return new st(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function bT(n){return Le(n.length>4&&n.get(4)==="documents"),n.popFirst(5)}function db(n,e,t){return{name:Hp(n,e),fields:t.value.mapValue.fields}}function wM(n,e){let t;if("targetChange"in e){e.targetChange;let r=function(m){return m==="NO_CHANGE"?0:m==="ADD"?1:m==="REMOVE"?2:m==="CURRENT"?3:m==="RESET"?4:ue()}(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],a=function(m,_){return m.useProto3Json?(Le(_===void 0||typeof _=="string"),At.fromBase64String(_||"")):(Le(_===void 0||_ instanceof Buffer||_ instanceof Uint8Array),At.fromUint8Array(_||new Uint8Array))}(n,e.targetChange.resumeToken),c=e.targetChange.cause,h=c&&function(m){let _=m.code===void 0?H.UNKNOWN:_T(m.code);return new re(_,m.message||"")}(c);t=new ph(r,s,a,h||null)}else if("documentChange"in e){e.documentChange;let r=e.documentChange;r.document,r.document.name,r.document.updateTime;let s=hp(n,r.document.name),a=Qn(r.document.updateTime),c=r.document.createTime?Qn(r.document.createTime):me.min(),h=new Zt({mapValue:{fields:r.document.fields}}),f=Rn.newFoundDocument(s,a,c,h),m=r.targetIds||[],_=r.removedTargetIds||[];t=new Oo(m,_,f.key,f)}else if("documentDelete"in e){e.documentDelete;let r=e.documentDelete;r.document;let s=hp(n,r.document),a=r.readTime?Qn(r.readTime):me.min(),c=Rn.newNoDocument(s,a),h=r.removedTargetIds||[];t=new Oo([],h,c.key,c)}else if("documentRemove"in e){e.documentRemove;let r=e.documentRemove;r.document;let s=hp(n,r.document),a=r.removedTargetIds||[];t=new Oo([],a,s,null)}else{if(!("filter"in e))return ue();{e.filter;let r=e.filter;r.targetId;let{count:s=0,unchangedNames:a}=r,c=new $p(s,a),h=r.targetId;t=new dh(h,c)}}return t}function bM(n,e){let t;if(e instanceof ds)t={update:db(n,e.key,e.value)};else if(e instanceof hh)t={delete:Hp(n,e.key)};else if(e instanceof Zn)t={update:db(n,e.key,e.data),updateMask:CM(e.fieldMask)};else{if(!(e instanceof Fp))return ue();t={verify:Hp(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(r=>function(a,c){let h=c.transform;if(h instanceof zo)return{fieldPath:c.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(h instanceof hs)return{fieldPath:c.field.canonicalString(),appendMissingElements:{values:h.elements}};if(h instanceof fs)return{fieldPath:c.field.canonicalString(),removeAllFromArray:{values:h.elements}};if(h instanceof Go)return{fieldPath:c.field.canonicalString(),increment:h.Ie};throw ue()}(0,r))),e.precondition.isNone||(t.currentDocument=function(s,a){return a.updateTime!==void 0?{updateTime:yM(s,a.updateTime)}:a.exists!==void 0?{exists:a.exists}:ue()}(n,e.precondition)),t}function TM(n,e){return n&&n.length>0?(Le(e!==void 0),n.map(t=>function(s,a){let c=s.updateTime?Qn(s.updateTime):Qn(a);return c.isEqual(me.min())&&(c=Qn(a)),new Mp(c,s.transformResults||[])}(t,e))):[]}function EM(n,e){return{documents:[wT(n,e.path)]}}function IM(n,e){let t={structuredQuery:{}},r=e.path,s;e.collectionGroup!==null?(s=r,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=r.popLast(),t.structuredQuery.from=[{collectionId:r.lastSegment()}]),t.parent=wT(n,s);let a=function(m){if(m.length!==0)return ET(Xn.create(m,"and"))}(e.filters);a&&(t.structuredQuery.where=a);let c=function(m){if(m.length!==0)return m.map(_=>function(I){return{field:Po(I.field),direction:SM(I.dir)}}(_))}(e.orderBy);c&&(t.structuredQuery.orderBy=c);let h=Kp(n,e.limit);return h!==null&&(t.structuredQuery.limit=h),e.startAt&&(t.structuredQuery.startAt=function(m){return{before:m.inclusive,values:m.position}}(e.startAt)),e.endAt&&(t.structuredQuery.endAt=function(m){return{before:!m.inclusive,values:m.position}}(e.endAt)),{ht:t,parent:s}}function xM(n){let e=vM(n.parent),t=n.structuredQuery,r=t.from?t.from.length:0,s=null;if(r>0){Le(r===1);let _=t.from[0];_.allDescendants?s=_.collectionId:e=e.child(_.collectionId)}let a=[];t.where&&(a=function(E){let I=TT(E);return I instanceof Xn&&tT(I)?I.getFilters():[I]}(t.where));let c=[];t.orderBy&&(c=function(E){return E.map(I=>function(B){return new jo(Co(B.field),function(j){switch(j){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(B.direction))}(I))}(t.orderBy));let h=null;t.limit&&(h=function(E){let I;return I=typeof E=="object"?E.value:E,Bh(I)?null:I}(t.limit));let f=null;t.startAt&&(f=function(E){let I=!!E.before,k=E.values||[];return new Bo(k,I)}(t.startAt));let m=null;return t.endAt&&(m=function(E){let I=!E.before,k=E.values||[];return new Bo(k,I)}(t.endAt)),J2(e,s,c,a,h,"F",f,m)}function AM(n,e){let t=function(s){switch(s){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ue()}}(e.purpose);return t==null?null:{"goog-listen-tags":t}}function TT(n){return n.unaryFilter!==void 0?function(t){switch(t.unaryFilter.op){case"IS_NAN":let r=Co(t.unaryFilter.field);return dt.create(r,"==",{doubleValue:NaN});case"IS_NULL":let s=Co(t.unaryFilter.field);return dt.create(s,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let a=Co(t.unaryFilter.field);return dt.create(a,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let c=Co(t.unaryFilter.field);return dt.create(c,"!=",{nullValue:"NULL_VALUE"});default:return ue()}}(n):n.fieldFilter!==void 0?function(t){return dt.create(Co(t.fieldFilter.field),function(s){switch(s){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";default:return ue()}}(t.fieldFilter.op),t.fieldFilter.value)}(n):n.compositeFilter!==void 0?function(t){return Xn.create(t.compositeFilter.filters.map(r=>TT(r)),function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return ue()}}(t.compositeFilter.op))}(n):ue()}function SM(n){return mM[n]}function RM(n){return gM[n]}function PM(n){return _M[n]}function Po(n){return{fieldPath:n.canonicalString()}}function Co(n){return en.fromServerFormat(n.fieldPath)}function ET(n){return n instanceof dt?function(t){if(t.op==="=="){if(eb(t.value))return{unaryFilter:{field:Po(t.field),op:"IS_NAN"}};if(Z0(t.value))return{unaryFilter:{field:Po(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(eb(t.value))return{unaryFilter:{field:Po(t.field),op:"IS_NOT_NAN"}};if(Z0(t.value))return{unaryFilter:{field:Po(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Po(t.field),op:RM(t.op),value:t.value}}}(n):n instanceof Xn?function(t){let r=t.getFilters().map(s=>ET(s));return r.length===1?r[0]:{compositeFilter:{op:PM(t.op),filters:r}}}(n):ue()}function CM(n){let e=[];return n.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function IT(n){return n.length>=4&&n.get(0)==="projects"&&n.get(2)==="databases"}var vu=class n{constructor(e,t,r,s,a=me.min(),c=me.min(),h=At.EMPTY_BYTE_STRING,f=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=s,this.snapshotVersion=a,this.lastLimboFreeSnapshotVersion=c,this.resumeToken=h,this.expectedCount=f}withSequenceNumber(e){return new n(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new n(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new n(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new n(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}};var Jp=class{constructor(e){this.Tt=e}};function DM(n){let e=xM({parent:n.parent,structuredQuery:n.structuredQuery});return n.limitType==="LAST"?Lp(e,e.limit,"L"):e}var _h=class{constructor(){}At(e,t){this.Rt(e,t),t.Vt()}Rt(e,t){if("nullValue"in e)this.ft(t,5);else if("booleanValue"in e)this.ft(t,10),t.gt(e.booleanValue?1:0);else if("integerValue"in e)this.ft(t,15),t.gt(ze(e.integerValue));else if("doubleValue"in e){let r=ze(e.doubleValue);isNaN(r)?this.ft(t,13):(this.ft(t,15),mu(r)?t.gt(0):t.gt(r))}else if("timestampValue"in e){let r=e.timestampValue;this.ft(t,20),typeof r=="string"&&(r=Cr(r)),t.yt(`${r.seconds||""}`),t.gt(r.nanos||0)}else if("stringValue"in e)this.wt(e.stringValue,t),this.St(t);else if("bytesValue"in e)this.ft(t,30),t.bt(Dr(e.bytesValue)),this.St(t);else if("referenceValue"in e)this.Dt(e.referenceValue,t);else if("geoPointValue"in e){let r=e.geoPointValue;this.ft(t,45),t.gt(r.latitude||0),t.gt(r.longitude||0)}else"mapValue"in e?Xb(e)?this.ft(t,Number.MAX_SAFE_INTEGER):Yb(e)?this.vt(e.mapValue,t):(this.Ct(e.mapValue,t),this.St(t)):"arrayValue"in e?(this.Ft(e.arrayValue,t),this.St(t)):ue()}wt(e,t){this.ft(t,25),this.Mt(e,t)}Mt(e,t){t.yt(e)}Ct(e,t){let r=e.fields||{};this.ft(t,55);for(let s of Object.keys(r))this.wt(s,t),this.Rt(r[s],t)}vt(e,t){var r,s;let a=e.fields||{};this.ft(t,53);let c=Mo,h=((s=(r=a[c].arrayValue)===null||r===void 0?void 0:r.values)===null||s===void 0?void 0:s.length)||0;this.ft(t,15),t.gt(ze(h)),this.wt(c,t),this.Rt(a[c],t)}Ft(e,t){let r=e.values||[];this.ft(t,50);for(let s of r)this.Rt(s,t)}Dt(e,t){this.ft(t,37),ce.fromName(e).path.forEach(r=>{this.ft(t,60),this.Mt(r,t)})}ft(e,t){e.gt(t)}St(e){e.gt(2)}};_h.xt=new _h;var Yp=class{constructor(){this.Tn=new Xp}addToCollectionParentIndex(e,t){return this.Tn.add(t),W.resolve()}getCollectionParents(e,t){return W.resolve(this.Tn.getEntries(t))}addFieldIndex(e,t){return W.resolve()}deleteFieldIndex(e,t){return W.resolve()}deleteAllFieldIndexes(e){return W.resolve()}createTargetIndexes(e,t){return W.resolve()}getDocumentsMatchingTarget(e,t){return W.resolve(null)}getIndexType(e,t){return W.resolve(0)}getFieldIndexes(e,t){return W.resolve([])}getNextCollectionGroupToUpdate(e){return W.resolve(null)}getMinOffset(e,t){return W.resolve(ls.min())}getMinOffsetFromCollectionGroup(e,t){return W.resolve(ls.min())}updateCollectionGroup(e,t,r){return W.resolve()}updateIndexEntries(e,t){return W.resolve()}},Xp=class{constructor(){this.index={}}add(e){let t=e.lastSegment(),r=e.popLast(),s=this.index[t]||new gt(st.comparator),a=!s.has(r);return this.index[t]=s.add(r),a}has(e){let t=e.lastSegment(),r=e.popLast(),s=this.index[t];return s&&s.has(r)}getEntries(e){return(this.index[e]||new gt(st.comparator)).toArray()}};var dK=new Uint8Array(0);var pb={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},xT=41943040,ln=class n{static withCacheSize(e){return new n(e,n.DEFAULT_COLLECTION_PERCENTILE,n.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=r}};ln.DEFAULT_COLLECTION_PERCENTILE=10,ln.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,ln.DEFAULT=new ln(xT,ln.DEFAULT_COLLECTION_PERCENTILE,ln.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),ln.DISABLED=new ln(-1,0,0);var wu=class n{constructor(e){this.$n=e}next(){return this.$n+=2,this.$n}static Kn(){return new n(0)}static Un(){return new n(-1)}};var mb="LruGarbageCollector",OM=1048576;function gb([n,e],[t,r]){let s=Re(n,t);return s===0?Re(e,r):s}var Zp=class{constructor(e){this.Hn=e,this.buffer=new gt(gb),this.Jn=0}Yn(){return++this.Jn}Zn(e){let t=[e,this.Yn()];if(this.buffer.size<this.Hn)this.buffer=this.buffer.add(t);else{let r=this.buffer.last();gb(t,r)<0&&(this.buffer=this.buffer.delete(r).add(t))}}get maxValue(){return this.buffer.last()[0]}},em=class{constructor(e,t,r){this.garbageCollector=e,this.asyncQueue=t,this.localStore=r,this.Xn=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.er(6e4)}stop(){this.Xn&&(this.Xn.cancel(),this.Xn=null)}get started(){return this.Xn!==null}er(e){X(mb,`Garbage collection scheduled in ${e}ms`),this.Xn=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Xn=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){Xo(t)?X(mb,"Ignoring IndexedDB error during garbage collection: ",t):await Yo(t)}await this.er(3e5)})}},tm=class{constructor(e,t){this.tr=e,this.params=t}calculateTargetCount(e,t){return this.tr.nr(e).next(r=>Math.floor(t/100*r))}nthSequenceNumber(e,t){if(t===0)return W.resolve(Lo.ae);let r=new Zp(t);return this.tr.forEachTarget(e,s=>r.Zn(s.sequenceNumber)).next(()=>this.tr.rr(e,s=>r.Zn(s))).next(()=>r.maxValue)}removeTargets(e,t,r){return this.tr.removeTargets(e,t,r)}removeOrphanedDocuments(e,t){return this.tr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(X("LruGarbageCollector","Garbage collection skipped; disabled"),W.resolve(pb)):this.getCacheSize(e).next(r=>r<this.params.cacheSizeCollectionThreshold?(X("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),pb):this.ir(e,t))}getCacheSize(e){return this.tr.getCacheSize(e)}ir(e,t){let r,s,a,c,h,f,m,_=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(E=>(E>this.params.maximumSequenceNumbersToCollect?(X("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${E}`),s=this.params.maximumSequenceNumbersToCollect):s=E,c=Date.now(),this.nthSequenceNumber(e,s))).next(E=>(r=E,h=Date.now(),this.removeTargets(e,r,t))).next(E=>(a=E,f=Date.now(),this.removeOrphanedDocuments(e,r))).next(E=>(m=Date.now(),So()<=Se.DEBUG&&X("LruGarbageCollector",`LRU Garbage Collection
32
+ Counted targets in ${c-_}ms
33
+ Determined least recently used ${s} in `+(h-c)+`ms
34
+ Removed ${a} targets in `+(f-h)+`ms
35
+ Removed ${E} documents in `+(m-f)+`ms
36
+ Total Duration: ${m-_}ms`),W.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:a,documentsRemoved:E})))}};function kM(n,e){return new tm(n,e)}var nm=class{constructor(){this.changes=new Or(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Rn.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let r=this.changes.get(t);return r!==void 0?W.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}};var rm=class{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}};var im=class{constructor(e,t,r,s){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=s}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next(s=>(r=s,this.remoteDocumentCache.getEntry(e,t))).next(s=>(r!==null&&du(r.mutation,s,hn.empty(),yt.now()),s))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.getLocalViewOfDocuments(e,r,xe()).next(()=>r))}getLocalViewOfDocuments(e,t,r=xe()){let s=os();return this.populateOverlays(e,s,t).next(()=>this.computeViews(e,t,s,r).next(a=>{let c=cu();return a.forEach((h,f)=>{c=c.insert(h,f.overlayedDocument)}),c}))}getOverlayedDocuments(e,t){let r=os();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,xe()))}populateOverlays(e,t,r){let s=[];return r.forEach(a=>{t.has(a)||s.push(a)}),this.documentOverlayCache.getOverlays(e,s).next(a=>{a.forEach((c,h)=>{t.set(c,h)})})}computeViews(e,t,r,s){let a=kr(),c=fu(),h=function(){return fu()}();return t.forEach((f,m)=>{let _=r.get(m.key);s.has(m.key)&&(_===void 0||_.mutation instanceof Zn)?a=a.insert(m.key,m):_!==void 0?(c.set(m.key,_.mutation.getFieldMask()),du(_.mutation,m,_.mutation.getFieldMask(),yt.now())):c.set(m.key,hn.empty())}),this.recalculateAndSaveOverlays(e,a).next(f=>(f.forEach((m,_)=>c.set(m,_)),t.forEach((m,_)=>{var E;return h.set(m,new rm(_,(E=c.get(m))!==null&&E!==void 0?E:null))}),h))}recalculateAndSaveOverlays(e,t){let r=fu(),s=new Je((c,h)=>c-h),a=xe();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(c=>{for(let h of c)h.keys().forEach(f=>{let m=t.get(f);if(m===null)return;let _=r.get(f)||hn.empty();_=h.applyToLocalView(m,_),r.set(f,_);let E=(s.get(h.batchId)||xe()).add(f);s=s.insert(h.batchId,E)})}).next(()=>{let c=[],h=s.getReverseIterator();for(;h.hasNext();){let f=h.getNext(),m=f.key,_=f.value,E=cT();_.forEach(I=>{if(!a.has(I)){let k=mT(t.get(I),r.get(I));k!==null&&E.set(I,k),a=a.add(I)}}),c.push(this.documentOverlayCache.saveOverlays(e,m,E))}return W.waitFor(c)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,t,r,s){return function(c){return ce.isDocumentKey(c.path)&&c.collectionGroup===null&&c.filters.length===0}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):Y2(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,s):this.getDocumentsMatchingCollectionQuery(e,t,r,s)}getNextDocuments(e,t,r,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,s).next(a=>{let c=s-a.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,s-a.size):W.resolve(os()),h=pu,f=a;return c.next(m=>W.forEach(m,(_,E)=>(h<E.largestBatchId&&(h=E.largestBatchId),a.get(_)?W.resolve():this.remoteDocumentCache.getEntry(e,_).next(I=>{f=f.insert(_,I)}))).next(()=>this.populateOverlays(e,m,a)).next(()=>this.computeViews(e,f,m,xe())).next(_=>({batchId:h,changes:uT(_)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new ce(t)).next(r=>{let s=cu();return r.isFoundDocument()&&(s=s.insert(r.key,r)),s})}getDocumentsMatchingCollectionGroupQuery(e,t,r,s){let a=t.collectionGroup,c=cu();return this.indexManager.getCollectionParents(e,a).next(h=>W.forEach(h,f=>{let m=function(E,I){return new $o(I,null,E.explicitOrderBy.slice(),E.filters.slice(),E.limit,E.limitType,E.startAt,E.endAt)}(t,f.child(a));return this.getDocumentsMatchingCollectionQuery(e,m,r,s).next(_=>{_.forEach((E,I)=>{c=c.insert(E,I)})})}).next(()=>c))}getDocumentsMatchingCollectionQuery(e,t,r,s){let a;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(c=>(a=c,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,a,s))).next(c=>{a.forEach((f,m)=>{let _=m.getKey();c.get(_)===null&&(c=c.insert(_,Rn.newInvalidDocument(_)))});let h=cu();return c.forEach((f,m)=>{let _=a.get(f);_!==void 0&&du(_.mutation,m,hn.empty(),yt.now()),zh(t,m)&&(h=h.insert(f,m))}),h})}};var sm=class{constructor(e){this.serializer=e,this.dr=new Map,this.Ar=new Map}getBundleMetadata(e,t){return W.resolve(this.dr.get(t))}saveBundleMetadata(e,t){return this.dr.set(t.id,function(s){return{id:s.id,version:s.version,createTime:Qn(s.createTime)}}(t)),W.resolve()}getNamedQuery(e,t){return W.resolve(this.Ar.get(t))}saveNamedQuery(e,t){return this.Ar.set(t.name,function(s){return{name:s.name,query:DM(s.bundledQuery),readTime:Qn(s.readTime)}}(t)),W.resolve()}};var om=class{constructor(){this.overlays=new Je(ce.comparator),this.Rr=new Map}getOverlay(e,t){return W.resolve(this.overlays.get(t))}getOverlays(e,t){let r=os();return W.forEach(t,s=>this.getOverlay(e,s).next(a=>{a!==null&&r.set(s,a)})).next(()=>r)}saveOverlays(e,t,r){return r.forEach((s,a)=>{this.Et(e,t,a)}),W.resolve()}removeOverlaysForBatchId(e,t,r){let s=this.Rr.get(r);return s!==void 0&&(s.forEach(a=>this.overlays=this.overlays.remove(a)),this.Rr.delete(r)),W.resolve()}getOverlaysForCollection(e,t,r){let s=os(),a=t.length+1,c=new ce(t.child("")),h=this.overlays.getIteratorFrom(c);for(;h.hasNext();){let f=h.getNext().value,m=f.getKey();if(!t.isPrefixOf(m.path))break;m.path.length===a&&f.largestBatchId>r&&s.set(f.getKey(),f)}return W.resolve(s)}getOverlaysForCollectionGroup(e,t,r,s){let a=new Je((m,_)=>m-_),c=this.overlays.getIterator();for(;c.hasNext();){let m=c.getNext().value;if(m.getKey().getCollectionGroup()===t&&m.largestBatchId>r){let _=a.get(m.largestBatchId);_===null&&(_=os(),a=a.insert(m.largestBatchId,_)),_.set(m.getKey(),m)}}let h=os(),f=a.getIterator();for(;f.hasNext()&&(f.getNext().value.forEach((m,_)=>h.set(m,_)),!(h.size()>=s)););return W.resolve(h)}Et(e,t,r){let s=this.overlays.get(r.key);if(s!==null){let c=this.Rr.get(s.largestBatchId).delete(r.key);this.Rr.set(s.largestBatchId,c)}this.overlays=this.overlays.insert(r.key,new jp(t,r));let a=this.Rr.get(t);a===void 0&&(a=xe(),this.Rr.set(t,a)),this.Rr.set(t,a.add(r.key))}};var am=class{constructor(){this.sessionToken=At.EMPTY_BYTE_STRING}getSessionToken(e){return W.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,W.resolve()}};var bu=class{constructor(){this.Vr=new gt(it.mr),this.gr=new gt(it.pr)}isEmpty(){return this.Vr.isEmpty()}addReference(e,t){let r=new it(e,t);this.Vr=this.Vr.add(r),this.gr=this.gr.add(r)}yr(e,t){e.forEach(r=>this.addReference(r,t))}removeReference(e,t){this.wr(new it(e,t))}Sr(e,t){e.forEach(r=>this.removeReference(r,t))}br(e){let t=new ce(new st([])),r=new it(t,e),s=new it(t,e+1),a=[];return this.gr.forEachInRange([r,s],c=>{this.wr(c),a.push(c.key)}),a}Dr(){this.Vr.forEach(e=>this.wr(e))}wr(e){this.Vr=this.Vr.delete(e),this.gr=this.gr.delete(e)}vr(e){let t=new ce(new st([])),r=new it(t,e),s=new it(t,e+1),a=xe();return this.gr.forEachInRange([r,s],c=>{a=a.add(c.key)}),a}containsKey(e){let t=new it(e,0),r=this.Vr.firstAfterOrEqual(t);return r!==null&&e.isEqual(r.key)}},it=class{constructor(e,t){this.key=e,this.Cr=t}static mr(e,t){return ce.comparator(e.key,t.key)||Re(e.Cr,t.Cr)}static pr(e,t){return Re(e.Cr,t.Cr)||ce.comparator(e.key,t.key)}};var um=class{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Fr=1,this.Mr=new gt(it.mr)}checkEmpty(e){return W.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,r,s){let a=this.Fr;this.Fr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let c=new Up(a,t,r,s);this.mutationQueue.push(c);for(let h of s)this.Mr=this.Mr.add(new it(h.key,a)),this.indexManager.addToCollectionParentIndex(e,h.key.path.popLast());return W.resolve(c)}lookupMutationBatch(e,t){return W.resolve(this.Or(t))}getNextMutationBatchAfterBatchId(e,t){let r=t+1,s=this.Nr(r),a=s<0?0:s;return W.resolve(this.mutationQueue.length>a?this.mutationQueue[a]:null)}getHighestUnacknowledgedBatchId(){return W.resolve(this.mutationQueue.length===0?Ym:this.Fr-1)}getAllMutationBatches(e){return W.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let r=new it(t,0),s=new it(t,Number.POSITIVE_INFINITY),a=[];return this.Mr.forEachInRange([r,s],c=>{let h=this.Or(c.Cr);a.push(h)}),W.resolve(a)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new gt(Re);return t.forEach(s=>{let a=new it(s,0),c=new it(s,Number.POSITIVE_INFINITY);this.Mr.forEachInRange([a,c],h=>{r=r.add(h.Cr)})}),W.resolve(this.Br(r))}getAllMutationBatchesAffectingQuery(e,t){let r=t.path,s=r.length+1,a=r;ce.isDocumentKey(a)||(a=a.child(""));let c=new it(new ce(a),0),h=new gt(Re);return this.Mr.forEachWhile(f=>{let m=f.key.path;return!!r.isPrefixOf(m)&&(m.length===s&&(h=h.add(f.Cr)),!0)},c),W.resolve(this.Br(h))}Br(e){let t=[];return e.forEach(r=>{let s=this.Or(r);s!==null&&t.push(s)}),t}removeMutationBatch(e,t){Le(this.Lr(t.batchId,"removed")===0),this.mutationQueue.shift();let r=this.Mr;return W.forEach(t.mutations,s=>{let a=new it(s.key,t.batchId);return r=r.delete(a),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)}).next(()=>{this.Mr=r})}qn(e){}containsKey(e,t){let r=new it(t,0),s=this.Mr.firstAfterOrEqual(r);return W.resolve(t.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,W.resolve()}Lr(e,t){return this.Nr(e)}Nr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Or(e){let t=this.Nr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}};var cm=class{constructor(e){this.kr=e,this.docs=function(){return new Je(ce.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){let r=t.key,s=this.docs.get(r),a=s?s.size:0,c=this.kr(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:c}),this.size+=c-a,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){let t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){let r=this.docs.get(t);return W.resolve(r?r.document.mutableCopy():Rn.newInvalidDocument(t))}getEntries(e,t){let r=kr();return t.forEach(s=>{let a=this.docs.get(s);r=r.insert(s,a?a.document.mutableCopy():Rn.newInvalidDocument(s))}),W.resolve(r)}getDocumentsMatchingQuery(e,t,r,s){let a=kr(),c=t.path,h=new ce(c.child("__id-9223372036854775808__")),f=this.docs.getIteratorFrom(h);for(;f.hasNext();){let{key:m,value:{document:_}}=f.getNext();if(!c.isPrefixOf(m.path))break;m.path.length>c.length+1||D2(C2(_),r)<=0||(s.has(_.key)||zh(t,_))&&(a=a.insert(_.key,_.mutableCopy()))}return W.resolve(a)}getAllFromCollectionGroup(e,t,r,s){ue()}qr(e,t){return W.forEach(this.docs,r=>t(r))}newChangeBuffer(e){return new lm(this)}getSize(e){return W.resolve(this.size)}},lm=class extends nm{constructor(e){super(),this.Ir=e}applyChanges(e){let t=[];return this.changes.forEach((r,s)=>{s.isValidDocument()?t.push(this.Ir.addEntry(e,s)):this.Ir.removeEntry(r)}),W.waitFor(t)}getFromCache(e,t){return this.Ir.getEntry(e,t)}getAllFromCache(e,t){return this.Ir.getEntries(e,t)}};var hm=class{constructor(e){this.persistence=e,this.Qr=new Or(t=>ng(t),rg),this.lastRemoteSnapshotVersion=me.min(),this.highestTargetId=0,this.$r=0,this.Kr=new bu,this.targetCount=0,this.Ur=wu.Kn()}forEachTarget(e,t){return this.Qr.forEach((r,s)=>t(s)),W.resolve()}getLastRemoteSnapshotVersion(e){return W.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return W.resolve(this.$r)}allocateTargetId(e){return this.highestTargetId=this.Ur.next(),W.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.$r&&(this.$r=t),W.resolve()}zn(e){this.Qr.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this.Ur=new wu(t),this.highestTargetId=t),e.sequenceNumber>this.$r&&(this.$r=e.sequenceNumber)}addTargetData(e,t){return this.zn(t),this.targetCount+=1,W.resolve()}updateTargetData(e,t){return this.zn(t),W.resolve()}removeTargetData(e,t){return this.Qr.delete(t.target),this.Kr.br(t.targetId),this.targetCount-=1,W.resolve()}removeTargets(e,t,r){let s=0,a=[];return this.Qr.forEach((c,h)=>{h.sequenceNumber<=t&&r.get(h.targetId)===null&&(this.Qr.delete(c),a.push(this.removeMatchingKeysForTargetId(e,h.targetId)),s++)}),W.waitFor(a).next(()=>s)}getTargetCount(e){return W.resolve(this.targetCount)}getTargetData(e,t){let r=this.Qr.get(t)||null;return W.resolve(r)}addMatchingKeys(e,t,r){return this.Kr.yr(t,r),W.resolve()}removeMatchingKeys(e,t,r){this.Kr.Sr(t,r);let s=this.persistence.referenceDelegate,a=[];return s&&t.forEach(c=>{a.push(s.markPotentiallyOrphaned(e,c))}),W.waitFor(a)}removeMatchingKeysForTargetId(e,t){return this.Kr.br(t),W.resolve()}getMatchingKeysForTargetId(e,t){let r=this.Kr.vr(t);return W.resolve(r)}containsKey(e,t){return W.resolve(this.Kr.containsKey(t))}};var yh=class{constructor(e,t){this.Wr={},this.overlays={},this.Gr=new Lo(0),this.zr=!1,this.zr=!0,this.jr=new am,this.referenceDelegate=e(this),this.Hr=new hm(this),this.indexManager=new Yp,this.remoteDocumentCache=function(s){return new cm(s)}(r=>this.referenceDelegate.Jr(r)),this.serializer=new Jp(t),this.Yr=new sm(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.zr=!1,Promise.resolve()}get started(){return this.zr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new om,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.Wr[e.toKey()];return r||(r=new um(t,this.referenceDelegate),this.Wr[e.toKey()]=r),r}getGlobalsCache(){return this.jr}getTargetCache(){return this.Hr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Yr}runTransaction(e,t,r){X("MemoryPersistence","Starting transaction:",e);let s=new fm(this.Gr.next());return this.referenceDelegate.Zr(),r(s).next(a=>this.referenceDelegate.Xr(s).next(()=>a)).toPromise().then(a=>(s.raiseOnCommittedEvent(),a))}ei(e,t){return W.or(Object.values(this.Wr).map(r=>()=>r.containsKey(e,t)))}},fm=class extends Tp{constructor(e){super(),this.currentSequenceNumber=e}},dm=class n{constructor(e){this.persistence=e,this.ti=new bu,this.ni=null}static ri(e){return new n(e)}get ii(){if(this.ni)return this.ni;throw ue()}addReference(e,t,r){return this.ti.addReference(r,t),this.ii.delete(r.toString()),W.resolve()}removeReference(e,t,r){return this.ti.removeReference(r,t),this.ii.add(r.toString()),W.resolve()}markPotentiallyOrphaned(e,t){return this.ii.add(t.toString()),W.resolve()}removeTarget(e,t){this.ti.br(t.targetId).forEach(s=>this.ii.add(s.toString()));let r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(s=>{s.forEach(a=>this.ii.add(a.toString()))}).next(()=>r.removeTargetData(e,t))}Zr(){this.ni=new Set}Xr(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return W.forEach(this.ii,r=>{let s=ce.fromPath(r);return this.si(e,s).next(a=>{a||t.removeEntry(s,me.min())})}).next(()=>(this.ni=null,t.apply(e)))}updateLimboDocument(e,t){return this.si(e,t).next(r=>{r?this.ii.delete(t.toString()):this.ii.add(t.toString())})}Jr(e){return 0}si(e,t){return W.or([()=>W.resolve(this.ti.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.ei(e,t)])}},vh=class n{constructor(e,t){this.persistence=e,this.oi=new Or(r=>V2(r.path),(r,s)=>r.isEqual(s)),this.garbageCollector=kM(this,t)}static ri(e,t){return new n(e,t)}Zr(){}Xr(e){return W.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}nr(e){let t=this.sr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>t.next(s=>r+s))}sr(e){let t=0;return this.rr(e,r=>{t++}).next(()=>t)}rr(e,t){return W.forEach(this.oi,(r,s)=>this.ar(e,r,s).next(a=>a?W.resolve():t(s)))}removeTargets(e,t,r){return this.persistence.getTargetCache().removeTargets(e,t,r)}removeOrphanedDocuments(e,t){let r=0,s=this.persistence.getRemoteDocumentCache(),a=s.newChangeBuffer();return s.qr(e,c=>this.ar(e,c,t).next(h=>{h||(r++,a.removeEntry(c,me.min()))})).next(()=>a.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,t){return this.oi.set(t,e.currentSequenceNumber),W.resolve()}removeTarget(e,t){let r=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,t,r){return this.oi.set(r,e.currentSequenceNumber),W.resolve()}removeReference(e,t,r){return this.oi.set(r,e.currentSequenceNumber),W.resolve()}updateLimboDocument(e,t){return this.oi.set(t,e.currentSequenceNumber),W.resolve()}Jr(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=Zl(e.data.value)),t}ar(e,t,r){return W.or([()=>this.persistence.ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{let s=this.oi.get(t);return W.resolve(s!==void 0&&s>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}};var pm=class n{constructor(e,t,r,s){this.targetId=e,this.fromCache=t,this.Hi=r,this.Ji=s}static Yi(e,t){let r=xe(),s=xe();for(let a of t.docChanges)switch(a.type){case 0:r=r.add(a.doc.key);break;case 1:s=s.add(a.doc.key)}return new n(e,t.fromCache,r,s)}};var mm=class{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}};var gm=class{constructor(){this.Zi=!1,this.Xi=!1,this.es=100,this.ts=function(){return T0()?8:k2(b0())>0?6:4}()}initialize(e,t){this.ns=e,this.indexManager=t,this.Zi=!0}getDocumentsMatchingQuery(e,t,r,s){let a={result:null};return this.rs(e,t).next(c=>{a.result=c}).next(()=>{if(!a.result)return this.ss(e,t,s,r).next(c=>{a.result=c})}).next(()=>{if(a.result)return;let c=new mm;return this._s(e,t,c).next(h=>{if(a.result=h,this.Xi)return this.us(e,t,c,h.size)})}).next(()=>a.result)}us(e,t,r,s){return r.documentReadCount<this.es?(So()<=Se.DEBUG&&X("QueryEngine","SDK will not create cache indexes for query:",Ro(t),"since it only creates cache indexes for collection contains","more than or equal to",this.es,"documents"),W.resolve()):(So()<=Se.DEBUG&&X("QueryEngine","Query:",Ro(t),"scans",r.documentReadCount,"local documents and returns",s,"documents as results."),r.documentReadCount>this.ts*s?(So()<=Se.DEBUG&&X("QueryEngine","The SDK decides to create cache indexes for query:",Ro(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Hn(t))):W.resolve())}rs(e,t){if(ib(t))return W.resolve(null);let r=Hn(t);return this.indexManager.getIndexType(e,r).next(s=>s===0?null:(t.limit!==null&&s===1&&(t=Lp(t,null,"F"),r=Hn(t)),this.indexManager.getDocumentsMatchingTarget(e,r).next(a=>{let c=xe(...a);return this.ns.getDocuments(e,c).next(h=>this.indexManager.getMinOffset(e,r).next(f=>{let m=this.cs(t,h);return this.ls(t,m,c,f.readTime)?this.rs(e,Lp(t,null,"F")):this.hs(e,m,t,f)}))})))}ss(e,t,r,s){return ib(t)||s.isEqual(me.min())?W.resolve(null):this.ns.getDocuments(e,r).next(a=>{let c=this.cs(t,a);return this.ls(t,c,r,s)?W.resolve(null):(So()<=Se.DEBUG&&X("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),Ro(t)),this.hs(e,c,t,P2(s,pu)).next(h=>h))})}cs(e,t){let r=new gt(oT(e));return t.forEach((s,a)=>{zh(e,a)&&(r=r.add(a))}),r}ls(e,t,r,s){if(e.limit===null)return!1;if(r.size!==t.size)return!0;let a=e.limitType==="F"?t.last():t.first();return!!a&&(a.hasPendingWrites||a.version.compareTo(s)>0)}_s(e,t,r){return So()<=Se.DEBUG&&X("QueryEngine","Using full collection scan to execute query:",Ro(t)),this.ns.getDocumentsMatchingQuery(e,t,ls.min(),r)}hs(e,t,r,s){return this.ns.getDocumentsMatchingQuery(e,r,s).next(a=>(t.forEach(c=>{a=a.insert(c.key,c)}),a))}};var og="LocalStore",NM=3e8,_m=class{constructor(e,t,r,s){this.persistence=e,this.Ps=t,this.serializer=s,this.Ts=new Je(Re),this.Is=new Or(a=>ng(a),rg),this.Es=new Map,this.ds=e.getRemoteDocumentCache(),this.Hr=e.getTargetCache(),this.Yr=e.getBundleCache(),this.As(r)}As(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new im(this.ds,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ds.setIndexManager(this.indexManager),this.Ps.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ts))}};function VM(n,e,t,r){return new _m(n,e,t,r)}async function AT(n,e){let t=fe(n);return await t.persistence.runTransaction("Handle user change","readonly",r=>{let s;return t.mutationQueue.getAllMutationBatches(r).next(a=>(s=a,t.As(e),t.mutationQueue.getAllMutationBatches(r))).next(a=>{let c=[],h=[],f=xe();for(let m of s){c.push(m.batchId);for(let _ of m.mutations)f=f.add(_.key)}for(let m of a){h.push(m.batchId);for(let _ of m.mutations)f=f.add(_.key)}return t.localDocuments.getDocuments(r,f).next(m=>({Rs:m,removedBatchIds:c,addedBatchIds:h}))})})}function LM(n,e){let t=fe(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{let s=e.batch.keys(),a=t.ds.newChangeBuffer({trackRemovals:!0});return function(h,f,m,_){let E=m.batch,I=E.keys(),k=W.resolve();return I.forEach(B=>{k=k.next(()=>_.getEntry(f,B)).next(G=>{let j=m.docVersions.get(B);Le(j!==null),G.version.compareTo(j)<0&&(E.applyToRemoteDocument(G,m),G.isValidDocument()&&(G.setReadTime(m.commitVersion),_.addEntry(G)))})}),k.next(()=>h.mutationQueue.removeMutationBatch(f,E))}(t,r,e,a).next(()=>a.apply(r)).next(()=>t.mutationQueue.performConsistencyCheck(r)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(r,s,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(h){let f=xe();for(let m=0;m<h.mutationResults.length;++m)h.mutationResults[m].transformResults.length>0&&(f=f.add(h.batch.mutations[m].key));return f}(e))).next(()=>t.localDocuments.getDocuments(r,s))})}function ST(n){let e=fe(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Hr.getLastRemoteSnapshotVersion(t))}function MM(n,e){let t=fe(n),r=e.snapshotVersion,s=t.Ts;return t.persistence.runTransaction("Apply remote event","readwrite-primary",a=>{let c=t.ds.newChangeBuffer({trackRemovals:!0});s=t.Ts;let h=[];e.targetChanges.forEach((_,E)=>{let I=s.get(E);if(!I)return;h.push(t.Hr.removeMatchingKeys(a,_.removedDocuments,E).next(()=>t.Hr.addMatchingKeys(a,_.addedDocuments,E)));let k=I.withSequenceNumber(a.currentSequenceNumber);e.targetMismatches.get(E)!==null?k=k.withResumeToken(At.EMPTY_BYTE_STRING,me.min()).withLastLimboFreeSnapshotVersion(me.min()):_.resumeToken.approximateByteSize()>0&&(k=k.withResumeToken(_.resumeToken,r)),s=s.insert(E,k),function(G,j,J){return G.resumeToken.approximateByteSize()===0||j.snapshotVersion.toMicroseconds()-G.snapshotVersion.toMicroseconds()>=NM?!0:J.addedDocuments.size+J.modifiedDocuments.size+J.removedDocuments.size>0}(I,k,_)&&h.push(t.Hr.updateTargetData(a,k))});let f=kr(),m=xe();if(e.documentUpdates.forEach(_=>{e.resolvedLimboDocuments.has(_)&&h.push(t.persistence.referenceDelegate.updateLimboDocument(a,_))}),h.push(FM(a,c,e.documentUpdates).next(_=>{f=_.Vs,m=_.fs})),!r.isEqual(me.min())){let _=t.Hr.getLastRemoteSnapshotVersion(a).next(E=>t.Hr.setTargetsMetadata(a,a.currentSequenceNumber,r));h.push(_)}return W.waitFor(h).next(()=>c.apply(a)).next(()=>t.localDocuments.getLocalViewOfDocuments(a,f,m)).next(()=>f)}).then(a=>(t.Ts=s,a))}function FM(n,e,t){let r=xe(),s=xe();return t.forEach(a=>r=r.add(a)),e.getEntries(n,r).next(a=>{let c=kr();return t.forEach((h,f)=>{let m=a.get(h);f.isFoundDocument()!==m.isFoundDocument()&&(s=s.add(h)),f.isNoDocument()&&f.version.isEqual(me.min())?(e.removeEntry(h,f.readTime),c=c.insert(h,f)):!m.isValidDocument()||f.version.compareTo(m.version)>0||f.version.compareTo(m.version)===0&&m.hasPendingWrites?(e.addEntry(f),c=c.insert(h,f)):X(og,"Ignoring outdated watch update for ",h,". Current version:",m.version," Watch version:",f.version)}),{Vs:c,fs:s}})}function UM(n,e){let t=fe(n);return t.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=Ym),t.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function BM(n,e){let t=fe(n);return t.persistence.runTransaction("Allocate target","readwrite",r=>{let s;return t.Hr.getTargetData(r,e).next(a=>a?(s=a,W.resolve(s)):t.Hr.allocateTargetId(r).next(c=>(s=new vu(e,c,"TargetPurposeListen",r.currentSequenceNumber),t.Hr.addTargetData(r,s).next(()=>s))))}).then(r=>{let s=t.Ts.get(r.targetId);return(s===null||r.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(t.Ts=t.Ts.insert(r.targetId,r),t.Is.set(e,r.targetId)),r})}async function ym(n,e,t){let r=fe(n),s=r.Ts.get(e),a=t?"readwrite":"readwrite-primary";try{t||await r.persistence.runTransaction("Release target",a,c=>r.persistence.referenceDelegate.removeTarget(c,s))}catch(c){if(!Xo(c))throw c;X(og,`Failed to update sequence numbers for target ${e}: ${c}`)}r.Ts=r.Ts.remove(e),r.Is.delete(s.target)}function _b(n,e,t){let r=fe(n),s=me.min(),a=xe();return r.persistence.runTransaction("Execute query","readwrite",c=>function(f,m,_){let E=fe(f),I=E.Is.get(_);return I!==void 0?W.resolve(E.Ts.get(I)):E.Hr.getTargetData(m,_)}(r,c,Hn(e)).next(h=>{if(h)return s=h.lastLimboFreeSnapshotVersion,r.Hr.getMatchingKeysForTargetId(c,h.targetId).next(f=>{a=f})}).next(()=>r.Ps.getDocumentsMatchingQuery(c,e,t?s:me.min(),t?a:xe())).next(h=>(jM(r,Z2(e),h),{documents:h,gs:a})))}function jM(n,e,t){let r=n.Es.get(e)||me.min();t.forEach((s,a)=>{a.readTime.compareTo(r)>0&&(r=a.readTime)}),n.Es.set(e,r)}var wh=class{constructor(){this.activeTargetIds=sM()}Ds(e){this.activeTargetIds=this.activeTargetIds.add(e)}vs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}bs(){let e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}};var vm=class{constructor(){this.ho=new wh,this.Po={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.ho.Ds(e),this.Po[e]||"not-current"}updateQueryState(e,t,r){this.Po[e]=t}removeLocalQueryTarget(e){this.ho.vs(e)}isLocalQueryTarget(e){return this.ho.activeTargetIds.has(e)}clearQueryState(e){delete this.Po[e]}getAllActiveQueryTargets(){return this.ho.activeTargetIds}isActiveQueryTarget(e){return this.ho.activeTargetIds.has(e)}start(){return this.ho=new wh,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}};var wm=class{To(e){}shutdown(){}};var yb="ConnectivityMonitor",bh=class{constructor(){this.Io=()=>this.Eo(),this.Ao=()=>this.Ro(),this.Vo=[],this.mo()}To(e){this.Vo.push(e)}shutdown(){window.removeEventListener("online",this.Io),window.removeEventListener("offline",this.Ao)}mo(){window.addEventListener("online",this.Io),window.addEventListener("offline",this.Ao)}Eo(){X(yb,"Network connectivity changed: AVAILABLE");for(let e of this.Vo)e(0)}Ro(){X(yb,"Network connectivity changed: UNAVAILABLE");for(let e of this.Vo)e(1)}static D(){return typeof window!="undefined"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}};var Xl=null;function bm(){return Xl===null?Xl=function(){return 268435456+Math.round(2147483648*Math.random())}():Xl++,"0x"+Xl.toString(16)}var fp="RestConnection",$M={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"},Tm=class{get fo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;let t=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.po=t+"://"+e.host,this.yo=`projects/${r}/databases/${s}`,this.wo=this.databaseId.database===uh?`project_id=${r}`:`project_id=${r}&database_id=${s}`}So(e,t,r,s,a){let c=bm(),h=this.bo(e,t.toUriEncodedString());X(fp,`Sending RPC '${e}' ${c}:`,h,r);let f={"google-cloud-resource-prefix":this.yo,"x-goog-request-params":this.wo};return this.Do(f,s,a),this.vo(e,h,f,r).then(m=>(X(fp,`Received RPC '${e}' ${c}: `,m),m),m=>{throw No(fp,`RPC '${e}' ${c} failed with error: `,m,"url: ",h,"request:",r),m})}Co(e,t,r,s,a,c){return this.So(e,t,r,s,a)}Do(e,t,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Jo}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((s,a)=>e[a]=s),r&&r.headers.forEach((s,a)=>e[a]=s)}bo(e,t){let r=$M[e];return`${this.po}/v1/${t}:${r}`}terminate(){}};var Em=class{constructor(e){this.Fo=e.Fo,this.Mo=e.Mo}xo(e){this.Oo=e}No(e){this.Bo=e}Lo(e){this.ko=e}onMessage(e){this.qo=e}close(){this.Mo()}send(e){this.Fo(e)}Qo(){this.Oo()}$o(){this.Bo()}Ko(e){this.ko(e)}Uo(e){this.qo(e)}};var xt="WebChannelConnection",Im=class extends Tm{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}vo(e,t,r,s){let a=bm();return new Promise((c,h)=>{let f=new op;f.setWithCredentials(!0),f.listenOnce(ap.COMPLETE,()=>{try{switch(f.getLastErrorCode()){case uu.NO_ERROR:let _=f.getResponseJson();X(xt,`XHR for RPC '${e}' ${a} received:`,JSON.stringify(_)),c(_);break;case uu.TIMEOUT:X(xt,`RPC '${e}' ${a} timed out`),h(new re(H.DEADLINE_EXCEEDED,"Request time out"));break;case uu.HTTP_ERROR:let E=f.getStatus();if(X(xt,`RPC '${e}' ${a} failed with status:`,E,"response text:",f.getResponseText()),E>0){let I=f.getResponseJson();Array.isArray(I)&&(I=I[0]);let k=I==null?void 0:I.error;if(k&&k.status&&k.message){let B=function(j){let J=j.toLowerCase().replace(/_/g,"-");return Object.values(H).indexOf(J)>=0?J:H.UNKNOWN}(k.status);h(new re(B,k.message))}else h(new re(H.UNKNOWN,"Server responded with status "+f.getStatus()))}else h(new re(H.UNAVAILABLE,"Connection failed."));break;default:ue()}}finally{X(xt,`RPC '${e}' ${a} completed.`)}});let m=JSON.stringify(s);X(xt,`RPC '${e}' ${a} sending request:`,s),f.send(t,"POST",m,r,15)})}Wo(e,t,r){let s=bm(),a=[this.po,"/","google.firestore.v1.Firestore","/",e,"/channel"],c=lp(),h=cp(),f={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},m=this.longPollingOptions.timeoutSeconds;m!==void 0&&(f.longPollingTimeout=Math.round(1e3*m)),this.useFetchStreams&&(f.useFetchStreams=!0),this.Do(f.initMessageHeaders,t,r),f.encodeInitMessageHeaders=!0;let _=a.join("");X(xt,`Creating RPC '${e}' stream ${s}: ${_}`,f);let E=c.createWebChannel(_,f),I=!1,k=!1,B=new Em({Fo:j=>{k?X(xt,`Not sending because RPC '${e}' stream ${s} is closed:`,j):(I||(X(xt,`Opening RPC '${e}' stream ${s} transport.`),E.open(),I=!0),X(xt,`RPC '${e}' stream ${s} sending:`,j),E.send(j))},Mo:()=>E.close()}),G=(j,J,ee)=>{j.listen(J,ne=>{try{ee(ne)}catch(le){setTimeout(()=>{throw le},0)}})};return G(E,Ao.EventType.OPEN,()=>{k||(X(xt,`RPC '${e}' stream ${s} transport opened.`),B.Qo())}),G(E,Ao.EventType.CLOSE,()=>{k||(k=!0,X(xt,`RPC '${e}' stream ${s} transport closed`),B.Ko())}),G(E,Ao.EventType.ERROR,j=>{k||(k=!0,No(xt,`RPC '${e}' stream ${s} transport errored:`,j),B.Ko(new re(H.UNAVAILABLE,"The operation could not be completed")))}),G(E,Ao.EventType.MESSAGE,j=>{var J;if(!k){let ee=j.data[0];Le(!!ee);let ne=ee,le=(ne==null?void 0:ne.error)||((J=ne[0])===null||J===void 0?void 0:J.error);if(le){X(xt,`RPC '${e}' stream ${s} received error:`,le);let de=le.status,ie=function(R){let D=rt[R];if(D!==void 0)return _T(D)}(de),C=le.message;ie===void 0&&(ie=H.INTERNAL,C="Unknown error status: "+de+" with message "+le.message),k=!0,B.Ko(new re(ie,C)),E.close()}else X(xt,`RPC '${e}' stream ${s} received:`,ee),B.Uo(ee)}}),G(h,up.STAT_EVENT,j=>{j.stat===Ql.PROXY?X(xt,`RPC '${e}' stream ${s} detected buffering proxy`):j.stat===Ql.NOPROXY&&X(xt,`RPC '${e}' stream ${s} detected no buffering proxy`)}),setTimeout(()=>{B.$o()},0),B}};function dp(){return typeof document!="undefined"?document:null}function Gh(n){return new Gp(n,!0)}var Th=class{constructor(e,t,r=1e3,s=1.5,a=6e4){this.Ti=e,this.timerId=t,this.Go=r,this.zo=s,this.jo=a,this.Ho=0,this.Jo=null,this.Yo=Date.now(),this.reset()}reset(){this.Ho=0}Zo(){this.Ho=this.jo}Xo(e){this.cancel();let t=Math.floor(this.Ho+this.e_()),r=Math.max(0,Date.now()-this.Yo),s=Math.max(0,t-r);s>0&&X("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Ho} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.Jo=this.Ti.enqueueAfterDelay(this.timerId,s,()=>(this.Yo=Date.now(),e())),this.Ho*=this.zo,this.Ho<this.Go&&(this.Ho=this.Go),this.Ho>this.jo&&(this.Ho=this.jo)}t_(){this.Jo!==null&&(this.Jo.skipDelay(),this.Jo=null)}cancel(){this.Jo!==null&&(this.Jo.cancel(),this.Jo=null)}e_(){return(Math.random()-.5)*this.Ho}};var vb="PersistentStream",Eh=class{constructor(e,t,r,s,a,c,h,f){this.Ti=e,this.n_=r,this.r_=s,this.connection=a,this.authCredentialsProvider=c,this.appCheckCredentialsProvider=h,this.listener=f,this.state=0,this.i_=0,this.s_=null,this.o_=null,this.stream=null,this.__=0,this.a_=new Th(e,t)}u_(){return this.state===1||this.state===5||this.c_()}c_(){return this.state===2||this.state===3}start(){this.__=0,this.state!==4?this.auth():this.l_()}async stop(){this.u_()&&await this.close(0)}h_(){this.state=0,this.a_.reset()}P_(){this.c_()&&this.s_===null&&(this.s_=this.Ti.enqueueAfterDelay(this.n_,6e4,()=>this.T_()))}I_(e){this.E_(),this.stream.send(e)}async T_(){if(this.c_())return this.close(0)}E_(){this.s_&&(this.s_.cancel(),this.s_=null)}d_(){this.o_&&(this.o_.cancel(),this.o_=null)}async close(e,t){this.E_(),this.d_(),this.a_.cancel(),this.i_++,e!==4?this.a_.reset():t&&t.code===H.RESOURCE_EXHAUSTED?(Pr(t.toString()),Pr("Using maximum backoff delay to prevent overloading the backend."),this.a_.Zo()):t&&t.code===H.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.A_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Lo(t)}A_(){}auth(){this.state=1;let e=this.R_(this.i_),t=this.i_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,s])=>{this.i_===t&&this.V_(r,s)},r=>{e(()=>{let s=new re(H.UNKNOWN,"Fetching auth token failed: "+r.message);return this.m_(s)})})}V_(e,t){let r=this.R_(this.i_);this.stream=this.f_(e,t),this.stream.xo(()=>{r(()=>this.listener.xo())}),this.stream.No(()=>{r(()=>(this.state=2,this.o_=this.Ti.enqueueAfterDelay(this.r_,1e4,()=>(this.c_()&&(this.state=3),Promise.resolve())),this.listener.No()))}),this.stream.Lo(s=>{r(()=>this.m_(s))}),this.stream.onMessage(s=>{r(()=>++this.__==1?this.g_(s):this.onNext(s))})}l_(){this.state=5,this.a_.Xo(async()=>{this.state=0,this.start()})}m_(e){return X(vb,`close with error: ${e}`),this.stream=null,this.close(4,e)}R_(e){return t=>{this.Ti.enqueueAndForget(()=>this.i_===e?t():(X(vb,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}},xm=class extends Eh{constructor(e,t,r,s,a,c){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,s,c),this.serializer=a}f_(e,t){return this.connection.Wo("Listen",e,t)}g_(e){return this.onNext(e)}onNext(e){this.a_.reset();let t=wM(this.serializer,e),r=function(a){if(!("targetChange"in a))return me.min();let c=a.targetChange;return c.targetIds&&c.targetIds.length?me.min():c.readTime?Qn(c.readTime):me.min()}(e);return this.listener.p_(t,r)}y_(e){let t={};t.database=Qp(this.serializer),t.addTarget=function(a,c){let h,f=c.target;if(h=Vp(f)?{documents:EM(a,f)}:{query:IM(a,f).ht},h.targetId=c.targetId,c.resumeToken.approximateByteSize()>0){h.resumeToken=yT(a,c.resumeToken);let m=Kp(a,c.expectedCount);m!==null&&(h.expectedCount=m)}else if(c.snapshotVersion.compareTo(me.min())>0){h.readTime=gh(a,c.snapshotVersion.toTimestamp());let m=Kp(a,c.expectedCount);m!==null&&(h.expectedCount=m)}return h}(this.serializer,e);let r=AM(this.serializer,e);r&&(t.labels=r),this.I_(t)}w_(e){let t={};t.database=Qp(this.serializer),t.removeTarget=e,this.I_(t)}},Am=class extends Eh{constructor(e,t,r,s,a,c){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,s,c),this.serializer=a}get S_(){return this.__>0}start(){this.lastStreamToken=void 0,super.start()}A_(){this.S_&&this.b_([])}f_(e,t){return this.connection.Wo("Write",e,t)}g_(e){return Le(!!e.streamToken),this.lastStreamToken=e.streamToken,Le(!e.writeResults||e.writeResults.length===0),this.listener.D_()}onNext(e){Le(!!e.streamToken),this.lastStreamToken=e.streamToken,this.a_.reset();let t=TM(e.writeResults,e.commitTime),r=Qn(e.commitTime);return this.listener.v_(r,t)}C_(){let e={};e.database=Qp(this.serializer),this.I_(e)}b_(e){let t={streamToken:this.lastStreamToken,writes:e.map(r=>bM(this.serializer,r))};this.I_(t)}};var Sm=class{},Rm=class extends Sm{constructor(e,t,r,s){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=s,this.F_=!1}M_(){if(this.F_)throw new re(H.FAILED_PRECONDITION,"The client has already been terminated.")}So(e,t,r,s){return this.M_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([a,c])=>this.connection.So(e,Wp(t,r),s,a,c)).catch(a=>{throw a.name==="FirebaseError"?(a.code===H.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),a):new re(H.UNKNOWN,a.toString())})}Co(e,t,r,s,a){return this.M_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([c,h])=>this.connection.Co(e,Wp(t,r),s,c,h,a)).catch(c=>{throw c.name==="FirebaseError"?(c.code===H.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),c):new re(H.UNKNOWN,c.toString())})}terminate(){this.F_=!0,this.connection.terminate()}},Pm=class{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.x_=0,this.O_=null,this.N_=!0}B_(){this.x_===0&&(this.L_("Unknown"),this.O_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.O_=null,this.k_("Backend didn't respond within 10 seconds."),this.L_("Offline"),Promise.resolve())))}q_(e){this.state==="Online"?this.L_("Unknown"):(this.x_++,this.x_>=1&&(this.Q_(),this.k_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.L_("Offline")))}set(e){this.Q_(),this.x_=0,e==="Online"&&(this.N_=!1),this.L_(e)}L_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}k_(e){let t=`Could not reach Cloud Firestore backend. ${e}
37
+ 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.N_?(Pr(t),this.N_=!1):X("OnlineStateTracker",t)}Q_(){this.O_!==null&&(this.O_.cancel(),this.O_=null)}};var ps="RemoteStore",Cm=class{constructor(e,t,r,s,a){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.K_=[],this.U_=new Map,this.W_=new Set,this.G_=[],this.z_=a,this.z_.To(c=>{r.enqueueAndForget(async()=>{ms(this)&&(X(ps,"Restarting streams for network reachability change."),await async function(f){let m=fe(f);m.W_.add(4),await Pu(m),m.j_.set("Unknown"),m.W_.delete(4),await Kh(m)}(this))})}),this.j_=new Pm(r,s)}};async function Kh(n){if(ms(n))for(let e of n.G_)await e(!0)}async function Pu(n){for(let e of n.G_)await e(!1)}function RT(n,e){let t=fe(n);t.U_.has(e.targetId)||(t.U_.set(e.targetId,e),lg(t)?cg(t):Zo(t).c_()&&ug(t,e))}function ag(n,e){let t=fe(n),r=Zo(t);t.U_.delete(e),r.c_()&&PT(t,e),t.U_.size===0&&(r.c_()?r.P_():ms(t)&&t.j_.set("Unknown"))}function ug(n,e){if(n.H_.Ne(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(me.min())>0){let t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}Zo(n).y_(e)}function PT(n,e){n.H_.Ne(e),Zo(n).w_(e)}function cg(n){n.H_=new zp({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),lt:e=>n.U_.get(e)||null,it:()=>n.datastore.serializer.databaseId}),Zo(n).start(),n.j_.B_()}function lg(n){return ms(n)&&!Zo(n).u_()&&n.U_.size>0}function ms(n){return fe(n).W_.size===0}function CT(n){n.H_=void 0}async function qM(n){n.j_.set("Online")}async function zM(n){n.U_.forEach((e,t)=>{ug(n,e)})}async function GM(n,e){CT(n),lg(n)?(n.j_.q_(e),cg(n)):n.j_.set("Unknown")}async function KM(n,e,t){if(n.j_.set("Online"),e instanceof ph&&e.state===2&&e.cause)try{await async function(s,a){let c=a.cause;for(let h of a.targetIds)s.U_.has(h)&&(await s.remoteSyncer.rejectListen(h,c),s.U_.delete(h),s.H_.removeTarget(h))}(n,e)}catch(r){X(ps,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await Ih(n,r)}else if(e instanceof Oo?n.H_.We(e):e instanceof dh?n.H_.Ze(e):n.H_.je(e),!t.isEqual(me.min()))try{let r=await ST(n.localStore);t.compareTo(r)>=0&&await function(a,c){let h=a.H_.ot(c);return h.targetChanges.forEach((f,m)=>{if(f.resumeToken.approximateByteSize()>0){let _=a.U_.get(m);_&&a.U_.set(m,_.withResumeToken(f.resumeToken,c))}}),h.targetMismatches.forEach((f,m)=>{let _=a.U_.get(f);if(!_)return;a.U_.set(f,_.withResumeToken(At.EMPTY_BYTE_STRING,_.snapshotVersion)),PT(a,f);let E=new vu(_.target,f,m,_.sequenceNumber);ug(a,E)}),a.remoteSyncer.applyRemoteEvent(h)}(n,t)}catch(r){X(ps,"Failed to raise snapshot:",r),await Ih(n,r)}}async function Ih(n,e,t){if(!Xo(e))throw e;n.W_.add(1),await Pu(n),n.j_.set("Offline"),t||(t=()=>ST(n.localStore)),n.asyncQueue.enqueueRetryable(async()=>{X(ps,"Retrying IndexedDB access"),await t(),n.W_.delete(1),await Kh(n)})}function DT(n,e){return e().catch(t=>Ih(n,t,e))}async function Wh(n){let e=fe(n),t=vi(e),r=e.K_.length>0?e.K_[e.K_.length-1].batchId:Ym;for(;WM(e);)try{let s=await UM(e.localStore,r);if(s===null){e.K_.length===0&&t.P_();break}r=s.batchId,HM(e,s)}catch(s){await Ih(e,s)}OT(e)&&kT(e)}function WM(n){return ms(n)&&n.K_.length<10}function HM(n,e){n.K_.push(e);let t=vi(n);t.c_()&&t.S_&&t.b_(e.mutations)}function OT(n){return ms(n)&&!vi(n).u_()&&n.K_.length>0}function kT(n){vi(n).start()}async function QM(n){vi(n).C_()}async function JM(n){let e=vi(n);for(let t of n.K_)e.b_(t.mutations)}async function YM(n,e,t){let r=n.K_.shift(),s=Bp.from(r,e,t);await DT(n,()=>n.remoteSyncer.applySuccessfulWrite(s)),await Wh(n)}async function XM(n,e){e&&vi(n).S_&&await async function(r,s){if(function(c){return fM(c)&&c!==H.ABORTED}(s.code)){let a=r.K_.shift();vi(r).h_(),await DT(r,()=>r.remoteSyncer.rejectFailedWrite(a.batchId,s)),await Wh(r)}}(n,e),OT(n)&&kT(n)}async function wb(n,e){let t=fe(n);t.asyncQueue.verifyOperationInProgress(),X(ps,"RemoteStore received new credentials");let r=ms(t);t.W_.add(3),await Pu(t),r&&t.j_.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.W_.delete(3),await Kh(t)}async function ZM(n,e){let t=fe(n);e?(t.W_.delete(2),await Kh(t)):e||(t.W_.add(2),await Pu(t),t.j_.set("Unknown"))}function Zo(n){return n.J_||(n.J_=function(t,r,s){let a=fe(t);return a.M_(),new xm(r,a.connection,a.authCredentials,a.appCheckCredentials,a.serializer,s)}(n.datastore,n.asyncQueue,{xo:qM.bind(null,n),No:zM.bind(null,n),Lo:GM.bind(null,n),p_:KM.bind(null,n)}),n.G_.push(async e=>{e?(n.J_.h_(),lg(n)?cg(n):n.j_.set("Unknown")):(await n.J_.stop(),CT(n))})),n.J_}function vi(n){return n.Y_||(n.Y_=function(t,r,s){let a=fe(t);return a.M_(),new Am(r,a.connection,a.authCredentials,a.appCheckCredentials,a.serializer,s)}(n.datastore,n.asyncQueue,{xo:()=>Promise.resolve(),No:QM.bind(null,n),Lo:XM.bind(null,n),D_:JM.bind(null,n),v_:YM.bind(null,n)}),n.G_.push(async e=>{e?(n.Y_.h_(),await Wh(n)):(await n.Y_.stop(),n.K_.length>0&&(X(ps,`Stopping write stream with ${n.K_.length} pending writes`),n.K_=[]))})),n.Y_}var Dm=class n{constructor(e,t,r,s,a){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=s,this.removalCallback=a,this.deferred=new Kn,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(c=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,s,a){let c=Date.now()+r,h=new n(e,t,c,s,a);return h.start(r),h}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new re(H.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 hg(n,e){if(Pr("AsyncQueue",`${e}: ${n}`),Xo(n))return new re(H.UNAVAILABLE,`${e}: ${n}`);throw n}var xh=class n{static emptySet(e){return new n(e.comparator)}constructor(e){this.comparator=e?(t,r)=>e(t,r)||ce.comparator(t.key,r.key):(t,r)=>ce.comparator(t.key,r.key),this.keyedMap=cu(),this.sortedSet=new Je(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 t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){let t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){let t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof n)||this.size!==e.size)return!1;let t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){let s=t.getNext().key,a=r.getNext().key;if(!s.isEqual(a))return!1}return!0}toString(){let e=[];return this.forEach(t=>{e.push(t.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
38
+ `+e.join(`
39
+ `)+`
40
+ )`}copy(e,t){let r=new n;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}};var Ah=class{constructor(){this.Z_=new Je(ce.comparator)}track(e){let t=e.doc.key,r=this.Z_.get(t);r?e.type!==0&&r.type===3?this.Z_=this.Z_.insert(t,e):e.type===3&&r.type!==1?this.Z_=this.Z_.insert(t,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.Z_=this.Z_.insert(t,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.Z_=this.Z_.insert(t,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.Z_=this.Z_.remove(t):e.type===1&&r.type===2?this.Z_=this.Z_.insert(t,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.Z_=this.Z_.insert(t,{type:2,doc:e.doc}):ue():this.Z_=this.Z_.insert(t,e)}X_(){let e=[];return this.Z_.inorderTraversal((t,r)=>{e.push(r)}),e}},Wo=class n{constructor(e,t,r,s,a,c,h,f,m){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=s,this.mutatedKeys=a,this.fromCache=c,this.syncStateChanged=h,this.excludesMetadataChanges=f,this.hasCachedResults=m}static fromInitialDocuments(e,t,r,s,a){let c=[];return t.forEach(h=>{c.push({type:0,doc:h})}),new n(e,t,xh.emptySet(t),c,r,s,!0,!1,a)}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)&&qh(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;let t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let s=0;s<t.length;s++)if(t[s].type!==r[s].type||!t[s].doc.isEqual(r[s].doc))return!1;return!0}};var Om=class{constructor(){this.ea=void 0,this.ta=[]}na(){return this.ta.some(e=>e.ra())}},km=class{constructor(){this.queries=bb(),this.onlineState="Unknown",this.ia=new Set}terminate(){(function(t,r){let s=fe(t),a=s.queries;s.queries=bb(),a.forEach((c,h)=>{for(let f of h.ta)f.onError(r)})})(this,new re(H.ABORTED,"Firestore shutting down"))}};function bb(){return new Or(n=>sT(n),qh)}async function NT(n,e){let t=fe(n),r=3,s=e.query,a=t.queries.get(s);a?!a.na()&&e.ra()&&(r=2):(a=new Om,r=e.ra()?0:1);try{switch(r){case 0:a.ea=await t.onListen(s,!0);break;case 1:a.ea=await t.onListen(s,!1);break;case 2:await t.onFirstRemoteStoreListen(s)}}catch(c){let h=hg(c,`Initialization of query '${Ro(e.query)}' failed`);return void e.onError(h)}t.queries.set(s,a),a.ta.push(e),e.sa(t.onlineState),a.ea&&e.oa(a.ea)&&fg(t)}async function VT(n,e){let t=fe(n),r=e.query,s=3,a=t.queries.get(r);if(a){let c=a.ta.indexOf(e);c>=0&&(a.ta.splice(c,1),a.ta.length===0?s=e.ra()?0:1:!a.na()&&e.ra()&&(s=2))}switch(s){case 0:return t.queries.delete(r),t.onUnlisten(r,!0);case 1:return t.queries.delete(r),t.onUnlisten(r,!1);case 2:return t.onLastRemoteStoreUnlisten(r);default:return}}function eF(n,e){let t=fe(n),r=!1;for(let s of e){let a=s.query,c=t.queries.get(a);if(c){for(let h of c.ta)h.oa(s)&&(r=!0);c.ea=s}}r&&fg(t)}function tF(n,e,t){let r=fe(n),s=r.queries.get(e);if(s)for(let a of s.ta)a.onError(t);r.queries.delete(e)}function fg(n){n.ia.forEach(e=>{e.next()})}var Nm,Tb;(Tb=Nm||(Nm={}))._a="default",Tb.Cache="cache";var Sh=class{constructor(e,t,r){this.query=e,this.aa=t,this.ua=!1,this.ca=null,this.onlineState="Unknown",this.options=r||{}}oa(e){if(!this.options.includeMetadataChanges){let r=[];for(let s of e.docChanges)s.type!==3&&r.push(s);e=new Wo(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.ua?this.la(e)&&(this.aa.next(e),t=!0):this.ha(e,this.onlineState)&&(this.Pa(e),t=!0),this.ca=e,t}onError(e){this.aa.error(e)}sa(e){this.onlineState=e;let t=!1;return this.ca&&!this.ua&&this.ha(this.ca,e)&&(this.Pa(this.ca),t=!0),t}ha(e,t){if(!e.fromCache||!this.ra())return!0;let r=t!=="Offline";return(!this.options.Ta||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}la(e){if(e.docChanges.length>0)return!0;let t=this.ca&&this.ca.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}Pa(e){e=Wo.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.ua=!0,this.aa.next(e)}ra(){return this.options.source!==Nm.Cache}};var Rh=class{constructor(e){this.key=e}},Ph=class{constructor(e){this.key=e}},Vm=class{constructor(e,t){this.query=e,this.fa=t,this.ga=null,this.hasCachedResults=!1,this.current=!1,this.pa=xe(),this.mutatedKeys=xe(),this.ya=oT(e),this.wa=new xh(this.ya)}get Sa(){return this.fa}ba(e,t){let r=t?t.Da:new Ah,s=t?t.wa:this.wa,a=t?t.mutatedKeys:this.mutatedKeys,c=s,h=!1,f=this.query.limitType==="F"&&s.size===this.query.limit?s.last():null,m=this.query.limitType==="L"&&s.size===this.query.limit?s.first():null;if(e.inorderTraversal((_,E)=>{let I=s.get(_),k=zh(this.query,E)?E:null,B=!!I&&this.mutatedKeys.has(I.key),G=!!k&&(k.hasLocalMutations||this.mutatedKeys.has(k.key)&&k.hasCommittedMutations),j=!1;I&&k?I.data.isEqual(k.data)?B!==G&&(r.track({type:3,doc:k}),j=!0):this.va(I,k)||(r.track({type:2,doc:k}),j=!0,(f&&this.ya(k,f)>0||m&&this.ya(k,m)<0)&&(h=!0)):!I&&k?(r.track({type:0,doc:k}),j=!0):I&&!k&&(r.track({type:1,doc:I}),j=!0,(f||m)&&(h=!0)),j&&(k?(c=c.add(k),a=G?a.add(_):a.delete(_)):(c=c.delete(_),a=a.delete(_)))}),this.query.limit!==null)for(;c.size>this.query.limit;){let _=this.query.limitType==="F"?c.last():c.first();c=c.delete(_.key),a=a.delete(_.key),r.track({type:1,doc:_})}return{wa:c,Da:r,ls:h,mutatedKeys:a}}va(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,s){let a=this.wa;this.wa=e.wa,this.mutatedKeys=e.mutatedKeys;let c=e.Da.X_();c.sort((_,E)=>function(k,B){let G=j=>{switch(j){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ue()}};return G(k)-G(B)}(_.type,E.type)||this.ya(_.doc,E.doc)),this.Ca(r),s=s!=null&&s;let h=t&&!s?this.Fa():[],f=this.pa.size===0&&this.current&&!s?1:0,m=f!==this.ga;return this.ga=f,c.length!==0||m?{snapshot:new Wo(this.query,e.wa,a,c,e.mutatedKeys,f===0,m,!1,!!r&&r.resumeToken.approximateByteSize()>0),Ma:h}:{Ma:h}}sa(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({wa:this.wa,Da:new Ah,mutatedKeys:this.mutatedKeys,ls:!1},!1)):{Ma:[]}}xa(e){return!this.fa.has(e)&&!!this.wa.has(e)&&!this.wa.get(e).hasLocalMutations}Ca(e){e&&(e.addedDocuments.forEach(t=>this.fa=this.fa.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.fa=this.fa.delete(t)),this.current=e.current)}Fa(){if(!this.current)return[];let e=this.pa;this.pa=xe(),this.wa.forEach(r=>{this.xa(r.key)&&(this.pa=this.pa.add(r.key))});let t=[];return e.forEach(r=>{this.pa.has(r)||t.push(new Ph(r))}),this.pa.forEach(r=>{e.has(r)||t.push(new Rh(r))}),t}Oa(e){this.fa=e.gs,this.pa=xe();let t=this.ba(e.documents);return this.applyChanges(t,!0)}Na(){return Wo.fromInitialDocuments(this.query,this.wa,this.mutatedKeys,this.ga===0,this.hasCachedResults)}},dg="SyncEngine",Lm=class{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}},Mm=class{constructor(e){this.key=e,this.Ba=!1}},Fm=class{constructor(e,t,r,s,a,c){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=s,this.currentUser=a,this.maxConcurrentLimboResolutions=c,this.La={},this.ka=new Or(h=>sT(h),qh),this.qa=new Map,this.Qa=new Set,this.$a=new Je(ce.comparator),this.Ka=new Map,this.Ua=new bu,this.Wa={},this.Ga=new Map,this.za=wu.Un(),this.onlineState="Unknown",this.ja=void 0}get isPrimaryClient(){return this.ja===!0}};async function nF(n,e,t=!0){let r=jT(n),s,a=r.ka.get(e);return a?(r.sharedClientState.addLocalQueryTarget(a.targetId),s=a.view.Na()):s=await LT(r,e,t,!0),s}async function rF(n,e){let t=jT(n);await LT(t,e,!0,!1)}async function LT(n,e,t,r){let s=await BM(n.localStore,Hn(e)),a=s.targetId,c=n.sharedClientState.addLocalQueryTarget(a,t),h;return r&&(h=await iF(n,e,a,c==="current",s.resumeToken)),n.isPrimaryClient&&t&&RT(n.remoteStore,s),h}async function iF(n,e,t,r,s){n.Ha=(E,I,k)=>async function(G,j,J,ee){let ne=j.view.ba(J);ne.ls&&(ne=await _b(G.localStore,j.query,!1).then(({documents:C})=>j.view.ba(C,ne)));let le=ee&&ee.targetChanges.get(j.targetId),de=ee&&ee.targetMismatches.get(j.targetId)!=null,ie=j.view.applyChanges(ne,G.isPrimaryClient,le,de);return Ib(G,j.targetId,ie.Ma),ie.snapshot}(n,E,I,k);let a=await _b(n.localStore,e,!0),c=new Vm(e,a.gs),h=c.ba(a.documents),f=yu.createSynthesizedTargetChangeForCurrentChange(t,r&&n.onlineState!=="Offline",s),m=c.applyChanges(h,n.isPrimaryClient,f);Ib(n,t,m.Ma);let _=new Lm(e,t,c);return n.ka.set(e,_),n.qa.has(t)?n.qa.get(t).push(e):n.qa.set(t,[e]),m.snapshot}async function sF(n,e,t){let r=fe(n),s=r.ka.get(e),a=r.qa.get(s.targetId);if(a.length>1)return r.qa.set(s.targetId,a.filter(c=>!qh(c,e))),void r.ka.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(s.targetId),r.sharedClientState.isActiveQueryTarget(s.targetId)||await ym(r.localStore,s.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(s.targetId),t&&ag(r.remoteStore,s.targetId),Um(r,s.targetId)}).catch(Yo)):(Um(r,s.targetId),await ym(r.localStore,s.targetId,!0))}async function oF(n,e){let t=fe(n),r=t.ka.get(e),s=t.qa.get(r.targetId);t.isPrimaryClient&&s.length===1&&(t.sharedClientState.removeLocalQueryTarget(r.targetId),ag(t.remoteStore,r.targetId))}async function aF(n,e,t){let r=pF(n);try{let s=await function(c,h){let f=fe(c),m=yt.now(),_=h.reduce((k,B)=>k.add(B.key),xe()),E,I;return f.persistence.runTransaction("Locally write mutations","readwrite",k=>{let B=kr(),G=xe();return f.ds.getEntries(k,_).next(j=>{B=j,B.forEach((J,ee)=>{ee.isValidDocument()||(G=G.add(J))})}).next(()=>f.localDocuments.getOverlayedDocuments(k,B)).next(j=>{E=j;let J=[];for(let ee of h){let ne=hM(ee,E.get(ee.key).overlayedDocument);ne!=null&&J.push(new Zn(ee.key,ne,Zb(ne.value.mapValue),_i.exists(!0)))}return f.mutationQueue.addMutationBatch(k,m,J,h)}).next(j=>{I=j;let J=j.applyToLocalDocumentSet(E,G);return f.documentOverlayCache.saveOverlays(k,j.batchId,J)})}).then(()=>({batchId:I.batchId,changes:uT(E)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(s.batchId),function(c,h,f){let m=c.Wa[c.currentUser.toKey()];m||(m=new Je(Re)),m=m.insert(h,f),c.Wa[c.currentUser.toKey()]=m}(r,s.batchId,t),await Cu(r,s.changes),await Wh(r.remoteStore)}catch(s){let a=hg(s,"Failed to persist write");t.reject(a)}}async function MT(n,e){let t=fe(n);try{let r=await MM(t.localStore,e);e.targetChanges.forEach((s,a)=>{let c=t.Ka.get(a);c&&(Le(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1),s.addedDocuments.size>0?c.Ba=!0:s.modifiedDocuments.size>0?Le(c.Ba):s.removedDocuments.size>0&&(Le(c.Ba),c.Ba=!1))}),await Cu(t,r,e)}catch(r){await Yo(r)}}function Eb(n,e,t){let r=fe(n);if(r.isPrimaryClient&&t===0||!r.isPrimaryClient&&t===1){let s=[];r.ka.forEach((a,c)=>{let h=c.view.sa(e);h.snapshot&&s.push(h.snapshot)}),function(c,h){let f=fe(c);f.onlineState=h;let m=!1;f.queries.forEach((_,E)=>{for(let I of E.ta)I.sa(h)&&(m=!0)}),m&&fg(f)}(r.eventManager,e),s.length&&r.La.p_(s),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function uF(n,e,t){let r=fe(n);r.sharedClientState.updateQueryState(e,"rejected",t);let s=r.Ka.get(e),a=s&&s.key;if(a){let c=new Je(ce.comparator);c=c.insert(a,Rn.newNoDocument(a,me.min()));let h=xe().add(a),f=new fh(me.min(),new Map,new Je(Re),c,h);await MT(r,f),r.$a=r.$a.remove(a),r.Ka.delete(e),pg(r)}else await ym(r.localStore,e,!1).then(()=>Um(r,e,t)).catch(Yo)}async function cF(n,e){let t=fe(n),r=e.batch.batchId;try{let s=await LM(t.localStore,e);UT(t,r,null),FT(t,r),t.sharedClientState.updateMutationState(r,"acknowledged"),await Cu(t,s)}catch(s){await Yo(s)}}async function lF(n,e,t){let r=fe(n);try{let s=await function(c,h){let f=fe(c);return f.persistence.runTransaction("Reject batch","readwrite-primary",m=>{let _;return f.mutationQueue.lookupMutationBatch(m,h).next(E=>(Le(E!==null),_=E.keys(),f.mutationQueue.removeMutationBatch(m,E))).next(()=>f.mutationQueue.performConsistencyCheck(m)).next(()=>f.documentOverlayCache.removeOverlaysForBatchId(m,_,h)).next(()=>f.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(m,_)).next(()=>f.localDocuments.getDocuments(m,_))})}(r.localStore,e);UT(r,e,t),FT(r,e),r.sharedClientState.updateMutationState(e,"rejected",t),await Cu(r,s)}catch(s){await Yo(s)}}function FT(n,e){(n.Ga.get(e)||[]).forEach(t=>{t.resolve()}),n.Ga.delete(e)}function UT(n,e,t){let r=fe(n),s=r.Wa[r.currentUser.toKey()];if(s){let a=s.get(e);a&&(t?a.reject(t):a.resolve(),s=s.remove(e)),r.Wa[r.currentUser.toKey()]=s}}function Um(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(let r of n.qa.get(e))n.ka.delete(r),t&&n.La.Ja(r,t);n.qa.delete(e),n.isPrimaryClient&&n.Ua.br(e).forEach(r=>{n.Ua.containsKey(r)||BT(n,r)})}function BT(n,e){n.Qa.delete(e.path.canonicalString());let t=n.$a.get(e);t!==null&&(ag(n.remoteStore,t),n.$a=n.$a.remove(e),n.Ka.delete(t),pg(n))}function Ib(n,e,t){for(let r of t)r instanceof Rh?(n.Ua.addReference(r.key,e),hF(n,r)):r instanceof Ph?(X(dg,"Document no longer in limbo: "+r.key),n.Ua.removeReference(r.key,e),n.Ua.containsKey(r.key)||BT(n,r.key)):ue()}function hF(n,e){let t=e.key,r=t.path.canonicalString();n.$a.get(t)||n.Qa.has(r)||(X(dg,"New document in limbo: "+t),n.Qa.add(r),pg(n))}function pg(n){for(;n.Qa.size>0&&n.$a.size<n.maxConcurrentLimboResolutions;){let e=n.Qa.values().next().value;n.Qa.delete(e);let t=new ce(st.fromString(e)),r=n.za.next();n.Ka.set(r,new Mm(t)),n.$a=n.$a.insert(t,r),RT(n.remoteStore,new vu(Hn($h(t.path)),r,"TargetPurposeLimboResolution",Lo.ae))}}async function Cu(n,e,t){let r=fe(n),s=[],a=[],c=[];r.ka.isEmpty()||(r.ka.forEach((h,f)=>{c.push(r.Ha(f,e,t).then(m=>{var _;if((m||t)&&r.isPrimaryClient){let E=m?!m.fromCache:(_=t==null?void 0:t.targetChanges.get(f.targetId))===null||_===void 0?void 0:_.current;r.sharedClientState.updateQueryState(f.targetId,E?"current":"not-current")}if(m){s.push(m);let E=pm.Yi(f.targetId,m);a.push(E)}}))}),await Promise.all(c),r.La.p_(s),await async function(f,m){let _=fe(f);try{await _.persistence.runTransaction("notifyLocalViewChanges","readwrite",E=>W.forEach(m,I=>W.forEach(I.Hi,k=>_.persistence.referenceDelegate.addReference(E,I.targetId,k)).next(()=>W.forEach(I.Ji,k=>_.persistence.referenceDelegate.removeReference(E,I.targetId,k)))))}catch(E){if(!Xo(E))throw E;X(og,"Failed to update sequence numbers: "+E)}for(let E of m){let I=E.targetId;if(!E.fromCache){let k=_.Ts.get(I),B=k.snapshotVersion,G=k.withLastLimboFreeSnapshotVersion(B);_.Ts=_.Ts.insert(I,G)}}}(r.localStore,a))}async function fF(n,e){let t=fe(n);if(!t.currentUser.isEqual(e)){X(dg,"User change. New user:",e.toKey());let r=await AT(t.localStore,e);t.currentUser=e,function(a,c){a.Ga.forEach(h=>{h.forEach(f=>{f.reject(new re(H.CANCELLED,c))})}),a.Ga.clear()}(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await Cu(t,r.Rs)}}function dF(n,e){let t=fe(n),r=t.Ka.get(e);if(r&&r.Ba)return xe().add(r.key);{let s=xe(),a=t.qa.get(e);if(!a)return s;for(let c of a){let h=t.ka.get(c);s=s.unionWith(h.view.Sa)}return s}}function jT(n){let e=fe(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=MT.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=dF.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=uF.bind(null,e),e.La.p_=eF.bind(null,e.eventManager),e.La.Ja=tF.bind(null,e.eventManager),e}function pF(n){let e=fe(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=cF.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=lF.bind(null,e),e}var Ho=class{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Gh(e.databaseInfo.databaseId),this.sharedClientState=this.Za(e),this.persistence=this.Xa(e),await this.persistence.start(),this.localStore=this.eu(e),this.gcScheduler=this.tu(e,this.localStore),this.indexBackfillerScheduler=this.nu(e,this.localStore)}tu(e,t){return null}nu(e,t){return null}eu(e){return VM(this.persistence,new gm,e.initialUser,this.serializer)}Xa(e){return new yh(dm.ri,this.serializer)}Za(e){return new vm}async terminate(){var e,t;(e=this.gcScheduler)===null||e===void 0||e.stop(),(t=this.indexBackfillerScheduler)===null||t===void 0||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}};Ho.provider={build:()=>new Ho};var Bm=class extends Ho{constructor(e){super(),this.cacheSizeBytes=e}tu(e,t){Le(this.persistence.referenceDelegate instanceof vh);let r=this.persistence.referenceDelegate.garbageCollector;return new em(r,e.asyncQueue,t)}Xa(e){let t=this.cacheSizeBytes!==void 0?ln.withCacheSize(this.cacheSizeBytes):ln.DEFAULT;return new yh(r=>vh.ri(r,t),this.serializer)}};var Tu=class{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>Eb(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=fF.bind(null,this.syncEngine),await ZM(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new km}()}createDatastore(e){let t=Gh(e.databaseInfo.databaseId),r=function(a){return new Im(a)}(e.databaseInfo);return function(a,c,h,f){return new Rm(a,c,h,f)}(e.authCredentials,e.appCheckCredentials,r,t)}createRemoteStore(e){return function(r,s,a,c,h){return new Cm(r,s,a,c,h)}(this.localStore,this.datastore,e.asyncQueue,t=>Eb(this.syncEngine,t,0),function(){return bh.D()?new bh:new wm}())}createSyncEngine(e,t){return function(s,a,c,h,f,m,_){let E=new Fm(s,a,c,h,f,m);return _&&(E.ja=!0),E}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(s){let a=fe(s);X(ps,"RemoteStore shutting down."),a.W_.add(5),await Pu(a),a.z_.shutdown(),a.j_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(t=this.eventManager)===null||t===void 0||t.terminate()}};Tu.provider={build:()=>new Tu};var Ch=class{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.iu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.iu(this.observer.error,e):Pr("Uncaught Error in snapshot listener:",e.toString()))}su(){this.muted=!0}iu(e,t){setTimeout(()=>{this.muted||e(t)},0)}};var wi="FirestoreClient",jm=class{constructor(e,t,r,s,a){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=s,this.user=mt.UNAUTHENTICATED,this.clientId=ih.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=a,this.authCredentials.start(r,async c=>{X(wi,"Received user=",c.uid),await this.authCredentialListener(c),this.user=c}),this.appCheckCredentials.start(r,c=>(X(wi,"Received new app check token=",c),this.appCheckCredentialListener(c,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 Kn;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){let r=hg(t,"Failed to shutdown persistence");e.reject(r)}}),e.promise}};async function pp(n,e){n.asyncQueue.verifyOperationInProgress(),X(wi,"Initializing OfflineComponentProvider");let t=n.configuration;await e.initialize(t);let r=t.initialUser;n.setCredentialChangeListener(async s=>{r.isEqual(s)||(await AT(e.localStore,s),r=s)}),e.persistence.setDatabaseDeletedListener(()=>n.terminate()),n._offlineComponents=e}async function xb(n,e){n.asyncQueue.verifyOperationInProgress();let t=await mF(n);X(wi,"Initializing OnlineComponentProvider"),await e.initialize(t,n.configuration),n.setCredentialChangeListener(r=>wb(e.remoteStore,r)),n.setAppCheckTokenChangeListener((r,s)=>wb(e.remoteStore,s)),n._onlineComponents=e}async function mF(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){X(wi,"Using user provided OfflineComponentProvider");try{await pp(n,n._uninitializedComponentsProvider._offline)}catch(e){let t=e;if(!function(s){return s.name==="FirebaseError"?s.code===H.FAILED_PRECONDITION||s.code===H.UNIMPLEMENTED:!(typeof DOMException!="undefined"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11}(t))throw t;No("Error using user provided cache. Falling back to memory cache: "+t),await pp(n,new Ho)}}else X(wi,"Using default OfflineComponentProvider"),await pp(n,new Bm(void 0));return n._offlineComponents}async function $T(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(X(wi,"Using user provided OnlineComponentProvider"),await xb(n,n._uninitializedComponentsProvider._online)):(X(wi,"Using default OnlineComponentProvider"),await xb(n,new Tu))),n._onlineComponents}function gF(n){return $T(n).then(e=>e.syncEngine)}async function $m(n){let e=await $T(n),t=e.eventManager;return t.onListen=nF.bind(null,e.syncEngine),t.onUnlisten=sF.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=rF.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=oF.bind(null,e.syncEngine),t}function _F(n,e,t={}){let r=new Kn;return n.asyncQueue.enqueueAndForget(async()=>function(a,c,h,f,m){let _=new Ch({next:I=>{_.su(),c.enqueueAndForget(()=>VT(a,E));let k=I.docs.has(h);!k&&I.fromCache?m.reject(new re(H.UNAVAILABLE,"Failed to get document because the client is offline.")):k&&I.fromCache&&f&&f.source==="server"?m.reject(new re(H.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.)')):m.resolve(I)},error:I=>m.reject(I)}),E=new Sh($h(h.path),_,{includeMetadataChanges:!0,Ta:!0});return NT(a,E)}(await $m(n),n.asyncQueue,e,t,r)),r.promise}function qT(n){let e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.timeoutSeconds),e}var Ab=new Map;function yF(n,e,t){if(!t)throw new re(H.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function vF(n,e,t,r){if(e===!0&&r===!0)throw new re(H.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)}function Sb(n){if(!ce.isDocumentKey(n))throw new re(H.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function mg(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return""+n;if(typeof n=="object"){if(n instanceof Array)return"an array";{let e=function(r){return r.constructor?r.constructor.name:null}(n);return e?`a custom ${e} object`:"an object"}}return typeof n=="function"?"a function":ue()}function Jn(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new re(H.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let t=mg(n);throw new re(H.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}var zT="firestore.googleapis.com",Rb=!0,Dh=class{constructor(e){var t,r;if(e.host===void 0){if(e.ssl!==void 0)throw new re(H.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=zT,this.ssl=Rb}else this.host=e.host,this.ssl=(t=e.ssl)!==null&&t!==void 0?t:Rb;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=xT;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<OM)throw new re(H.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}vF("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=qT((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(a){if(a.timeoutSeconds!==void 0){if(isNaN(a.timeoutSeconds))throw new re(H.INVALID_ARGUMENT,`invalid long polling timeout: ${a.timeoutSeconds} (must not be NaN)`);if(a.timeoutSeconds<5)throw new re(H.INVALID_ARGUMENT,`invalid long polling timeout: ${a.timeoutSeconds} (minimum allowed value is 5)`);if(a.timeoutSeconds>30)throw new re(H.INVALID_ARGUMENT,`invalid long polling timeout: ${a.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,s){return r.timeoutSeconds===s.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}},Eu=class{constructor(e,t,r,s){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Dh({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new re(H.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 re(H.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 Dh(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new mp;switch(r.type){case"firstParty":return new vp(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new re(H.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){let r=Ab.get(t);r&&(X("ComponentProvider","Removing Datastore"),Ab.delete(t),r.terminate())}(this),Promise.resolve()}};function wF(n,e,t,r={}){var s;let a=(n=Jn(n,Eu))._getSettings(),c=`${e}:${t}`;if(a.host!==zT&&a.host!==c&&No("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),n._setSettings(Object.assign(Object.assign({},a),{host:c,ssl:!1})),r.mockUserToken){let h,f;if(typeof r.mockUserToken=="string")h=r.mockUserToken,f=mt.MOCK_USER;else{h=w0(r.mockUserToken,(s=n._app)===null||s===void 0?void 0:s.options.projectId);let m=r.mockUserToken.sub||r.mockUserToken.user_id;if(!m)throw new re(H.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");f=new mt(m)}n._authCredentials=new gp(new nh(h,f))}}var Oh=class n{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new n(this.firestore,e,this._query)}},qt=class n{constructor(e,t,r){this.converter=t,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 Iu(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new n(this.firestore,e,this._key)}},Iu=class n extends Oh{constructor(e,t,r){super(e,t,$h(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 qt(this.firestore,null,new ce(e))}withConverter(e){return new n(this.firestore,e,this._path)}};function Hh(n,e,...t){if(n=Ir(n),arguments.length===1&&(e=ih.newId()),yF("doc","path",e),n instanceof Eu){let r=st.fromString(e,...t);return Sb(r),new qt(n,null,new ce(r))}{if(!(n instanceof qt||n instanceof Iu))throw new re(H.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=n._path.child(st.fromString(e,...t));return Sb(r),new qt(n.firestore,n instanceof Iu?n.converter:null,new ce(r))}}var Pb="AsyncQueue",kh=class{constructor(e=Promise.resolve()){this.Vu=[],this.mu=!1,this.fu=[],this.gu=null,this.pu=!1,this.yu=!1,this.wu=[],this.a_=new Th(this,"async_queue_retry"),this.Su=()=>{let r=dp();r&&X(Pb,"Visibility state changed to "+r.visibilityState),this.a_.t_()},this.bu=e;let t=dp();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.Su)}get isShuttingDown(){return this.mu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Du(),this.vu(e)}enterRestrictedMode(e){if(!this.mu){this.mu=!0,this.yu=e||!1;let t=dp();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Su)}}enqueue(e){if(this.Du(),this.mu)return new Promise(()=>{});let t=new Kn;return this.vu(()=>this.mu&&this.yu?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Vu.push(e),this.Cu()))}async Cu(){if(this.Vu.length!==0){try{await this.Vu[0](),this.Vu.shift(),this.a_.reset()}catch(e){if(!Xo(e))throw e;X(Pb,"Operation failed with retryable error: "+e)}this.Vu.length>0&&this.a_.Xo(()=>this.Cu())}}vu(e){let t=this.bu.then(()=>(this.pu=!0,e().catch(r=>{this.gu=r,this.pu=!1;let s=function(c){let h=c.message||"";return c.stack&&(h=c.stack.includes(c.message)?c.stack:c.message+`
41
+ `+c.stack),h}(r);throw Pr("INTERNAL UNHANDLED ERROR: ",s),r}).then(r=>(this.pu=!1,r))));return this.bu=t,t}enqueueAfterDelay(e,t,r){this.Du(),this.wu.indexOf(e)>-1&&(t=0);let s=Dm.createAndSchedule(this,e,t,r,a=>this.Fu(a));return this.fu.push(s),s}Du(){this.gu&&ue()}verifyOperationInProgress(){}async Mu(){let e;do e=this.bu,await e;while(e!==this.bu)}xu(e){for(let t of this.fu)if(t.timerId===e)return!0;return!1}Ou(e){return this.Mu().then(()=>{this.fu.sort((t,r)=>t.targetTimeMs-r.targetTimeMs);for(let t of this.fu)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.Mu()})}Nu(e){this.wu.push(e)}Fu(e){let t=this.fu.indexOf(e);this.fu.splice(t,1)}};function Cb(n){return function(t,r){if(typeof t!="object"||t===null)return!1;let s=t;for(let a of r)if(a in s&&typeof s[a]=="function")return!0;return!1}(n,["next","error","complete"])}var bi=class extends Eu{constructor(e,t,r,s){super(e,t,r,s),this.type="firestore",this._queue=new kh,this._persistenceKey=(s==null?void 0:s.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){let e=this._firestoreClient.terminate();this._queue=new kh(e),this._firestoreClient=void 0,await e}}};function GT(n,e){let t=typeof n=="object"?n:U0(),r=typeof n=="string"?n:e||uh,s=L0(t,"firestore").getImmediate({identifier:r});if(!s._initialized){let a=v0("firestore");a&&wF(s,...a)}return s}function gg(n){if(n._terminated)throw new re(H.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||bF(n),n._firestoreClient}function bF(n){var e,t,r;let s=n._freezeSettings(),a=function(h,f,m,_){return new Ep(h,f,m,_.host,_.ssl,_.experimentalForceLongPolling,_.experimentalAutoDetectLongPolling,qT(_.experimentalLongPollingOptions),_.useFetchStreams)}(n._databaseId,((e=n._app)===null||e===void 0?void 0:e.options.appId)||"",n._persistenceKey,s);n._componentsProvider||!((t=s.localCache)===null||t===void 0)&&t._offlineComponentProvider&&(!((r=s.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(n._componentsProvider={_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider}),n._firestoreClient=new jm(n._authCredentials,n._appCheckCredentials,n._queue,a,n._componentsProvider&&function(h){let f=h==null?void 0:h._online.build();return{_offline:h==null?void 0:h._offline.build(f),_online:f}}(n._componentsProvider))}var xu=class n{constructor(e){this._byteString=e}static fromBase64String(e){try{return new n(At.fromBase64String(e))}catch(t){throw new re(H.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new n(At.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)}};var Qo=class{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new re(H.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new en(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}};var Au=class{constructor(e){this._methodName=e}};var Su=class{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new re(H.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new re(H.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return Re(this._lat,e._lat)||Re(this._long,e._long)}};var Ru=class{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,s){if(r.length!==s.length)return!1;for(let a=0;a<r.length;++a)if(r[a]!==s[a])return!1;return!0}(this._values,e._values)}};var TF=/^__.*__$/,qm=class{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return this.fieldMask!==null?new Zn(e,this.data,this.fieldMask,t,this.fieldTransforms):new ds(e,this.data,t,this.fieldTransforms)}},Nh=class{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return new Zn(e,this.data,this.fieldMask,t,this.fieldTransforms)}};function KT(n){switch(n){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ue()}}var zm=class n{constructor(e,t,r,s,a,c){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=s,a===void 0&&this.Bu(),this.fieldTransforms=a||[],this.fieldMask=c||[]}get path(){return this.settings.path}get Lu(){return this.settings.Lu}ku(e){return new n(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}qu(e){var t;let r=(t=this.path)===null||t===void 0?void 0:t.child(e),s=this.ku({path:r,Qu:!1});return s.$u(e),s}Ku(e){var t;let r=(t=this.path)===null||t===void 0?void 0:t.child(e),s=this.ku({path:r,Qu:!1});return s.Bu(),s}Uu(e){return this.ku({path:void 0,Qu:!0})}Wu(e){return Lh(e,this.settings.methodName,this.settings.Gu||!1,this.path,this.settings.zu)}contains(e){return this.fieldMask.find(t=>e.isPrefixOf(t))!==void 0||this.fieldTransforms.find(t=>e.isPrefixOf(t.field))!==void 0}Bu(){if(this.path)for(let e=0;e<this.path.length;e++)this.$u(this.path.get(e))}$u(e){if(e.length===0)throw this.Wu("Document fields must not be empty");if(KT(this.Lu)&&TF.test(e))throw this.Wu('Document fields cannot begin and end with "__"')}},Gm=class{constructor(e,t,r){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=r||Gh(e)}ju(e,t,r,s=!1){return new zm({Lu:e,methodName:t,zu:r,path:en.emptyPath(),Qu:!1,Gu:s},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}};function WT(n){let e=n._freezeSettings(),t=Gh(n._databaseId);return new Gm(n._databaseId,!!e.ignoreUndefinedProperties,t)}function EF(n,e,t,r,s,a={}){let c=n.ju(a.merge||a.mergeFields?2:0,e,t,s);_g("Data must be an object, but it was:",c,r);let h=HT(r,c),f,m;if(a.merge)f=new hn(c.fieldMask),m=c.fieldTransforms;else if(a.mergeFields){let _=[];for(let E of a.mergeFields){let I=Km(e,E,t);if(!c.contains(I))throw new re(H.INVALID_ARGUMENT,`Field '${I}' is specified in your field mask but missing from your input data.`);JT(_,I)||_.push(I)}f=new hn(_),m=c.fieldTransforms.filter(E=>f.covers(E.field))}else f=null,m=c.fieldTransforms;return new qm(new Zt(h),f,m)}var Vh=class n extends Au{_toFieldTransform(e){if(e.Lu!==2)throw e.Lu===1?e.Wu(`${this._methodName}() can only appear at the top level of your update data`):e.Wu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof n}};function IF(n,e,t,r){let s=n.ju(1,e,t);_g("Data must be an object, but it was:",s,r);let a=[],c=Zt.empty();Ti(r,(f,m)=>{let _=yg(e,f,t);m=Ir(m);let E=s.Ku(_);if(m instanceof Vh)a.push(_);else{let I=Qh(m,E);I!=null&&(a.push(_),c.set(_,I))}});let h=new hn(a);return new Nh(c,h,s.fieldTransforms)}function xF(n,e,t,r,s,a){let c=n.ju(1,e,t),h=[Km(e,r,t)],f=[s];if(a.length%2!=0)throw new re(H.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let I=0;I<a.length;I+=2)h.push(Km(e,a[I])),f.push(a[I+1]);let m=[],_=Zt.empty();for(let I=h.length-1;I>=0;--I)if(!JT(m,h[I])){let k=h[I],B=f[I];B=Ir(B);let G=c.Ku(k);if(B instanceof Vh)m.push(k);else{let j=Qh(B,G);j!=null&&(m.push(k),_.set(k,j))}}let E=new hn(m);return new Nh(_,E,c.fieldTransforms)}function Qh(n,e){if(QT(n=Ir(n)))return _g("Unsupported field value:",e,n),HT(n,e);if(n instanceof Au)return function(r,s){if(!KT(s.Lu))throw s.Wu(`${r._methodName}() can only be used with update() and set()`);if(!s.path)throw s.Wu(`${r._methodName}() is not currently supported inside arrays`);let a=r._toFieldTransform(s);a&&s.fieldTransforms.push(a)}(n,e),null;if(n===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.Qu&&e.Lu!==4)throw e.Wu("Nested arrays are not supported");return function(r,s){let a=[],c=0;for(let h of r){let f=Qh(h,s.Uu(c));f==null&&(f={nullValue:"NULL_VALUE"}),a.push(f),c++}return{arrayValue:{values:a}}}(n,e)}return function(r,s){if((r=Ir(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return oM(s.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){let a=yt.fromDate(r);return{timestampValue:gh(s.serializer,a)}}if(r instanceof yt){let a=new yt(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:gh(s.serializer,a)}}if(r instanceof Su)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof xu)return{bytesValue:yT(s.serializer,r._byteString)};if(r instanceof qt){let a=s.databaseId,c=r.firestore._databaseId;if(!c.isEqual(a))throw s.Wu(`Document reference is for database ${c.projectId}/${c.database} but should be for database ${a.projectId}/${a.database}`);return{referenceValue:sg(r.firestore._databaseId||s.databaseId,r._key.path)}}if(r instanceof Ru)return function(c,h){return{mapValue:{fields:{[Zm]:{stringValue:eg},[Mo]:{arrayValue:{values:c.toArray().map(m=>{if(typeof m!="number")throw h.Wu("VectorValues must only contain numeric values.");return ig(h.serializer,m)})}}}}}}(r,s);throw s.Wu(`Unsupported field value: ${mg(r)}`)}(n,e)}function HT(n,e){let t={};return Gb(n)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ti(n,(r,s)=>{let a=Qh(s,e.qu(r));a!=null&&(t[r]=a)}),{mapValue:{fields:t}}}function QT(n){return!(typeof n!="object"||n===null||n instanceof Array||n instanceof Date||n instanceof yt||n instanceof Su||n instanceof xu||n instanceof qt||n instanceof Au||n instanceof Ru)}function _g(n,e,t){if(!QT(t)||!function(s){return typeof s=="object"&&s!==null&&(Object.getPrototypeOf(s)===Object.prototype||Object.getPrototypeOf(s)===null)}(t)){let r=mg(t);throw r==="an object"?e.Wu(n+" a custom object"):e.Wu(n+" "+r)}}function Km(n,e,t){if((e=Ir(e))instanceof Qo)return e._internalPath;if(typeof e=="string")return yg(n,e);throw Lh("Field path arguments must be of type string or ",n,!1,void 0,t)}var AF=new RegExp("[~\\*/\\[\\]]");function yg(n,e,t){if(e.search(AF)>=0)throw Lh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new Qo(...e.split("."))._internalPath}catch{throw Lh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function Lh(n,e,t,r,s){let a=r&&!r.isEmpty(),c=s!==void 0,h=`Function ${e}() called with invalid data`;t&&(h+=" (via `toFirestore()`)"),h+=". ";let f="";return(a||c)&&(f+=" (found",a&&(f+=` in field ${r}`),c&&(f+=` in document ${s}`),f+=")"),new re(H.INVALID_ARGUMENT,h+n+f)}function JT(n,e){return n.some(t=>t.isEqual(e))}var Mh=class{constructor(e,t,r,s,a){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=s,this._converter=a}get id(){return this._key.path.lastSegment()}get ref(){return new qt(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){let e=new Wm(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 t=this._document.data.field(YT("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}},Wm=class extends Mh{data(){return super.data()}};function YT(n,e){return typeof e=="string"?yg(n,e):e instanceof Qo?e._internalPath:e._delegate._internalPath}function SF(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new re(H.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Hm=class{convertValue(e,t="none"){switch(yi(e)){case 0:return null;case 1:return e.booleanValue;case 2:return ze(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Dr(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw ue()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){let r={};return Ti(e,(s,a)=>{r[s]=this.convertValue(a,t)}),r}convertVectorValue(e){var t,r,s;let a=(s=(r=(t=e.fields)===null||t===void 0?void 0:t[Mo].arrayValue)===null||r===void 0?void 0:r.values)===null||s===void 0?void 0:s.map(c=>ze(c.doubleValue));return new Ru(a)}convertGeoPoint(e){return new Su(ze(e.latitude),ze(e.longitude))}convertArray(e,t){return(e.values||[]).map(r=>this.convertValue(r,t))}convertServerTimestamp(e,t){switch(t){case"previous":let r=jh(e);return r==null?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(gu(e));default:return null}}convertTimestamp(e){let t=Cr(e);return new yt(t.seconds,t.nanos)}convertDocumentKey(e,t){let r=st.fromString(e);Le(IT(r));let s=new ch(r.get(1),r.get(3)),a=new ce(r.popFirst(5));return s.isEqual(t)||Pr(`Document ${a} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),a}};function RF(n,e,t){let r;return r=n?t&&(t.merge||t.mergeFields)?n.toFirestore(e,t):n.toFirestore(e):e,r}var us=class{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}},Fh=class extends Mh{constructor(e,t,r,s,a,c){super(e,t,r,s,c),this._firestore=e,this._firestoreImpl=e,this.metadata=a}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let t=new ko(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){let r=this._document.data.field(YT("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}},ko=class extends Fh{data(e={}){return super.data(e)}},Qm=class{constructor(e,t,r,s){this._firestore=e,this._userDataWriter=t,this._snapshot=s,this.metadata=new us(s.hasPendingWrites,s.fromCache),this.query=r}get docs(){let e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new ko(this._firestore,this._userDataWriter,r.key,r,new us(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new re(H.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(s,a){if(s._snapshot.oldDocs.isEmpty()){let c=0;return s._snapshot.docChanges.map(h=>{let f=new ko(s._firestore,s._userDataWriter,h.doc.key,h.doc,new us(s._snapshot.mutatedKeys.has(h.doc.key),s._snapshot.fromCache),s.query.converter);return h.doc,{type:"added",doc:f,oldIndex:-1,newIndex:c++}})}{let c=s._snapshot.oldDocs;return s._snapshot.docChanges.filter(h=>a||h.type!==3).map(h=>{let f=new ko(s._firestore,s._userDataWriter,h.doc.key,h.doc,new us(s._snapshot.mutatedKeys.has(h.doc.key),s._snapshot.fromCache),s.query.converter),m=-1,_=-1;return h.type!==0&&(m=c.indexOf(h.doc.key),c=c.delete(h.doc.key)),h.type!==1&&(c=c.add(h.doc),_=c.indexOf(h.doc.key)),{type:PF(h.type),doc:f,oldIndex:m,newIndex:_}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}};function PF(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ue()}}function vg(n){n=Jn(n,qt);let e=Jn(n.firestore,bi);return _F(gg(e),n._key).then(t=>nE(e,n,t))}var Uh=class extends Hm{constructor(e){super(),this.firestore=e}convertBytes(e){return new xu(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new qt(this.firestore,null,t)}};function XT(n,e,t){n=Jn(n,qt);let r=Jn(n.firestore,bi),s=RF(n.converter,e,t);return tE(r,[EF(WT(r),"setDoc",n._key,s,n.converter!==null,t).toMutation(n._key,_i.none())])}function ZT(n,e,t,...r){n=Jn(n,qt);let s=Jn(n.firestore,bi),a=WT(s),c;return c=typeof(e=Ir(e))=="string"||e instanceof Qo?xF(a,"updateDoc",n._key,e,t,r):IF(a,"updateDoc",n._key,e),tE(s,[c.toMutation(n._key,_i.exists(!0))])}function eE(n,...e){var t,r,s;n=Ir(n);let a={includeMetadataChanges:!1,source:"default"},c=0;typeof e[c]!="object"||Cb(e[c])||(a=e[c],c++);let h={includeMetadataChanges:a.includeMetadataChanges,source:a.source};if(Cb(e[c])){let E=e[c];e[c]=(t=E.next)===null||t===void 0?void 0:t.bind(E),e[c+1]=(r=E.error)===null||r===void 0?void 0:r.bind(E),e[c+2]=(s=E.complete)===null||s===void 0?void 0:s.bind(E)}let f,m,_;if(n instanceof qt)m=Jn(n.firestore,bi),_=$h(n._key.path),f={next:E=>{e[c]&&e[c](nE(m,n,E))},error:e[c+1],complete:e[c+2]};else{let E=Jn(n,Oh);m=Jn(E.firestore,bi),_=E._query;let I=new Uh(m);f={next:k=>{e[c]&&e[c](new Qm(m,I,E,k))},error:e[c+1],complete:e[c+2]},SF(n._query)}return function(I,k,B,G){let j=new Ch(G),J=new Sh(k,j,B);return I.asyncQueue.enqueueAndForget(async()=>NT(await $m(I),J)),()=>{j.su(),I.asyncQueue.enqueueAndForget(async()=>VT(await $m(I),J))}}(gg(m),_,h,f)}function tE(n,e){return function(r,s){let a=new Kn;return r.asyncQueue.enqueueAndForget(async()=>aF(await gF(r),s,a)),a.promise}(gg(n),e)}function nE(n,e,t){let r=t.docs.get(e._key),s=new Uh(n);return new Fh(n,s,e._key,r,new us(t.hasPendingWrites,t.fromCache),e.converter)}(function(e,t=!0){(function(s){Jo=s})(F0),ou(new xr("firestore",(r,{instanceIdentifier:s,options:a})=>{let c=r.getProvider("app").getImmediate(),h=new bi(new _p(r.getProvider("auth-internal")),new wp(c,r.getProvider("app-check-internal")),function(m,_){if(!Object.prototype.hasOwnProperty.apply(m.options,["projectId"]))throw new re(H.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new ch(m.options.projectId,_)}(c,s),c);return a=Object.assign({useFetchStreams:t},a),h._setSettings(a),h},"PUBLIC").setMultipleInstances(!0)),gi(z0,G0,e),gi(z0,G0,"esm2017")})();var rE=n=>{let e;return n?e=n:typeof fetch=="undefined"?e=(...t)=>Promise.resolve().then(()=>(Ei(),gs)).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)};var Du=class extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}},Jh=class extends Du{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}},Yh=class extends Du{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}},Xh=class extends Du{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}},Zh;(function(n){n.Any="any",n.ApNortheast1="ap-northeast-1",n.ApNortheast2="ap-northeast-2",n.ApSouth1="ap-south-1",n.ApSoutheast1="ap-southeast-1",n.ApSoutheast2="ap-southeast-2",n.CaCentral1="ca-central-1",n.EuCentral1="eu-central-1",n.EuWest1="eu-west-1",n.EuWest2="eu-west-2",n.EuWest3="eu-west-3",n.SaEast1="sa-east-1",n.UsEast1="us-east-1",n.UsWest1="us-west-1",n.UsWest2="us-west-2"})(Zh||(Zh={}));var NF=function(n,e,t,r){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function h(_){try{m(r.next(_))}catch(E){c(E)}}function f(_){try{m(r.throw(_))}catch(E){c(E)}}function m(_){_.done?a(_.value):s(_.value).then(h,f)}m((r=r.apply(n,e||[])).next())})},Ou=class{constructor(e,{headers:t={},customFetch:r,region:s=Zh.Any}={}){this.url=e,this.headers=t,this.region=s,this.fetch=rE(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var r;return NF(this,void 0,void 0,function*(){try{let{headers:s,method:a,body:c}=t,h={},{region:f}=t;f||(f=this.region),f&&f!=="any"&&(h["x-region"]=f);let m;c&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)&&(typeof Blob!="undefined"&&c instanceof Blob||c instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",m=c):typeof c=="string"?(h["Content-Type"]="text/plain",m=c):typeof FormData!="undefined"&&c instanceof FormData?m=c:(h["Content-Type"]="application/json",m=JSON.stringify(c)));let _=yield this.fetch(`${this.url}/${e}`,{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),s),body:m}).catch(B=>{throw new Jh(B)}),E=_.headers.get("x-relay-error");if(E&&E==="true")throw new Yh(_);if(!_.ok)throw new Xh(_);let I=((r=_.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),k;return I==="application/json"?k=yield _.json():I==="application/octet-stream"?k=yield _.blob():I==="text/event-stream"?k=_:I==="multipart/form-data"?k=yield _.formData():k=yield _.text(),{data:k,error:null}}catch(s){return{data:null,error:s}}})}};var gE=Cd(mE(),1),{PostgrestClient:_E,PostgrestQueryBuilder:kK,PostgrestFilterBuilder:NK,PostgrestTransformBuilder:VK,PostgrestBuilder:LK,PostgrestError:KF}=gE.default;var yE="2.11.2";var vE={"X-Client-Info":`realtime-js/${yE}`},wE="1.0.0",sf=1e4,bE=1e3,_s;(function(n){n[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed"})(_s||(_s={}));var zt;(function(n){n.closed="closed",n.errored="errored",n.joined="joined",n.joining="joining",n.leaving="leaving"})(zt||(zt={}));var tn;(function(n){n.close="phx_close",n.error="phx_error",n.join="phx_join",n.reply="phx_reply",n.leave="phx_leave",n.access_token="access_token"})(tn||(tn={}));var rf;(function(n){n.websocket="websocket"})(rf||(rf={}));var Ii;(function(n){n.Connecting="connecting",n.Open="open",n.Closing="closing",n.Closed="closed"})(Ii||(Ii={}));var Uu=class{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){let t=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,t,r)}_decodeBroadcast(e,t,r){let s=t.getUint8(1),a=t.getUint8(2),c=this.HEADER_LENGTH+2,h=r.decode(e.slice(c,c+s));c=c+s;let f=r.decode(e.slice(c,c+a));c=c+a;let m=JSON.parse(r.decode(e.slice(c,e.byteLength)));return{ref:null,topic:h,event:f,payload:m}}};var ys=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var je;(function(n){n.abstime="abstime",n.bool="bool",n.date="date",n.daterange="daterange",n.float4="float4",n.float8="float8",n.int2="int2",n.int4="int4",n.int4range="int4range",n.int8="int8",n.int8range="int8range",n.json="json",n.jsonb="jsonb",n.money="money",n.numeric="numeric",n.oid="oid",n.reltime="reltime",n.text="text",n.time="time",n.timestamp="timestamp",n.timestamptz="timestamptz",n.timetz="timetz",n.tsrange="tsrange",n.tstzrange="tstzrange"})(je||(je={}));var Ng=(n,e,t={})=>{var r;let s=(r=t.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(e).reduce((a,c)=>(a[c]=WF(c,n,e,s),a),{})},WF=(n,e,t,r)=>{let s=e.find(h=>h.name===n),a=s==null?void 0:s.type,c=t[n];return a&&!r.includes(a)?TE(a,c):kg(c)},TE=(n,e)=>{if(n.charAt(0)==="_"){let t=n.slice(1,n.length);return YF(e,t)}switch(n){case je.bool:return HF(e);case je.float4:case je.float8:case je.int2:case je.int4:case je.int8:case je.numeric:case je.oid:return QF(e);case je.json:case je.jsonb:return JF(e);case je.timestamp:return XF(e);case je.abstime:case je.date:case je.daterange:case je.int4range:case je.int8range:case je.money:case je.reltime:case je.text:case je.time:case je.timestamptz:case je.timetz:case je.tsrange:case je.tstzrange:return kg(e);default:return kg(e)}},kg=n=>n,HF=n=>{switch(n){case"t":return!0;case"f":return!1;default:return n}},QF=n=>{if(typeof n=="string"){let e=parseFloat(n);if(!Number.isNaN(e))return e}return n},JF=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(e){return console.log(`JSON parse error: ${e}`),n}return n},YF=(n,e)=>{if(typeof n!="string")return n;let t=n.length-1,r=n[t];if(n[0]==="{"&&r==="}"){let a,c=n.slice(1,t);try{a=JSON.parse("["+c+"]")}catch{a=c?c.split(","):[]}return a.map(h=>TE(e,h))}return n},XF=n=>typeof n=="string"?n.replace(" ","T"):n,of=n=>{let e=n;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};var vs=class{constructor(e,t,r={},s=sf){this.channel=e,this.event=t,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var r;return this._hasReceived(e)&&t((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}};var Vg;(function(n){n.SYNC="sync",n.JOIN="join",n.LEAVE="leave"})(Vg||(Vg={}));var na=class n{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=(t==null?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{let{onJoin:a,onLeave:c,onSync:h}=this.caller;this.joinRef=this.channel._joinRef(),this.state=n.syncState(this.state,s,a,c),this.pendingDiffs.forEach(f=>{this.state=n.syncDiff(this.state,f,a,c)}),this.pendingDiffs=[],h()}),this.channel._on(r.diff,{},s=>{let{onJoin:a,onLeave:c,onSync:h}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=n.syncDiff(this.state,s,a,c),h())}),this.onJoin((s,a,c)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:a,newPresences:c})}),this.onLeave((s,a,c)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:a,leftPresences:c})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,r,s){let a=this.cloneDeep(e),c=this.transformState(t),h={},f={};return this.map(a,(m,_)=>{c[m]||(f[m]=_)}),this.map(c,(m,_)=>{let E=a[m];if(E){let I=_.map(j=>j.presence_ref),k=E.map(j=>j.presence_ref),B=_.filter(j=>k.indexOf(j.presence_ref)<0),G=E.filter(j=>I.indexOf(j.presence_ref)<0);B.length>0&&(h[m]=B),G.length>0&&(f[m]=G)}else h[m]=_}),this.syncDiff(a,{joins:h,leaves:f},r,s)}static syncDiff(e,t,r,s){let{joins:a,leaves:c}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(a,(h,f)=>{var m;let _=(m=e[h])!==null&&m!==void 0?m:[];if(e[h]=this.cloneDeep(f),_.length>0){let E=e[h].map(k=>k.presence_ref),I=_.filter(k=>E.indexOf(k.presence_ref)<0);e[h].unshift(...I)}r(h,_,f)}),this.map(c,(h,f)=>{let m=e[h];if(!m)return;let _=f.map(E=>E.presence_ref);m=m.filter(E=>_.indexOf(E.presence_ref)<0),e[h]=m,s(h,m,f),m.length===0&&delete e[h]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,r)=>{let s=e[r];return"metas"in s?t[r]=s.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):t[r]=s,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var Lg;(function(n){n.ALL="*",n.INSERT="INSERT",n.UPDATE="UPDATE",n.DELETE="DELETE"})(Lg||(Lg={}));var Mg;(function(n){n.BROADCAST="broadcast",n.PRESENCE="presence",n.POSTGRES_CHANGES="postgres_changes",n.SYSTEM="system"})(Mg||(Mg={}));var er;(function(n){n.SUBSCRIBED="SUBSCRIBED",n.TIMED_OUT="TIMED_OUT",n.CLOSED="CLOSED",n.CHANNEL_ERROR="CHANNEL_ERROR"})(er||(er={}));var ra=class n{constructor(e,t={config:{}},r){this.topic=e,this.params=t,this.socket=r,this.bindings={},this.state=zt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new vs(this,tn.join,this.params,this.timeout),this.rejoinTimer=new ys(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=zt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=zt.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=zt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=zt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(tn.reply,{},(s,a)=>{this._trigger(this._replyEventName(a),s)}),this.presence=new na(this),this.broadcastEndpointURL=of(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(e,t=this.timeout){var r,s;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{let{config:{broadcast:a,presence:c,private:h}}=this.params;this._onError(_=>e==null?void 0:e(er.CHANNEL_ERROR,_)),this._onClose(()=>e==null?void 0:e(er.CLOSED));let f={},m={broadcast:a,presence:c,postgres_changes:(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(_=>_.filter))!==null&&s!==void 0?s:[],private:h};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:m},f)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:_})=>{var E;if(this.socket.setAuth(),_===void 0){e==null||e(er.SUBSCRIBED);return}else{let I=this.bindings.postgres_changes,k=(E=I==null?void 0:I.length)!==null&&E!==void 0?E:0,B=[];for(let G=0;G<k;G++){let j=I[G],{filter:{event:J,schema:ee,table:ne,filter:le}}=j,de=_&&_[G];if(de&&de.event===J&&de.schema===ee&&de.table===ne&&de.filter===le)B.push(Object.assign(Object.assign({},j),{id:de.id}));else{this.unsubscribe(),e==null||e(er.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=B,e&&e(er.SUBSCRIBED);return}}).receive("error",_=>{e==null||e(er.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(_).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(er.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){return this._on(e,t,r)}async send(e,t={}){var r,s;if(!this._canPush()&&e.type==="broadcast"){let{event:a,payload:c}=e,f={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:c,private:this.private}]})};try{let m=await this._fetchWithTimeout(this.broadcastEndpointURL,f,(r=t.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=m.body)===null||s===void 0?void 0:s.cancel()),m.ok?"ok":"error"}catch(m){return m.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var c,h,f;let m=this._push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((f=(h=(c=this.params)===null||c===void 0?void 0:c.config)===null||h===void 0?void 0:h.broadcast)===null||f===void 0)&&f.ack)&&a("ok"),m.receive("ok",()=>a("ok")),m.receive("error",()=>a("error")),m.receive("timeout",()=>a("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=zt.leaving;let t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(tn.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(r=>{let s=new vs(this,tn.leave,{},e);s.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),s.send(),this._canPush()||s.trigger("ok",{})})}async _fetchWithTimeout(e,t,r){let s=new AbortController,a=setTimeout(()=>s.abort(),r),c=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:s.signal}));return clearTimeout(a),c}_push(e,t,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new vs(this,e,t,r);return this._canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}_onMessage(e,t,r){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,r){var s,a;let c=e.toLocaleLowerCase(),{close:h,error:f,leave:m,join:_}=tn;if(r&&[h,f,m,_].indexOf(c)>=0&&r!==this._joinRef())return;let I=this._onMessage(c,t,r);if(t&&!I)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(c)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(k=>{var B,G,j;return((B=k.filter)===null||B===void 0?void 0:B.event)==="*"||((j=(G=k.filter)===null||G===void 0?void 0:G.event)===null||j===void 0?void 0:j.toLocaleLowerCase())===c}).map(k=>k.callback(I,r)):(a=this.bindings[c])===null||a===void 0||a.filter(k=>{var B,G,j,J,ee,ne;if(["broadcast","presence","postgres_changes"].includes(c))if("id"in k){let le=k.id,de=(B=k.filter)===null||B===void 0?void 0:B.event;return le&&((G=t.ids)===null||G===void 0?void 0:G.includes(le))&&(de==="*"||(de==null?void 0:de.toLocaleLowerCase())===((j=t.data)===null||j===void 0?void 0:j.type.toLocaleLowerCase()))}else{let le=(ee=(J=k==null?void 0:k.filter)===null||J===void 0?void 0:J.event)===null||ee===void 0?void 0:ee.toLocaleLowerCase();return le==="*"||le===((ne=t==null?void 0:t.event)===null||ne===void 0?void 0:ne.toLocaleLowerCase())}else return k.type.toLocaleLowerCase()===c}).map(k=>{if(typeof I=="object"&&"ids"in I){let B=I.data,{schema:G,table:j,commit_timestamp:J,type:ee,errors:ne}=B;I=Object.assign(Object.assign({},{schema:G,table:j,commit_timestamp:J,eventType:ee,new:{},old:{},errors:ne}),this._getPayloadRecords(B))}k.callback(I,r)})}_isClosed(){return this.state===zt.closed}_isJoined(){return this.state===zt.joined}_isJoining(){return this.state===zt.joining}_isLeaving(){return this.state===zt.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,r){let s=e.toLocaleLowerCase(),a={type:s,filter:t,callback:r};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this}_off(e,t){let r=e.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(s=>{var a;return!(((a=s.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===r&&n.isEqual(s.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(tn.close,{},e)}_onError(e){this._on(tn.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=zt.joining,this.joinPush.resend(e))}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=Ng(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=Ng(e.columns,e.old_record)),t}};var eU=()=>{},tU=typeof WebSocket!="undefined",nU=`
42
+ addEventListener("message", (e) => {
43
+ if (e.data.event === "start") {
44
+ setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
45
+ }
46
+ });`,ia=class{constructor(e,t){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=vE,this.params={},this.timeout=sf,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=eU,this.conn=null,this.sendBuffer=[],this.serializer=new Uu,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=a=>{let c;return a?c=a:typeof fetch=="undefined"?c=(...h)=>Promise.resolve().then(()=>(Ei(),gs)).then(({default:f})=>f(...h)):c=fetch,(...h)=>c(...h)},this.endPoint=`${e}/${rf.websocket}`,this.httpEndpoint=of(e),t!=null&&t.transport?this.transport=t.transport:this.transport=null,t!=null&&t.params&&(this.params=t.params),t!=null&&t.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t!=null&&t.timeout&&(this.timeout=t.timeout),t!=null&&t.logger&&(this.logger=t.logger),t!=null&&t.heartbeatIntervalMs&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);let s=(r=t==null?void 0:t.params)===null||r===void 0?void 0:r.apikey;if(s&&(this.accessTokenValue=s,this.apiKey=s),this.reconnectAfterMs=t!=null&&t.reconnectAfterMs?t.reconnectAfterMs:a=>[1e3,2e3,5e3,1e4][a-1]||1e4,this.encode=t!=null&&t.encode?t.encode:(a,c)=>c(JSON.stringify(a)),this.decode=t!=null&&t.decode?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new ys(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(t==null?void 0:t.fetch),t!=null&&t.worker){if(typeof window!="undefined"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(t==null?void 0:t.worker)||!1,this.workerUrl=t==null?void 0:t.workerUrl}this.accessToken=(t==null?void 0:t.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(tU){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new Fg(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),Promise.resolve().then(()=>Cd(IE())).then(({default:e})=>{this.conn=new e(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:wE}))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,t!=null?t:""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){let e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.disconnect(),e}log(e,t,r){this.logger(e,t,r)}connectionState(){switch(this.conn&&this.conn.readyState){case _s.connecting:return Ii.Connecting;case _s.open:return Ii.Open;case _s.closing:return Ii.Closing;default:return Ii.Closed}}isConnected(){return this.connectionState()===Ii.Open}channel(e,t={config:{}}){let r=new ra(`realtime:${e}`,t,this);return this.channels.push(r),r}push(e){let{topic:t,event:r,payload:s,ref:a}=e,c=()=>{this.encode(e,h=>{var f;(f=this.conn)===null||f===void 0||f.send(h)})};this.log("push",`${t} ${r} (${a})`,s),this.isConnected()?c():this.sendBuffer.push(c)}async setAuth(e=null){let t=e||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(t){let r=null;try{r=JSON.parse(atob(t.split(".")[1]))}catch{}if(r&&r.exp&&!(Math.floor(Date.now()/1e3)-r.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`);this.accessTokenValue=t,this.channels.forEach(s=>{t&&s.updateJoinPayload({access_token:t}),s.joinedOnce&&s._isJoined()&&s._push(tn.access_token,{access_token:t})})}}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(bE,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:s,payload:a,ref:c}=t;c&&c===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${a.status||""} ${r} ${s} ${c&&"("+c+")"||""}`,a),this.channels.filter(h=>h._isMember(r)).forEach(h=>h._trigger(s,a,c)),this.stateChangeCallbacks.message.forEach(h=>h(t))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this.workerRef.terminate()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(tn.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?",s=new URLSearchParams(t);return`${e}${r}${s}`}_workerObjectUrl(e){let t;if(e)t=e;else{let r=new Blob([nU],{type:"application/javascript"});t=URL.createObjectURL(r)}return t}},Fg=class{constructor(e,t,r){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=_s.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=r.close}};var sa=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function ot(n){return typeof n=="object"&&n!==null&&"__isStorageError"in n}var af=class extends sa{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}},ws=class extends sa{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}};var rU=function(n,e,t,r){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function h(_){try{m(r.next(_))}catch(E){c(E)}}function f(_){try{m(r.throw(_))}catch(E){c(E)}}function m(_){_.done?a(_.value):s(_.value).then(h,f)}m((r=r.apply(n,e||[])).next())})},cf=n=>{let e;return n?e=n:typeof fetch=="undefined"?e=(...t)=>Promise.resolve().then(()=>(Ei(),gs)).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)},xE=()=>rU(void 0,void 0,void 0,function*(){return typeof Response=="undefined"?(yield Promise.resolve().then(()=>(Ei(),gs))).Response:Response}),uf=n=>{if(Array.isArray(n))return n.map(t=>uf(t));if(typeof n=="function"||n!==Object(n))return n;let e={};return Object.entries(n).forEach(([t,r])=>{let s=t.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));e[s]=uf(r)}),e};var bs=function(n,e,t,r){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function h(_){try{m(r.next(_))}catch(E){c(E)}}function f(_){try{m(r.throw(_))}catch(E){c(E)}}function m(_){_.done?a(_.value):s(_.value).then(h,f)}m((r=r.apply(n,e||[])).next())})},Ug=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),iU=(n,e,t)=>bs(void 0,void 0,void 0,function*(){let r=yield xE();n instanceof r&&!(t!=null&&t.noResolveJson)?n.json().then(s=>{e(new af(Ug(s),n.status||500))}).catch(s=>{e(new ws(Ug(s),s))}):e(new ws(Ug(n),n))}),sU=(n,e,t,r)=>{let s={method:n,headers:(e==null?void 0:e.headers)||{}};return n==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),r&&(s.body=JSON.stringify(r)),Object.assign(Object.assign({},s),t))};function Bu(n,e,t,r,s,a){return bs(this,void 0,void 0,function*(){return new Promise((c,h)=>{n(t,sU(e,r,s,a)).then(f=>{if(!f.ok)throw f;return r!=null&&r.noResolveJson?f:f.json()}).then(f=>c(f)).catch(f=>iU(f,h,r))})})}function oa(n,e,t,r){return bs(this,void 0,void 0,function*(){return Bu(n,"GET",e,t,r)})}function tr(n,e,t,r,s){return bs(this,void 0,void 0,function*(){return Bu(n,"POST",e,r,s,t)})}function AE(n,e,t,r,s){return bs(this,void 0,void 0,function*(){return Bu(n,"PUT",e,r,s,t)})}function SE(n,e,t,r){return bs(this,void 0,void 0,function*(){return Bu(n,"HEAD",e,Object.assign(Object.assign({},t),{noResolveJson:!0}),r)})}function lf(n,e,t,r,s){return bs(this,void 0,void 0,function*(){return Bu(n,"DELETE",e,r,s,t)})}var Gt=function(n,e,t,r){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function h(_){try{m(r.next(_))}catch(E){c(E)}}function f(_){try{m(r.throw(_))}catch(E){c(E)}}function m(_){_.done?a(_.value):s(_.value).then(h,f)}m((r=r.apply(n,e||[])).next())})},oU={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},RE={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},ju=class{constructor(e,t={},r,s){this.url=e,this.headers=t,this.bucketId=r,this.fetch=cf(s)}uploadOrUpdate(e,t,r,s){return Gt(this,void 0,void 0,function*(){try{let a,c=Object.assign(Object.assign({},RE),s),h=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(c.upsert)}),f=c.metadata;typeof Blob!="undefined"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",c.cacheControl),f&&a.append("metadata",this.encodeMetadata(f)),a.append("",r)):typeof FormData!="undefined"&&r instanceof FormData?(a=r,a.append("cacheControl",c.cacheControl),f&&a.append("metadata",this.encodeMetadata(f))):(a=r,h["cache-control"]=`max-age=${c.cacheControl}`,h["content-type"]=c.contentType,f&&(h["x-metadata"]=this.toBase64(this.encodeMetadata(f)))),s!=null&&s.headers&&(h=Object.assign(Object.assign({},h),s.headers));let m=this._removeEmptyFolders(t),_=this._getFinalPath(m),E=yield this.fetch(`${this.url}/object/${_}`,Object.assign({method:e,body:a,headers:h},c!=null&&c.duplex?{duplex:c.duplex}:{})),I=yield E.json();return E.ok?{data:{path:m,id:I.Id,fullPath:I.Key},error:null}:{data:null,error:I}}catch(a){if(ot(a))return{data:null,error:a};throw a}})}upload(e,t,r){return Gt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,r)})}uploadToSignedUrl(e,t,r,s){return Gt(this,void 0,void 0,function*(){let a=this._removeEmptyFolders(e),c=this._getFinalPath(a),h=new URL(this.url+`/object/upload/sign/${c}`);h.searchParams.set("token",t);try{let f,m=Object.assign({upsert:RE.upsert},s),_=Object.assign(Object.assign({},this.headers),{"x-upsert":String(m.upsert)});typeof Blob!="undefined"&&r instanceof Blob?(f=new FormData,f.append("cacheControl",m.cacheControl),f.append("",r)):typeof FormData!="undefined"&&r instanceof FormData?(f=r,f.append("cacheControl",m.cacheControl)):(f=r,_["cache-control"]=`max-age=${m.cacheControl}`,_["content-type"]=m.contentType);let E=yield this.fetch(h.toString(),{method:"PUT",body:f,headers:_}),I=yield E.json();return E.ok?{data:{path:a,fullPath:I.Key},error:null}:{data:null,error:I}}catch(f){if(ot(f))return{data:null,error:f};throw f}})}createSignedUploadUrl(e,t){return Gt(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),s=Object.assign({},this.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");let a=yield tr(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:s}),c=new URL(this.url+a.url),h=c.searchParams.get("token");if(!h)throw new sa("No token returned by API");return{data:{signedUrl:c.toString(),path:e,token:h},error:null}}catch(r){if(ot(r))return{data:null,error:r};throw r}})}update(e,t,r){return Gt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,r)})}move(e,t,r){return Gt(this,void 0,void 0,function*(){try{return{data:yield tr(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(ot(s))return{data:null,error:s};throw s}})}copy(e,t,r){return Gt(this,void 0,void 0,function*(){try{return{data:{path:(yield tr(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(ot(s))return{data:null,error:s};throw s}})}createSignedUrl(e,t,r){return Gt(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),a=yield tr(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers}),c=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${c}`)},{data:a,error:null}}catch(s){if(ot(s))return{data:null,error:s};throw s}})}createSignedUrls(e,t,r){return Gt(this,void 0,void 0,function*(){try{let s=yield tr(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:s.map(c=>Object.assign(Object.assign({},c),{signedUrl:c.signedURL?encodeURI(`${this.url}${c.signedURL}${a}`):null})),error:null}}catch(s){if(ot(s))return{data:null,error:s};throw s}})}download(e,t){return Gt(this,void 0,void 0,function*(){let s=typeof(t==null?void 0:t.transform)!="undefined"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),c=a?`?${a}`:"";try{let h=this._getFinalPath(e);return{data:yield(yield oa(this.fetch,`${this.url}/${s}/${h}${c}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(h){if(ot(h))return{data:null,error:h};throw h}})}info(e){return Gt(this,void 0,void 0,function*(){let t=this._getFinalPath(e);try{let r=yield oa(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:uf(r),error:null}}catch(r){if(ot(r))return{data:null,error:r};throw r}})}exists(e){return Gt(this,void 0,void 0,function*(){let t=this._getFinalPath(e);try{return yield SE(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(ot(r)&&r instanceof ws){let s=r.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,t){let r=this._getFinalPath(e),s=[],a=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";a!==""&&s.push(a);let h=typeof(t==null?void 0:t.transform)!="undefined"?"render/image":"object",f=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});f!==""&&s.push(f);let m=s.join("&");return m!==""&&(m=`?${m}`),{data:{publicUrl:encodeURI(`${this.url}/${h}/public/${r}${m}`)}}}remove(e){return Gt(this,void 0,void 0,function*(){try{return{data:yield lf(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(ot(t))return{data:null,error:t};throw t}})}list(e,t,r){return Gt(this,void 0,void 0,function*(){try{let s=Object.assign(Object.assign(Object.assign({},oU),t),{prefix:e||""});return{data:yield tr(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},r),error:null}}catch(s){if(ot(s))return{data:null,error:s};throw s}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer!="undefined"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};var PE="2.7.1";var CE={"X-Client-Info":`storage-js/${PE}`};var aa=function(n,e,t,r){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function h(_){try{m(r.next(_))}catch(E){c(E)}}function f(_){try{m(r.throw(_))}catch(E){c(E)}}function m(_){_.done?a(_.value):s(_.value).then(h,f)}m((r=r.apply(n,e||[])).next())})},$u=class{constructor(e,t={},r){this.url=e,this.headers=Object.assign(Object.assign({},CE),t),this.fetch=cf(r)}listBuckets(){return aa(this,void 0,void 0,function*(){try{return{data:yield oa(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(ot(e))return{data:null,error:e};throw e}})}getBucket(e){return aa(this,void 0,void 0,function*(){try{return{data:yield oa(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(ot(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return aa(this,void 0,void 0,function*(){try{return{data:yield tr(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(ot(r))return{data:null,error:r};throw r}})}updateBucket(e,t){return aa(this,void 0,void 0,function*(){try{return{data:yield AE(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(ot(r))return{data:null,error:r};throw r}})}emptyBucket(e){return aa(this,void 0,void 0,function*(){try{return{data:yield tr(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(ot(t))return{data:null,error:t};throw t}})}deleteBucket(e){return aa(this,void 0,void 0,function*(){try{return{data:yield lf(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(ot(t))return{data:null,error:t};throw t}})}};var qu=class extends $u{constructor(e,t={},r){super(e,t,r)}from(e){return new ju(this.url,this.headers,e,this.fetch)}};var DE="2.48.1";var zu="";typeof Deno!="undefined"?zu="deno":typeof document!="undefined"?zu="web":typeof navigator!="undefined"&&navigator.product==="ReactNative"?zu="react-native":zu="node";var aU={"X-Client-Info":`supabase-js-${zu}/${DE}`},OE={headers:aU},kE={schema:"public"},NE={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},VE={};Ei();var uU=function(n,e,t,r){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function h(_){try{m(r.next(_))}catch(E){c(E)}}function f(_){try{m(r.throw(_))}catch(E){c(E)}}function m(_){_.done?a(_.value):s(_.value).then(h,f)}m((r=r.apply(n,e||[])).next())})},cU=n=>{let e;return n?e=n:typeof fetch=="undefined"?e=wg:e=fetch,(...t)=>e(...t)},lU=()=>typeof Headers=="undefined"?bg:Headers,LE=(n,e,t)=>{let r=cU(t),s=lU();return(a,c)=>uU(void 0,void 0,void 0,function*(){var h;let f=(h=yield e())!==null&&h!==void 0?h:n,m=new s(c==null?void 0:c.headers);return m.has("apikey")||m.set("apikey",n),m.has("Authorization")||m.set("Authorization",`Bearer ${f}`),r(a,Object.assign(Object.assign({},c),{headers:m}))})};var hU=function(n,e,t,r){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function h(_){try{m(r.next(_))}catch(E){c(E)}}function f(_){try{m(r.throw(_))}catch(E){c(E)}}function m(_){_.done?a(_.value):s(_.value).then(h,f)}m((r=r.apply(n,e||[])).next())})};function ME(n){return n.replace(/\/$/,"")}function FE(n,e){let{db:t,auth:r,realtime:s,global:a}=n,{db:c,auth:h,realtime:f,global:m}=e,_={db:Object.assign(Object.assign({},c),t),auth:Object.assign(Object.assign({},h),r),realtime:Object.assign(Object.assign({},f),s),global:Object.assign(Object.assign({},m),a),accessToken:()=>hU(this,void 0,void 0,function*(){return""})};return n.accessToken?_.accessToken=n.accessToken:delete _.accessToken,_}var hf="2.67.3";var UE="http://localhost:9999",BE="supabase.auth.token";var jE={"X-Client-Info":`gotrue-js/${hf}`},Bg=10;var Gu="X-Supabase-Api-Version",jg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function $E(n){return Math.round(Date.now()/1e3)+n}function qE(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){let e=Math.random()*16|0;return(n=="x"?e:e&3|8).toString(16)})}var Pn=()=>typeof window!="undefined"&&typeof document!="undefined",Ts={tested:!1,writable:!1},xi=()=>{if(!Pn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ts.tested)return Ts.writable;let n=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(n,n),globalThis.localStorage.removeItem(n),Ts.tested=!0,Ts.writable=!0}catch{Ts.tested=!0,Ts.writable=!1}return Ts.writable};function zE(n){let e={},t=new URL(n);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((s,a)=>{e[a]=s})}catch{}return t.searchParams.forEach((r,s)=>{e[s]=r}),e}var ff=n=>{let e;return n?e=n:typeof fetch=="undefined"?e=(...t)=>Promise.resolve().then(()=>(Ei(),gs)).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)},GE=n=>typeof n=="object"&&n!==null&&"status"in n&&"ok"in n&&"json"in n&&typeof n.json=="function",$g=async(n,e,t)=>{await n.setItem(e,JSON.stringify(t))},Wu=async(n,e)=>{let t=await n.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},Hu=async(n,e)=>{await n.removeItem(e)};function fU(n){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",t="",r,s,a,c,h,f,m,_=0;for(n=n.replace("-","+").replace("_","/");_<n.length;)c=e.indexOf(n.charAt(_++)),h=e.indexOf(n.charAt(_++)),f=e.indexOf(n.charAt(_++)),m=e.indexOf(n.charAt(_++)),r=c<<2|h>>4,s=(h&15)<<4|f>>2,a=(f&3)<<6|m,t=t+String.fromCharCode(r),f!=64&&s!=0&&(t=t+String.fromCharCode(s)),m!=64&&a!=0&&(t=t+String.fromCharCode(a));return t}var Ku=class n{constructor(){this.promise=new n.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};Ku.promiseConstructor=Promise;function qg(n){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,t=n.split(".");if(t.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(t[1]))throw new Error("JWT is not valid: payload is not in base64url format");let r=t[1];return JSON.parse(fU(r))}async function KE(n){return await new Promise(e=>{setTimeout(()=>e(null),n)})}function WE(n,e){return new Promise((r,s)=>{(async()=>{for(let a=0;a<1/0;a++)try{let c=await n(a);if(!e(a,null,c)){r(c);return}}catch(c){if(!e(a,c)){s(c);return}}})()})}function dU(n){return("0"+n.toString(16)).substr(-2)}function pU(){let e=new Uint32Array(56);if(typeof crypto=="undefined"){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=t.length,s="";for(let a=0;a<56;a++)s+=t.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(e),Array.from(e,dU).join("")}async function mU(n){let t=new TextEncoder().encode(n),r=await crypto.subtle.digest("SHA-256",t),s=new Uint8Array(r);return Array.from(s).map(a=>String.fromCharCode(a)).join("")}function gU(n){return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function _U(n){if(!(typeof crypto!="undefined"&&typeof crypto.subtle!="undefined"&&typeof TextEncoder!="undefined"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),n;let t=await mU(n);return gU(t)}async function Es(n,e,t=!1){let r=pU(),s=r;t&&(s+="/PASSWORD_RECOVERY"),await $g(n,`${e}-code-verifier`,s);let a=await _U(r);return[a,r===a?"plain":"s256"]}var yU=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function HE(n){let e=n.headers.get(Gu);if(!e||!e.match(yU))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}var Qu=class extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}};function ge(n){return typeof n=="object"&&n!==null&&"__isAuthError"in n}var df=class extends Qu{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}};function QE(n){return ge(n)&&n.name==="AuthApiError"}var ua=class extends Qu{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}},Nr=class extends Qu{constructor(e,t,r,s){super(e,r,s),this.name=t,this.status=r}},fn=class extends Nr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function JE(n){return ge(n)&&n.name==="AuthSessionMissingError"}var ca=class extends Nr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Is=class extends Nr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}},xs=class extends Nr{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function YE(n){return ge(n)&&n.name==="AuthImplicitGrantRedirectError"}var Ju=class extends Nr{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},la=class extends Nr{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}};function pf(n){return ge(n)&&n.name==="AuthRetryableFetchError"}var Yu=class extends Nr{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}};var vU=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t},As=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),wU=[502,503,504];async function XE(n){var e;if(!GE(n))throw new la(As(n),0);if(wU.includes(n.status))throw new la(As(n),n.status);let t;try{t=await n.json()}catch(a){throw new ua(As(a),a)}let r,s=HE(n);if(s&&s.getTime()>=jg["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?r=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(r=t.error_code),r){if(r==="weak_password")throw new Yu(As(t),n.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new fn}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((a,c)=>a&&typeof c=="string",!0))throw new Yu(As(t),n.status,t.weak_password.reasons);throw new df(As(t),n.status||500,r)}var bU=(n,e,t,r)=>{let s={method:n,headers:(e==null?void 0:e.headers)||{}};return n==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),t))};async function Ee(n,e,t,r){var s;let a=Object.assign({},r==null?void 0:r.headers);a[Gu]||(a[Gu]=jg["2024-01-01"].name),r!=null&&r.jwt&&(a.Authorization=`Bearer ${r.jwt}`);let c=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(c.redirect_to=r.redirectTo);let h=Object.keys(c).length?"?"+new URLSearchParams(c).toString():"",f=await TU(n,e,t+h,{headers:a,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(f):{data:Object.assign({},f),error:null}}async function TU(n,e,t,r,s,a){let c=bU(e,r,s,a),h;try{h=await n(t,Object.assign({},c))}catch(f){throw console.error(f),new la(As(f),0)}if(h.ok||await XE(h),r!=null&&r.noResolveJson)return h;try{return await h.json()}catch(f){await XE(f)}}function Vr(n){var e;let t=null;EU(n)&&(t=Object.assign({},n),n.expires_at||(t.expires_at=$E(n.expires_in)));let r=(e=n.user)!==null&&e!==void 0?e:n;return{data:{session:t,user:r},error:null}}function zg(n){let e=Vr(n);return!e.error&&n.weak_password&&typeof n.weak_password=="object"&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.message&&typeof n.weak_password.message=="string"&&n.weak_password.reasons.reduce((t,r)=>t&&typeof r=="string",!0)&&(e.data.weak_password=n.weak_password),e}function nr(n){var e;return{data:{user:(e=n.user)!==null&&e!==void 0?e:n},error:null}}function ZE(n){return{data:n,error:null}}function eI(n){let{action_link:e,email_otp:t,hashed_token:r,redirect_to:s,verification_type:a}=n,c=vU(n,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),h={action_link:e,email_otp:t,hashed_token:r,redirect_to:s,verification_type:a},f=Object.assign({},c);return{data:{properties:h,user:f},error:null}}function tI(n){return n}function EU(n){return n.access_token&&n.refresh_token&&n.expires_in}var IU=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t},Ss=class{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=ff(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,t="global"){try{return await Ee(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ge(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,t={}){try{return await Ee(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:nr})}catch(r){if(ge(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{let{options:t}=e,r=IU(e,["options"]),s=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Ee(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:eI,redirectTo:t==null?void 0:t.redirectTo})}catch(t){if(ge(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await Ee(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:nr})}catch(t){if(ge(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,r,s,a,c,h,f;try{let m={nextPage:null,lastPage:0,total:0},_=await Ee(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(a=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:tI});if(_.error)throw _.error;let E=await _.json(),I=(c=_.headers.get("x-total-count"))!==null&&c!==void 0?c:0,k=(f=(h=_.headers.get("link"))===null||h===void 0?void 0:h.split(","))!==null&&f!==void 0?f:[];return k.length>0&&(k.forEach(B=>{let G=parseInt(B.split(";")[0].split("=")[1].substring(0,1)),j=JSON.parse(B.split(";")[1].split("=")[1]);m[`${j}Page`]=G}),m.total=parseInt(I)),{data:Object.assign(Object.assign({},E),m),error:null}}catch(m){if(ge(m))return{data:{users:[]},error:m};throw m}}async getUserById(e){try{return await Ee(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:nr})}catch(t){if(ge(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){try{return await Ee(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:nr})}catch(r){if(ge(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,t=!1){try{return await Ee(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:nr})}catch(r){if(ge(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){try{let{data:t,error:r}=await Ee(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:t,error:r}}catch(t){if(ge(t))return{data:null,error:t};throw t}}async _deleteFactor(e){try{return{data:await Ee(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(ge(t))return{data:null,error:t};throw t}}};var nI={getItem:n=>xi()?globalThis.localStorage.getItem(n):null,setItem:(n,e)=>{xi()&&globalThis.localStorage.setItem(n,e)},removeItem:n=>{xi()&&globalThis.localStorage.removeItem(n)}};function Gg(n={}){return{getItem:e=>n[e]||null,setItem:(e,t)=>{n[e]=t},removeItem:e=>{delete n[e]}}}function rI(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self!="undefined"&&(self.globalThis=self)}}var Rs={debug:!!(globalThis&&xi()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},Xu=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}},mf=class extends Xu{};async function Kg(n,e,t){Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",n,e);let r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",n)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(n,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",n,s.name);try{return await t()}finally{Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",n,s.name)}}else{if(e===0)throw Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",n),new mf(`Acquiring an exclusive Navigator LockManager lock "${n}" immediately failed`);if(Rs.debug)try{let a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null," "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await t()}}))}rI();var xU={url:UE,storageKey:BE,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:jE,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},Zu=30*1e3,iI=3;async function sI(n,e,t){return await t()}var Ps=class n{constructor(e){var t,r;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=n.nextInstanceID,n.nextInstanceID+=1,this.instanceID>0&&Pn()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let s=Object.assign(Object.assign({},xU),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new Ss({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=ff(s.fetch),this.lock=s.lock||sI,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:Pn()&&(!((t=globalThis==null?void 0:globalThis.navigator)===null||t===void 0)&&t.locks)?this.lock=Kg:this.lock=sI,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?s.storage?this.storage=s.storage:xi()?this.storage=nI:(this.memoryStorage={},this.storage=Gg(this.memoryStorage)):(this.memoryStorage={},this.storage=Gg(this.memoryStorage)),Pn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${hf}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let t=zE(window.location.href),r="none";if(this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce"),Pn()&&this.detectSessionInUrl&&r!=="none"){let{data:s,error:a}=await this._getSessionFromURL(t,r);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),YE(a)){let f=(e=a.details)===null||e===void 0?void 0:e.code;if(f==="identity_already_exists"||f==="identity_not_found"||f==="single_identity_not_deletable")return{error:a}}return await this._removeSession(),{error:a}}let{session:c,redirectType:h}=s;return this._debug("#_initialize()","detected session in URL",c,"redirect type",h),await this._saveSession(c),setTimeout(async()=>{h==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",c):await this._notifyAllSubscribers("SIGNED_IN",c)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return ge(t)?{error:t}:{error:new ua("Unexpected error during initialization",t)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,s;try{let a=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:Vr}),{data:c,error:h}=a;if(h||!c)return{data:{user:null,session:null},error:h};let f=c.session,m=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",f)),{data:{user:m,session:f},error:null}}catch(a){if(ge(a))return{data:{user:null,session:null},error:a};throw a}}async signUp(e){var t,r,s;try{let a;if("email"in e){let{email:_,password:E,options:I}=e,k=null,B=null;this.flowType==="pkce"&&([k,B]=await Es(this.storage,this.storageKey)),a=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:I==null?void 0:I.emailRedirectTo,body:{email:_,password:E,data:(t=I==null?void 0:I.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:I==null?void 0:I.captchaToken},code_challenge:k,code_challenge_method:B},xform:Vr})}else if("phone"in e){let{phone:_,password:E,options:I}=e;a=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:_,password:E,data:(r=I==null?void 0:I.data)!==null&&r!==void 0?r:{},channel:(s=I==null?void 0:I.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:I==null?void 0:I.captchaToken}},xform:Vr})}else throw new Is("You must provide either an email or phone number and a password");let{data:c,error:h}=a;if(h||!c)return{data:{user:null,session:null},error:h};let f=c.session,m=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",f)),{data:{user:m,session:f},error:null}}catch(a){if(ge(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithPassword(e){try{let t;if("email"in e){let{email:a,password:c,options:h}=e;t=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:c,gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:zg})}else if("phone"in e){let{phone:a,password:c,options:h}=e;t=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:c,gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:zg})}else throw new Is("You must provide either an email or phone number and a password");let{data:r,error:s}=t;return s?{data:{user:null,session:null},error:s}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new ca}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(t){if(ge(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,r,s,a;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(a=e.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let t=await Wu(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(t!=null?t:"").split("/");try{let{data:a,error:c}=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:Vr});if(await Hu(this.storage,`${this.storageKey}-code-verifier`),c)throw c;return!a||!a.session||!a.user?{data:{user:null,session:null,redirectType:null},error:new ca}:(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:Object.assign(Object.assign({},a),{redirectType:s!=null?s:null}),error:c})}catch(a){if(ge(a))return{data:{user:null,session:null,redirectType:null},error:a};throw a}}async signInWithIdToken(e){try{let{options:t,provider:r,token:s,access_token:a,nonce:c}=e,h=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:a,nonce:c,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:Vr}),{data:f,error:m}=h;return m?{data:{user:null,session:null},error:m}:!f||!f.session||!f.user?{data:{user:null,session:null},error:new ca}:(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("SIGNED_IN",f.session)),{data:f,error:m})}catch(t){if(ge(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,r,s,a,c;try{if("email"in e){let{email:h,options:f}=e,m=null,_=null;this.flowType==="pkce"&&([m,_]=await Es(this.storage,this.storageKey));let{error:E}=await Ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:h,data:(t=f==null?void 0:f.data)!==null&&t!==void 0?t:{},create_user:(r=f==null?void 0:f.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:m,code_challenge_method:_},redirectTo:f==null?void 0:f.emailRedirectTo});return{data:{user:null,session:null},error:E}}if("phone"in e){let{phone:h,options:f}=e,{data:m,error:_}=await Ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:h,data:(s=f==null?void 0:f.data)!==null&&s!==void 0?s:{},create_user:(a=f==null?void 0:f.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},channel:(c=f==null?void 0:f.channel)!==null&&c!==void 0?c:"sms"}});return{data:{user:null,session:null,messageId:m==null?void 0:m.message_id},error:_}}throw new Is("You must provide either an email or phone number.")}catch(h){if(ge(h))return{data:{user:null,session:null},error:h};throw h}}async verifyOtp(e){var t,r;try{let s,a;"options"in e&&(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo,a=(r=e.options)===null||r===void 0?void 0:r.captchaToken);let{data:c,error:h}=await Ee(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:s,xform:Vr});if(h)throw h;if(!c)throw new Error("An error occurred on token verification.");let f=c.session,m=c.user;return f!=null&&f.access_token&&(await this._saveSession(f),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",f)),{data:{user:m,session:f},error:null}}catch(s){if(ge(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithSSO(e){var t,r,s;try{let a=null,c=null;return this.flowType==="pkce"&&([a,c]=await Es(this.storage,this.storageKey)),await Ee(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:c}),headers:this.headers,xform:ZE})}catch(a){if(ge(a))return{data:null,error:a};throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new fn;let{error:s}=await Ee(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:s}})}catch(e){if(ge(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let t=`${this.url}/resend`;if("email"in e){let{email:r,type:s,options:a}=e,{error:c}=await Ee(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return{data:{user:null,session:null},error:c}}else if("phone"in e){let{phone:r,type:s,options:a}=e,{data:c,error:h}=await Ee(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return{data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:h}}throw new Is("You must provide either an email or phone number and a type")}catch(t){if(ge(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await t()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let r=t();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){let s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,t=await Wu(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let r=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.storage.isServer){let c=this.suppressGetSessionWarning;e=new Proxy(e,{get:(f,m,_)=>(!c&&m==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),c=!0,this.suppressGetSessionWarning=!0),Reflect.get(f,m,_))})}return{data:{session:e},error:null}}let{session:s,error:a}=await this._callRefreshToken(e.refresh_token);return a?{data:{session:null},error:a}:{data:{session:s},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await Ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:nr}):await this._useSession(async t=>{var r,s,a;let{data:c,error:h}=t;if(h)throw h;return!(!((r=c.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new fn}:await Ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(s=c.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0,xform:nr})})}catch(t){if(ge(t))return JE(t)&&(await this._removeSession(),await Hu(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:t};throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:s,error:a}=r;if(a)throw a;if(!s.session)throw new fn;let c=s.session,h=null,f=null;this.flowType==="pkce"&&e.email!=null&&([h,f]=await Es(this.storage,this.storageKey));let{data:m,error:_}=await Ee(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:h,code_challenge_method:f}),jwt:c.access_token,xform:nr});if(_)throw _;return c.user=m.user,await this._saveSession(c),await this._notifyAllSubscribers("USER_UPDATED",c),{data:{user:c.user},error:null}})}catch(r){if(ge(r))return{data:{user:null},error:r};throw r}}_decodeJWT(e){return qg(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new fn;let t=Date.now()/1e3,r=t,s=!0,a=null,c=qg(e.access_token);if(c.exp&&(r=c.exp,s=r<=t),s){let{session:h,error:f}=await this._callRefreshToken(e.refresh_token);if(f)return{data:{user:null,session:null},error:f};if(!h)return{data:{user:null,session:null},error:null};a=h}else{let{data:h,error:f}=await this._getUser(e.access_token);if(f)throw f;a={access_token:e.access_token,refresh_token:e.refresh_token,user:h.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return{data:{user:a.user,session:a},error:null}}catch(t){if(ge(t))return{data:{session:null,user:null},error:t};throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:c,error:h}=t;if(h)throw h;e=(r=c.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new fn;let{session:s,error:a}=await this._callRefreshToken(e.refresh_token);return a?{data:{user:null,session:null},error:a}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(t){if(ge(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e,t){try{if(!Pn())throw new xs("No browser detected.");if(e.error||e.error_description||e.error_code)throw new xs(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new Ju("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new xs("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Ju("No code detected.");let{data:ee,error:ne}=await this._exchangeCodeForSession(e.code);if(ne)throw ne;let le=new URL(window.location.href);return le.searchParams.delete("code"),window.history.replaceState(window.history.state,"",le.toString()),{data:{session:ee.session,redirectType:null},error:null}}let{provider_token:r,provider_refresh_token:s,access_token:a,refresh_token:c,expires_in:h,expires_at:f,token_type:m}=e;if(!a||!h||!c||!m)throw new xs("No session defined in URL");let _=Math.round(Date.now()/1e3),E=parseInt(h),I=_+E;f&&(I=parseInt(f));let k=I-_;k*1e3<=Zu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${k}s, should have been closer to ${E}s`);let B=I-E;_-B>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",B,I,_):_-B<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",B,I,_);let{data:G,error:j}=await this._getUser(a);if(j)throw j;let J={provider_token:r,provider_refresh_token:s,access_token:a,expires_in:E,expires_at:I,refresh_token:c,token_type:m,user:G.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:J,redirectType:e.type},error:null}}catch(r){if(ge(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await Wu(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:s,error:a}=t;if(a)return{error:a};let c=(r=s.session)===null||r===void 0?void 0:r.access_token;if(c){let{error:h}=await this.admin.signOut(c,e);if(h&&!(QE(h)&&(h.status===404||h.status===401||h.status===403)))return{error:h}}return e!=="others"&&(await this._removeSession(),await Hu(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let t=qE(),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,s;try{let{data:{session:a},error:c}=t;if(c)throw c;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",e,"session",a)}catch(a){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",a),console.error(a)}})}async resetPasswordForEmail(e,t={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Es(this.storage,this.storageKey,!0));try{return await Ee(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(a){if(ge(a))return{data:null,error:a};throw a}}async getUserIdentities(){var e;try{let{data:t,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(t){if(ge(t))return{data:null,error:t};throw t}}async linkIdentity(e){var t;try{let{data:r,error:s}=await this._useSession(async a=>{var c,h,f,m,_;let{data:E,error:I}=a;if(I)throw I;let k=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(c=e.options)===null||c===void 0?void 0:c.redirectTo,scopes:(h=e.options)===null||h===void 0?void 0:h.scopes,queryParams:(f=e.options)===null||f===void 0?void 0:f.queryParams,skipBrowserRedirect:!0});return await Ee(this.fetch,"GET",k,{headers:this.headers,jwt:(_=(m=E.session)===null||m===void 0?void 0:m.access_token)!==null&&_!==void 0?_:void 0})});if(s)throw s;return Pn()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:e.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(ge(r))return{data:{provider:e.provider,url:null},error:r};throw r}}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,s;let{data:a,error:c}=t;if(c)throw c;return await Ee(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(t){if(ge(t))return{data:null,error:t};throw t}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{let r=Date.now();return await WE(async s=>(s>0&&await KE(200*Math.pow(2,s-1)),this._debug(t,"refreshing attempt",s),await Ee(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Vr})),(s,a)=>{let c=200*Math.pow(2,s);return a&&pf(a)&&Date.now()+c-r<Zu})}catch(r){if(this._debug(t,"error",r),ge(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(t,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),Pn()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e;let t="#_recoverAndRefresh()";this._debug(t,"begin");try{let r=await Wu(this.storage,this.storageKey);if(this._debug(t,"session from storage",r),!this._isValidSession(r)){this._debug(t,"session is not valid"),r!==null&&await this._removeSession();return}let s=Math.round(Date.now()/1e3),a=((e=r.expires_at)!==null&&e!==void 0?e:1/0)<s+Bg;if(this._debug(t,`session has${a?"":" not"} expired with margin of ${Bg}s`),a){if(this.autoRefreshToken&&r.refresh_token){let{error:c}=await this._callRefreshToken(r.refresh_token);c&&(console.error(c),pf(c)||(this._debug(t,"refresh failed with a non-retryable error, removing the session",c),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(r){this._debug(t,"error",r),console.error(r);return}finally{this._debug(t,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new fn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Ku;let{data:a,error:c}=await this._refreshAccessToken(e);if(c)throw c;if(!a.session)throw new fn;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);let h={session:a.session,error:null};return this.refreshingDeferred.resolve(h),h}catch(a){if(this._debug(s,"error",a),ge(a)){let c={session:null,error:a};return pf(a)||await this._removeSession(),(t=this.refreshingDeferred)===null||t===void 0||t.resolve(c),c}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(a),a}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,t,r=!0){let s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let a=[],c=Array.from(this.stateChangeEmitters.values()).map(async h=>{try{await h.callback(e,t)}catch(f){a.push(f)}});if(await Promise.all(c),a.length>0){for(let h=0;h<a.length;h+=1)console.error(a[h]);throw a[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await $g(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await Hu(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Pn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),Zu);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno!="undefined"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let s=Math.floor((r.expires_at*1e3-e)/Zu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Zu}ms, refresh threshold is ${iI} ticks`),s<=iI&&await this._callRefreshToken(r.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Xu)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Pn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){let s=[`provider=${encodeURIComponent(t)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){let[a,c]=await Es(this.storage,this.storageKey),h=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(c)}`});s.push(h.toString())}if(r!=null&&r.queryParams){let a=new URLSearchParams(r.queryParams);s.push(a.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:s,error:a}=t;return a?{data:null,error:a}:await Ee(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(ge(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var r,s;let{data:a,error:c}=t;if(c)return{data:null,error:c};let h=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:f,error:m}=await Ee(this.fetch,"POST",`${this.url}/factors`,{body:h,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return m?{data:null,error:m}:(e.factorType==="totp"&&(!((s=f==null?void 0:f.totp)===null||s===void 0)&&s.qr_code)&&(f.totp.qr_code=`data:image/svg+xml;utf-8,${f.totp.qr_code}`),{data:f,error:null})})}catch(t){if(ge(t))return{data:null,error:t};throw t}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;let{data:s,error:a}=t;if(a)return{data:null,error:a};let{data:c,error:h}=await Ee(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return h?{data:null,error:h}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),{data:c,error:h})})}catch(t){if(ge(t))return{data:null,error:t};throw t}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;let{data:s,error:a}=t;return a?{data:null,error:a}:await Ee(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(ge(t))return{data:null,error:t};throw t}})}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let r=(e==null?void 0:e.factors)||[],s=r.filter(c=>c.factor_type==="totp"&&c.status==="verified"),a=r.filter(c=>c.factor_type==="phone"&&c.status==="verified");return{data:{all:r,totp:s,phone:a},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var t,r;let{data:{session:s},error:a}=e;if(a)return{data:null,error:a};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let c=this._decodeJWT(s.access_token),h=null;c.aal&&(h=c.aal);let f=h;((r=(t=s.user.factors)===null||t===void 0?void 0:t.filter(E=>E.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(f="aal2");let _=c.amr||[];return{data:{currentLevel:h,nextLevel:f,currentAuthenticationMethods:_},error:null}}))}};Ps.nextInstanceID=0;var AU=Ps,Wg=AU;var gf=class extends Wg{constructor(e){super(e)}};var SU=function(n,e,t,r){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function h(_){try{m(r.next(_))}catch(E){c(E)}}function f(_){try{m(r.throw(_))}catch(E){c(E)}}function m(_){_.done?a(_.value):s(_.value).then(h,f)}m((r=r.apply(n,e||[])).next())})},ec=class{constructor(e,t,r){var s,a,c;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");let h=ME(e);this.realtimeUrl=`${h}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${h}/auth/v1`,this.storageUrl=`${h}/storage/v1`,this.functionsUrl=`${h}/functions/v1`;let f=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,m={db:kE,realtime:VE,auth:Object.assign(Object.assign({},NE),{storageKey:f}),global:OE},_=FE(r!=null?r:{},m);this.storageKey=(s=_.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(a=_.global.headers)!==null&&a!==void 0?a:{},_.accessToken?(this.accessToken=_.accessToken,this.auth=new Proxy({},{get:(E,I)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(I)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((c=_.auth)!==null&&c!==void 0?c:{},this.headers,_.global.fetch),this.fetch=LE(t,this._getAccessToken.bind(this),_.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},_.realtime)),this.rest=new _E(`${h}/rest/v1`,{headers:this.headers,schema:_.db.schema,fetch:this.fetch}),_.accessToken||this._listenForAuthEvents()}get functions(){return new Ou(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new qu(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return SU(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:r}=yield this.auth.getSession();return(t=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,storageKey:a,flowType:c,lock:h,debug:f},m,_){let E={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new gf({url:this.authUrl,headers:Object.assign(Object.assign({},E),m),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,flowType:c,lock:h,debug:f,fetch:_,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new ia(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,r)=>{this._handleTokenChanged(t,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};var oI=(n,e,t)=>new ec(n,e,t);var yI=Cd(lI(),1);var hI={id:"~date",test:n=>n instanceof Date,serialize:n=>({_:"~date",v:n.toISOString()}),deserialize:n=>new Date(n.v)};var fI={id:"~function",test:n=>typeof n=="function",serialize:n=>({_:"~function",v:n.toString()}),deserialize:v=>eval(v.v.toString())};var dI={id:"~infinity",test:n=>n===1/0||n===-1/0,serialize:n=>({_:"~infinity",v:n===1/0?1:0}),deserialize:n=>n.v==1?1/0:-1/0};var pI={id:"~nan",test:n=>Number.isNaN(n),serialize:n=>({_:"~nan"}),deserialize:n=>NaN};var mI={id:"~regexp",test:n=>n instanceof RegExp,serialize:n=>({_:"~regexp",v:n.source,f:n.flags}),deserialize:n=>new RegExp(n.v,n.f)};var gI={id:"~set",test:n=>n instanceof Set,serialize:n=>({_:"~set",v:Array.from(n)}),deserialize:n=>new Set(n.v)};var _I={id:"~undefined",test:n=>n===void 0,serialize:n=>({_:"~undefined"}),deserialize:n=>{}};var fa={settings:{stringify:!0,destringify:!0,clone:!1,depth:0,modules:[hI,fI,dI,pI,mI,gI,_I],circular:!0,symetric:!1},loadedModules:{},loadModules(n){return n.map(e=>{if(De(e)){if(!e.id)throw new Error("Provided custom module does not expose an `id` property");return fa.loadedModules[e.id]=e}else throw new Error("Unknown module type")})},serialize(n,e){let t=ql(e,fa.settings),r=fa.loadModules(t.modules),s=t.symetric?(0,yI.keyArrangeDeep)(n):t.clone?zn(n):n,a=new Map,c=(h,f)=>{let m=De(h);if(m&&t.circular){let I=a.get(h);if(I)return pi(s,f,{_:"~circular",p:I.join(".")});a.set(h,f)}let _=r.find(I=>I.test(h)),E=(!t.depth||f.length<t.depth)&&m;if(_){let I=_.serialize(h);if(_.recursive&&E){let k=It(h);t.symetric&&k.sort(),pi(s,f,I),k.forEach(B=>c(h[B],f.concat(B)))}else f.length?pi(s,f,I):s=I}else if(E){let I=It(h);t.symetric&&I.sort(),I.forEach(k=>c(h[k],f.concat(k)))}};return c(s,[]),t.stringify?JSON.stringify(s):s},deserialize(n,e){let t=ql(e,fa.settings),r=fa.loadModules(t.modules),s=Fd(r,"id"),a=t.destringify?JSON.parse(n):t.clone?zn(n):n,c=(h,f)=>{if(De(h)&&h._&&h._.startsWith("~")&&s[h._]){let m=s[h._].deserialize(h);f.length?s[h._].recursive&&De(m)?(pi(a,f,m),It(m).forEach(_=>c(h[_],[...f,_]))):pi(a,f,m):a=m}else t.circular&&De(h)&&h._&&h._=="~circular"?pi(a,f,tu(a,h.p)):(!t.depth||f.length<t.depth)&&De(h)&&It(h).forEach(m=>c(h[m],f.concat(m)))};return c(a,[]),a}},nc=fa;var wt=class wt{constructor(e,t){jt(this,"path");jt(this,"docRef");jt(this,"value");jt(this,"throttle",250);this.path=e,Object.assign(this,t)}debug(...e){}getReactive(e){console.warn("Syncro.getReactive has not been subclassed, assuming a POJO response");let t={...e};return{doc:t,setState(r){Object.entries(r||{}).forEach(([s,a])=>t[s]=a)},getState(){return zn(t)},watch(r){}}}static pathSplit(e){var r;let t={...(r=/^(?<entity>\w+?)::(?<id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:::(?<relation>\w+?))?$/.exec(e))==null?void 0:r.groups};if(!t)throw new Error(`Invalid session path syntax "${e}"`);if(!t.entity in Qg)throw new Error(`Unsupported entity "${e}" -> Entity="${t.entity}"`);return{...t,fsCollection:t.entity,fsId:t.relation?`${t.id}::${t.relation}`:t.id}}static toFirestore(e={}){return nc.serialize(this.cleanPojo(e),{clone:!0,modules:[vI,...nc.settings.modules],stringify:!1})}static fromFirestore(e={}){return nc.deserialize(this.cleanPojo(e),{modules:[vI,...nc.settings.modules],destringify:!1})}static getSnapshot(e){let{fsCollection:t,fsId:r}=wt.pathSplit(e);return Promise.resolve().then(async()=>{let s=Hh(wt.firestore,t,r);return vg(s)}).then(s=>s?wt.fromFirestore(snapshot.data()):null)}static setSnapshot(e,t,r){let s={method:"merge",...r},{fsCollection:a,fsId:c}=wt.pathSplit(e);return Promise.resolve().then(()=>(s.method=="merge"?"FirestoreUpdateDoc":"FirestoreSetDoc")(Hh(this.firestore,a,c),wt.toFirestore(t))).then(()=>t)}static cleanPojo(e){return Object.fromEntries(Object.entries(e).filter(([t])=>!/^[\$_]/.test(t)&&t!=="metadata"))}static wrapSupabase(e){return Promise.resolve(e).then(t=>{var r,s;if(t!=null&&t.error)throw/JSON object requested, multiple \(or no\) rows returned$/.test(t.error.message)?(console.warn("Supabase query threw record not found against query",e.url.search),console.warn("Supabase raw error",t),new Error("NOT-FOUND")):(console.warn("Supabase query threw",t.error.message),new Error(`${((r=t.error)==null?void 0:r.code)||"UnknownError"}: ${((s=t.error)==null?void 0:s.message)||"Unknown Supabase error"}`));if(t.data)return t.data})}mount(){let{fsCollection:e,fsId:t,entity:r,id:s,relation:a}=wt.pathSplit(this.path),c,h;return Promise.resolve().then(async()=>{this.docRef=Hh(wt.firestore,e,t);let f=wt.fromFirestore((await vg(this.docRef)).data());if(c=this.getReactive(f),!c.doc||!c.setState||!c.getState||!c.watch)throw new Error("Syncro.getReactive() requires a returned `doc`, `setState()`, `getState()` + `watch()`");this.value=h=c.doc,this.debug("Initial state",{doc:h}),eE(this.docRef,m=>{let _=wt.fromFirestore(m.data());this.debug("Incoming snapshot",{snapshotData:_}),c.setState(_)})}).then(()=>{if(Md(h))return this.debug("Populate initial state"),Promise.resolve().then(()=>Qg[r]||Promise.reject(`Unknown Sync entity "${r}"`)).then(()=>Qg[r].initState({supabase:wt.supabase,entity:r,id:s,relation:a})).then(f=>XT(this.docRef,wt.toFirestore(f)))}).then(()=>{c.watch(Ud(f=>{this.debug("Local change",{newState:f}),ZT(this.docRef,wt.toFirestore(f))},this.throttle))}).then(()=>this)}};jt(wt,"firebase"),jt(wt,"firestore"),jt(wt,"supabase");var dn=wt,Qg={projects:{singular:"project",initState({supabase:n,id:e}){return dn.wrapSupabase(n.from("projects").select("data").limit(1).eq("id",e)).then(t=>t.length==1?t[0]:Promise.reject(`Syncro project "${e}" not found`)).then(t=>t.data)}},project_namespaces:{singular:"project namespace",initState({supabase:n,id:e,relation:t}){if(!t)throw new Error('Project namespace relation missing, path should resemble "project_namespaces::${PROJECT}::${RELATION}"');return dn.wrapSupabase(n.from("project_namespaces").select("data").limit(1).eq("project",e).eq("name",t)).then(r=>r.length==1?r[0]:Promise.reject(`Syncro project ("${e}") namespace ("${t}") not found`)).then(r=>r.data)}},test:{singular:"test",initState({supabase:n,id:e}){return dn.wrapSupabase(n.from("test").select("data").limit(1).eq("id",e)).then(t=>t.length==1?t[0]:Promise.reject(`Syncro test item "${e}" not found`)).then(t=>t.data)}},users:{singular:"user",initState({supabase:n,id:e}){return dn.wrapSupabase(n.from("users").select("data").limit(1).eq("id",e)).then(t=>t.length==1?t[0]:Promise.reject(`Syncro user "${e}" not found`)).then(t=>t.data)}}},vI={id:"~array",recursive:!0,test:n=>Array.isArray(n),serialize:n=>({_:"~array",...n}),deserialize:n=>{let e=Array.from({length:Object.keys(n).length-1});return Object.entries(n).filter(([t])=>t!=="_").forEach(([t,r])=>e[+t]=r),e}};var rc=class{init(){}constructor(e,t){}};var ic=class extends rc{constructor(){super(...arguments);jt(this,"syncros",{})}async init(t){let r={firebaseApiKey:null,firebaseAuthDomain:null,firebaseProjectId:null,firebaseAppId:null,supabaseUrl:null,supabaseKey:null,...await this.getCredentials(),...t},s=Object.keys(r).filter(a=>a===null);if(s.length>0)throw new Error("Firebase plugin requires mandatory options: "+s.join(", "));dn.firebase=ip({apiKey:r.firebaseApiKey,authDomain:r.firebaseAuthDomain,projectId:r.firebaseProjectId,appId:r.firebaseAppId}),dn.firestore=GT(this.firebase),dn.supabase=oI(r.supabaseUrl,r.supabaseKey)}_mountNamespace(t){let r;return Promise.resolve().then(()=>this.requireProject()).then(s=>{let a=t=="_PROJECT"?`projects::${s.id}`:`project_namespaces::${s.id}::${t}`;return r=this.syncros[t]=new dn(a,{debug:(...c)=>this.debug(`SYNCRO://${a}`,...c),getReactive:this.getReactive}),r.mount()}).then(()=>{this.namespaces[t]=r.value})}_unmountNamespace(t){let r=this.syncros[t];return delete this.namespaces[t],delete this.syncros[t],r.destroy()}};var Jg=class extends ic{constructor(){super(...arguments);jt(this,"Vue");jt(this,"project",null);jt(this,"reactiveId",1001)}async init(t){let r={app:null,Vue:null,globalName:"$tera",...t};if(!r.Vue)throw new Error("Vue instance to use must be specified in init options as `Vue`");if(this.Vue=r.Vue,!r.app)throw new Error("Vue Root / App instance to use must be specified in init options as `app`");this.app=r.app,r.globalName&&(this.Vue.prototype[r.globalName]=this),await super.init(r),this.project=await this.mountNamespace("_PROJECT")}getReactive(t){let r=this.Vue.observable(t),s=`_teraFy_${this.reactiveId++}`;return this.app[s]=r,{doc:r,setState(a){Object.entries(a||{}).forEach(([c,h])=>r[c]=h)},getState(){return zn(r)},watch:a=>{this.app.$watch(s,a,{deep:!0})}}}bindProjectState(t){let r={component:null,componentKey:null,autoRequire:!0,read:!0,write:!0,throttle:{wait:200,maxWait:2e3,leading:!1,trailing:!0},...t};return Promise.resolve().then(()=>Promise.all([this.getProjectState({autoRequire:r.autoRequire}),(()=>{if(!r.componentKey){for(let s=0;s<50;s++){let a=`terafy_${s}`;if(!Object.hasOwnProperty(r.component,a)){r.componentKey=a;return}}throw new Error("Unable to find unique key to allocate against Vue2 component")}})()])).then(([s])=>{this.debug("INFO",2,"Got project snapshot",s);let a=this.Vue.observable(s);if(r.component[r.componentKey]=a,r.read&&this.events.on(`update:projects/${a.id}`,c=>{var h;(h=c==null?void 0:c.lastPatch)!=null&&h.session&&c.lastPatch.session==this.settings.session||(this.debug("INFO",5,"Update Vue2 Remote->Local",{new:c,old:a}),this.merge(a,c))}),r.write){if(!r.component)throw new Error("bindProjectState requires a VueComponent specified as `component`");let c=zn(s),h=()=>{let f=zn(s);this.debug("INFO",5,"Update Vue2 Local->Remote",{new:f,old:c}),this.createProjectStatePatch(f,c),c=f};r.component.$watch(r.componentKey,r.throttle?debounce(h,r.throttle.wait,r.throttle):h,{deep:!0})}return a})}merge(t,...r){return r.forEach(s=>Object.keys(s).forEach(a=>{isPlainObject(s[a])?(a in t||this.Vue.set(t,a,{}),this.merge(t[a],s[a])):this.Vue.set(t,a,s[a])})),t}};export{Jg as default};
2
47
  /*! Bundled license information:
3
48
 
49
+ lodash/lodash.js:
50
+ (**
51
+ * @license
52
+ * Lodash <https://lodash.com/>
53
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
54
+ * Released under MIT license <https://lodash.com/license>
55
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
56
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
57
+ *)
58
+
4
59
  lodash-es/lodash.js:
5
60
  (**
6
61
  * @license
@@ -11,4 +66,2242 @@ lodash-es/lodash.js:
11
66
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12
67
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
68
  *)
69
+
70
+ @firebase/util/dist/index.esm2017.js:
71
+ (**
72
+ * @license
73
+ * Copyright 2017 Google LLC
74
+ *
75
+ * Licensed under the Apache License, Version 2.0 (the "License");
76
+ * you may not use this file except in compliance with the License.
77
+ * You may obtain a copy of the License at
78
+ *
79
+ * http://www.apache.org/licenses/LICENSE-2.0
80
+ *
81
+ * Unless required by applicable law or agreed to in writing, software
82
+ * distributed under the License is distributed on an "AS IS" BASIS,
83
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
84
+ * See the License for the specific language governing permissions and
85
+ * limitations under the License.
86
+ *)
87
+
88
+ @firebase/util/dist/index.esm2017.js:
89
+ (**
90
+ * @license
91
+ * Copyright 2017 Google LLC
92
+ *
93
+ * Licensed under the Apache License, Version 2.0 (the "License");
94
+ * you may not use this file except in compliance with the License.
95
+ * You may obtain a copy of the License at
96
+ *
97
+ * http://www.apache.org/licenses/LICENSE-2.0
98
+ *
99
+ * Unless required by applicable law or agreed to in writing, software
100
+ * distributed under the License is distributed on an "AS IS" BASIS,
101
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
102
+ * See the License for the specific language governing permissions and
103
+ * limitations under the License.
104
+ *)
105
+
106
+ @firebase/util/dist/index.esm2017.js:
107
+ (**
108
+ * @license
109
+ * Copyright 2017 Google LLC
110
+ *
111
+ * Licensed under the Apache License, Version 2.0 (the "License");
112
+ * you may not use this file except in compliance with the License.
113
+ * You may obtain a copy of the License at
114
+ *
115
+ * http://www.apache.org/licenses/LICENSE-2.0
116
+ *
117
+ * Unless required by applicable law or agreed to in writing, software
118
+ * distributed under the License is distributed on an "AS IS" BASIS,
119
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
120
+ * See the License for the specific language governing permissions and
121
+ * limitations under the License.
122
+ *)
123
+
124
+ @firebase/util/dist/index.esm2017.js:
125
+ (**
126
+ * @license
127
+ * Copyright 2022 Google LLC
128
+ *
129
+ * Licensed under the Apache License, Version 2.0 (the "License");
130
+ * you may not use this file except in compliance with the License.
131
+ * You may obtain a copy of the License at
132
+ *
133
+ * http://www.apache.org/licenses/LICENSE-2.0
134
+ *
135
+ * Unless required by applicable law or agreed to in writing, software
136
+ * distributed under the License is distributed on an "AS IS" BASIS,
137
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138
+ * See the License for the specific language governing permissions and
139
+ * limitations under the License.
140
+ *)
141
+
142
+ @firebase/util/dist/index.esm2017.js:
143
+ (**
144
+ * @license
145
+ * Copyright 2017 Google LLC
146
+ *
147
+ * Licensed under the Apache License, Version 2.0 (the "License");
148
+ * you may not use this file except in compliance with the License.
149
+ * You may obtain a copy of the License at
150
+ *
151
+ * http://www.apache.org/licenses/LICENSE-2.0
152
+ *
153
+ * Unless required by applicable law or agreed to in writing, software
154
+ * distributed under the License is distributed on an "AS IS" BASIS,
155
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
156
+ * See the License for the specific language governing permissions and
157
+ * limitations under the License.
158
+ *)
159
+ (**
160
+ * @license
161
+ * Copyright 2021 Google LLC
162
+ *
163
+ * Licensed under the Apache License, Version 2.0 (the "License");
164
+ * you may not use this file except in compliance with the License.
165
+ * You may obtain a copy of the License at
166
+ *
167
+ * http://www.apache.org/licenses/LICENSE-2.0
168
+ *
169
+ * Unless required by applicable law or agreed to in writing, software
170
+ * distributed under the License is distributed on an "AS IS" BASIS,
171
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
172
+ * See the License for the specific language governing permissions and
173
+ * limitations under the License.
174
+ *)
175
+
176
+ @firebase/util/dist/index.esm2017.js:
177
+ (**
178
+ * @license
179
+ * Copyright 2017 Google LLC
180
+ *
181
+ * Licensed under the Apache License, Version 2.0 (the "License");
182
+ * you may not use this file except in compliance with the License.
183
+ * You may obtain a copy of the License at
184
+ *
185
+ * http://www.apache.org/licenses/LICENSE-2.0
186
+ *
187
+ * Unless required by applicable law or agreed to in writing, software
188
+ * distributed under the License is distributed on an "AS IS" BASIS,
189
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ * See the License for the specific language governing permissions and
191
+ * limitations under the License.
192
+ *)
193
+
194
+ @firebase/util/dist/index.esm2017.js:
195
+ (**
196
+ * @license
197
+ * Copyright 2017 Google LLC
198
+ *
199
+ * Licensed under the Apache License, Version 2.0 (the "License");
200
+ * you may not use this file except in compliance with the License.
201
+ * You may obtain a copy of the License at
202
+ *
203
+ * http://www.apache.org/licenses/LICENSE-2.0
204
+ *
205
+ * Unless required by applicable law or agreed to in writing, software
206
+ * distributed under the License is distributed on an "AS IS" BASIS,
207
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208
+ * See the License for the specific language governing permissions and
209
+ * limitations under the License.
210
+ *)
211
+
212
+ @firebase/util/dist/index.esm2017.js:
213
+ (**
214
+ * @license
215
+ * Copyright 2017 Google LLC
216
+ *
217
+ * Licensed under the Apache License, Version 2.0 (the "License");
218
+ * you may not use this file except in compliance with the License.
219
+ * You may obtain a copy of the License at
220
+ *
221
+ * http://www.apache.org/licenses/LICENSE-2.0
222
+ *
223
+ * Unless required by applicable law or agreed to in writing, software
224
+ * distributed under the License is distributed on an "AS IS" BASIS,
225
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
226
+ * See the License for the specific language governing permissions and
227
+ * limitations under the License.
228
+ *)
229
+
230
+ @firebase/util/dist/index.esm2017.js:
231
+ (**
232
+ * @license
233
+ * Copyright 2022 Google LLC
234
+ *
235
+ * Licensed under the Apache License, Version 2.0 (the "License");
236
+ * you may not use this file except in compliance with the License.
237
+ * You may obtain a copy of the License at
238
+ *
239
+ * http://www.apache.org/licenses/LICENSE-2.0
240
+ *
241
+ * Unless required by applicable law or agreed to in writing, software
242
+ * distributed under the License is distributed on an "AS IS" BASIS,
243
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
244
+ * See the License for the specific language governing permissions and
245
+ * limitations under the License.
246
+ *)
247
+
248
+ @firebase/util/dist/index.esm2017.js:
249
+ (**
250
+ * @license
251
+ * Copyright 2017 Google LLC
252
+ *
253
+ * Licensed under the Apache License, Version 2.0 (the "License");
254
+ * you may not use this file except in compliance with the License.
255
+ * You may obtain a copy of the License at
256
+ *
257
+ * http://www.apache.org/licenses/LICENSE-2.0
258
+ *
259
+ * Unless required by applicable law or agreed to in writing, software
260
+ * distributed under the License is distributed on an "AS IS" BASIS,
261
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
262
+ * See the License for the specific language governing permissions and
263
+ * limitations under the License.
264
+ *)
265
+
266
+ @firebase/util/dist/index.esm2017.js:
267
+ (**
268
+ * @license
269
+ * Copyright 2017 Google LLC
270
+ *
271
+ * Licensed under the Apache License, Version 2.0 (the "License");
272
+ * you may not use this file except in compliance with the License.
273
+ * You may obtain a copy of the License at
274
+ *
275
+ * http://www.apache.org/licenses/LICENSE-2.0
276
+ *
277
+ * Unless required by applicable law or agreed to in writing, software
278
+ * distributed under the License is distributed on an "AS IS" BASIS,
279
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
280
+ * See the License for the specific language governing permissions and
281
+ * limitations under the License.
282
+ *)
283
+
284
+ @firebase/util/dist/index.esm2017.js:
285
+ (**
286
+ * @license
287
+ * Copyright 2017 Google LLC
288
+ *
289
+ * Licensed under the Apache License, Version 2.0 (the "License");
290
+ * you may not use this file except in compliance with the License.
291
+ * You may obtain a copy of the License at
292
+ *
293
+ * http://www.apache.org/licenses/LICENSE-2.0
294
+ *
295
+ * Unless required by applicable law or agreed to in writing, software
296
+ * distributed under the License is distributed on an "AS IS" BASIS,
297
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
298
+ * See the License for the specific language governing permissions and
299
+ * limitations under the License.
300
+ *)
301
+
302
+ @firebase/util/dist/index.esm2017.js:
303
+ (**
304
+ * @license
305
+ * Copyright 2017 Google LLC
306
+ *
307
+ * Licensed under the Apache License, Version 2.0 (the "License");
308
+ * you may not use this file except in compliance with the License.
309
+ * You may obtain a copy of the License at
310
+ *
311
+ * http://www.apache.org/licenses/LICENSE-2.0
312
+ *
313
+ * Unless required by applicable law or agreed to in writing, software
314
+ * distributed under the License is distributed on an "AS IS" BASIS,
315
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
316
+ * See the License for the specific language governing permissions and
317
+ * limitations under the License.
318
+ *)
319
+
320
+ @firebase/util/dist/index.esm2017.js:
321
+ (**
322
+ * @license
323
+ * Copyright 2019 Google LLC
324
+ *
325
+ * Licensed under the Apache License, Version 2.0 (the "License");
326
+ * you may not use this file except in compliance with the License.
327
+ * You may obtain a copy of the License at
328
+ *
329
+ * http://www.apache.org/licenses/LICENSE-2.0
330
+ *
331
+ * Unless required by applicable law or agreed to in writing, software
332
+ * distributed under the License is distributed on an "AS IS" BASIS,
333
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
334
+ * See the License for the specific language governing permissions and
335
+ * limitations under the License.
336
+ *)
337
+
338
+ @firebase/util/dist/index.esm2017.js:
339
+ (**
340
+ * @license
341
+ * Copyright 2020 Google LLC
342
+ *
343
+ * Licensed under the Apache License, Version 2.0 (the "License");
344
+ * you may not use this file except in compliance with the License.
345
+ * You may obtain a copy of the License at
346
+ *
347
+ * http://www.apache.org/licenses/LICENSE-2.0
348
+ *
349
+ * Unless required by applicable law or agreed to in writing, software
350
+ * distributed under the License is distributed on an "AS IS" BASIS,
351
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
352
+ * See the License for the specific language governing permissions and
353
+ * limitations under the License.
354
+ *)
355
+
356
+ @firebase/util/dist/index.esm2017.js:
357
+ (**
358
+ * @license
359
+ * Copyright 2021 Google LLC
360
+ *
361
+ * Licensed under the Apache License, Version 2.0 (the "License");
362
+ * you may not use this file except in compliance with the License.
363
+ * You may obtain a copy of the License at
364
+ *
365
+ * http://www.apache.org/licenses/LICENSE-2.0
366
+ *
367
+ * Unless required by applicable law or agreed to in writing, software
368
+ * distributed under the License is distributed on an "AS IS" BASIS,
369
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
370
+ * See the License for the specific language governing permissions and
371
+ * limitations under the License.
372
+ *)
373
+
374
+ @firebase/component/dist/esm/index.esm2017.js:
375
+ (**
376
+ * @license
377
+ * Copyright 2019 Google LLC
378
+ *
379
+ * Licensed under the Apache License, Version 2.0 (the "License");
380
+ * you may not use this file except in compliance with the License.
381
+ * You may obtain a copy of the License at
382
+ *
383
+ * http://www.apache.org/licenses/LICENSE-2.0
384
+ *
385
+ * Unless required by applicable law or agreed to in writing, software
386
+ * distributed under the License is distributed on an "AS IS" BASIS,
387
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
388
+ * See the License for the specific language governing permissions and
389
+ * limitations under the License.
390
+ *)
391
+
392
+ @firebase/logger/dist/esm/index.esm2017.js:
393
+ (**
394
+ * @license
395
+ * Copyright 2017 Google LLC
396
+ *
397
+ * Licensed under the Apache License, Version 2.0 (the "License");
398
+ * you may not use this file except in compliance with the License.
399
+ * You may obtain a copy of the License at
400
+ *
401
+ * http://www.apache.org/licenses/LICENSE-2.0
402
+ *
403
+ * Unless required by applicable law or agreed to in writing, software
404
+ * distributed under the License is distributed on an "AS IS" BASIS,
405
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
406
+ * See the License for the specific language governing permissions and
407
+ * limitations under the License.
408
+ *)
409
+
410
+ @firebase/app/dist/esm/index.esm2017.js:
411
+ (**
412
+ * @license
413
+ * Copyright 2019 Google LLC
414
+ *
415
+ * Licensed under the Apache License, Version 2.0 (the "License");
416
+ * you may not use this file except in compliance with the License.
417
+ * You may obtain a copy of the License at
418
+ *
419
+ * http://www.apache.org/licenses/LICENSE-2.0
420
+ *
421
+ * Unless required by applicable law or agreed to in writing, software
422
+ * distributed under the License is distributed on an "AS IS" BASIS,
423
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
424
+ * See the License for the specific language governing permissions and
425
+ * limitations under the License.
426
+ *)
427
+
428
+ @firebase/app/dist/esm/index.esm2017.js:
429
+ (**
430
+ * @license
431
+ * Copyright 2019 Google LLC
432
+ *
433
+ * Licensed under the Apache License, Version 2.0 (the "License");
434
+ * you may not use this file except in compliance with the License.
435
+ * You may obtain a copy of the License at
436
+ *
437
+ * http://www.apache.org/licenses/LICENSE-2.0
438
+ *
439
+ * Unless required by applicable law or agreed to in writing, software
440
+ * distributed under the License is distributed on an "AS IS" BASIS,
441
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
442
+ * See the License for the specific language governing permissions and
443
+ * limitations under the License.
444
+ *)
445
+ (**
446
+ * @license
447
+ * Copyright 2023 Google LLC
448
+ *
449
+ * Licensed under the Apache License, Version 2.0 (the "License");
450
+ * you may not use this file except in compliance with the License.
451
+ * You may obtain a copy of the License at
452
+ *
453
+ * http://www.apache.org/licenses/LICENSE-2.0
454
+ *
455
+ * Unless required by applicable law or agreed to in writing, software
456
+ * distributed under the License is distributed on an "AS IS" BASIS,
457
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
458
+ * See the License for the specific language governing permissions and
459
+ * limitations under the License.
460
+ *)
461
+
462
+ @firebase/app/dist/esm/index.esm2017.js:
463
+ (**
464
+ * @license
465
+ * Copyright 2019 Google LLC
466
+ *
467
+ * Licensed under the Apache License, Version 2.0 (the "License");
468
+ * you may not use this file except in compliance with the License.
469
+ * You may obtain a copy of the License at
470
+ *
471
+ * http://www.apache.org/licenses/LICENSE-2.0
472
+ *
473
+ * Unless required by applicable law or agreed to in writing, software
474
+ * distributed under the License is distributed on an "AS IS" BASIS,
475
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
476
+ * See the License for the specific language governing permissions and
477
+ * limitations under the License.
478
+ *)
479
+
480
+ @firebase/app/dist/esm/index.esm2017.js:
481
+ (**
482
+ * @license
483
+ * Copyright 2021 Google LLC
484
+ *
485
+ * Licensed under the Apache License, Version 2.0 (the "License");
486
+ * you may not use this file except in compliance with the License.
487
+ * You may obtain a copy of the License at
488
+ *
489
+ * http://www.apache.org/licenses/LICENSE-2.0
490
+ *
491
+ * Unless required by applicable law or agreed to in writing, software
492
+ * distributed under the License is distributed on an "AS IS" BASIS,
493
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494
+ * See the License for the specific language governing permissions and
495
+ * limitations under the License.
496
+ *)
497
+ (**
498
+ * @license
499
+ * Copyright 2019 Google LLC
500
+ *
501
+ * Licensed under the Apache License, Version 2.0 (the "License");
502
+ * you may not use this file except in compliance with the License.
503
+ * You may obtain a copy of the License at
504
+ *
505
+ * http://www.apache.org/licenses/LICENSE-2.0
506
+ *
507
+ * Unless required by applicable law or agreed to in writing, software
508
+ * distributed under the License is distributed on an "AS IS" BASIS,
509
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
510
+ * See the License for the specific language governing permissions and
511
+ * limitations under the License.
512
+ *)
513
+
514
+ firebase/app/dist/esm/index.esm.js:
515
+ (**
516
+ * @license
517
+ * Copyright 2020 Google LLC
518
+ *
519
+ * Licensed under the Apache License, Version 2.0 (the "License");
520
+ * you may not use this file except in compliance with the License.
521
+ * You may obtain a copy of the License at
522
+ *
523
+ * http://www.apache.org/licenses/LICENSE-2.0
524
+ *
525
+ * Unless required by applicable law or agreed to in writing, software
526
+ * distributed under the License is distributed on an "AS IS" BASIS,
527
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
528
+ * See the License for the specific language governing permissions and
529
+ * limitations under the License.
530
+ *)
531
+
532
+ @firebase/webchannel-wrapper/dist/bloom-blob/esm/bloom_blob_es2018.js:
533
+ (** @license
534
+ Copyright The Closure Library Authors.
535
+ SPDX-License-Identifier: Apache-2.0
536
+ *)
537
+ (** @license
538
+
539
+ Copyright The Closure Library Authors.
540
+ SPDX-License-Identifier: Apache-2.0
541
+ *)
542
+
543
+ @firebase/webchannel-wrapper/dist/webchannel-blob/esm/webchannel_blob_es2018.js:
544
+ (** @license
545
+ Copyright The Closure Library Authors.
546
+ SPDX-License-Identifier: Apache-2.0
547
+ *)
548
+ (** @license
549
+
550
+ Copyright The Closure Library Authors.
551
+ SPDX-License-Identifier: Apache-2.0
552
+ *)
553
+
554
+ @firebase/firestore/dist/index.esm2017.js:
555
+ (**
556
+ * @license
557
+ * Copyright 2017 Google LLC
558
+ *
559
+ * Licensed under the Apache License, Version 2.0 (the "License");
560
+ * you may not use this file except in compliance with the License.
561
+ * You may obtain a copy of the License at
562
+ *
563
+ * http://www.apache.org/licenses/LICENSE-2.0
564
+ *
565
+ * Unless required by applicable law or agreed to in writing, software
566
+ * distributed under the License is distributed on an "AS IS" BASIS,
567
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
568
+ * See the License for the specific language governing permissions and
569
+ * limitations under the License.
570
+ *)
571
+
572
+ @firebase/firestore/dist/index.esm2017.js:
573
+ (**
574
+ * @license
575
+ * Copyright 2020 Google LLC
576
+ *
577
+ * Licensed under the Apache License, Version 2.0 (the "License");
578
+ * you may not use this file except in compliance with the License.
579
+ * You may obtain a copy of the License at
580
+ *
581
+ * http://www.apache.org/licenses/LICENSE-2.0
582
+ *
583
+ * Unless required by applicable law or agreed to in writing, software
584
+ * distributed under the License is distributed on an "AS IS" BASIS,
585
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
586
+ * See the License for the specific language governing permissions and
587
+ * limitations under the License.
588
+ *)
589
+ (**
590
+ * @license
591
+ * Copyright 2017 Google LLC
592
+ *
593
+ * Licensed under the Apache License, Version 2.0 (the "License");
594
+ * you may not use this file except in compliance with the License.
595
+ * You may obtain a copy of the License at
596
+ *
597
+ * http://www.apache.org/licenses/LICENSE-2.0
598
+ *
599
+ * Unless required by applicable law or agreed to in writing, software
600
+ * distributed under the License is distributed on an "AS IS" BASIS,
601
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
602
+ * See the License for the specific language governing permissions and
603
+ * limitations under the License.
604
+ *)
605
+
606
+ @firebase/firestore/dist/index.esm2017.js:
607
+ (**
608
+ * @license
609
+ * Copyright 2017 Google LLC
610
+ *
611
+ * Licensed under the Apache License, Version 2.0 (the "License");
612
+ * you may not use this file except in compliance with the License.
613
+ * You may obtain a copy of the License at
614
+ *
615
+ * http://www.apache.org/licenses/LICENSE-2.0
616
+ *
617
+ * Unless required by applicable law or agreed to in writing, software
618
+ * distributed under the License is distributed on an "AS IS" BASIS,
619
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
620
+ * See the License for the specific language governing permissions and
621
+ * limitations under the License.
622
+ *)
623
+
624
+ @firebase/firestore/dist/index.esm2017.js:
625
+ (**
626
+ * @license
627
+ * Copyright 2020 Google LLC
628
+ *
629
+ * Licensed under the Apache License, Version 2.0 (the "License");
630
+ * you may not use this file except in compliance with the License.
631
+ * You may obtain a copy of the License at
632
+ *
633
+ * http://www.apache.org/licenses/LICENSE-2.0
634
+ *
635
+ * Unless required by applicable law or agreed to in writing, software
636
+ * distributed under the License is distributed on an "AS IS" BASIS,
637
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
638
+ * See the License for the specific language governing permissions and
639
+ * limitations under the License.
640
+ *)
641
+ (**
642
+ * @license
643
+ * Copyright 2017 Google LLC
644
+ *
645
+ * Licensed under the Apache License, Version 2.0 (the "License");
646
+ * you may not use this file except in compliance with the License.
647
+ * You may obtain a copy of the License at
648
+ *
649
+ * http://www.apache.org/licenses/LICENSE-2.0
650
+ *
651
+ * Unless required by applicable law or agreed to in writing, software
652
+ * distributed under the License is distributed on an "AS IS" BASIS,
653
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
654
+ * See the License for the specific language governing permissions and
655
+ * limitations under the License.
656
+ *)
657
+
658
+ @firebase/firestore/dist/index.esm2017.js:
659
+ (**
660
+ * @license
661
+ * Copyright 2017 Google LLC
662
+ *
663
+ * Licensed under the Apache License, Version 2.0 (the "License");
664
+ * you may not use this file except in compliance with the License.
665
+ * You may obtain a copy of the License at
666
+ *
667
+ * http://www.apache.org/licenses/LICENSE-2.0
668
+ *
669
+ * Unless required by applicable law or agreed to in writing, software
670
+ * distributed under the License is distributed on an "AS IS" BASIS,
671
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
672
+ * See the License for the specific language governing permissions and
673
+ * limitations under the License.
674
+ *)
675
+ (**
676
+ * @license
677
+ * Copyright 2021 Google LLC
678
+ *
679
+ * Licensed under the Apache License, Version 2.0 (the "License");
680
+ * you may not use this file except in compliance with the License.
681
+ * You may obtain a copy of the License at
682
+ *
683
+ * http://www.apache.org/licenses/LICENSE-2.0
684
+ *
685
+ * Unless required by applicable law or agreed to in writing, software
686
+ * distributed under the License is distributed on an "AS IS" BASIS,
687
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
688
+ * See the License for the specific language governing permissions and
689
+ * limitations under the License.
690
+ *)
691
+
692
+ @firebase/firestore/dist/index.esm2017.js:
693
+ (**
694
+ * @license
695
+ * Copyright 2020 Google LLC
696
+ *
697
+ * Licensed under the Apache License, Version 2.0 (the "License");
698
+ * you may not use this file except in compliance with the License.
699
+ * You may obtain a copy of the License at
700
+ *
701
+ * http://www.apache.org/licenses/LICENSE-2.0
702
+ *
703
+ * Unless required by applicable law or agreed to in writing, software
704
+ * distributed under the License is distributed on an "AS IS" BASIS,
705
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
706
+ * See the License for the specific language governing permissions and
707
+ * limitations under the License.
708
+ *)
709
+ (**
710
+ * @license
711
+ * Copyright 2017 Google LLC
712
+ *
713
+ * Licensed under the Apache License, Version 2.0 (the "License");
714
+ * you may not use this file except in compliance with the License.
715
+ * You may obtain a copy of the License at
716
+ *
717
+ * http://www.apache.org/licenses/LICENSE-2.0
718
+ *
719
+ * Unless required by applicable law or agreed to in writing, software
720
+ * distributed under the License is distributed on an "AS IS" BASIS,
721
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
722
+ * See the License for the specific language governing permissions and
723
+ * limitations under the License.
724
+ *)
725
+
726
+ @firebase/firestore/dist/index.esm2017.js:
727
+ (**
728
+ * @license
729
+ * Copyright 2018 Google LLC
730
+ *
731
+ * Licensed under the Apache License, Version 2.0 (the "License");
732
+ * you may not use this file except in compliance with the License.
733
+ * You may obtain a copy of the License at
734
+ *
735
+ * http://www.apache.org/licenses/LICENSE-2.0
736
+ *
737
+ * Unless required by applicable law or agreed to in writing, software
738
+ * distributed under the License is distributed on an "AS IS" BASIS,
739
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
740
+ * See the License for the specific language governing permissions and
741
+ * limitations under the License.
742
+ *)
743
+ (**
744
+ * @license
745
+ * Copyright 2017 Google LLC
746
+ *
747
+ * Licensed under the Apache License, Version 2.0 (the "License");
748
+ * you may not use this file except in compliance with the License.
749
+ * You may obtain a copy of the License at
750
+ *
751
+ * http://www.apache.org/licenses/LICENSE-2.0
752
+ *
753
+ * Unless required by applicable law or agreed to in writing, software
754
+ * distributed under the License is distributed on an "AS IS" BASIS,
755
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
756
+ * See the License for the specific language governing permissions and
757
+ * limitations under the License.
758
+ *)
759
+
760
+ @firebase/firestore/dist/index.esm2017.js:
761
+ (**
762
+ * @license
763
+ * Copyright 2022 Google LLC
764
+ *
765
+ * Licensed under the Apache License, Version 2.0 (the "License");
766
+ * you may not use this file except in compliance with the License.
767
+ * You may obtain a copy of the License at
768
+ *
769
+ * http://www.apache.org/licenses/LICENSE-2.0
770
+ *
771
+ * Unless required by applicable law or agreed to in writing, software
772
+ * distributed under the License is distributed on an "AS IS" BASIS,
773
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
774
+ * See the License for the specific language governing permissions and
775
+ * limitations under the License.
776
+ *)
777
+
778
+ @firebase/firestore/dist/index.esm2017.js:
779
+ (**
780
+ * @license
781
+ * Copyright 2022 Google LLC
782
+ *
783
+ * Licensed under the Apache License, Version 2.0 (the "License");
784
+ * you may not use this file except in compliance with the License.
785
+ * You may obtain a copy of the License at
786
+ *
787
+ * http://www.apache.org/licenses/LICENSE-2.0
788
+ *
789
+ * Unless required by applicable law or agreed to in writing, software
790
+ * distributed under the License is distributed on an "AS IS" BASIS,
791
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
792
+ * See the License for the specific language governing permissions and
793
+ * limitations under the License.
794
+ *)
795
+
796
+ @firebase/firestore/dist/index.esm2017.js:
797
+ (**
798
+ * @license
799
+ * Copyright 2020 Google LLC
800
+ *
801
+ * Licensed under the Apache License, Version 2.0 (the "License");
802
+ * you may not use this file except in compliance with the License.
803
+ * You may obtain a copy of the License at
804
+ *
805
+ * http://www.apache.org/licenses/LICENSE-2.0
806
+ *
807
+ * Unless required by applicable law or agreed to in writing, software
808
+ * distributed under the License is distributed on an "AS IS" BASIS,
809
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
810
+ * See the License for the specific language governing permissions and
811
+ * limitations under the License.
812
+ *)
813
+
814
+ @firebase/firestore/dist/index.esm2017.js:
815
+ (**
816
+ * @license
817
+ * Copyright 2017 Google LLC
818
+ *
819
+ * Licensed under the Apache License, Version 2.0 (the "License");
820
+ * you may not use this file except in compliance with the License.
821
+ * You may obtain a copy of the License at
822
+ *
823
+ * http://www.apache.org/licenses/LICENSE-2.0
824
+ *
825
+ * Unless required by applicable law or agreed to in writing, software
826
+ * distributed under the License is distributed on an "AS IS" BASIS,
827
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
828
+ * See the License for the specific language governing permissions and
829
+ * limitations under the License.
830
+ *)
831
+
832
+ @firebase/firestore/dist/index.esm2017.js:
833
+ (**
834
+ * @license
835
+ * Copyright 2017 Google LLC
836
+ *
837
+ * Licensed under the Apache License, Version 2.0 (the "License");
838
+ * you may not use this file except in compliance with the License.
839
+ * You may obtain a copy of the License at
840
+ *
841
+ * http://www.apache.org/licenses/LICENSE-2.0
842
+ *
843
+ * Unless required by applicable law or agreed to in writing, software
844
+ * distributed under the License is distributed on an "AS IS" BASIS,
845
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
846
+ * See the License for the specific language governing permissions and
847
+ * limitations under the License.
848
+ *)
849
+
850
+ @firebase/firestore/dist/index.esm2017.js:
851
+ (**
852
+ * @license
853
+ * Copyright 2020 Google LLC
854
+ *
855
+ * Licensed under the Apache License, Version 2.0 (the "License");
856
+ * you may not use this file except in compliance with the License.
857
+ * You may obtain a copy of the License at
858
+ *
859
+ * http://www.apache.org/licenses/LICENSE-2.0
860
+ *
861
+ * Unless required by applicable law or agreed to in writing, software
862
+ * distributed under the License is distributed on an "AS IS" BASIS,
863
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
864
+ * See the License for the specific language governing permissions and
865
+ * limitations under the License.
866
+ *)
867
+ (**
868
+ * @license
869
+ * Copyright 2023 Google LLC
870
+ *
871
+ * Licensed under the Apache License, Version 2.0 (the "License");
872
+ * you may not use this file except in compliance with the License.
873
+ * You may obtain a copy of the License at
874
+ *
875
+ * http://www.apache.org/licenses/LICENSE-2.0
876
+ *
877
+ * Unless required by applicable law or agreed to in writing, software
878
+ * distributed under the License is distributed on an "AS IS" BASIS,
879
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
880
+ * See the License for the specific language governing permissions and
881
+ * limitations under the License.
882
+ *)
883
+
884
+ @firebase/firestore/dist/index.esm2017.js:
885
+ (**
886
+ * @license
887
+ * Copyright 2020 Google LLC
888
+ *
889
+ * Licensed under the Apache License, Version 2.0 (the "License");
890
+ * you may not use this file except in compliance with the License.
891
+ * You may obtain a copy of the License at
892
+ *
893
+ * http://www.apache.org/licenses/LICENSE-2.0
894
+ *
895
+ * Unless required by applicable law or agreed to in writing, software
896
+ * distributed under the License is distributed on an "AS IS" BASIS,
897
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
898
+ * See the License for the specific language governing permissions and
899
+ * limitations under the License.
900
+ *)
901
+ (**
902
+ * @license
903
+ * Copyright 2017 Google LLC
904
+ *
905
+ * Licensed under the Apache License, Version 2.0 (the "License");
906
+ * you may not use this file except in compliance with the License.
907
+ * You may obtain a copy of the License at
908
+ *
909
+ * http://www.apache.org/licenses/LICENSE-2.0
910
+ *
911
+ * Unless required by applicable law or agreed to in writing, software
912
+ * distributed under the License is distributed on an "AS IS" BASIS,
913
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
914
+ * See the License for the specific language governing permissions and
915
+ * limitations under the License.
916
+ *)
917
+
918
+ @firebase/firestore/dist/index.esm2017.js:
919
+ (**
920
+ * @license
921
+ * Copyright 2017 Google LLC
922
+ *
923
+ * Licensed under the Apache License, Version 2.0 (the "License");
924
+ * you may not use this file except in compliance with the License.
925
+ * You may obtain a copy of the License at
926
+ *
927
+ * http://www.apache.org/licenses/LICENSE-2.0
928
+ *
929
+ * Unless required by applicable law or agreed to in writing, software
930
+ * distributed under the License is distributed on an "AS IS" BASIS,
931
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
932
+ * See the License for the specific language governing permissions and
933
+ * limitations under the License.
934
+ *)
935
+ (**
936
+ * @license
937
+ * Copyright 2022 Google LLC
938
+ *
939
+ * Licensed under the Apache License, Version 2.0 (the "License");
940
+ * you may not use this file except in compliance with the License.
941
+ * You may obtain a copy of the License at
942
+ *
943
+ * http://www.apache.org/licenses/LICENSE-2.0
944
+ *
945
+ * Unless required by applicable law or agreed to in writing, software
946
+ * distributed under the License is distributed on an "AS IS" BASIS,
947
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
948
+ * See the License for the specific language governing permissions and
949
+ * limitations under the License.
950
+ *)
951
+
952
+ @firebase/firestore/dist/index.esm2017.js:
953
+ (**
954
+ * @license
955
+ * Copyright 2019 Google LLC
956
+ *
957
+ * Licensed under the Apache License, Version 2.0 (the "License");
958
+ * you may not use this file except in compliance with the License.
959
+ * You may obtain a copy of the License at
960
+ *
961
+ * http://www.apache.org/licenses/LICENSE-2.0
962
+ *
963
+ * Unless required by applicable law or agreed to in writing, software
964
+ * distributed under the License is distributed on an "AS IS" BASIS,
965
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
966
+ * See the License for the specific language governing permissions and
967
+ * limitations under the License.
968
+ *)
969
+
970
+ @firebase/firestore/dist/index.esm2017.js:
971
+ (**
972
+ * @license
973
+ * Copyright 2017 Google LLC
974
+ *
975
+ * Licensed under the Apache License, Version 2.0 (the "License");
976
+ * you may not use this file except in compliance with the License.
977
+ * You may obtain a copy of the License at
978
+ *
979
+ * http://www.apache.org/licenses/LICENSE-2.0
980
+ *
981
+ * Unless required by applicable law or agreed to in writing, software
982
+ * distributed under the License is distributed on an "AS IS" BASIS,
983
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
984
+ * See the License for the specific language governing permissions and
985
+ * limitations under the License.
986
+ *)
987
+
988
+ @firebase/firestore/dist/index.esm2017.js:
989
+ (**
990
+ * @license
991
+ * Copyright 2017 Google LLC
992
+ *
993
+ * Licensed under the Apache License, Version 2.0 (the "License");
994
+ * you may not use this file except in compliance with the License.
995
+ * You may obtain a copy of the License at
996
+ *
997
+ * http://www.apache.org/licenses/LICENSE-2.0
998
+ *
999
+ * Unless required by applicable law or agreed to in writing, software
1000
+ * distributed under the License is distributed on an "AS IS" BASIS,
1001
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1002
+ * See the License for the specific language governing permissions and
1003
+ * limitations under the License.
1004
+ *)
1005
+ (**
1006
+ * @license
1007
+ * Copyright 2020 Google LLC
1008
+ *
1009
+ * Licensed under the Apache License, Version 2.0 (the "License");
1010
+ * you may not use this file except in compliance with the License.
1011
+ * You may obtain a copy of the License at
1012
+ *
1013
+ * http://www.apache.org/licenses/LICENSE-2.0
1014
+ *
1015
+ * Unless required by applicable law or agreed to in writing, software
1016
+ * distributed under the License is distributed on an "AS IS" BASIS,
1017
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1018
+ * See the License for the specific language governing permissions and
1019
+ * limitations under the License.
1020
+ *)
1021
+ (**
1022
+ * @license
1023
+ * Copyright 2018 Google LLC
1024
+ *
1025
+ * Licensed under the Apache License, Version 2.0 (the "License");
1026
+ * you may not use this file except in compliance with the License.
1027
+ * You may obtain a copy of the License at
1028
+ *
1029
+ * http://www.apache.org/licenses/LICENSE-2.0
1030
+ *
1031
+ * Unless required by applicable law or agreed to in writing, software
1032
+ * distributed under the License is distributed on an "AS IS" BASIS,
1033
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
+ * See the License for the specific language governing permissions and
1035
+ * limitations under the License.
1036
+ *)
1037
+
1038
+ @firebase/firestore/dist/index.esm2017.js:
1039
+ (**
1040
+ * @license
1041
+ * Copyright 2017 Google LLC
1042
+ *
1043
+ * Licensed under the Apache License, Version 2.0 (the "License");
1044
+ * you may not use this file except in compliance with the License.
1045
+ * You may obtain a copy of the License at
1046
+ *
1047
+ * http://www.apache.org/licenses/LICENSE-2.0
1048
+ *
1049
+ * Unless required by applicable law or agreed to in writing, software
1050
+ * distributed under the License is distributed on an "AS IS" BASIS,
1051
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1052
+ * See the License for the specific language governing permissions and
1053
+ * limitations under the License.
1054
+ *)
1055
+ (**
1056
+ * @license
1057
+ * Copyright 2022 Google LLC
1058
+ *
1059
+ * Licensed under the Apache License, Version 2.0 (the "License");
1060
+ * you may not use this file except in compliance with the License.
1061
+ * You may obtain a copy of the License at
1062
+ *
1063
+ * http://www.apache.org/licenses/LICENSE-2.0
1064
+ *
1065
+ * Unless required by applicable law or agreed to in writing, software
1066
+ * distributed under the License is distributed on an "AS IS" BASIS,
1067
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1068
+ * See the License for the specific language governing permissions and
1069
+ * limitations under the License.
1070
+ *)
1071
+ (**
1072
+ * @license
1073
+ * Copyright 2023 Google LLC
1074
+ *
1075
+ * Licensed under the Apache License, Version 2.0 (the "License");
1076
+ * you may not use this file except in compliance with the License.
1077
+ * You may obtain a copy of the License at
1078
+ *
1079
+ * http://www.apache.org/licenses/LICENSE-2.0
1080
+ *
1081
+ * Unless required by applicable law or agreed to in writing, software
1082
+ * distributed under the License is distributed on an "AS IS" BASIS,
1083
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1084
+ * See the License for the specific language governing permissions and
1085
+ * limitations under the License.
1086
+ *)
1087
+
1088
+ @firebase/firestore/dist/index.esm2017.js:
1089
+ (**
1090
+ * @license
1091
+ * Copyright 2017 Google LLC
1092
+ *
1093
+ * Licensed under the Apache License, Version 2.0 (the "License");
1094
+ * you may not use this file except in compliance with the License.
1095
+ * You may obtain a copy of the License at
1096
+ *
1097
+ * http://www.apache.org/licenses/LICENSE-2.0
1098
+ *
1099
+ * Unless required by applicable law or agreed to in writing, software
1100
+ * distributed under the License is distributed on an "AS IS" BASIS,
1101
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1102
+ * See the License for the specific language governing permissions and
1103
+ * limitations under the License.
1104
+ *)
1105
+ (**
1106
+ * @license
1107
+ * Copyright 2023 Google LLC
1108
+ *
1109
+ * Licensed under the Apache License, Version 2.0 (the "License");
1110
+ * you may not use this file except in compliance with the License.
1111
+ * You may obtain a copy of the License at
1112
+ *
1113
+ * http://www.apache.org/licenses/LICENSE-2.0
1114
+ *
1115
+ * Unless required by applicable law or agreed to in writing, software
1116
+ * distributed under the License is distributed on an "AS IS" BASIS,
1117
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1118
+ * See the License for the specific language governing permissions and
1119
+ * limitations under the License.
1120
+ *)
1121
+ (**
1122
+ * @license
1123
+ * Copyright 2022 Google LLC
1124
+ *
1125
+ * Licensed under the Apache License, Version 2.0 (the "License");
1126
+ * you may not use this file except in compliance with the License.
1127
+ * You may obtain a copy of the License at
1128
+ *
1129
+ * http://www.apache.org/licenses/LICENSE-2.0
1130
+ *
1131
+ * Unless required by applicable law or agreed to in writing, software
1132
+ * distributed under the License is distributed on an "AS IS" BASIS,
1133
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1134
+ * See the License for the specific language governing permissions and
1135
+ * limitations under the License.
1136
+ *)
1137
+
1138
+ @firebase/firestore/dist/index.esm2017.js:
1139
+ (**
1140
+ * @license
1141
+ * Copyright 2017 Google LLC
1142
+ *
1143
+ * Licensed under the Apache License, Version 2.0 (the "License");
1144
+ * you may not use this file except in compliance with the License.
1145
+ * You may obtain a copy of the License at
1146
+ *
1147
+ * http://www.apache.org/licenses/LICENSE-2.0
1148
+ *
1149
+ * Unless required by applicable law or agreed to in writing, software
1150
+ * distributed under the License is distributed on an "AS IS" BASIS,
1151
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1152
+ * See the License for the specific language governing permissions and
1153
+ * limitations under the License.
1154
+ *)
1155
+
1156
+ @firebase/firestore/dist/index.esm2017.js:
1157
+ (**
1158
+ * @license
1159
+ * Copyright 2020 Google LLC
1160
+ *
1161
+ * Licensed under the Apache License, Version 2.0 (the "License");
1162
+ * you may not use this file except in compliance with the License.
1163
+ * You may obtain a copy of the License at
1164
+ *
1165
+ * http://www.apache.org/licenses/LICENSE-2.0
1166
+ *
1167
+ * Unless required by applicable law or agreed to in writing, software
1168
+ * distributed under the License is distributed on an "AS IS" BASIS,
1169
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1170
+ * See the License for the specific language governing permissions and
1171
+ * limitations under the License.
1172
+ *)
1173
+
1174
+ @firebase/firestore/dist/index.esm2017.js:
1175
+ (**
1176
+ * @license
1177
+ * Copyright 2022 Google LLC
1178
+ *
1179
+ * Licensed under the Apache License, Version 2.0 (the "License");
1180
+ * you may not use this file except in compliance with the License.
1181
+ * You may obtain a copy of the License at
1182
+ *
1183
+ * http://www.apache.org/licenses/LICENSE-2.0
1184
+ *
1185
+ * Unless required by applicable law or agreed to in writing, software
1186
+ * distributed under the License is distributed on an "AS IS" BASIS,
1187
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1188
+ * See the License for the specific language governing permissions and
1189
+ * limitations under the License.
1190
+ *)
1191
+
1192
+ @firebase/firestore/dist/index.esm2017.js:
1193
+ (**
1194
+ * @license
1195
+ * Copyright 2024 Google LLC
1196
+ *
1197
+ * Licensed under the Apache License, Version 2.0 (the "License");
1198
+ * you may not use this file except in compliance with the License.
1199
+ * You may obtain a copy of the License at
1200
+ *
1201
+ * http://www.apache.org/licenses/LICENSE-2.0
1202
+ *
1203
+ * Unless required by applicable law or agreed to in writing, software
1204
+ * distributed under the License is distributed on an "AS IS" BASIS,
1205
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1206
+ * See the License for the specific language governing permissions and
1207
+ * limitations under the License.
1208
+ *)
1209
+
1210
+ @firebase/firestore/dist/index.esm2017.js:
1211
+ (**
1212
+ * @license
1213
+ * Copyright 2021 Google LLC
1214
+ *
1215
+ * Licensed under the Apache License, Version 2.0 (the "License");
1216
+ * you may not use this file except in compliance with the License.
1217
+ * You may obtain a copy of the License at
1218
+ *
1219
+ * http://www.apache.org/licenses/LICENSE-2.0
1220
+ *
1221
+ * Unless required by applicable law or agreed to in writing, software
1222
+ * distributed under the License is distributed on an "AS IS" BASIS,
1223
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1224
+ * See the License for the specific language governing permissions and
1225
+ * limitations under the License.
1226
+ *)
1227
+ (**
1228
+ * @license
1229
+ * Copyright 2021 Google LLC
1230
+ *
1231
+ * Licensed under the Apache License, Version 2.0 (the "License");
1232
+ * you may not use this file except in compliance with the License.
1233
+ * You may obtain a copy of the License at
1234
+ *
1235
+ * http://www.apache.org/licenses/LICENSE-2.0
1236
+ *
1237
+ * Unless required by applicable law | agreed to in writing, software
1238
+ * distributed under the License is distributed on an "AS IS" BASIS,
1239
+ * WITHOUT WARRANTIES | CONDITIONS OF ANY KIND, either express | implied.
1240
+ * See the License for the specific language governing permissions and
1241
+ * limitations under the License.
1242
+ *)
1243
+
1244
+ @firebase/firestore/dist/index.esm2017.js:
1245
+ (**
1246
+ * @license
1247
+ * Copyright 2022 Google LLC
1248
+ *
1249
+ * Licensed under the Apache License, Version 2.0 (the "License");
1250
+ * you may not use this file except in compliance with the License.
1251
+ * You may obtain a copy of the License at
1252
+ *
1253
+ * http://www.apache.org/licenses/LICENSE-2.0
1254
+ *
1255
+ * Unless required by applicable law or agreed to in writing, software
1256
+ * distributed under the License is distributed on an "AS IS" BASIS,
1257
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1258
+ * See the License for the specific language governing permissions and
1259
+ * limitations under the License.
1260
+ *)
1261
+
1262
+ @firebase/firestore/dist/index.esm2017.js:
1263
+ (**
1264
+ * @license
1265
+ * Copyright 2022 Google LLC
1266
+ *
1267
+ * Licensed under the Apache License, Version 2.0 (the "License");
1268
+ * you may not use this file except in compliance with the License.
1269
+ * You may obtain a copy of the License at
1270
+ *
1271
+ * http://www.apache.org/licenses/LICENSE-2.0
1272
+ *
1273
+ * Unless required by applicable law or agreed to in writing, software
1274
+ * distributed under the License is distributed on an "AS IS" BASIS,
1275
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1276
+ * See the License for the specific language governing permissions and
1277
+ * limitations under the License.
1278
+ *)
1279
+
1280
+ @firebase/firestore/dist/index.esm2017.js:
1281
+ (**
1282
+ * @license
1283
+ * Copyright 2022 Google LLC
1284
+ *
1285
+ * Licensed under the Apache License, Version 2.0 (the "License");
1286
+ * you may not use this file except in compliance with the License.
1287
+ * You may obtain a copy of the License at
1288
+ *
1289
+ * http://www.apache.org/licenses/LICENSE-2.0
1290
+ *
1291
+ * Unless required by applicable law or agreed to in writing, software
1292
+ * distributed under the License is distributed on an "AS IS" BASIS,
1293
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1294
+ * See the License for the specific language governing permissions and
1295
+ * limitations under the License.
1296
+ *)
1297
+
1298
+ @firebase/firestore/dist/index.esm2017.js:
1299
+ (**
1300
+ * @license
1301
+ * Copyright 2019 Google LLC
1302
+ *
1303
+ * Licensed under the Apache License, Version 2.0 (the "License");
1304
+ * you may not use this file except in compliance with the License.
1305
+ * You may obtain a copy of the License at
1306
+ *
1307
+ * http://www.apache.org/licenses/LICENSE-2.0
1308
+ *
1309
+ * Unless required by applicable law or agreed to in writing, software
1310
+ * distributed under the License is distributed on an "AS IS" BASIS,
1311
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1312
+ * See the License for the specific language governing permissions and
1313
+ * limitations under the License.
1314
+ *)
1315
+
1316
+ @firebase/firestore/dist/index.esm2017.js:
1317
+ (**
1318
+ * @license
1319
+ * Copyright 2018 Google LLC
1320
+ *
1321
+ * Licensed under the Apache License, Version 2.0 (the "License");
1322
+ * you may not use this file except in compliance with the License.
1323
+ * You may obtain a copy of the License at
1324
+ *
1325
+ * http://www.apache.org/licenses/LICENSE-2.0
1326
+ *
1327
+ * Unless required by applicable law or agreed to in writing, software
1328
+ * distributed under the License is distributed on an "AS IS" BASIS,
1329
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1330
+ * See the License for the specific language governing permissions and
1331
+ * limitations under the License.
1332
+ *)
1333
+ (**
1334
+ * @license
1335
+ * Copyright 2020 Google LLC
1336
+ *
1337
+ * Licensed under the Apache License, Version 2.0 (the "License");
1338
+ * you may not use this file except in compliance with the License.
1339
+ * You may obtain a copy of the License at
1340
+ *
1341
+ * http://www.apache.org/licenses/LICENSE-2.0
1342
+ *
1343
+ * Unless required by applicable law or agreed to in writing, software
1344
+ * distributed under the License is distributed on an "AS IS" BASIS,
1345
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1346
+ * See the License for the specific language governing permissions and
1347
+ * limitations under the License.
1348
+ *)
1349
+
1350
+ @firebase/firestore/dist/index.esm2017.js:
1351
+ (**
1352
+ * @license
1353
+ * Copyright 2017 Google LLC
1354
+ *
1355
+ * Licensed under the Apache License, Version 2.0 (the "License");
1356
+ * you may not use this file except in compliance with the License.
1357
+ * You may obtain a copy of the License at
1358
+ *
1359
+ * http://www.apache.org/licenses/LICENSE-2.0
1360
+ *
1361
+ * Unless required by applicable law or agreed to in writing, software
1362
+ * distributed under the License is distributed on an "AS IS" BASIS,
1363
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1364
+ * See the License for the specific language governing permissions and
1365
+ * limitations under the License.
1366
+ *)
1367
+
1368
+ @firebase/firestore/dist/index.esm2017.js:
1369
+ (**
1370
+ * @license
1371
+ * Copyright 2017 Google LLC
1372
+ *
1373
+ * Licensed under the Apache License, Version 2.0 (the "License");
1374
+ * you may not use this file except in compliance with the License.
1375
+ * You may obtain a copy of the License at
1376
+ *
1377
+ * http://www.apache.org/licenses/LICENSE-2.0
1378
+ *
1379
+ * Unless required by applicable law or agreed to in writing, software
1380
+ * distributed under the License is distributed on an "AS IS" BASIS,
1381
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1382
+ * See the License for the specific language governing permissions and
1383
+ * limitations under the License.
1384
+ *)
1385
+
1386
+ @firebase/firestore/dist/index.esm2017.js:
1387
+ (**
1388
+ * @license
1389
+ * Copyright 2020 Google LLC
1390
+ *
1391
+ * Licensed under the Apache License, Version 2.0 (the "License");
1392
+ * you may not use this file except in compliance with the License.
1393
+ * You may obtain a copy of the License at
1394
+ *
1395
+ * http://www.apache.org/licenses/LICENSE-2.0
1396
+ *
1397
+ * Unless required by applicable law or agreed to in writing, software
1398
+ * distributed under the License is distributed on an "AS IS" BASIS,
1399
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1400
+ * See the License for the specific language governing permissions and
1401
+ * limitations under the License.
1402
+ *)
1403
+
1404
+ @firebase/firestore/dist/index.esm2017.js:
1405
+ (**
1406
+ * @license
1407
+ * Copyright 2017 Google LLC
1408
+ *
1409
+ * Licensed under the Apache License, Version 2.0 (the "License");
1410
+ * you may not use this file except in compliance with the License.
1411
+ * You may obtain a copy of the License at
1412
+ *
1413
+ * http://www.apache.org/licenses/LICENSE-2.0
1414
+ *
1415
+ * Unless required by applicable law or agreed to in writing, software
1416
+ * distributed under the License is distributed on an "AS IS" BASIS,
1417
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1418
+ * See the License for the specific language governing permissions and
1419
+ * limitations under the License.
1420
+ *)
1421
+
1422
+ @firebase/firestore/dist/index.esm2017.js:
1423
+ (**
1424
+ * @license
1425
+ * Copyright 2017 Google LLC
1426
+ *
1427
+ * Licensed under the Apache License, Version 2.0 (the "License");
1428
+ * you may not use this file except in compliance with the License.
1429
+ * You may obtain a copy of the License at
1430
+ *
1431
+ * http://www.apache.org/licenses/LICENSE-2.0
1432
+ *
1433
+ * Unless required by applicable law or agreed to in writing, software
1434
+ * distributed under the License is distributed on an "AS IS" BASIS,
1435
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1436
+ * See the License for the specific language governing permissions and
1437
+ * limitations under the License.
1438
+ *)
1439
+ (**
1440
+ * @license
1441
+ * Copyright 2022 Google LLC
1442
+ *
1443
+ * Licensed under the Apache License, Version 2.0 (the "License");
1444
+ * you may not use this file except in compliance with the License.
1445
+ * You may obtain a copy of the License at
1446
+ *
1447
+ * http://www.apache.org/licenses/LICENSE-2.0
1448
+ *
1449
+ * Unless required by applicable law or agreed to in writing, software
1450
+ * distributed under the License is distributed on an "AS IS" BASIS,
1451
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1452
+ * See the License for the specific language governing permissions and
1453
+ * limitations under the License.
1454
+ *)
1455
+ (**
1456
+ * @license
1457
+ * Copyright 2020 Google LLC
1458
+ *
1459
+ * Licensed under the Apache License, Version 2.0 (the "License");
1460
+ * you may not use this file except in compliance with the License.
1461
+ * You may obtain a copy of the License at
1462
+ *
1463
+ * http://www.apache.org/licenses/LICENSE-2.0
1464
+ *
1465
+ * Unless required by applicable law or agreed to in writing, software
1466
+ * distributed under the License is distributed on an "AS IS" BASIS,
1467
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1468
+ * See the License for the specific language governing permissions and
1469
+ * limitations under the License.
1470
+ *)
1471
+ (**
1472
+ * @license
1473
+ * Copyright 2024 Google LLC
1474
+ *
1475
+ * Licensed under the Apache License, Version 2.0 (the "License");
1476
+ * you may not use this file except in compliance with the License.
1477
+ * You may obtain a copy of the License at
1478
+ *
1479
+ * http://www.apache.org/licenses/LICENSE-2.0
1480
+ *
1481
+ * Unless required by applicable law or agreed to in writing, software
1482
+ * distributed under the License is distributed on an "AS IS" BASIS,
1483
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1484
+ * See the License for the specific language governing permissions and
1485
+ * limitations under the License.
1486
+ *)
1487
+
1488
+ @firebase/firestore/dist/index.esm2017.js:
1489
+ (**
1490
+ * @license
1491
+ * Copyright 2017 Google LLC
1492
+ *
1493
+ * Licensed under the Apache License, Version 2.0 (the "License");
1494
+ * you may not use this file except in compliance with the License.
1495
+ * You may obtain a copy of the License at
1496
+ *
1497
+ * http://www.apache.org/licenses/LICENSE-2.0
1498
+ *
1499
+ * Unless required by applicable law or agreed to in writing, software
1500
+ * distributed under the License is distributed on an "AS IS" BASIS,
1501
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1502
+ * See the License for the specific language governing permissions and
1503
+ * limitations under the License.
1504
+ *)
1505
+ (**
1506
+ * @license
1507
+ * Copyright 2023 Google LLC
1508
+ *
1509
+ * Licensed under the Apache License, Version 2.0 (the "License");
1510
+ * you may not use this file except in compliance with the License.
1511
+ * You may obtain a copy of the License at
1512
+ *
1513
+ * http://www.apache.org/licenses/LICENSE-2.0
1514
+ *
1515
+ * Unless required by applicable law or agreed to in writing, software
1516
+ * distributed under the License is distributed on an "AS IS" BASIS,
1517
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1518
+ * See the License for the specific language governing permissions and
1519
+ * limitations under the License.
1520
+ *)
1521
+ (**
1522
+ * @license
1523
+ * Copyright 2019 Google LLC
1524
+ *
1525
+ * Licensed under the Apache License, Version 2.0 (the "License");
1526
+ * you may not use this file except in compliance with the License.
1527
+ * You may obtain a copy of the License at
1528
+ *
1529
+ * http://www.apache.org/licenses/LICENSE-2.0
1530
+ *
1531
+ * Unless required by applicable law or agreed to in writing, software
1532
+ * distributed under the License is distributed on an "AS IS" BASIS,
1533
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1534
+ * See the License for the specific language governing permissions and
1535
+ * limitations under the License.
1536
+ *)
1537
+ (**
1538
+ * @license
1539
+ * Copyright 2020 Google LLC
1540
+ *
1541
+ * Licensed under the Apache License, Version 2.0 (the "License");
1542
+ * you may not use this file except in compliance with the License.
1543
+ * You may obtain a copy of the License at
1544
+ *
1545
+ * http://www.apache.org/licenses/LICENSE-2.0
1546
+ *
1547
+ * Unless required by applicable law or agreed to in writing, software
1548
+ * distributed under the License is distributed on an "AS IS" BASIS,
1549
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1550
+ * See the License for the specific language governing permissions and
1551
+ * limitations under the License.
1552
+ *)
1553
+
1554
+ @firebase/firestore/dist/index.esm2017.js:
1555
+ (**
1556
+ * @license
1557
+ * Copyright 2019 Google LLC
1558
+ *
1559
+ * Licensed under the Apache License, Version 2.0 (the "License");
1560
+ * you may not use this file except in compliance with the License.
1561
+ * You may obtain a copy of the License at
1562
+ *
1563
+ * http://www.apache.org/licenses/LICENSE-2.0
1564
+ *
1565
+ * Unless required by applicable law or agreed to in writing, software
1566
+ * distributed under the License is distributed on an "AS IS" BASIS,
1567
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1568
+ * See the License for the specific language governing permissions and
1569
+ * limitations under the License.
1570
+ *)
1571
+
1572
+ @firebase/firestore/dist/index.esm2017.js:
1573
+ (**
1574
+ * @license
1575
+ * Copyright 2018 Google LLC
1576
+ *
1577
+ * Licensed under the Apache License, Version 2.0 (the "License");
1578
+ * you may not use this file except in compliance with the License.
1579
+ * You may obtain a copy of the License at
1580
+ *
1581
+ * http://www.apache.org/licenses/LICENSE-2.0
1582
+ *
1583
+ * Unless required by applicable law or agreed to in writing, software
1584
+ * distributed under the License is distributed on an "AS IS" BASIS,
1585
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1586
+ * See the License for the specific language governing permissions and
1587
+ * limitations under the License.
1588
+ *)
1589
+
1590
+ @firebase/firestore/dist/index.esm2017.js:
1591
+ (**
1592
+ * @license
1593
+ * Copyright 2019 Google LLC
1594
+ *
1595
+ * Licensed under the Apache License, Version 2.0 (the "License");
1596
+ * you may not use this file except in compliance with the License.
1597
+ * You may obtain a copy of the License at
1598
+ *
1599
+ * http://www.apache.org/licenses/LICENSE-2.0
1600
+ *
1601
+ * Unless required by applicable law or agreed to in writing, software
1602
+ * distributed under the License is distributed on an "AS IS" BASIS,
1603
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1604
+ * See the License for the specific language governing permissions and
1605
+ * limitations under the License.
1606
+ *)
1607
+ (**
1608
+ * @license
1609
+ * Copyright 2023 Google LLC
1610
+ *
1611
+ * Licensed under the Apache License, Version 2.0 (the "License");
1612
+ * you may not use this file except in compliance with the License.
1613
+ * You may obtain a copy of the License at
1614
+ *
1615
+ * http://www.apache.org/licenses/LICENSE-2.0
1616
+ *
1617
+ * Unless required by applicable law or agreed to in writing, software
1618
+ * distributed under the License is distributed on an "AS IS" BASIS,
1619
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1620
+ * See the License for the specific language governing permissions and
1621
+ * limitations under the License.
1622
+ *)
1623
+ (**
1624
+ * @license
1625
+ * Copyright 2020 Google LLC
1626
+ *
1627
+ * Licensed under the Apache License, Version 2.0 (the "License");
1628
+ * you may not use this file except in compliance with the License.
1629
+ * You may obtain a copy of the License at
1630
+ *
1631
+ * http://www.apache.org/licenses/LICENSE-2.0
1632
+ *
1633
+ * Unless required by applicable law or agreed to in writing, software
1634
+ * distributed under the License is distributed on an "AS IS" BASIS,
1635
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1636
+ * See the License for the specific language governing permissions and
1637
+ * limitations under the License.
1638
+ *)
1639
+ (**
1640
+ * @license
1641
+ * Copyright 2017 Google LLC
1642
+ *
1643
+ * Licensed under the Apache License, Version 2.0 (the "License");
1644
+ * you may not use this file except in compliance with the License.
1645
+ * You may obtain a copy of the License at
1646
+ *
1647
+ * http://www.apache.org/licenses/LICENSE-2.0
1648
+ *
1649
+ * Unless required by applicable law or agreed to in writing, software
1650
+ * distributed under the License is distributed on an "AS IS" BASIS,
1651
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1652
+ * See the License for the specific language governing permissions and
1653
+ * limitations under the License.
1654
+ *)
1655
+
1656
+ @firebase/firestore/dist/index.esm2017.js:
1657
+ (**
1658
+ * @license
1659
+ * Copyright 2020 Google LLC
1660
+ *
1661
+ * Licensed under the Apache License, Version 2.0 (the "License");
1662
+ * you may not use this file except in compliance with the License.
1663
+ * You may obtain a copy of the License at
1664
+ *
1665
+ * http://www.apache.org/licenses/LICENSE-2.0
1666
+ *
1667
+ * Unless required by applicable law or agreed to in writing, software
1668
+ * distributed under the License is distributed on an "AS IS" BASIS,
1669
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1670
+ * See the License for the specific language governing permissions and
1671
+ * limitations under the License.
1672
+ *)
1673
+ (**
1674
+ * @license
1675
+ * Copyright 2017 Google LLC
1676
+ *
1677
+ * Licensed under the Apache License, Version 2.0 (the "License");
1678
+ * you may not use this file except in compliance with the License.
1679
+ * You may obtain a copy of the License at
1680
+ *
1681
+ * http://www.apache.org/licenses/LICENSE-2.0
1682
+ *
1683
+ * Unless required by applicable law or agreed to in writing, software
1684
+ * distributed under the License is distributed on an "AS IS" BASIS,
1685
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1686
+ * See the License for the specific language governing permissions and
1687
+ * limitations under the License.
1688
+ *)
1689
+
1690
+ @firebase/firestore/dist/index.esm2017.js:
1691
+ (**
1692
+ * @license
1693
+ * Copyright 2020 Google LLC
1694
+ *
1695
+ * Licensed under the Apache License, Version 2.0 (the "License");
1696
+ * you may not use this file except in compliance with the License.
1697
+ * You may obtain a copy of the License at
1698
+ *
1699
+ * http://www.apache.org/licenses/LICENSE-2.0
1700
+ *
1701
+ * Unless required by applicable law or agreed to in writing, software
1702
+ * distributed under the License is distributed on an "AS IS" BASIS,
1703
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1704
+ * See the License for the specific language governing permissions and
1705
+ * limitations under the License.
1706
+ *)
1707
+
1708
+ @firebase/firestore/dist/index.esm2017.js:
1709
+ (**
1710
+ * @license
1711
+ * Copyright 2017 Google LLC
1712
+ *
1713
+ * Licensed under the Apache License, Version 2.0 (the "License");
1714
+ * you may not use this file except in compliance with the License.
1715
+ * You may obtain a copy of the License at
1716
+ *
1717
+ * http://www.apache.org/licenses/LICENSE-2.0
1718
+ *
1719
+ * Unless required by applicable law or agreed to in writing, software
1720
+ * distributed under the License is distributed on an "AS IS" BASIS,
1721
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1722
+ * See the License for the specific language governing permissions and
1723
+ * limitations under the License.
1724
+ *)
1725
+
1726
+ @firebase/firestore/dist/index.esm2017.js:
1727
+ (**
1728
+ * @license
1729
+ * Copyright 2020 Google LLC
1730
+ *
1731
+ * Licensed under the Apache License, Version 2.0 (the "License");
1732
+ * you may not use this file except in compliance with the License.
1733
+ * You may obtain a copy of the License at
1734
+ *
1735
+ * http://www.apache.org/licenses/LICENSE-2.0
1736
+ *
1737
+ * Unless required by applicable law or agreed to in writing, software
1738
+ * distributed under the License is distributed on an "AS IS" BASIS,
1739
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1740
+ * See the License for the specific language governing permissions and
1741
+ * limitations under the License.
1742
+ *)
1743
+ (**
1744
+ * @license
1745
+ * Copyright 2017 Google LLC
1746
+ *
1747
+ * Licensed under the Apache License, Version 2.0 (the "License");
1748
+ * you may not use this file except in compliance with the License.
1749
+ * You may obtain a copy of the License at
1750
+ *
1751
+ * http://www.apache.org/licenses/LICENSE-2.0
1752
+ *
1753
+ * Unless required by applicable law or agreed to in writing, software
1754
+ * distributed under the License is distributed on an "AS IS" BASIS,
1755
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1756
+ * See the License for the specific language governing permissions and
1757
+ * limitations under the License.
1758
+ *)
1759
+
1760
+ @firebase/firestore/dist/index.esm2017.js:
1761
+ (**
1762
+ * @license
1763
+ * Copyright 2017 Google LLC
1764
+ *
1765
+ * Licensed under the Apache License, Version 2.0 (the "License");
1766
+ * you may not use this file except in compliance with the License.
1767
+ * You may obtain a copy of the License at
1768
+ *
1769
+ * http://www.apache.org/licenses/LICENSE-2.0
1770
+ *
1771
+ * Unless required by applicable law or agreed to in writing, software
1772
+ * distributed under the License is distributed on an "AS IS" BASIS,
1773
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1774
+ * See the License for the specific language governing permissions and
1775
+ * limitations under the License.
1776
+ *)
1777
+
1778
+ @firebase/firestore/dist/index.esm2017.js:
1779
+ (**
1780
+ * @license
1781
+ * Copyright 2019 Google LLC
1782
+ *
1783
+ * Licensed under the Apache License, Version 2.0 (the "License");
1784
+ * you may not use this file except in compliance with the License.
1785
+ * You may obtain a copy of the License at
1786
+ *
1787
+ * http://www.apache.org/licenses/LICENSE-2.0
1788
+ *
1789
+ * Unless required by applicable law or agreed to in writing, software
1790
+ * distributed under the License is distributed on an "AS IS" BASIS,
1791
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1792
+ * See the License for the specific language governing permissions and
1793
+ * limitations under the License.
1794
+ *)
1795
+
1796
+ @firebase/firestore/dist/index.esm2017.js:
1797
+ (**
1798
+ * @license
1799
+ * Copyright 2017 Google LLC
1800
+ *
1801
+ * Licensed under the Apache License, Version 2.0 (the "License");
1802
+ * you may not use this file except in compliance with the License.
1803
+ * You may obtain a copy of the License at
1804
+ *
1805
+ * http://www.apache.org/licenses/LICENSE-2.0
1806
+ *
1807
+ * Unless required by applicable law or agreed to in writing, software
1808
+ * distributed under the License is distributed on an "AS IS" BASIS,
1809
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1810
+ * See the License for the specific language governing permissions and
1811
+ * limitations under the License.
1812
+ *)
1813
+
1814
+ @firebase/firestore/dist/index.esm2017.js:
1815
+ (**
1816
+ * @license
1817
+ * Copyright 2023 Google LLC
1818
+ *
1819
+ * Licensed under the Apache License, Version 2.0 (the "License");
1820
+ * you may not use this file except in compliance with the License.
1821
+ * You may obtain a copy of the License at
1822
+ *
1823
+ * http://www.apache.org/licenses/LICENSE-2.0
1824
+ *
1825
+ * Unless required by applicable law or agreed to in writing, software
1826
+ * distributed under the License is distributed on an "AS IS" BASIS,
1827
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1828
+ * See the License for the specific language governing permissions and
1829
+ * limitations under the License.
1830
+ *)
1831
+ (**
1832
+ * @license
1833
+ * Copyright 2020 Google LLC
1834
+ *
1835
+ * Licensed under the Apache License, Version 2.0 (the "License");
1836
+ * you may not use this file except in compliance with the License.
1837
+ * You may obtain a copy of the License at
1838
+ *
1839
+ * http://www.apache.org/licenses/LICENSE-2.0
1840
+ *
1841
+ * Unless required by applicable law or agreed to in writing, software
1842
+ * distributed under the License is distributed on an "AS IS" BASIS,
1843
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1844
+ * See the License for the specific language governing permissions and
1845
+ * limitations under the License.
1846
+ *)
1847
+ (**
1848
+ * @license
1849
+ * Copyright 2017 Google LLC
1850
+ *
1851
+ * Licensed under the Apache License, Version 2.0 (the "License");
1852
+ * you may not use this file except in compliance with the License.
1853
+ * You may obtain a copy of the License at
1854
+ *
1855
+ * http://www.apache.org/licenses/LICENSE-2.0
1856
+ *
1857
+ * Unless required by applicable law or agreed to in writing, software
1858
+ * distributed under the License is distributed on an "AS IS" BASIS,
1859
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1860
+ * See the License for the specific language governing permissions and
1861
+ * limitations under the License.
1862
+ *)
1863
+
1864
+ @firebase/firestore/dist/index.esm2017.js:
1865
+ (**
1866
+ * @license
1867
+ * Copyright 2020 Google LLC
1868
+ *
1869
+ * Licensed under the Apache License, Version 2.0 (the "License");
1870
+ * you may not use this file except in compliance with the License.
1871
+ * You may obtain a copy of the License at
1872
+ *
1873
+ * http://www.apache.org/licenses/LICENSE-2.0
1874
+ *
1875
+ * Unless required by applicable law or agreed to in writing, software
1876
+ * distributed under the License is distributed on an "AS IS" BASIS,
1877
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1878
+ * See the License for the specific language governing permissions and
1879
+ * limitations under the License.
1880
+ *)
1881
+
1882
+ @firebase/firestore/dist/index.esm2017.js:
1883
+ (**
1884
+ * @license
1885
+ * Copyright 2020 Google LLC
1886
+ *
1887
+ * Licensed under the Apache License, Version 2.0 (the "License");
1888
+ * you may not use this file except in compliance with the License.
1889
+ * You may obtain a copy of the License at
1890
+ *
1891
+ * http://www.apache.org/licenses/LICENSE-2.0
1892
+ *
1893
+ * Unless required by applicable law or agreed to in writing, software
1894
+ * distributed under the License is distributed on an "AS IS" BASIS,
1895
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1896
+ * See the License for the specific language governing permissions and
1897
+ * limitations under the License.
1898
+ *)
1899
+
1900
+ @firebase/firestore/dist/index.esm2017.js:
1901
+ (**
1902
+ * @license
1903
+ * Copyright 2020 Google LLC
1904
+ *
1905
+ * Licensed under the Apache License, Version 2.0 (the "License");
1906
+ * you may not use this file except in compliance with the License.
1907
+ * You may obtain a copy of the License at
1908
+ *
1909
+ * http://www.apache.org/licenses/LICENSE-2.0
1910
+ *
1911
+ * Unless required by applicable law or agreed to in writing, software
1912
+ * distributed under the License is distributed on an "AS IS" BASIS,
1913
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1914
+ * See the License for the specific language governing permissions and
1915
+ * limitations under the License.
1916
+ *)
1917
+
1918
+ @firebase/firestore/dist/index.esm2017.js:
1919
+ (**
1920
+ * @license
1921
+ * Copyright 2020 Google LLC
1922
+ *
1923
+ * Licensed under the Apache License, Version 2.0 (the "License");
1924
+ * you may not use this file except in compliance with the License.
1925
+ * You may obtain a copy of the License at
1926
+ *
1927
+ * http://www.apache.org/licenses/LICENSE-2.0
1928
+ *
1929
+ * Unless required by applicable law or agreed to in writing, software
1930
+ * distributed under the License is distributed on an "AS IS" BASIS,
1931
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1932
+ * See the License for the specific language governing permissions and
1933
+ * limitations under the License.
1934
+ *)
1935
+ (**
1936
+ * @license
1937
+ * Copyright 2022 Google LLC
1938
+ *
1939
+ * Licensed under the Apache License, Version 2.0 (the "License");
1940
+ * you may not use this file except in compliance with the License.
1941
+ * You may obtain a copy of the License at
1942
+ *
1943
+ * http://www.apache.org/licenses/LICENSE-2.0
1944
+ *
1945
+ * Unless required by applicable law or agreed to in writing, software
1946
+ * distributed under the License is distributed on an "AS IS" BASIS,
1947
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1948
+ * See the License for the specific language governing permissions and
1949
+ * limitations under the License.
1950
+ *)
1951
+
1952
+ @firebase/firestore/dist/index.esm2017.js:
1953
+ (**
1954
+ * @license
1955
+ * Copyright 2020 Google LLC
1956
+ *
1957
+ * Licensed under the Apache License, Version 2.0 (the "License");
1958
+ * you may not use this file except in compliance with the License.
1959
+ * You may obtain a copy of the License at
1960
+ *
1961
+ * http://www.apache.org/licenses/LICENSE-2.0
1962
+ *
1963
+ * Unless required by applicable law or agreed to in writing, software
1964
+ * distributed under the License is distributed on an "AS IS" BASIS,
1965
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1966
+ * See the License for the specific language governing permissions and
1967
+ * limitations under the License.
1968
+ *)
1969
+
1970
+ @firebase/firestore/dist/index.esm2017.js:
1971
+ (**
1972
+ * @license
1973
+ * Copyright 2020 Google LLC
1974
+ *
1975
+ * Licensed under the Apache License, Version 2.0 (the "License");
1976
+ * you may not use this file except in compliance with the License.
1977
+ * You may obtain a copy of the License at
1978
+ *
1979
+ * http://www.apache.org/licenses/LICENSE-2.0
1980
+ *
1981
+ * Unless required by applicable law or agreed to in writing, software
1982
+ * distributed under the License is distributed on an "AS IS" BASIS,
1983
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1984
+ * See the License for the specific language governing permissions and
1985
+ * limitations under the License.
1986
+ *)
1987
+ (**
1988
+ * @license
1989
+ * Copyright 2017 Google LLC
1990
+ *
1991
+ * Licensed under the Apache License, Version 2.0 (the "License");
1992
+ * you may not use this file except in compliance with the License.
1993
+ * You may obtain a copy of the License at
1994
+ *
1995
+ * http://www.apache.org/licenses/LICENSE-2.0
1996
+ *
1997
+ * Unless required by applicable law or agreed to in writing, software
1998
+ * distributed under the License is distributed on an "AS IS" BASIS,
1999
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2000
+ * See the License for the specific language governing permissions and
2001
+ * limitations under the License.
2002
+ *)
2003
+ (**
2004
+ * @license
2005
+ * Copyright 2024 Google LLC
2006
+ *
2007
+ * Licensed under the Apache License, Version 2.0 (the "License");
2008
+ * you may not use this file except in compliance with the License.
2009
+ * You may obtain a copy of the License at
2010
+ *
2011
+ * http://www.apache.org/licenses/LICENSE-2.0
2012
+ *
2013
+ * Unless required by applicable law or agreed to in writing, software
2014
+ * distributed under the License is distributed on an "AS IS" BASIS,
2015
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2016
+ * See the License for the specific language governing permissions and
2017
+ * limitations under the License.
2018
+ *)
2019
+
2020
+ @firebase/firestore/dist/index.esm2017.js:
2021
+ (**
2022
+ * @license
2023
+ * Copyright 2020 Google LLC
2024
+ *
2025
+ * Licensed under the Apache License, Version 2.0 (the "License");
2026
+ * you may not use this file except in compliance with the License.
2027
+ * You may obtain a copy of the License at
2028
+ *
2029
+ * http://www.apache.org/licenses/LICENSE-2.0
2030
+ *
2031
+ * Unless required by applicable law or agreed to in writing, software
2032
+ * distributed under the License is distributed on an "AS IS" BASIS,
2033
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2034
+ * See the License for the specific language governing permissions and
2035
+ * limitations under the License.
2036
+ *)
2037
+
2038
+ @firebase/firestore/dist/index.esm2017.js:
2039
+ (**
2040
+ * @license
2041
+ * Copyright 2020 Google LLC
2042
+ *
2043
+ * Licensed under the Apache License, Version 2.0 (the "License");
2044
+ * you may not use this file except in compliance with the License.
2045
+ * You may obtain a copy of the License at
2046
+ *
2047
+ * http://www.apache.org/licenses/LICENSE-2.0
2048
+ *
2049
+ * Unless required by applicable law or agreed to in writing, software
2050
+ * distributed under the License is distributed on an "AS IS" BASIS,
2051
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2052
+ * See the License for the specific language governing permissions and
2053
+ * limitations under the License.
2054
+ *)
2055
+
2056
+ @firebase/firestore/dist/index.esm2017.js:
2057
+ (**
2058
+ * @license
2059
+ * Copyright 2022 Google LLC
2060
+ *
2061
+ * Licensed under the Apache License, Version 2.0 (the "License");
2062
+ * you may not use this file except in compliance with the License.
2063
+ * You may obtain a copy of the License at
2064
+ *
2065
+ * http://www.apache.org/licenses/LICENSE-2.0
2066
+ *
2067
+ * Unless required by applicable law or agreed to in writing, software
2068
+ * distributed under the License is distributed on an "AS IS" BASIS,
2069
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2070
+ * See the License for the specific language governing permissions and
2071
+ * limitations under the License.
2072
+ *)
2073
+
2074
+ @firebase/firestore/dist/index.esm2017.js:
2075
+ (**
2076
+ * @license
2077
+ * Copyright 2020 Google LLC
2078
+ *
2079
+ * Licensed under the Apache License, Version 2.0 (the "License");
2080
+ * you may not use this file except in compliance with the License.
2081
+ * You may obtain a copy of the License at
2082
+ *
2083
+ * http://www.apache.org/licenses/LICENSE-2.0
2084
+ *
2085
+ * Unless required by applicable law or agreed to in writing, software
2086
+ * distributed under the License is distributed on an "AS IS" BASIS,
2087
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2088
+ * See the License for the specific language governing permissions and
2089
+ * limitations under the License.
2090
+ *)
2091
+
2092
+ @firebase/firestore/dist/index.esm2017.js:
2093
+ (**
2094
+ * @license
2095
+ * Copyright 2020 Google LLC
2096
+ *
2097
+ * Licensed under the Apache License, Version 2.0 (the "License");
2098
+ * you may not use this file except in compliance with the License.
2099
+ * You may obtain a copy of the License at
2100
+ *
2101
+ * http://www.apache.org/licenses/LICENSE-2.0
2102
+ *
2103
+ * Unless required by applicable law or agreed to in writing, software
2104
+ * distributed under the License is distributed on an "AS IS" BASIS,
2105
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2106
+ * See the License for the specific language governing permissions and
2107
+ * limitations under the License.
2108
+ *)
2109
+
2110
+ @firebase/firestore/dist/index.esm2017.js:
2111
+ (**
2112
+ * @license
2113
+ * Copyright 2022 Google LLC
2114
+ *
2115
+ * Licensed under the Apache License, Version 2.0 (the "License");
2116
+ * you may not use this file except in compliance with the License.
2117
+ * You may obtain a copy of the License at
2118
+ *
2119
+ * http://www.apache.org/licenses/LICENSE-2.0
2120
+ *
2121
+ * Unless required by applicable law or agreed to in writing, software
2122
+ * distributed under the License is distributed on an "AS IS" BASIS,
2123
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2124
+ * See the License for the specific language governing permissions and
2125
+ * limitations under the License.
2126
+ *)
2127
+
2128
+ @firebase/firestore/dist/index.esm2017.js:
2129
+ (**
2130
+ * @license
2131
+ * Copyright 2022 Google LLC
2132
+ *
2133
+ * Licensed under the Apache License, Version 2.0 (the "License");
2134
+ * you may not use this file except in compliance with the License.
2135
+ * You may obtain a copy of the License at
2136
+ *
2137
+ * http://www.apache.org/licenses/LICENSE-2.0
2138
+ *
2139
+ * Unless required by applicable law or agreed to in writing, software
2140
+ * distributed under the License is distributed on an "AS IS" BASIS,
2141
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2142
+ * See the License for the specific language governing permissions and
2143
+ * limitations under the License.
2144
+ *)
2145
+
2146
+ @firebase/firestore/dist/index.esm2017.js:
2147
+ (**
2148
+ * @license
2149
+ * Copyright 2020 Google LLC
2150
+ *
2151
+ * Licensed under the Apache License, Version 2.0 (the "License");
2152
+ * you may not use this file except in compliance with the License.
2153
+ * You may obtain a copy of the License at
2154
+ *
2155
+ * http://www.apache.org/licenses/LICENSE-2.0
2156
+ *
2157
+ * Unless required by applicable law or agreed to in writing, software
2158
+ * distributed under the License is distributed on an "AS IS" BASIS,
2159
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2160
+ * See the License for the specific language governing permissions and
2161
+ * limitations under the License.
2162
+ *)
2163
+
2164
+ @firebase/firestore/dist/index.esm2017.js:
2165
+ (**
2166
+ * @license
2167
+ * Copyright 2020 Google LLC
2168
+ *
2169
+ * Licensed under the Apache License, Version 2.0 (the "License");
2170
+ * you may not use this file except in compliance with the License.
2171
+ * You may obtain a copy of the License at
2172
+ *
2173
+ * http://www.apache.org/licenses/LICENSE-2.0
2174
+ *
2175
+ * Unless required by applicable law or agreed to in writing, software
2176
+ * distributed under the License is distributed on an "AS IS" BASIS,
2177
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2178
+ * See the License for the specific language governing permissions and
2179
+ * limitations under the License.
2180
+ *)
2181
+
2182
+ @firebase/firestore/dist/index.esm2017.js:
2183
+ (**
2184
+ * @license
2185
+ * Copyright 2020 Google LLC
2186
+ *
2187
+ * Licensed under the Apache License, Version 2.0 (the "License");
2188
+ * you may not use this file except in compliance with the License.
2189
+ * You may obtain a copy of the License at
2190
+ *
2191
+ * http://www.apache.org/licenses/LICENSE-2.0
2192
+ *
2193
+ * Unless required by applicable law or agreed to in writing, software
2194
+ * distributed under the License is distributed on an "AS IS" BASIS,
2195
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2196
+ * See the License for the specific language governing permissions and
2197
+ * limitations under the License.
2198
+ *)
2199
+
2200
+ @firebase/firestore/dist/index.esm2017.js:
2201
+ (**
2202
+ * @license
2203
+ * Copyright 2020 Google LLC
2204
+ *
2205
+ * Licensed under the Apache License, Version 2.0 (the "License");
2206
+ * you may not use this file except in compliance with the License.
2207
+ * You may obtain a copy of the License at
2208
+ *
2209
+ * http://www.apache.org/licenses/LICENSE-2.0
2210
+ *
2211
+ * Unless required by applicable law or agreed to in writing, software
2212
+ * distributed under the License is distributed on an "AS IS" BASIS,
2213
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2214
+ * See the License for the specific language governing permissions and
2215
+ * limitations under the License.
2216
+ *)
2217
+
2218
+ @firebase/firestore/dist/index.esm2017.js:
2219
+ (**
2220
+ * @license
2221
+ * Copyright 2020 Google LLC
2222
+ *
2223
+ * Licensed under the Apache License, Version 2.0 (the "License");
2224
+ * you may not use this file except in compliance with the License.
2225
+ * You may obtain a copy of the License at
2226
+ *
2227
+ * http://www.apache.org/licenses/LICENSE-2.0
2228
+ *
2229
+ * Unless required by applicable law or agreed to in writing, software
2230
+ * distributed under the License is distributed on an "AS IS" BASIS,
2231
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2232
+ * See the License for the specific language governing permissions and
2233
+ * limitations under the License.
2234
+ *)
2235
+
2236
+ @firebase/firestore/dist/index.esm2017.js:
2237
+ (**
2238
+ * @license
2239
+ * Copyright 2021 Google LLC
2240
+ *
2241
+ * Licensed under the Apache License, Version 2.0 (the "License");
2242
+ * you may not use this file except in compliance with the License.
2243
+ * You may obtain a copy of the License at
2244
+ *
2245
+ * http://www.apache.org/licenses/LICENSE-2.0
2246
+ *
2247
+ * Unless required by applicable law or agreed to in writing, software
2248
+ * distributed under the License is distributed on an "AS IS" BASIS,
2249
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2250
+ * See the License for the specific language governing permissions and
2251
+ * limitations under the License.
2252
+ *)
2253
+
2254
+ @firebase/firestore/dist/index.esm2017.js:
2255
+ (**
2256
+ * @license
2257
+ * Copyright 2023 Google LLC
2258
+ *
2259
+ * Licensed under the Apache License, Version 2.0 (the "License");
2260
+ * you may not use this file except in compliance with the License.
2261
+ * You may obtain a copy of the License at
2262
+ *
2263
+ * http://www.apache.org/licenses/LICENSE-2.0
2264
+ *
2265
+ * Unless required by applicable law or agreed to in writing, software
2266
+ * distributed under the License is distributed on an "AS IS" BASIS,
2267
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2268
+ * See the License for the specific language governing permissions and
2269
+ * limitations under the License.
2270
+ *)
2271
+
2272
+ @firebase/firestore/dist/index.esm2017.js:
2273
+ (**
2274
+ * @license
2275
+ * Copyright 2017 Google LLC
2276
+ *
2277
+ * Licensed under the Apache License, Version 2.0 (the "License");
2278
+ * you may not use this file except in compliance with the License.
2279
+ * You may obtain a copy of the License at
2280
+ *
2281
+ * http://www.apache.org/licenses/LICENSE-2.0
2282
+ *
2283
+ * Unless required by applicable law or agreed to in writing, software
2284
+ * distributed under the License is distributed on an "AS IS" BASIS,
2285
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2286
+ * See the License for the specific language governing permissions and
2287
+ * limitations under the License.
2288
+ *)
2289
+
2290
+ @firebase/firestore/dist/index.esm2017.js:
2291
+ (**
2292
+ * @license
2293
+ * Copyright 2023 Google LLC
2294
+ *
2295
+ * Licensed under the Apache License, Version 2.0 (the "License");
2296
+ * you may not use this file except in compliance with the License.
2297
+ * You may obtain a copy of the License at
2298
+ *
2299
+ * http://www.apache.org/licenses/LICENSE-2.0
2300
+ *
2301
+ * Unless required by applicable law or agreed to in writing, software
2302
+ * distributed under the License is distributed on an "AS IS" BASIS,
2303
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2304
+ * See the License for the specific language governing permissions and
2305
+ * limitations under the License.
2306
+ *)
14
2307
  */