PageSourceSearch

https://thelearningcenter-app.web.app/_nuxt/D-PUlpRb.js

js thelearningcenter-app.web.app collected 2026-10-03 12:37:44 UTC 945,637 bytes, 4,227 lines download raw bytes

1const __vite__fileDeps=["./BDQ9MDMk.js","./IGDAv620.js","./CQL_qRXx.js","./BZ4uzxOu.js","./XGy33eLM.js","./C-d76r6v.js","./DZH49GZo.js","./D8zloTqS.js","./BbyXTb7X.js","./B5Dh89Tr.js","./Cw2NMzM6.js","./CVJFRJPe.js","./Bsqh1IXA.js","./gzV5SUTf.js","./DUvfemQh.js","./BJ0UOYXk.js","./D_fjAe7V.js","./P6Mu1pSG.js","./DBNSq6wU.js","./BGORVvuQ.js","./PGSAeBI8.js","./EOzdEtZU.js","./Pl_vxqg_.js","./BXLlCAmL.js","./B37MJ9Md.js","./DeKASEA5.js","./CcAfxCLL.js","./Ci32Ihc2.js","./DTDnu9VJ.js","./BVNPJpXp.js","./BNAqP0kv.js","./NYtO84mS.js","./BLxBQuXe.js","./C0BYo4J-.js","./DlAUqK2U.js","./CSaVrPWc.js","./BsiNkyqf.js","./CB2Ns7fe.js","./7yUaO9v7.js","./Csr1pvSm.js","./Profile.D27ZLbL6.css","./B3I24IwX.js","./KIyAdPUI.js","./LHrwe12K.js","./DL1hy_kD.js","./4nK3gmyB.js","./CKz5okDk.js","./CQgqbv0S.js","./EmailPreview.CKpSVOqw.css","./BrPgzZLZ.js","./Z3OPhpND.js","./B5lT-vuo.js","./UMyYZUVs.js","./index.B61Efq60.css","./D7_mnvlw.js","./yKXTsfaC.js","./DRbUCTrV.js","./Doe8BYIp.js","./Bx-xPH1L.js","./DEKjwazq.js","./wE_gxS-Z.js","./BhTNMIup.js","./DSg03o7I.js","./CYXVOzso.js","./DCdiYwWB.js","./HP7T1YQF.js","./B0XXjqWF.js","./DgNHZTT8.js","./BbafVSPm.js","./BvZDmPEq.js","./B6fcvw1n.js","./CTxAERh2.js","./index.B3vwzvAa.css","./L4d6X9Q8.js","./CyTO1fhC.js","./DMd4P3Gc.js","./C9ubPts8.js","./BtRBtJJV.js","./D5ub4s54.js","./BbqxCBGY.js","./CBNzdYqW.js","./index.BkUA3it5.css","./DhtPLRlh.js","./CZ4G7yO5.js","./8iod1lvZ.js","./DaogXtOx.js","./DFMOy7WO.js","./CgH9RGFj.js","./BYIhP7gr.js","./Dash.C6LMqSIw.css","./D7a9ptfT.js","./vP2_zCIN.js","./AyckwrNf.js","./DX6i9xOy.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2/**
3* @vue/shared v3.5.34
4* (c) 2018-present Yuxi (Evan) You and Vue contributors
5* @license MIT
vendor: 20,863 bytes, lines 6-13
6**/function Ep(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Ge={},so=[],Ps=()=>{},Ww=()=>!1,Ic=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Su=t=>t.startsWith("onUpdate:"),ot=Object.assign,Sp=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},aA=Object.prototype.hasOwnProperty,Ne=(t,e)=>aA.call(t,e),re=Array.isArray,io=t=>Lo(t)==="[object Map]",Oo=t=>Lo(t)==="[object Set]",ly=t=>Lo(t)==="[object Date]",cA=t=>Lo(t)==="[object RegExp]",ue=t=>typeof t=="function",ze=t=>typeof t=="string",Gn=t=>typeof t=="symbol",Re=t=>t!==null&&typeof t=="object",Kw=t=>(Re(t)||ue(t))&&ue(t.then)&&ue(t.catch),zw=Object.prototype.toString,Lo=t=>zw.call(t),lA=t=>Lo(t).slice(8,-1),Jw=t=>Lo(t)==="[object Object]",Du=t=>ze(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,cr=Ep(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Au=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},uA=/-\w/g,Xt=Au(t=>t.replace(uA,e=>e.slice(1).toUpperCase())),dA=/\B([A-Z])/g,Cr=Au(t=>t.replace(dA,"-$1").toLowerCase()),Cu=Au(t=>t.charAt(0).toUpperCase()+t.slice(1)),Xd=Au(t=>t?`on${Cu(t)}`:""),bs=(t,e)=>!Object.is(t,e),ro=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},Yw=(t,e,n,s=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:n})},Pu=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Qw=t=>{const e=ze(t)?Number(t):NaN;return isNaN(e)?t:e};let uy;const Ru=()=>uy||(uy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Dp(t){if(re(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],i=ze(s)?mA(s):Dp(s);if(i)for(const r in i)e[r]=i[r]}return e}else if(ze(t)||Re(t))return t}const hA=/;(?![^(]*\))/g,fA=/:([^]+)/,pA=/\/\*[^]*?\*\//g;function mA(t){const e={};return t.replace(pA,"").split(hA).forEach(n=>{if(n){const s=n.split(fA);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function ku(t){let e="";if(ze(t))e=t;else if(re(t))for(let n=0;n<t.length;n++){const s=ku(t[n]);s&&(e+=s+" ")}else if(Re(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const gA="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",yA=Ep(gA);function Xw(t){return!!t||t===""}function _A(t,e){if(t.length!==e.length)return!1;let n=!0;for(let s=0;n&&s<t.length;s++)n=Fo(t[s],e[s]);return n}function Fo(t,e){if(t===e)return!0;let n=ly(t),s=ly(e);if(n||s)return n&&s?t.getTime()===e.getTime():!1;if(n=Gn(t),s=Gn(e),n||s)return t===e;if(n=re(t),s=re(e),n||s)return n&&s?_A(t,e):!1;if(n=Re(t),s=Re(e),n||s){if(!n||!s)return!1;const i=Object.keys(t).length,r=Object.keys(e).length;if(i!==r)return!1;for(const o in t){const a=t.hasOwnProperty(o),c=e.hasOwnProperty(o);if(a&&!c||!a&&c||!Fo(t[o],e[o]))return!1}}return String(t)===String(e)}function Ap(t,e){return t.findIndex(n=>Fo(n,e))}const Zw=t=>!!(t&&t.__v_isRef===!0),IA=t=>ze(t)?t:t==null?"":re(t)||Re(t)&&(t.toString===zw||!ue(t.toString))?Zw(t)?IA(t.value):JSON.stringify(t,ev,2):String(t),ev=(t,e)=>Zw(e)?ev(t,e.value):io(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,i],r)=>(n[Zd(s,r)+" =>"]=i,n),{})}:Oo(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Zd(n))}:Gn(e)?Zd(e):Re(e)&&!re(e)&&!Jw(e)?String(e):e,Zd=(t,e="")=>{var n;return Gn(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
7* @vue/reactivity v3.5.34
8* (c) 2018-present Yuxi (Evan) You and Vue contributors
9* @license MIT
10**/let mt;class tv{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&mt&&(mt.active?(this.parent=mt,this.index=(mt.scopes||(mt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=mt;try{return mt=this,e()}finally{mt=n}}}on(){++this._on===1&&(this.prevScope=mt,mt=this)}off(){if(this._on>0&&--this._on===0){if(mt===this)mt=this.prevScope;else{let e=mt;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Cp(t){return new tv(t)}function nv(){return mt}function wA(t,e=!1){mt&&mt.cleanups.push(t)}let je;const eh=new WeakSet;class sv{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,mt&&(mt.active?mt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,eh.has(this)&&(eh.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||rv(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dy(this),ov(this);const e=je,n=rs;je=this,rs=!0;try{return this.fn()}finally{av(this),je=e,rs=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)kp(e);this.deps=this.depsTail=void 0,dy(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?eh.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Zh(this)&&this.run()}get dirty(){return Zh(this)}}let iv=0,ya,_a;function rv(t,e=!1){if(t.flags|=8,e){t.next=_a,_a=t;return}t.next=ya,ya=t}function Pp(){iv++}function Rp(){if(--iv>0)return;if(_a){let e=_a;for(_a=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;ya;){let e=ya;for(ya=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=n}}if(t)throw t}function ov(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function av(t){let e,n=t.depsTail,s=n;for(;s;){const i=s.prevDep;s.version===-1?(s===n&&(n=i),kp(s),vA(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=i}t.deps=e,t.depsTail=n}function Zh(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(cv(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function cv(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Oa)||(t.globalVersion=Oa,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Zh(t))))return;t.flags|=2;const e=t.dep,n=je,s=rs;je=t,rs=!0;try{ov(t);const i=t.fn(t._value);(e.version===0||bs(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{je=n,rs=s,av(t),t.flags&=-3}}function kp(t,e=!1){const{dep:n,prevSub:s,nextSub:i}=t;if(s&&(s.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=s,t.nextSub=void 0),n.subs===t&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)kp(r,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function vA(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let rs=!0;const lv=[];function ni(){lv.push(rs),rs=!1}function si(){const t=lv.pop();rs=t===void 0?!0:t}function dy(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=je;je=void 0;try{e()}finally{je=n}}}let Oa=0;class TA{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Up{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!je||!rs||je===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==je)n=this.activeLink=new TA(je,this),je.deps?(n.prevDep=je.depsTail,je.depsTail.nextDep=n,je.depsTail=n):je.deps=je.depsTail=n,uv(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=je.depsTail,n.nextDep=void 0,je.depsTail.nextDep=n,je.depsTail=n,je.deps===n&&(je.deps=s)}return n}trigger(e){this.version++,Oa++,this.notify(e)}notify(e){Pp();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Rp()}}}function uv(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)uv(s)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Ul=new WeakMap,lr=Symbol(""),ef=Symbol(""),La=Symbol("");function Lt(t,e,n){if(rs&&je){let s=Ul.get(t);s||Ul.set(t,s=new Map);let i=s.get(n);i||(s.set(n,i=new Up),i.map=s,i.key=n),i.track()}}function $s(t,e,n,s,i,r){const o=Ul.get(t);if(!o){Oa++;return}const a=c=>{c&&c.trigger()};if(Pp(),e==="clear")o.forEach(a);else{const c=re(t),l=c&&Du(n);if(c&&n==="length"){const u=Number(s);o.forEach((d,h)=>{(h==="length"||h===La||!Gn(h)&&h>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),l&&a(o.get(La)),e){case"add":c?l&&a(o.get("length")):(a(o.get(lr)),io(t)&&a(o.get(ef)));break;case"delete":c||(a(o.get(lr)),io(t)&&a(o.get(ef)));break;case"set":io(t)&&a(o.get(lr));break}}Rp()}function bA(t,e){const n=Ul.get(t);return n&&n.get(e)}function jr(t){const e=Ee(t);return e===t?e:(Lt(e,"iterate",La),Ln(t)?e:e.map(ls))}function Uu(t){return Lt(t=Ee(t),"iterate",La),t}function Ts(t,e){return xs(t)?Io(os(t)?ls(e):e):ls(e)}const EA={__proto__:null,[Symbol.iterator](){return th(this,Symbol.iterator,t=>Ts(this,t))},concat(...t){return jr(this).concat(...t.map(e=>re(e)?jr(e):e))},entries(){return th(this,"entries",t=>(t[1]=Ts(this,t[1]),t))},every(t,e){return Vs(this,"every",t,e,void 0,arguments)},filter(t,e){return Vs(this,"filter",t,e,n=>n.map(s=>Ts(this,s)),arguments)},find(t,e){return Vs(this,"find",t,e,n=>Ts(this,n),arguments)},findIndex(t,e){return Vs(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Vs(this,"findLast",t,e,n=>Ts(this,n),arguments)},findLastIndex(t,e){return Vs(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Vs(this,"forEach",t,e,void 0,arguments)},includes(...t){return nh(this,"includes",t)},indexOf(...t){return nh(this,"indexOf",t)},join(t){return jr(this).join(t)},lastIndexOf(...t){return nh(this,"lastIndexOf",t)},map(t,e){return Vs(this,"map",t,e,void 0,arguments)},pop(){return Yo(this,"pop")},push(...t){return Yo(this,"push",t)},reduce(t,...e){return hy(this,"reduce",t,e)},reduceRight(t,...e){return hy(this,"reduceRight",t,e)},shift(){return Yo(this,"shift")},some(t,e){return Vs(this,"some",t,e,void 0,arguments)},splice(...t){return Yo(this,"splice",t)},toReversed(){return jr(this).toReversed()},toSorted(t){return jr(this).toSorted(t)},toSpliced(...t){return jr(this).toSpliced(...t)},unshift(...t){return Yo(this,"unshift",t)},values(){return th(this,"values",t=>Ts(this,t))}};function th(t,e,n){const s=Uu(t),i=s[e]();return s!==t&&!Ln(t)&&(i._next=i.next,i.next=()=>{const r=i._next();return r.done||(r.value=n(r.value)),r}),i}const SA=Array.prototype;function Vs(t,e,n,s,i,r){const o=Uu(t),a=o!==t&&!Ln(t),c=o[e];if(c!==SA[e]){const d=c.apply(t,r);return a?ls(d):d}let l=n;o!==t&&(a?l=function(d,h){return n.call(this,Ts(t,d),h,t)}:n.length>2&&(l=function(d,h){return n.call(this,d,h,t)}));const u=c.call(o,l,s);return a&&i?i(u):u}function hy(t,e,n,s){const i=Uu(t),r=i!==t&&!Ln(t);let o=n,a=!1;i!==t&&(r?(a=s.length===0,o=function(l,u,d){return a&&(a=!1,l=Ts(t,l)),n.call(this,l,Ts(t,u),d,t)}):n.length>3&&(o=function(l,u,d){return n.call(this,l,u,d,t)}));const c=i[e](o,...s);return a?Ts(t,c):c}function nh(t,e,n){const s=Ee(t);Lt(s,"iterate",La);const i=s[e](...n);return(i===-1||i===!1)&&Nu(n[0])?(n[0]=Ee(n[0]),s[e](...n)):i}function Yo(t,e,n=[]){ni(),Pp();const s=Ee(t)[e].apply(t,n);return Rp(),si(),s}const DA=Ep("__proto__,__v_isRef,__isVue"),dv=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Gn));function AA(t){Gn(t)||(t=String(t));const e=Ee(this);return Lt(e,"has",t),e.hasOwnProperty(t)}class hv{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){if(n==="__v_skip")return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(i?r?LA:gv:r?mv:pv).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=re(e);if(!i){let c;if(o&&(c=EA[n]))return c;if(n==="hasOwnProperty")return AA}const a=Reflect.get(e,n,Ze(e)?e:s);if((Gn(n)?dv.has(n):DA(n))||(i||Lt(e,"get",n),r))return a;if(Ze(a)){const c=o&&Du(n)?a:a.value;return i&&Re(c)?nf(c):c}return Re(a)?i?nf(a):Os(a):a}}class fv extends hv{constructor(e=!1){super(!1,e)}set(e,n,s,i){let r=e[n];const o=re(e)&&Du(n);if(!this._isShallow){const l=xs(r);if(!Ln(s)&&!xs(s)&&(r=Ee(r),s=Ee(s)),!o&&Ze(r)&&!Ze(s))return l||(r.value=s),!0}const a=o?Number(n)<e.length:Ne(e,n),c=Reflect.set(e,n,s,Ze(e)?e:i);return e===Ee(i)&&(a?bs(s,r)&&$s(e,"set",n,s):$s(e,"add",n,s)),c}deleteProperty(e,n){const s=Ne(e,n);e[n];const i=Reflect.deleteProperty(e,n);return i&&s&&$s(e,"delete",n,void 0),i}has(e,n){const s=Reflect.has(e,n);return(!Gn(n)||!dv.has(n))&&Lt(e,"has",n),s}ownKeys(e){return Lt(e,"iterate",re(e)?"length":lr),Reflect.ownKeys(e)}}class CA extends hv{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const PA=new fv,RA=new CA,kA=new fv(!0);const tf=t=>t,Jc=t=>Reflect.getPrototypeOf(t);function UA(t,e,n){return function(...s){const i=this.__v_raw,r=Ee(i),o=io(r),a=t==="entries"||t===Symbol.iterator&&o,c=t==="keys"&&o,l=i[t](...s),u=n?tf:e?Io:ls;return!e&&Lt(r,"iterate",c?ef:lr),ot(Object.create(l),{next(){const{value:d,done:h}=l.next();return h?{value:d,done:h}:{value:a?[u(d[0]),u(d[1])]:u(d),done:h}}})}}function Yc(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function NA(t,e){const n={get(i){const r=this.__v_raw,o=Ee(r),a=Ee(i);t||(bs(i,a)&&Lt(o,"get",i),Lt(o,"get",a));const{has:c}=Jc(o),l=e?tf:t?Io:ls;if(c.call(o,i))return l(r.get(i));if(c.call(o,a))return l(r.get(a));r!==o&&r.get(i)},get size(){const i=this.__v_raw;return!t&&Lt(Ee(i),"iterate",lr),i.size},has(i){const r=this.__v_raw,o=Ee(r),a=Ee(i);return t||(bs(i,a)&&Lt(o,"has",i),Lt(o,"has",a)),i===a?r.has(i):r.has(i)||r.has(a)},forEach(i,r){const o=this,a=o.__v_raw,c=Ee(a),l=e?tf:t?Io:ls;return!t&&Lt(c,"iterate",lr),a.forEach((u,d)=>i.call(r,l(u),l(d),o))}};return ot(n,t?{add:Yc("add"),set:Yc("set"),delete:Yc("delete"),clear:Yc("clear")}:{add(i){const r=Ee(this),o=Jc(r),a=Ee(i),c=!e&&!Ln(i)&&!xs(i)?a:i;return o.has.call(r,c)||bs(i,c)&&o.has.call(r,i)||bs(a,c)&&o.has.call(r,a)||(r.add(c),$s(r,"add",c,c)),this},set(i,r){!e&&!Ln(r)&&!xs(r)&&(r=Ee(r));const o=Ee(this),{has:a,get:c}=Jc(o);let l=a.call(o,i);l||(i=Ee(i),l=a.call(o,i));const u=c.call(o,i);return o.set(i,r),l?bs(r,u)&&$s(o,"set",i,r):$s(o,"add",i,r),this},delete(i){const r=Ee(this),{has:o,get:a}=Jc(r);let c=o.call(r,i);c||(i=Ee(i),c=o.call(r,i)),a&&a.call(r,i);const l=r.delete(i);return c&&$s(r,"delete",i,void 0),l},clear(){const i=Ee(this),r=i.size!==0,o=i.clear();return r&&$s(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=UA(i,t,e)}),n}function Np(t,e){const n=NA(t,e);return(s,i,r)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?s:Reflect.get(Ne(n,i)&&i in s?n:s,i,r)}const xA={get:Np(!1,!1)},MA={get:Np(!1,!0)},OA={get:Np(!0,!1)};const pv=new WeakMap,mv=new WeakMap,gv=new WeakMap,LA=new WeakMap;function FA(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function VA(t){return t.__v_skip||!Object.isExtensible(t)?0:FA(lA(t))}function Os(t){return xs(t)?t:xp(t,!1,PA,xA,pv)}function wc(t){return xp(t,!1,kA,MA,mv)}function nf(t){return xp(t,!0,RA,OA,gv)}function xp(t,e,n,s,i){if(!Re(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const r=VA(t);if(r===0)return t;const o=i.get(t);if(o)return o;const a=new Proxy(t,r===2?s:n);return i.set(t,a),a}function os(t){return xs(t)?os(t.__v_raw):!!(t&&t.__v_isReactive)}function xs(t){return!!(t&&t.__v_isReadonly)}function Ln(t){return!!(t&&t.__v_isShallow)}function Nu(t){return t?!!t.__v_raw:!1}function Ee(t){const e=t&&t.__v_raw;return e?Ee(e):t}function Mp(t){return!Ne(t,"__v_skip")&&Object.isExtensible(t)&&Yw(t,"__v_skip",!0),t}const ls=t=>Re(t)?Os(t):t,Io=t=>Re(t)?nf(t):t;function Ze(t){return t?t.__v_isRef===!0:!1}function _t(t){return yv(t,!1)}function Fa(t){return yv(t,!0)}function yv(t,e){return Ze(t)?t:new qA(t,e)}class qA{constructor(e,n){this.dep=new Up,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Ee(e),this._value=n?e:ls(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,s=this.__v_isShallow||Ln(e)||xs(e);e=s?e:Ee(e),bs(e,n)&&(this._rawValue=e,this._value=s?e:ls(e),this.dep.trigger())}}function st(t){return Ze(t)?t.value:t}const GA={get:(t,e,n)=>e==="__v_raw"?t:st(Reflect.get(t,e,n)),set:(t,e,n,s)=>{const i=t[e];return Ze(i)&&!Ze(n)?(i.value=n,!0):Reflect.set(t,e,n,s)}};function _v(t){return os(t)?t:new Proxy(t,GA)}function BA(t){const e=re(t)?new Array(t.length):{};for(const n in t)e[n]=wv(t,n);return e}class jA{constructor(e,n,s){this._object=e,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Gn(n)?n:String(n),this._raw=Ee(e);let i=!0,r=e;if(!re(e)||Gn(this._key)||!Du(this._key))do i=!Nu(r)||Ln(r);while(i&&(r=r.__v_raw));this._shallow=i}get value(){let e=this._object[this._key];return this._shallow&&(e=st(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Ze(this._raw[this._key])){const n=this._object[this._key];if(Ze(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return bA(this._raw,this._key)}}class $A{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Iv(t,e,n){return Ze(t)?t:ue(t)?new $A(t):Re(t)&&arguments.length>1?wv(t,e,n):_t(t)}function wv(t,e,n){return new jA(t,e,n)}class HA{constructor(e,n,s){this.fn=e,this.setter=n,this._value=void 0,this.dep=new Up(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Oa-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&je!==this)return rv(this,!0),!0}get value(){const e=this.dep.track();return cv(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function WA(t,e,n=!1){let s,i;return ue(t)?s=t:(s=t.get,i=t.set),new HA(s,i,n)}const Qc={},Nl=new WeakMap;let Zi;function KA(t,e=!1,n=Zi){if(n){let s=Nl.get(n);s||Nl.set(n,s=[]),s.push(t)}}function zA(t,e,n=Ge){const{immediate:s,deep:i,once:r,scheduler:o,augmentJob:a,call:c}=n,l=_=>i?_:Ln(_)||i===!1||i===0?Hs(_,1):Hs(_);let u,d,h,f,m=!1,v=!1;if(Ze(t)?(d=()=>t.value,m=Ln(t)):os(t)?(d=()=>l(t),m=!0):re(t)?(v=!0,m=t.some(_=>os(_)||Ln(_)),d=()=>t.map(_=>{if(Ze(_))return _.value;if(os(_))return l(_);if(ue(_))return c?c(_,2):_()})):ue(t)?e?d=c?()=>c(t,2):t:d=()=>{if(h){ni();try{h()}finally{si()}}const _=Zi;Zi=u;try{return c?c(t,3,[f]):t(f)}finally{Zi=_}}:d=Ps,e&&i){const _=d,S=i===!0?1/0:i;d=()=>Hs(_(),S)}const b=nv(),D=()=>{u.stop(),b&&b.active&&Sp(b.effects,u)};if(r&&e){const _=e;e=(...S)=>{_(...S),D()}}let w=v?new Array(t.length).fill(Qc):Qc;const y=_=>{if(!(!(u.flags&1)||!u.dirty&&!_))if(e){const S=u.run();if(i||m||(v?S.some((P,x)=>bs(P,w[x])):bs(S,w))){h&&h();const P=Zi;Zi=u;try{const x=[S,w===Qc?void 0:v&&w[0]===Qc?[]:w,f];w=S,c?c(e,3,x):e(...x)}finally{Zi=P}}}else u.run()};return a&&a(y),u=new sv(d),u.scheduler=o?()=>o(y,!1):y,f=_=>KA(_,!1,u),h=u.onStop=()=>{const _=Nl.get(u);if(_){if(c)c(_,4);else for(const S of _)S();Nl.delete(u)}},e?s?y(!0):w=u.run():o?o(y.bind(null,!0),!0):u.run(),D.pause=u.pause.bind(u),D.resume=u.resume.bind(u),D.stop=D,D}function Hs(t,e=1/0,n){if(e<=0||!Re(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Ze(t))Hs(t.value,e,n);else if(re(t))for(let s=0;s<t.length;s++)Hs(t[s],e,n);else if(Oo(t)||io(t))t.forEach(s=>{Hs(s,e,n)});else if(Jw(t)){for(const s in t)Hs(t[s],e,n);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&Hs(t[s],e,n)}return t}/**
11* @vue/runtime-core v3.5.34
12* (c) 2018-present Yuxi (Evan) You and Vue contributors
13* @license MIT
14**/function vc(t,e,n,s){try{return s?t(...s):t()}catch(i){Tc(i,e,n)}}function us(t,e,n,s){if(ue(t)){const i=vc(t,e,n,s);return i&&Kw(i)&&i.catch(r=>{Tc(r,e,n)}),i}if(re(t)){const i=[];for(let r=0;r<t.length;r++)i.push(us(t[r],e,n,s));return i}}function Tc(t,e,n,s=!0){const i=e?e.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||Ge;if(e){let a=e.parent;const c=e.proxy,l=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](t,c,l)===!1)return}a=a.parent}if(r){ni(),vc(r,null,10,[t,c,l]),si();return}}JA(t,n,i,s,o)}function JA(t,e,n,s=!0,i=!1){if(i)throw t;console.error(t)}const Jt=[];let Is=-1;const oo=[];let wi=null,Jr=0;const vv=Promise.resolve();let xl=null;function ui(t){const e=xl||vv;return t?e.then(this?t.bind(this):t):e}function YA(t){let e=Is+1,n=Jt.length;for(;e<n;){const s=e+n>>>1,i=Jt[s],r=Va(i);r<t||r===t&&i.flags&2?e=s+1:n=s}return e}function Op(t){if(!(t.flags&1)){const e=Va(t),n=Jt[Jt.length-1];!n||!(t.flags&2)&&e>=Va(n)?Jt.push(t):Jt.splice(YA(e),0,t),t.flags|=1,Tv()}}function Tv(){xl||(xl=vv.then(bv))}function sf(t){re(t)?oo.push(...t):wi&&t.id===-1?wi.splice(Jr+1,0,t):t.flags&1||(oo.push(t),t.flags|=1),Tv()}function fy(t,e,n=Is+1){for(;n<Jt.length;n++){const s=Jt[n];if(s&&s.flags&2){if(t&&s.id!==t.uid)continue;Jt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Ml(t){if(oo.length){const e=[...new Set(oo)].sort((n,s)=>Va(n)-Va(s));if(oo.length=0,wi){wi.push(...e);return}for(wi=e,Jr=0;Jr<wi.length;Jr++){const n=wi[Jr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}wi=null,Jr=0}}const Va=t=>t.id==null?t.flags&2?-1:1/0:t.id;function bv(t){try{for(Is=0;Is<Jt.length;Is++){const e=Jt[Is];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),vc(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Is<Jt.length;Is++){const e=Jt[Is];e&&(e.flags&=-2)}Is=-1,Jt.length=0,Ml(),xl=null,(Jt.length||oo.length)&&bv()}}let Pt=null,Ev=null;function Ol(t){const e=Pt;return Pt=t,Ev=t&&t.type.__scopeId||null,e}function Lp(t,e=Pt,n){if(!e||t._n)return t;const s=(...i)=>{s._d&&Gl(-1);const r=Ol(e);let o;try{o=t(...i)}finally{Ol(r),s._d&&Gl(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function S$(t,e){if(Pt===null)return t;const n=qu(Pt),s=t.dirs||(t.dirs=[]);for(let i=0;i<e.length;i++){let[r,o,a,c=Ge]=e[i];r&&(ue(r)&&(r={mounted:r,updated:r}),r.deep&&Hs(o),s.push({dir:r,instance:n,value:o,oldValue:void 0,arg:a,modifiers:c}))}return t}function ws(t,e,n,s){const i=t.dirs,r=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];r&&(a.oldValue=r[o].value);let c=a.dir[s];c&&(ni(),us(c,n,8,[t.el,a,t,e]),si())}}function ur(t,e){if(Vt){let n=Vt.provides;const s=Vt.parent&&Vt.parent.provides;s===n&&(n=Vt.provides=Object.create(s)),n[t]=e}}function Gt(t,e,n=!1){const s=Vo();if(s||dr){let i=dr?dr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(i&&t in i)return i[t];if(arguments.length>1)return n&&ue(e)?e.call(s&&s.proxy):e}}function Fp(){return!!(Vo()||dr)}const QA=Symbol.for("v-scx"),XA=()=>Gt(QA);function ZA(t,e){return Vp(t,null,e)}function Ui(t,e,n){return Vp(t,e,n)}function Vp(t,e,n=Ge){const{immediate:s,deep:i,flush:r,once:o}=n,a=ot({},n),c=e&&s||!e&&r!=="post";let l;if(Ga){if(r==="sync"){const f=XA();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!c){const f=()=>{};return f.stop=Ps,f.resume=Ps,f.pause=Ps,f}}const u=Vt;a.call=(f,m,v)=>us(f,u,m,v);let d=!1;r==="post"?a.scheduler=f=>{gt(f,u&&u.suspense)}:r!=="sync"&&(d=!0,a.scheduler=(f,m)=>{m?f():Op(f)}),a.augmentJob=f=>{e&&(f.flags|=4),d&&(f.flags|=2,u&&(f.id=u.uid,f.i=u))};const h=zA(t,e,a);return Ga&&(l?l.push(h):c&&h()),h}function eC(t,e,n){const s=this.proxy,i=ze(t)?t.includes(".")?Sv(s,t):()=>s[t]:t.bind(s,s);let r;ue(e)?r=e:(r=e.handler,n=e);const o=bc(this),a=Vp(i,r.bind(s),n);return o(),a}function Sv(t,e){const n=e.split(".");return()=>{let s=t;for(let i=0;i<n.length&&s;i++)s=s[n[i]];return s}}const tC=Symbol("_vte"),Dv=t=>t.__isTeleport,vs=Symbol("_leaveCb"),Qo=Symbol("_enterCb");function nC(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leav
14ingVNodes:new Map};return Ou(()=>{t.isMounted=!0}),Lu(()=>{t.isUnmounting=!0}),t}const Kn=[Function,Array],Av={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Kn,onEnter:Kn,onAfterEnter:Kn,onEnterCancelled:Kn,onBeforeLeave:Kn,onLeave:Kn,onAfterLeave:Kn,onLeaveCancelled:Kn,onBeforeAppear:Kn,onAppear:Kn,onAfterAppear:Kn,onAppearCancelled:Kn},Cv=t=>{const e=t.subTree;return e.component?Cv(e.component):e},sC={name:"BaseTransition",props:Av,setup(t,{slots:e}){const n=Vo(),s=nC();return()=>{const i=e.default&&kv(e.default(),!0),r=i&&i.length?Pv(i):n.subTree?QC():void 0;if(!r)return;const o=Ee(t),{mode:a}=o;if(s.isLeaving)return sh(r);const c=py(r);if(!c)return sh(r);let l=rf(c,o,s,n,d=>l=d);c.type!==ht&&wo(c,l);let u=n.subTree&&py(n.subTree);if(u&&u.type!==ht&&!is(u,c)&&Cv(n).type!==ht){let d=rf(u,o,s,n);if(wo(u,d),a==="out-in"&&c.type!==ht)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},sh(r);a==="in-out"&&c.type!==ht?d.delayLeave=(h,f,m)=>{const v=Rv(s,u);v[String(u.key)]=u,h[vs]=()=>{f(),h[vs]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{m(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function Pv(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==ht){e=n;break}}return e}const iC=sC;function Rv(t,e){const{leavingVNodes:n}=t;let s=n.get(e.type);return s||(s=Object.create(null),n.set(e.type,s)),s}function rf(t,e,n,s,i){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:f,onAfterLeave:m,onLeaveCancelled:v,onBeforeAppear:b,onAppear:D,onAfterAppear:w,onAppearCancelled:y}=e,_=String(t.key),S=Rv(n,t),P=(C,N)=>{C&&us(C,s,9,N)},x=(C,N)=>{const X=N[1];P(C,N),re(C)?C.every(O=>O.length<=1)&&X():C.length<=1&&X()},M={mode:o,persisted:a,beforeEnter(C){let N=c;if(!n.isMounted)if(r)N=b||c;else return;C[vs]&&C[vs](!0);const X=S[_];X&&is(t,X)&&X.el[vs]&&X.el[vs](),P(N,[C])},enter(C){if(S[_]===t)return;let N=l,X=u,O=d;if(!n.isMounted)if(r)N=D||l,X=w||u,O=y||d;else return;let ne=!1;C[Qo]=Te=>{ne||(ne=!0,Te?P(O,[C]):P(X,[C]),M.delayedLeave&&M.delayedLeave(),C[Qo]=void 0)};const _e=C[Qo].bind(null,!1);N?x(N,[C,_e]):_e()},leave(C,N){const X=String(t.key);if(C[Qo]&&C[Qo](!0),n.isUnmounting)return N();P(h,[C]);let O=!1;C[vs]=_e=>{O||(O=!0,N(),_e?P(v,[C]):P(m,[C]),C[vs]=void 0,S[X]===t&&delete S[X])};const ne=C[vs].bind(null,!1);S[X]=t,f?x(f,[C,ne]):ne()},clone(C){const N=rf(C,e,n,s,i);return i&&i(N),N}};return M}function sh(t){if(xu(t))return t=ii(t),t.children=null,t}function py(t){if(!xu(t))return Dv(t.type)&&t.children?Pv(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&ue(n.default))return n.default()}}function wo(t,e){t.shapeFlag&6&&t.component?(t.transition=e,wo(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function kv(t,e=!1,n){let s=[],i=0;for(let r=0;r<t.length;r++){let o=t[r];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:r);o.type===Yt?(o.patchFlag&128&&i++,s=s.concat(kv(o.children,e,a))):(e||o.type!==ht)&&s.push(a!=null?ii(o,{key:a}):o)}if(i>1)for(let r=0;r<s.length;r++)s[r].patchFlag=-2;return s}function di(t,e){return ue(t)?ot({name:t.name},e,{setup:t}):t}function Uv(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function my(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const Ll=new WeakMap;function ao(t,e,n,s,i=!1){if(re(t)){t.forEach((v,b)=>ao(v,e&&(re(e)?e[b]:e),n,s,i));return}if(Qs(s)&&!i){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ao(t,e,n,s.component.subTree);return}const r=s.shapeFlag&4?qu(s.component):s.el,o=i?null:r,{i:a,r:c}=t,l=e&&e.r,u=a.refs===Ge?a.refs={}:a.refs,d=a.setupState,h=Ee(d),f=d===Ge?Ww:v=>my(u,v)?!1:Ne(h,v),m=(v,b)=>!(b&&my(u,b));if(l!=null&&l!==c){if(gy(e),ze(l))u[l]=null,f(l)&&(d[l]=null);else if(Ze(l)){const v=e;m(l,v.k)&&(l.value=null),v.k&&(u[v.k]=null)}}if(ue(c))vc(c,a,12,[o,u]);else{const v=ze(c),b=Ze(c);if(v||b){const D=()=>
vendor: 5,069 bytes, lines 14-16
14{if(t.f){const w=v?f(c)?d[c]:u[c]:m()||!t.k?c.value:u[t.k];if(i)re(w)&&Sp(w,r);else if(re(w))w.includes(r)||w.push(r);else if(v)u[c]=[r],f(c)&&(d[c]=u[c]);else{const y=[r];m(c,t.k)&&(c.value=y),t.k&&(u[t.k]=y)}}else v?(u[c]=o,f(c)&&(d[c]=o)):b&&(m(c,t.k)&&(c.value=o),t.k&&(u[t.k]=o))};if(o){const w=()=>{D(),Ll.delete(t)};w.id=-1,Ll.set(t,w),gt(w,n)}else gy(t),D()}}}function gy(t){const e=Ll.get(t);e&&(e.flags|=8,Ll.delete(t))}let yy=!1;const $r=()=>{yy||(console.error("Hydration completed but contains mismatches."),yy=!0)},rC=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",oC=t=>t.namespaceURI.includes("MathML"),Xc=t=>{if(t.nodeType===1){if(rC(t))return"svg";if(oC(t))return"mathml"}},Zc=t=>t.nodeType===8;function aC(t){const{mt:e,p:n,o:{patchProp:s,createText:i,nextSibling:r,parentNode:o,remove:a,insert:c,createComment:l}}=t,u=(y,_)=>{if(!_.hasChildNodes()){n(null,y,_),Ml(),_._vnode=y;return}d(_.firstChild,y,null,null,null),Ml(),_._vnode=y},d=(y,_,S,P,x,M=!1)=>{M=M||!!_.dynamicChildren;const C=Zc(y)&&y.data==="[",N=()=>v(y,_,S,P,x,C),{type:X,ref:O,shapeFlag:ne,patchFlag:_e}=_;let Te=y.nodeType;_.el=y,_e===-2&&(M=!1,_.dynamicChildren=null);let W=null;switch(X){case hr:Te!==3?_.children===""?(c(_.el=i(""),o(y),y),W=y):W=N():(y.data!==_.children&&($r(),y.data=_.children),W=r(y));break;case ht:w(y)?(W=r(y),D(_.el=y.content.firstChild,y,S)):Te!==8||C?W=N():W=r(y);break;case wa:if(C&&(y=r(y),Te=y.nodeType),Te===1||Te===3){W=y;const de=!_.children.length;for(let ee=0;ee<_.staticCount;ee++)de&&(_.children+=W.nodeType===1?W.outerHTML:W.data),ee===_.staticCount-1&&(_.anchor=W),W=r(W);return C?r(W):W}else N();break;case Yt:C?W=m(y,_,S,P,x,M):W=N();break;default:if(ne&1)(Te!==1||_.type.toLowerCase()!==y.tagName.toLowerCase())&&!w(y)?W=N():W=h(y,_,S,P,x,M);else if(ne&6){_.slotScopeIds=x;const de=o(y);if(C?W=b(y):Zc(y)&&y.data==="teleport start"?W=b(y,y.data,"teleport end"):W=r(y),e(_,de,null,S,P,Xc(de),M),Qs(_)&&!_.type.__asyncResolved){let ee;C?(ee=rt(Yt),ee.anchor=W?W.previousSibling:de.lastChild):ee=y.nodeType===3?hT(""):rt("div"),ee.el=y,_.component.subTree=ee}}else ne&64?Te!==8?W=N():W=_.type.hydrate(y,_,S,P,x,M,t,f):ne&128&&(W=_.type.hydrate(y,_,S,P,Xc(o(y)),x,M,t,d))}return O!=null&&ao(O,null,P,_),W},h=(y,_,S,P,x,M)=>{M=M||!!_.dynamicChildren;const{type:C,props:N,patchFlag:X,shapeFlag:O,dirs:ne,transition:_e}=_,Te=C==="input"||C==="option";if(Te||X!==-1){ne&&ws(_,null,S,"created");let W=!1;if(w(y)){W=nT(null,_e)&&S&&S.vnode.props&&S.vnode.props.appear;const ee=y.content.firstChild;if(W){const Me=ee.getAttribute("class");Me&&(ee.$cls=Me),_e.beforeEnter(ee)}D(ee,y,S),_.el=y=ee}if(O&16&&!(N&&(N.innerHTML||N.textContent))){let ee=f(y.firstChild,_,y,S,P,x,M);for(;ee;){el(y,1)||$r();const Me=ee;ee=ee.nextSibling,a(Me)}}else if(O&8){let ee=_.children;ee[0]===`
15`&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(ee=ee.slice(1));const{textContent:Me}=y;Me!==ee&&Me!==ee.replace(/\r\n|\r/g,`
16`)&&(el(y,0)||$r(),y.textContent=_.children)}if(N){if(Te||!M||X&48){const ee=y.tagName.includes("-");for(const Me in N)(Te&&(Me.endsWith("value")||Me==="indeterminate")||Ic(Me)&&!cr(Me)||Me[0]==="."||ee&&!cr(Me))&&s(y,Me,null,N[Me],void 0,S)}else if(N.onClick)s(y,"onClick",null,N.onClick,void 0,S);else if(X&4&&os(N.style))for(const ee in N.style)N.style[ee]}let de;(de=N&&N.onVnodeBeforeMount)&&nn(de,S,_),ne&&ws(_,null,S,"beforeMount"),((de=N&&N.onVnodeMounted)||ne||W)&&aT(()=>{de&&nn(de,S,_),W&&_e.enter(y),ne&&ws(_,null,S,"mounted")},P)}return y.nextSibling},f=(y,_,S,P,x,M,C)=>{C=C||!!_.dynamicChildren;const N=_.children,X=N.length;for(let O=0;O<X;O++){const ne=C?N[O]:N[O]=Nn(N[O]),_e=ne.type===hr;y?(_e&&!C&&O+1<X&&Nn(N[O+1]).type===hr&&(c(i(y.data.slice(ne.children.length)),S,r(y)),y.data=ne.children),y=d(y,ne,P,x,M,C)):_e&&!ne.children?c(ne.el=i(""),S):(el(S,1)||$r(),n(null,ne,S,null,P,x,Xc(S),M))}return y},m=(y,_,S,P,x,M)=>{const{slotScopeIds:C}=_;C&&(x=x?x.concat(C):C);const N=o(y),X=f(r(y),_,N,S,P,x,M);return X&&Zc(X)&&X.data==="]"?r(_.anchor=X):($r(),c(_.anchor=l("]"),N,X),X)},v=(y,_,S,P,x,M)=>{if(el(y.parentElement,1)||$r(),_.el=null,M){const X=b(y);for(;;){const O=r(y);if(O&&O!==X)a(O);else break}}const C=r(y),N=o(y);return a(y),n(null,_,N,C,S,P,Xc(N),x),S&&(S.vnode.el=_.el,Vu(S,_.el)),C},b=(y,_="[",S="]")=>{let P=0;for(;y;)if(y=r(y),y&&Zc(y)&&(y.data===_&&P++,y.data===S)){if(P===0)return r(y);P--}return y},D=(y,_,S)=>{const P=_.parentNode;P&&P.replaceChild(y,_);let x=S;for(;x;)x.vnode.el===_&&(x.vnode.el=x.subTree.el=y),x=x.parent},w=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[u,d]}const _y="data-allow-mismatch",cC={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function el(t,e){if(e===0||e===1)for(;t&&!t.hasAttribute(_y);)t=t.parentElement;const n=t&&t.getAttribute(_y);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return e===0&&s.includes("children")?!0:s.includes(cC[e])}}Ru().requestIdleCallback;Ru().cancelIdleCallback;const Qs=t=>!!t.type.__asyncLoader,xu=t=>t.type.__isKeepAlive,lC={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array
vendor: 3,110 bytes, line 16
16],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const n=Vo(),s=n.ctx;if(!s.renderer)return()=>{const w=e.default&&e.default();return w&&w.length===1?w[0]:w};const i=new Map,r=new Set;let o=null;const a=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=s,h=d("div");s.activate=(w,y,_,S,P)=>{const x=w.component;l(w,y,_,0,a),c(x.vnode,w,y,_,x,a,S,w.slotScopeIds,P),gt(()=>{x.isDeactivated=!1,x.a&&ro(x.a);const M=w.props&&w.props.onVnodeMounted;M&&nn(M,x.parent,w)},a)},s.deactivate=w=>{const y=w.component;Vl(y.m),Vl(y.a),l(w,h,null,1,a),gt(()=>{y.da&&ro(y.da);const _=w.props&&w.props.onVnodeUnmounted;_&&nn(_,y.parent,w),y.isDeactivated=!0},a)};function f(w){ih(w),u(w,n,a,!0)}function m(w){i.forEach((y,_)=>{const S=pf(Qs(y)?y.type.__asyncResolved||{}:y.type);S&&!w(S)&&v(_)})}function v(w){const y=i.get(w);y&&(!o||!is(y,o))?f(y):o&&ih(o),i.delete(w),r.delete(w)}Ui(()=>[t.include,t.exclude],([w,y])=>{w&&m(_=>ra(w,_)),y&&m(_=>!ra(y,_))},{flush:"post",deep:!0});let b=null;const D=()=>{b!=null&&(ql(n.subTree.type)?gt(()=>{i.set(b,tl(n.subTree))},n.subTree.suspense):i.set(b,tl(n.subTree)))};return Ou(D),Ov(D),Lu(()=>{i.forEach(w=>{const{subTree:y,suspense:_}=n,S=tl(y);if(w.type===S.type&&w.key===S.key){ih(S);const P=S.component.da;P&&gt(P,_);return}f(w)})}),()=>{if(b=null,!e.default)return o=null;const w=e.default(),y=w[0];if(w.length>1)return o=null,w;if(!gr(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return o=null,y;let _=tl(y);if(_.type===ht)return o=null,_;const S=_.type,P=pf(Qs(_)?_.type.__asyncResolved||{}:S),{include:x,exclude:M,max:C}=t;if(x&&(!P||!ra(x,P))||M&&P&&ra(M,P))return _.shapeFlag&=-257,o=_,y;const N=_.key==null?S:_.key,X=i.get(N);return _.el&&(_=ii(_),y.shapeFlag&128&&(y.ssContent=_)),b=N,X?(_.el=X.el,_.component=X.component,_.transition&&wo(_,_.transition),_.shapeFlag|=512,r.delete(N),r.add(N)):(r.add(N),C&&r.size>parseInt(C,10)&&v(r.values().next().value)),_.shapeFlag|=256,o=_,ql(y.type)?y:_}}},uC=lC;function ra(t,e){return re(t)?t.some(n=>ra(n,e)):ze(t)?t.split(",").includes(e):cA(t)?(t.lastIndex=0,t.test(e)):!1}function Nv(t,e){Mv(t,"a",e)}function xv(t,e){Mv(t,"da",e)}function Mv(t,e,n=Vt){const s=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(Mu(e,s,n),n){let i=n.parent;for(;i&&i.parent;)xu(i.parent.vnode)&&dC(s,e,n,i),i=i.parent}}function dC(t,e,n,s){const i=Mu(e,t,s,!0);Lv(()=>{Sp(s[e],i)},n)}function ih(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function tl(t){return t.shapeFlag&128?t.ssContent:t}function Mu(t,e,n=Vt,s=!1){if(n){const i=n[t]||(n[t]=[]),r=e.__weh||(e.__weh=(...o)=>{ni();const a=bc(n),c=us(e,n,t,o);return a(),si(),c});return s?i.unshift(r):i.push(r),r}}const hi=t=>(e,n=Vt)=>{(!Ga||t==="sp")&&Mu(t,(...s)=>e(...s),n)},hC=hi("bm"),Ou=hi("m"),fC=hi("bu"),Ov=hi("u"),Lu=hi("bum"),Lv=hi("um"),pC=hi("sp"),mC=hi("rtg"),gC=hi("rtc");function Fv(t,e=Vt){Mu("ec",t,e)}const Vv="components";function D$(t,e){return Gv(Vv,t,!0,e)||t}const qv=Symbol.for("v-ndc");function yC(t){return ze(t)?Gv(Vv,t,!1)||t:t||qv}function Gv(t,e,n=!0,s=!1){const i=Pt||Vt;if(i){const r=i.type;
vendor: 4,113 bytes, line 16
16{const a=pf(r,!1);if(a&&(a===e||a===Xt(e)||a===Cu(Xt(e))))return r}const o=Iy(i[t]||r[t],e)||Iy(i.appContext[t],e);return!o&&s?r:o}}function Iy(t,e){return t&&(t[e]||t[Xt(e)]||t[Cu(Xt(e))])}function A$(t,e,n,s){let i;const r=n,o=re(t);if(o||ze(t)){const a=o&&os(t);let c=!1,l=!1;a&&(c=!Ln(t),l=xs(t),t=Uu(t)),i=new Array(t.length);for(let u=0,d=t.length;u<d;u++)i[u]=e(c?l?Io(ls(t[u])):ls(t[u]):t[u],u,void 0,r)}else if(typeof t=="number"){i=new Array(t);for(let a=0;a<t;a++)i[a]=e(a+1,a,void 0,r)}else if(Re(t))if(t[Symbol.iterator])i=Array.from(t,(a,c)=>e(a,c,void 0,r));else{const a=Object.keys(t);i=new Array(a.length);for(let c=0,l=a.length;c<l;c++){const u=a[c];i[c]=e(t[u],u,c,r)}}else i=[];return i}function C$(t,e,n={},s,i){if(Pt.ce||Pt.parent&&Qs(Pt.parent)&&Pt.parent.ce){const l=Object.keys(n).length>0;return ss(),Ti(Yt,null,[rt("slot",n,s)],l?-2:64)}let r=t[e];r&&r._c&&(r._d=!1),ss();const o=r&&Bv(r(n)),a=n.key||o&&o.key,c=Ti(Yt,{key:(a&&!Gn(a)?a:`_${e}`)+(!o&&s?"_fb":"")},o||[],o&&t._===1?64:-2);return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),r&&r._c&&(r._d=!0),c}function Bv(t){return t.some(e=>gr(e)?!(e.type===ht||e.type===Yt&&!Bv(e.children)):!0)?t:null}const of=t=>t?pT(t)?qu(t):of(t.parent):null,Ia=ot(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>of(t.parent),$root:t=>of(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>qp(t),$forceUpdate:t=>t.f||(t.f=()=>{Op(t.update)}),$nextTick:t=>t.n||(t.n=ui.bind(t.proxy)),$watch:t=>eC.bind(t)}),rh=(t,e)=>t!==Ge&&!t.__isScriptSetup&&Ne(t,e),_C={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:s,data:i,props:r,accessCache:o,type:a,appContext:c}=t;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return s[e];case 2:return i[e];case 4:return n[e];case 3:return r[e]}else{if(rh(s,e))return o[e]=1,s[e];if(i!==Ge&&Ne(i,e))return o[e]=2,i[e];if(Ne(r,e))return o[e]=3,r[e];if(n!==Ge&&Ne(n,e))return o[e]=4,n[e];af&&(o[e]=0)}}const l=Ia[e];let u,d;if(l)return e==="$attrs"&&Lt(t.attrs,"get",""),l(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Ge&&Ne(n,e))return o[e]=4,n[e];if(d=c.config.globalProperties,Ne(d,e))return d[e]},set({_:t},e,n){const{data:s,setupState:i,ctx:r}=t;return rh(i,e)?(i[e]=n,!0):s!==Ge&&Ne(s,e)?(s[e]=n,!0):Ne(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(r[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:s,appContext:i,props:r,type:o}},a){let c;return!!(n[a]||t!==Ge&&a[0]!=="$"&&Ne(t,a)||rh(e,a)||Ne(r,a)||Ne(s,a)||Ne(Ia,a)||Ne(i.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Ne(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function wy(t){return re(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let af=!0;function IC(t){const e=qp(t),n=t.proxy,s=t.ctx;af=!1,e.beforeCreate&&vy(e.beforeCreate,t,"bc");const{data:i,computed:r,methods:o,watch:a,provide:c,inject:l,created:u,beforeMount:d,mounted:h,beforeUpdate:f,updated:m,activated:v,deactivated:b,beforeDestroy:D,beforeUnmount:w,destroyed:y,unmounted:_,render:S,renderTracked:P,renderTriggered:x,errorCaptured:M,serverPrefetch:C,expose:N,inheritAttrs:X,components:O,directives:ne,filters:_e}=e;if(l&&wC(l,s,null),o)for(const de in o){const ee=o[de];ue(ee)&&(s[de]=ee.bind(n))}if(i){const de=i.call(n,n);Re(de)&&(t.data=Os(de))}if(af=!0,r)for(const de in r){const ee=r[de],Me=ue(ee)?ee.bind(n,n):ue(ee.get)?ee.get.bind(n,n):Ps,mi=!ue(ee)&&ue(ee.set)?ee.set.bind(n):Ps,ys=xn({get:Me,set:mi});Object.defineProperty(s,de,{enumerable:!0,configurable:!0,get:()=>ys.value,set:tn=>ys.value=tn})}if(a)for(const de in a)jv(a[de],s,n,de);if(c){const de=ue(c)?c.call(n):c;Reflect.ownKeys(de).forEach(ee=>{ur(ee,de[ee])})}u&&vy(u,t,"c");function W(de,ee){re(ee)?ee.forEach(Me=>de(Me.bind(n))):ee&&de(ee.bind(n))}if(W(hC,d),W(Ou,h),W(fC,f),W(Ov,m),W(Nv,v),W(xv,b),W(Fv,M),W(gC,P),W(mC,x),W(Lu,w),W(Lv,_),W(pC,C),re(N))if(N.length){const de=t.exposed||(t.exposed={});N.forEach(ee=>{Object.defineProperty(de,ee,{get:()=>n[ee],set:Me=>n[ee]=Me,enumerable:!0})})}
vendor: 5,552 bytes, line 16
16else t.exposed||(t.exposed={});S&&t.render===Ps&&(t.render=S),X!=null&&(t.inheritAttrs=X),O&&(t.components=O),ne&&(t.directives=ne),C&&Uv(t)}function wC(t,e,n=Ps){re(t)&&(t=cf(t));for(const s in t){const i=t[s];let r;Re(i)?"default"in i?r=Gt(i.from||s,i.default,!0):r=Gt(i.from||s):r=Gt(i),Ze(r)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[s]=r}}function vy(t,e,n){us(re(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,n)}function jv(t,e,n,s){let i=s.includes(".")?Sv(n,s):()=>n[s];if(ze(t)){const r=e[t];ue(r)&&Ui(i,r)}else if(ue(t))Ui(i,t.bind(n));else if(Re(t))if(re(t))t.forEach(r=>jv(r,e,n,s));else{const r=ue(t.handler)?t.handler.bind(n):e[t.handler];ue(r)&&Ui(i,r,t)}}function qp(t){const e=t.type,{mixins:n,extends:s}=e,{mixins:i,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,a=r.get(e);let c;return a?c=a:!i.length&&!n&&!s?c=e:(c={},i.length&&i.forEach(l=>Fl(c,l,o,!0)),Fl(c,e,o)),Re(e)&&r.set(e,c),c}function Fl(t,e,n,s=!1){const{mixins:i,extends:r}=e;r&&Fl(t,r,n,!0),i&&i.forEach(o=>Fl(t,o,n,!0));for(const o in e)if(!(s&&o==="expose")){const a=vC[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const vC={data:Ty,props:by,emits:by,methods:oa,computed:oa,beforeCreate:Kt,created:Kt,beforeMount:Kt,mounted:Kt,beforeUpdate:Kt,updated:Kt,beforeDestroy:Kt,beforeUnmount:Kt,destroyed:Kt,unmounted:Kt,activated:Kt,deactivated:Kt,errorCaptured:Kt,serverPrefetch:Kt,components:oa,directives:oa,watch:bC,provide:Ty,inject:TC};function Ty(t,e){return e?t?function(){return ot(ue(t)?t.call(this,this):t,ue(e)?e.call(this,this):e)}:e:t}function TC(t,e){return oa(cf(t),cf(e))}function cf(t){if(re(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Kt(t,e){return t?[...new Set([].concat(t,e))]:e}function oa(t,e){return t?ot(Object.create(null),t,e):e}function by(t,e){return t?re(t)&&re(e)?[...new Set([...t,...e])]:ot(Object.create(null),wy(t),wy(e??{})):e}function bC(t,e){if(!t)return e;if(!e)return t;const n=ot(Object.create(null),t);for(const s in e)n[s]=Kt(t[s],e[s]);return n}function $v(){return{app:null,config:{isNativeTag:Ww,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let EC=0;function SC(t,e){return function(s,i=null){ue(s)||(s=ot({},s)),i!=null&&!Re(i)&&(i=null);const r=$v(),o=new WeakSet,a=[];let c=!1;const l=r.app={_uid:EC++,_component:s,_props:i,_container:null,_context:r,_instance:null,version:gT,get config(){return r.config},set config(u){},use(u,...d){return o.has(u)||(u&&ue(u.install)?(o.add(u),u.install(l,...d)):ue(u)&&(o.add(u),u(l,...d))),l},mixin(u){return r.mixins.includes(u)||r.mixins.push(u),l},component(u,d){return d?(r.components[u]=d,l):r.components[u]},directive(u,d){return d?(r.directives[u]=d,l):r.directives[u]},mount(u,d,h){if(!c){const f=l._ceVNode||rt(s,i);return f.appContext=r,h===!0?h="svg":h===!1&&(h=void 0),d&&e?e(f,u):t(f,u,h),c=!0,l._container=u,u.__vue_app__=l,qu(f.component)}},onUnmount(u){a.push(u)},unmount(){c&&(us(a,l._instance,16),t(null,l._container),delete l._container.__vue_app__)},provide(u,d){return r.provides[u]=d,l},runWithContext(u){const d=dr;dr=l;try{return u()}finally{dr=d}}};return l}}let dr=null;const DC=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Xt(e)}Modifiers`]||t[`${Cr(e)}Modifiers`];function AC(t,e,...n){if(t.isUnmounted)return;const s=t.vnode.props||Ge;let i=n;const r=e.startsWith("update:"),o=r&&DC(s,e.slice(7));o&&(o.trim&&(i=n.map(u=>ze(u)?u.trim():u)),o.number&&(i=n.map(Pu)));let a,c=s[a=Xd(e)]||s[a=Xd(Xt(e))];!c&&r&&(c=s[a=Xd(Cr(e))]),c&&us(c,t,6,i);const l=s[a+"Once"];if(l){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,us(l,t,6,i)}}const CC=new WeakMap;function Hv(t,e,n=!1){const s=n?CC:e.emitsCache,i=s.get(t);if(i!==void 0)return i;const r=t.emits;let o={},a=!1;if(!ue(t)){const c=l=>{const u=Hv(l,e,!0);u&&(a=!0,ot(o,u))};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}return!r&&!a?(Re(t)&&s.set(t,null),null):(re(r)?r.forEach(c=>o[c]=null):ot(o,r),Re(t)&&s.set(t,o),o)}function Fu(t,e){return!t||!Ic(e)?!1:(e=e.slice(2).replace(/Once$/,""),Ne(t,e[0].toLowerCase()+e.slice(1))||Ne(t,Cr(e))||Ne(t,e))}function oh(t){const{type:e,vnode:n,proxy:s,withProxy:i,propsOptions:[r],slots:o,attrs:a,emit:c,render:l,renderCache:u,props:d,data:h,setupState:f,ctx:m,inheritAttrs:v}=t,b=Ol(t);let D,w;try{if(n.shapeFlag&4){const _=i||s,S=_;D=Nn(l.call(S,_,u,d,f,h,m)),w=a}else{const _=e;D=Nn(_.length>1?_(d,{attrs:a,slots:o,emit:c}):_(d,null)),w=e.props?a:RC(a)}}catch(_){va.length=0,Tc(_,t,1),D=rt(ht)}let y=D;if(w&&v!==!1){const _=Object.keys(w),{shapeFlag:S}=y;_.length&&S&7&&(r&&_.some(Su)&&(w=kC(w,r)),y=ii(y,w,!1,!0))}return n.dirs&&(y=ii(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&wo(y,n.transition),D=y,Ol(b),D}function PC(t,e=!0){let n;for(let s=0;s<t.length;s++){const i=t[s];if(gr(i)){if(i.type!==ht||i.children==="v-if"){if(n)return;n=i}}else return}return n}const RC=t=>{let e;for(const n in t)(n==="class"||n==="style"||Ic(n))&&((e||(e={}))[n]=t[n]);return e},kC=(t,e)=>{const n={};for(const s in t)(!Su(s)||!(s.slice(9)in e))&&(n[s]=t[s]);return n};function UC(t,e,n){const{props:s,children:i,component:r}=t,{props:o,children:a,patchFlag:c}=e,l=r.emitsOptions;if(e.dirs||e.transition)return!0;
vendor: 4,516 bytes, line 16
16if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?Ey(s,o,l):!!o;if(c&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(Wv(o,s,h)&&!Fu(l,h))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:s===o?!1:s?o?Ey(s,o,l):!0:!!o;return!1}function Ey(t,e,n){const s=Object.keys(e);if(s.length!==Object.keys(t).length)return!0;for(let i=0;i<s.length;i++){const r=s[i];if(Wv(e,t,r)&&!Fu(n,r))return!0}return!1}function Wv(t,e,n){const s=t[n],i=e[n];return n==="style"&&Re(s)&&Re(i)?!Fo(s,i):s!==i}function Vu({vnode:t,parent:e,suspense:n},s){for(;e;){const i=e.subTree;if(i.suspense&&i.suspense.activeBranch===t&&(i.suspense.vnode.el=i.el=s,t=i),i===t)(t=e.vnode).el=s,e=e.parent;else break}n&&n.activeBranch===t&&(n.vnode.el=s)}const Kv={},zv=()=>Object.create(Kv),Jv=t=>Object.getPrototypeOf(t)===Kv;function NC(t,e,n,s=!1){const i={},r=zv();t.propsDefaults=Object.create(null),Yv(t,e,i,r);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);n?t.props=s?i:wc(i):t.type.props?t.props=i:t.props=r,t.attrs=r}function xC(t,e,n,s){const{props:i,attrs:r,vnode:{patchFlag:o}}=t,a=Ee(i),[c]=t.propsOptions;let l=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(Fu(t.emitsOptions,h))continue;const f=e[h];if(c)if(Ne(r,h))f!==r[h]&&(r[h]=f,l=!0);else{const m=Xt(h);i[m]=lf(c,a,m,f,t,!1)}else f!==r[h]&&(r[h]=f,l=!0)}}}else{Yv(t,e,i,r)&&(l=!0);let u;for(const d in a)(!e||!Ne(e,d)&&((u=Cr(d))===d||!Ne(e,u)))&&(c?n&&(n[d]!==void 0||n[u]!==void 0)&&(i[d]=lf(c,a,d,void 0,t,!0)):delete i[d]);if(r!==a)for(const d in r)(!e||!Ne(e,d))&&(delete r[d],l=!0)}l&&$s(t.attrs,"set","")}function Yv(t,e,n,s){const[i,r]=t.propsOptions;let o=!1,a;if(e)for(let c in e){if(cr(c))continue;const l=e[c];let u;i&&Ne(i,u=Xt(c))?!r||!r.includes(u)?n[u]=l:(a||(a={}))[u]=l:Fu(t.emitsOptions,c)||(!(c in s)||l!==s[c])&&(s[c]=l,o=!0)}if(r){const c=Ee(n),l=a||Ge;for(let u=0;u<r.length;u++){const d=r[u];n[d]=lf(i,c,d,l[d],t,!Ne(l,d))}}return o}function lf(t,e,n,s,i,r){const o=t[n];if(o!=null){const a=Ne(o,"default");if(a&&s===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&ue(c)){const{propsDefaults:l}=i;if(n in l)s=l[n];else{const u=bc(i);s=l[n]=c.call(null,e),u()}}else s=c;i.ce&&i.ce._setProp(n,s)}o[0]&&(r&&!a?s=!1:o[1]&&(s===""||s===Cr(n))&&(s=!0))}return s}const MC=new WeakMap;function Qv(t,e,n=!1){const s=n?MC:e.propsCache,i=s.get(t);if(i)return i;const r=t.props,o={},a=[];let c=!1;if(!ue(t)){const u=d=>{c=!0;const[h,f]=Qv(d,e,!0);ot(o,h),f&&a.push(...f)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!r&&!c)return Re(t)&&s.set(t,so),so;if(re(r))for(let u=0;u<r.length;u++){const d=Xt(r[u]);Sy(d)&&(o[d]=Ge)}else if(r)for(const u in r){const d=Xt(u);if(Sy(d)){const h=r[u],f=o[d]=re(h)||ue(h)?{type:h}:ot({},h),m=f.type;let v=!1,b=!0;if(re(m))for(let D=0;D<m.length;++D){const w=m[D],y=ue(w)&&w.name;if(y==="Boolean"){v=!0;break}else y==="String"&&(b=!1)}else v=ue(m)&&m.name==="Boolean";f[0]=v,f[1]=b,(v||Ne(f,"default"))&&a.push(d)}}const l=[o,a];return Re(t)&&s.set(t,l),l}function Sy(t){return t[0]!=="$"&&!cr(t)}const Gp=t=>t==="_"||t==="_ctx"||t==="$stable",Bp=t=>re(t)?t.map(Nn):[Nn(t)],OC=(t,e,n)=>{if(e._n)return e;const s=Lp((...i)=>Bp(e(...i)),n);return s._c=!1,s},Xv=(t,e,n)=>{const s=t._ctx;for(const i in t){if(Gp(i))continue;const r=t[i];if(ue(r))e[i]=OC(i,r,s);else if(r!=null){const o=Bp(r);e[i]=()=>o}}},Zv=(t,e)=>{const n=Bp(e);t.slots.default=()=>n},eT=(t,e,n)=>{for(const s in e)(n||!Gp(s))&&(t[s]=e[s])},LC=(t,e,n)=>{const s=t.slots=zv();if(t.vnode.shapeFlag&32){const i=e._;i?(eT(s,e,n),n&&Yw(s,"_",i,!0)):Xv(e,s)}else e&&Zv(t,e)},FC=(t,e,n)=>{const{vnode:s,slots:i}=t;let r=!0,o=Ge;if(s.shapeFlag&32){const a=e._;a?n&&a===1?r=!1:eT(i,e,n):(r=!e.$stable,Xv(e,i)),o=e}else e&&(Zv(t,e),o={default:1});if(r)for(const a in i)!Gp(a)&&o[a]==null&&delete i[a]},gt=aT;function VC(t){return tT(t)}function qC(t){return tT(t,aC)}function tT(t,e){const n=Ru();n.__VUE__=!0;const{insert:s,remove:i,patchProp:r,createElement:o,createText:a,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:h,setScopeId:f=Ps,insertStaticContent:m}=t,v=(g,I,A,L=null,k=null,F=null,K=void 0,j=null,B=!!I.dynamicChildren)=>{if(g===I)return;g&&!is(g,I)&&(L=U(g),tn(g,k,F,!0),g=null),I.patchFlag===-2&&(B=!1,I.dynamicChildren=null);const{type:V,ref:ce,shapeFlag:Q}=I;switch(V){case hr:b(g,I,A,L);break;case ht:D(g,I,A,L);break;case wa:g==null&&w(I,A,L,K);break;case Yt:O(g,I,A,L,k,F,K,j,B);break;
vendor: 3,838 bytes, line 16
16default:Q&1?S(g,I,A,L,k,F,K,j,B):Q&6?ne(g,I,A,L,k,F,K,j,B):(Q&64||Q&128)&&V.process(g,I,A,L,k,F,K,j,B,se)}ce!=null&&k?ao(ce,g&&g.ref,F,I||g,!I):ce==null&&g&&g.ref!=null&&ao(g.ref,null,F,g,!0)},b=(g,I,A,L)=>{if(g==null)s(I.el=a(I.children),A,L);else{const k=I.el=g.el;I.children!==g.children&&l(k,I.children)}},D=(g,I,A,L)=>{g==null?s(I.el=c(I.children||""),A,L):I.el=g.el},w=(g,I,A,L)=>{[g.el,g.anchor]=m(g.children,I,A,L,g.el,g.anchor)},y=({el:g,anchor:I},A,L)=>{let k;for(;g&&g!==I;)k=h(g),s(g,A,L),g=k;s(I,A,L)},_=({el:g,anchor:I})=>{let A;for(;g&&g!==I;)A=h(g),i(g),g=A;i(I)},S=(g,I,A,L,k,F,K,j,B)=>{if(I.type==="svg"?K="svg":I.type==="math"&&(K="mathml"),g==null)P(I,A,L,k,F,K,j,B);else{const V=g.el&&g.el._isVueCE?g.el:null;try{V&&V._beginPatch(),C(g,I,k,F,K,j,B)}finally{V&&V._endPatch()}}},P=(g,I,A,L,k,F,K,j)=>{let B,V;const{props:ce,shapeFlag:Q,transition:ie,dirs:he}=g;if(B=g.el=o(g.type,F,ce&&ce.is,ce),Q&8?u(B,g.children):Q&16&&M(g.children,B,null,L,k,ah(g,F),K,j),he&&ws(g,null,L,"created"),x(B,g,g.scopeId,K,L),ce){for(const qe in ce)qe!=="value"&&!cr(qe)&&r(B,qe,null,ce[qe],F,L);"value"in ce&&r(B,"value",null,ce.value,F),(V=ce.onVnodeBeforeMount)&&nn(V,L,g)}he&&ws(g,null,L,"beforeMount");const De=nT(k,ie);De&&ie.beforeEnter(B),s(B,I,A),((V=ce&&ce.onVnodeMounted)||De||he)&&gt(()=>{try{V&&nn(V,L,g),De&&ie.enter(B),he&&ws(g,null,L,"mounted")}finally{}},k)},x=(g,I,A,L,k)=>{if(A&&f(g,A),L)for(let F=0;F<L.length;F++)f(g,L[F]);if(k){let F=k.subTree;if(I===F||ql(F.type)&&(F.ssContent===I||F.ssFallback===I)){const K=k.vnode;x(g,K,K.scopeId,K.slotScopeIds,k.parent)}}},M=(g,I,A,L,k,F,K,j,B=0)=>{for(let V=B;V<g.length;V++){const ce=g[V]=j?js(g[V]):Nn(g[V]);v(null,ce,I,A,L,k,F,K,j)}},C=(g,I,A,L,k,F,K)=>{const j=I.el=g.el;let{patchFlag:B,dynamicChildren:V,dirs:ce}=I;B|=g.patchFlag&16;const Q=g.props||Ge,ie=I.props||Ge;let he;if(A&&Yi(A,!1),(he=ie.onVnodeBeforeUpdate)&&nn(he,A,I,g),ce&&ws(I,g,A,"beforeUpdate"),A&&Yi(A,!0),(Q.innerHTML&&ie.innerHTML==null||Q.textContent&&ie.textContent==null)&&u(j,""),V?N(g.dynamicChildren,V,j,A,L,ah(I,k),F):K||ee(g,I,j,null,A,L,ah(I,k),F,!1),B>0){if(B&16)X(j,Q,ie,A,k);else if(B&2&&Q.class!==ie.class&&r(j,"class",null,ie.class,k),B&4&&r(j,"style",Q.style,ie.style,k),B&8){const De=I.dynamicProps;for(let qe=0;qe<De.length;qe++){const Be=De[qe],at=Q[Be],pt=ie[Be];(pt!==at||Be==="value")&&r(j,Be,at,pt,k,A)}}B&1&&g.children!==I.children&&u(j,I.children)}else!K&&V==null&&X(j,Q,ie,A,k);((he=ie.onVnodeUpdated)||ce)&&gt(()=>{he&&nn(he,A,I,g),ce&&ws(I,g,A,"updated")},L)},N=(g,I,A,L,k,F,K)=>{for(let j=0;j<I.length;j++){const B=g[j],V=I[j],ce=B.el&&(B.type===Yt||!is(B,V)||B.shapeFlag&198)?d(B.el):A;v(B,V,ce,null,L,k,F,K,!0)}},X=(g,I,A,L,k)=>{if(I!==A){if(I!==Ge)for(const F in I)!cr(F)&&!(F in A)&&r(g,F,I[F],null,k,L);for(const F in A){if(cr(F))continue;const K=A[F],j=I[F];K!==j&&F!=="value"&&r(g,F,j,K,k,L)}"value"in A&&r(g,"value",I.value,A.value,k)}},O=(g,I,A,L,k,F,K,j,B)=>{const V=I.el=g?g.el:a(""),ce=I.anchor=g?g.anchor:a("");let{patchFlag:Q,dynamicChildren:ie,slotScopeIds:he}=I;he&&(j=j?j.concat(he):he),g==null?(s(V,A,L),s(ce,A,L),M(I.children||[],A,ce,k,F,K,j,B)):Q>0&&Q&64&&ie&&g.dynamicChildren&&g.dynamicChildren.length===ie.length?(N(g.dynamicChildren,ie,A,k,F,K,j),(I.key!=null||k&&I===k.subTree)&&sT(g,I,!0)):ee(g,I,A,ce,k,F,K,j,B)},ne=(g,I,A,L,k,F,K,j,B)=>{I.slotScopeIds=j,g==null?I.shapeFlag&512?k.ctx.activate(I,A,L,K,B):_e(I,A,L,k,F,K,B):Te(g,I,B)},_e=(g,I,A,L,k,F,K)=>{const j=g.component=eP(g,L,k);if(xu(g)&&(j.ctx.renderer=se),tP(j,!1,K),j.asyncDep){if(k&&k.registerDep(j,W,K),!g.el){const B=j.subTree=rt(ht);D(null,B,I,A),g.placeholder=B.el}}else W(j,g,I,A,k,F,K)},Te=(g,I,A)=>{const L=I.component=g.component;if(UC(g,I,A))if(L.asyncDep&&!L.asyncResolved){de(L,I,A);return}else L.next=I,L.update();else I.el=g.el,L.vnode=I},W=(g,I,A,L,k,F,K)=>{const j=()=>
vendor: 10,171 bytes, line 16
16{if(g.isMounted){let{next:Q,bu:ie,u:he,parent:De,vnode:qe}=g;{const un=iT(g);if(un){Q&&(Q.el=qe.el,de(g,Q,K)),un.asyncDep.then(()=>{gt(()=>{g.isUnmounted||V()},k)});return}}let Be=Q,at;Yi(g,!1),Q?(Q.el=qe.el,de(g,Q,K)):Q=qe,ie&&ro(ie),(at=Q.props&&Q.props.onVnodeBeforeUpdate)&&nn(at,De,Q,qe),Yi(g,!0);const pt=oh(g),Zn=g.subTree;g.subTree=pt,v(Zn,pt,d(Zn.el),U(Zn),g,k,F),Q.el=pt.el,Be===null&&Vu(g,pt.el),he&&gt(he,k),(at=Q.props&&Q.props.onVnodeUpdated)&&gt(()=>nn(at,De,Q,qe),k)}else{let Q;const{el:ie,props:he}=I,{bm:De,m:qe,parent:Be,root:at,type:pt}=g,Zn=Qs(I);if(Yi(g,!1),De&&ro(De),!Zn&&(Q=he&&he.onVnodeBeforeMount)&&nn(Q,Be,I),Yi(g,!0),ie&&Ye){const un=()=>{g.subTree=oh(g),Ye(ie,g.subTree,g,k,null)};Zn&&pt.__asyncHydrate?pt.__asyncHydrate(ie,g,un):un()}else{at.ce&&at.ce._hasShadowRoot()&&at.ce._injectChildStyle(pt,g.parent?g.parent.type:void 0);const un=g.subTree=oh(g);v(null,un,A,L,g,k,F),I.el=un.el}if(qe&&gt(qe,k),!Zn&&(Q=he&&he.onVnodeMounted)){const un=I;gt(()=>nn(Q,Be,un),k)}(I.shapeFlag&256||Be&&Qs(Be.vnode)&&Be.vnode.shapeFlag&256)&&g.a&&gt(g.a,k),g.isMounted=!0,I=A=L=null}};g.scope.on();const B=g.effect=new sv(j);g.scope.off();const V=g.update=B.run.bind(B),ce=g.job=B.runIfDirty.bind(B);ce.i=g,ce.id=g.uid,B.scheduler=()=>Op(ce),Yi(g,!0),V()},de=(g,I,A)=>{I.component=g;const L=g.vnode.props;g.vnode=I,g.next=null,xC(g,I.props,L,A),FC(g,I.children,A),ni(),fy(g),si()},ee=(g,I,A,L,k,F,K,j,B=!1)=>{const V=g&&g.children,ce=g?g.shapeFlag:0,Q=I.children,{patchFlag:ie,shapeFlag:he}=I;if(ie>0){if(ie&128){mi(V,Q,A,L,k,F,K,j,B);return}else if(ie&256){Me(V,Q,A,L,k,F,K,j,B);return}}he&8?(ce&16&&Wn(V,k,F),Q!==V&&u(A,Q)):ce&16?he&16?mi(V,Q,A,L,k,F,K,j,B):Wn(V,k,F,!0):(ce&8&&u(A,""),he&16&&M(Q,A,L,k,F,K,j,B))},Me=(g,I,A,L,k,F,K,j,B)=>{g=g||so,I=I||so;const V=g.length,ce=I.length,Q=Math.min(V,ce);let ie;for(ie=0;ie<Q;ie++){const he=I[ie]=B?js(I[ie]):Nn(I[ie]);v(g[ie],he,A,null,k,F,K,j,B)}V>ce?Wn(g,k,F,!0,!1,Q):M(I,A,L,k,F,K,j,B,Q)},mi=(g,I,A,L,k,F,K,j,B)=>{let V=0;const ce=I.length;let Q=g.length-1,ie=ce-1;for(;V<=Q&&V<=ie;){const he=g[V],De=I[V]=B?js(I[V]):Nn(I[V]);if(is(he,De))v(he,De,A,null,k,F,K,j,B);else break;V++}for(;V<=Q&&V<=ie;){const he=g[Q],De=I[ie]=B?js(I[ie]):Nn(I[ie]);if(is(he,De))v(he,De,A,null,k,F,K,j,B);else break;Q--,ie--}if(V>Q){if(V<=ie){const he=ie+1,De=he<ce?I[he].el:L;for(;V<=ie;)v(null,I[V]=B?js(I[V]):Nn(I[V]),A,De,k,F,K,j,B),V++}}else if(V>ie)for(;V<=Q;)tn(g[V],k,F,!0),V++;else{const he=V,De=V,qe=new Map;for(V=De;V<=ie;V++){const dn=I[V]=B?js(I[V]):Nn(I[V]);dn.key!=null&&qe.set(dn.key,V)}let Be,at=0;const pt=ie-De+1;let Zn=!1,un=0;const Jo=new Array(pt);for(V=0;V<pt;V++)Jo[V]=0;for(V=he;V<=Q;V++){const dn=g[V];if(at>=pt){tn(dn,k,F,!0);continue}let _s;if(dn.key!=null)_s=qe.get(dn.key);else for(Be=De;Be<=ie;Be++)if(Jo[Be-De]===0&&is(dn,I[Be])){_s=Be;break}_s===void 0?tn(dn,k,F,!0):(Jo[_s-De]=V+1,_s>=un?un=_s:Zn=!0,v(dn,I[_s],A,null,k,F,K,j,B),at++)}const oy=Zn?GC(Jo):so;for(Be=oy.length-1,V=pt-1;V>=0;V--){const dn=De+V,_s=I[dn],ay=I[dn+1],cy=dn+1<ce?ay.el||rT(ay):L;Jo[V]===0?v(null,_s,A,cy,k,F,K,j,B):Zn&&(Be<0||V!==oy[Be]?ys(_s,A,cy,2):Be--)}}},ys=(g,I,A,L,k=null)=>{const{el:F,type:K,transition:j,children:B,shapeFlag:V}=g;if(V&6){ys(g.component.subTree,I,A,L);return}if(V&128){g.suspense.move(I,A,L);return}if(V&64){K.move(g,I,A,se);return}if(K===Yt){s(F,I,A);for(let Q=0;Q<B.length;Q++)ys(B[Q],I,A,L);s(g.anchor,I,A);return}if(K===wa){y(g,I,A);return}if(L!==2&&V&1&&j)if(L===0)j.beforeEnter(F),s(F,I,A),gt(()=>j.enter(F),k);else{const{leave:Q,delayLeave:ie,afterLeave:he}=j,De=()=>{g.ctx.isUnmounted?i(F):s(F,I,A)},qe=()=>{F._isLeaving&&F[vs](!0),Q(F,()=>{De(),he&&he()})};ie?ie(F,De,qe):qe()}else s(F,I,A)},tn=(g,I,A,L=!1,k=!1)=>{const{type:F,props:K,ref:j,children:B,dynamicChildren:V,shapeFlag:ce,patchFlag:Q,dirs:ie,cacheIndex:he,memo:De}=g;if(Q===-2&&(k=!1),j!=null&&(ni(),ao(j,null,A,g,!0),si()),he!=null&&(I.renderCache[he]=void 0),ce&256){I.ctx.deactivate(g);return}const qe=ce&1&&ie,Be=!Qs(g);let at;if(Be&&(at=K&&K.onVnodeBeforeUnmount)&&nn(at,I,g),ce&6)zc(g.component,A,L);else{if(ce&128){g.suspense.unmount(A,L);return}qe&&ws(g,null,I,"beforeUnmount"),ce&64?g.type.remove(g,I,A,se,L):V&&!V.hasOnce&&(F!==Yt||Q>0&&Q&64)?Wn(V,I,A,!1,!0):(F===Yt&&Q&384||!k&&ce&16)&&Wn(B,I,A),L&&Gr(g)}const pt=De!=null&&he==null;(Be&&(at=K&&K.onVnodeUnmounted)||qe||pt)&&gt(()=>{at&&nn(at,I,g),qe&&ws(g,null,I,"unmounted"),pt&&(g.el=null)},A)},Gr=g=>{const{type:I,el:A,anchor:L,transition:k}=g;if(I===Yt){Br(A,L);return}if(I===wa){_(g);return}const F=()=>{i(A),k&&!k.persisted&&k.afterLeave&&k.afterLeave()};if(g.shapeFlag&1&&k&&!k.persisted){const{leave:K,delayLeave:j}=k,B=()=>K(A,F);j?j(g.el,F,B):B()}else F()},Br=(g,I)=>{let A;for(;g!==I;)A=h(g),i(g),g=A;i(I)},zc=(g,I,A)=>{const{bum:L,scope:k,job:F,subTree:K,um:j,m:B,a:V}=g;Vl(B),Vl(V),L&&ro(L),k.stop(),F&&(F.flags|=8,tn(K,g,I,A)),j&&gt(j,I),gt(()=>{g.isUnmounted=!0},I)},Wn=(g,I,A,L=!1,k=!1,F=0)=>{for(let K=F;K<g.length;K++)tn(g[K],I,A,L,k)},U=g=>{if(g.shapeFlag&6)return U(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const I=h(g.anchor||g.el),A=I&&I[tC];return A?h(A):I};let Z=!1;const z=(g,I,A)=>{let L;g==null?I._vnode&&(tn(I._vnode,null,null,!0),L=I._vnode.component):v(I._vnode||null,g,I,null,null,null,A),I._vnode=g,Z||(Z=!0,fy(L),Ml(),Z=!1)},se={p:v,um:tn,m:ys,r:Gr,mt:_e,mc:M,pc:ee,pbc:N,n:U,o:t};let ke,Ye;return e&&([ke,Ye]=e(se)),{render:z,hydrate:ke,createApp:SC(z,ke)}}function ah({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Yi({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function nT(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function sT(t,e,n=!1){const s=t.children,i=e.children;if(re(s)&&re(i))for(let r=0;r<s.length;r++){const o=s[r];let a=i[r];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[r]=js(i[r]),a.el=o.el),!n&&a.patchFlag!==-2&&sT(o,a)),a.type===hr&&(a.patchFlag===-1&&(a=i[r]=js(a)),a.el=o.el),a.type===ht&&!a.el&&(a.el=o.el)}}function GC(t){const e=t.slice(),n=[0];let s,i,r,o,a;const c=t.length;for(s=0;s<c;s++){const l=t[s];if(l!==0){if(i=n[n.length-1],t[i]<l){e[s]=i,n.push(s);continue}for(r=0,o=n.length-1;r<o;)a=r+o>>1,t[n[a]]<l?r=a+1:o=a;l<t[n[r]]&&(r>0&&(e[s]=n[r-1]),n[r]=s)}}for(r=n.length,o=n[r-1];r-- >0;)n[r]=o,o=e[o];return n}function iT(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:iT(e)}function Vl(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function rT(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?rT(e.subTree):null}const ql=t=>t.__isSuspense;let uf=0;const BC={name:"Suspense",__isSuspense:!0,process(t,e,n,s,i,r,o,a,c,l){if(t==null)jC(e,n,s,i,r,o,a,c,l);else{if(r&&r.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}$C(t,e,n,s,i,o,a,c,l)}},hydrate:HC,normalize:WC},jp=BC;function qa(t,e){const n=t.props&&t.props[e];ue(n)&&n()}function jC(t,e,n,s,i,r,o,a,c){const{p:l,o:{createElement:u}}=c,d=u("div"),h=t.suspense=oT(t,i,s,e,d,n,r,o,a,c);l(null,h.pendingBranch=t.ssContent,d,null,s,h,r,o),h.deps>0?(qa(t,"onPending"),qa(t,"onFallback"),l(null,t.ssFallback,e,n,s,null,r,o),co(h,t.ssFallback)):h.resolve(!1,!0)}function $C(t,e,n,s,i,r,o,a,{p:c,um:l,o:{createElement:u}}){const d=e.suspense=t.suspense;d.vnode=e,e.el=t.el;const h=e.ssContent,f=e.ssFallback,{activeBranch:m,pendingBranch:v,isInFallback:b,isHydrating:D}=d;if(v)d.pendingBranch=h,is(v,h)?(c(v,h,d.hiddenContainer,null,i,d,r,o,a),d.deps<=0?d.resolve():b&&(D||(c(m,f,n,s,i,null,r,o,a),co(d,f)))):(d.pendingId=uf++,D?(d.isHydrating=!1,d.activeBranch=v):l(v,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(c(null,h,d.hiddenContainer,null,i,d,r,o,a),d.deps<=0?d.resolve():(c(m,f,n,s,i,null,r,o,a),co(d,f))):m&&is(m,h)?(c(m,h,n,s,i,d,r,o,a),d.resolve(!0)):(c(null,h,d.hiddenContainer,null,i,d,r,o,a),d.deps<=0&&d.resolve()));else if(m&&is(m,h))c(m,h,n,s,i,d,r,o,a),co(d,h);else if(qa(e,"onPending"),d.pendingBranch=h,h.shapeFlag&512?d.pendingId=h.component.suspenseId:d.pendingId=uf++,c(null,h,d.hiddenContainer,null,i,d,r,o,a),d.deps<=0)d.resolve();else{const{timeout:w,pendingId:y}=d;w>0?setTimeout(()=>{d.pendingId===y&&d.fallback(f)},w):w===0&&d.fallback(f)}}function oT(t,e,n,s,i,r,o,a,c,l,u=!1){const{p:d,m:h,um:f,n:m,o:{parentNode:v,remove:b}}=l;let D;const w=KC(t);w&&e&&e.pendingBranch&&(D=e.pendingId,e.deps++);const y=t.props?Qw(t.props.timeout):void 0,_=r,S={vnode:t,parent:e,parentComponent:n,namespace:o,container:s,hiddenContainer:i,deps:0,pendingId:uf++,timeout:typeof y=="number"?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(P=!1,x=!1){const{vnode:M,activeBranch:C,pendingBranch:N,pendingId:X,effects:O,parentComponent:ne,container:_e,isInFallback:Te}=S;let W=!1;if(S.isHydrating)S.isHydrating=!1;else if(!P){W=C&&N.transition&&N.transition.mode==="out-in";let Me=!1;W&&(C.transition.afterLeave=()=>{X===S.pendingId&&(h(N,_e,r===_&&!Me?m(C):r,0),sf(O),Te&&M.ssFallback&&(M.ssFallback.el=null))}),C&&!S.isFallbackMountPending&&(v(C.el)===_e&&(r=m(C),Me=!0),f(C,ne,S,!0),!W&&Te&&M.ssFallback&&gt(()=>M.ssFallback.el=null,S)),W||h(N,_e,r,0)}S.isFallbackMountPending=!1,co(S,N),S.pendingBranch=null,S.isInFallback=!1;let de=S.parent,ee=!1;for(;de;){if(de.pendingBranch){de.effects.push(...O),ee=!0;break}de=de.parent}!ee&&!W&&sf(O),S.effects=[],w&&e&&e.pendingBranch&&D===e.pendingId&&(e.deps--,e.deps===0&&!x&&e.resolve()),qa(M,"onResolve")},fallback(P){if(!S.pendingBranch)return;const{vnode:x,activeBranch:M,parentComponent:C,container:N,namespace:X}=S;qa(x,"onFallback");const O=m(M),ne=()=>{S.isFallbackMountPending=!1,S.isInFallback&&(d(null,P,N,O,C,null,X,a,c),co(S,P))},_e=P.transition&&P.transition.mode==="out-in";_e&&(S.isFallbackMountPending=!0,M.transition.afterLeave=ne),S.isInFallback=!0,f(M,C,null,!0),_e||ne()},move(P,x,M){S.activeBranch&&h(S.activeBranch,P,x,M),S.container=P},next(){return S.activeBranch&&m(S.activeBranch)},registerDep(P,x,M){const C=!!S.pendingBranch;C&&S.deps++;const N=P.vnode.el;
vendor: 8,130 bytes, lines 16-19
16P.asyncDep.catch(X=>{Tc(X,P,0)}).then(X=>{if(P.isUnmounted||S.isUnmounted||S.pendingId!==P.suspenseId)return;hf(),P.asyncResolved=!0;const{vnode:O}=P;ff(P,X,!1),N&&(O.el=N);const ne=!N&&P.subTree.el;x(P,O,v(N||P.subTree.el),N?null:m(P.subTree),S,o,M),ne&&(O.placeholder=null,b(ne)),Vu(P,O.el),C&&--S.deps===0&&S.resolve()})},unmount(P,x){S.isUnmounted=!0,S.activeBranch&&f(S.activeBranch,n,P,x),S.pendingBranch&&f(S.pendingBranch,n,P,x)}};return S}function HC(t,e,n,s,i,r,o,a,c){const l=e.suspense=oT(e,s,n,t.parentNode,document.createElement("div"),null,i,r,o,a,!0),u=c(t,l.pendingBranch=e.ssContent,n,l,r,o);return l.deps===0&&l.resolve(!1,!0),u}function WC(t){const{shapeFlag:e,children:n}=t,s=e&32;t.ssContent=Dy(s?n.default:n),t.ssFallback=s?Dy(n.fallback):rt(ht)}function Dy(t){let e;if(ue(t)){const n=vo&&t._c;n&&(t._d=!1,ss()),t=t(),n&&(t._d=!0,e=on,cT())}return re(t)&&(t=PC(t)),t=Nn(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function aT(t,e){e&&e.pendingBranch?re(t)?e.effects.push(...t):e.effects.push(t):sf(t)}function co(t,e){t.activeBranch=e;const{vnode:n,parentComponent:s}=t;let i=e.el;for(;!i&&e.component;)e=e.component.subTree,i=e.el;n.el=i,s&&s.subTree===n&&(s.vnode.el=i,Vu(s,i))}function KC(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}const Yt=Symbol.for("v-fgt"),hr=Symbol.for("v-txt"),ht=Symbol.for("v-cmt"),wa=Symbol.for("v-stc"),va=[];let on=null;function ss(t=!1){va.push(on=t?null:[])}function cT(){va.pop(),on=va[va.length-1]||null}let vo=1;function Gl(t,e=!1){vo+=t,t<0&&on&&e&&(on.hasOnce=!0)}function lT(t){return t.dynamicChildren=vo>0?on||so:null,cT(),vo>0&&on&&on.push(t),t}function uT(t,e,n,s,i,r){return lT(Ta(t,e,n,s,i,r,!0))}function Ti(t,e,n,s,i){return lT(rt(t,e,n,s,i,!0))}function gr(t){return t?t.__v_isVNode===!0:!1}function is(t,e){return t.type===e.type&&t.key===e.key}const dT=({key:t})=>t??null,_l=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?ze(t)||Ze(t)||ue(t)?{i:Pt,r:t,k:e,f:!!n}:t:null);function Ta(t,e=null,n=null,s=0,i=null,r=t===Yt?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&dT(e),ref:e&&_l(e),scopeId:Ev,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Pt};return a?($p(c,n),r&128&&t.normalize(c)):n&&(c.shapeFlag|=ze(n)?8:16),vo>0&&!o&&on&&(c.patchFlag>0||r&6)&&c.patchFlag!==32&&on.push(c),c}const rt=zC;function zC(t,e=null,n=null,s=0,i=null,r=!1){if((!t||t===qv)&&(t=ht),gr(t)){const a=ii(t,e,!0);return n&&$p(a,n),vo>0&&!r&&on&&(a.shapeFlag&6?on[on.indexOf(t)]=a:on.push(a)),a.patchFlag=-2,a}if(rP(t)&&(t=t.__vccOpts),e){e=JC(e);let{class:a,style:c}=e;a&&!ze(a)&&(e.class=ku(a)),Re(c)&&(Nu(c)&&!re(c)&&(c=ot({},c)),e.style=Dp(c))}const o=ze(t)?1:ql(t)?128:Dv(t)?64:Re(t)?4:ue(t)?2:0;return Ta(t,e,n,s,i,o,r,!0)}function JC(t){return t?Nu(t)||Jv(t)?ot({},t):t:null}function ii(t,e,n=!1,s=!1){const{props:i,ref:r,patchFlag:o,children:a,transition:c}=t,l=e?fT(i||{},e):i,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&dT(l),ref:e&&e.ref?n&&r?re(r)?r.concat(_l(e)):[r,_l(e)]:_l(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Yt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&ii(t.ssContent),ssFallback:t.ssFallback&&ii(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&s&&wo(u,c.clone(u)),u}function hT(t=" ",e=0){return rt(hr,null,t,e)}function YC(t,e){const n=rt(wa,null,t);return n.staticCount=e,n}function QC(t="",e=!1){return e?(ss(),Ti(ht,null,t)):rt(ht,null,t)}function Nn(t){return t==null||typeof t=="boolean"?rt(ht):re(t)?rt(Yt,null,t.slice()):gr(t)?js(t):rt(hr,null,String(t))}function js(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:ii(t)}function $p(t,e){let n=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(re(e))n=16;else if(typeof e=="object")if(s&65){const i=e.default;i&&(i._c&&(i._d=!1),$p(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!Jv(e)?e._ctx=Pt:i===3&&Pt&&(Pt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ue(e)?(e={default:e,_ctx:Pt},n=32):(e=String(e),s&64?(n=16,e=[hT(e)]):n=8);t.children=e,t.shapeFlag|=n}function fT(...t){const e={};for(let n=0;n<t.length;n++){const s=t[n];for(const i in s)if(i==="class")e.class!==s.class&&(e.class=ku([e.class,s.class]));else if(i==="style")e.style=Dp([e.style,s.style]);else if(Ic(i)){const r=e[i],o=s[i];o&&r!==o&&!(re(r)&&r.includes(o))?e[i]=r?[].concat(r,o):o:o==null&&r==null&&!Su(i)&&(e[i]=o)}else i!==""&&(e[i]=s[i])}return e}function nn(t,e,n,s=null){us(t,e,7,[n,s])}const XC=$v();let ZC=0;function eP(t,e,n){const s=t.type,i=(e?e.appContext:t.appContext)||XC,r={uid:ZC++,vnode:t,type:s,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new tv(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Qv(s,i),emitsOptions:Hv(s,i),emit:null,emitted:null,propsDefaults:Ge,inheritAttrs:s.inheritAttrs,ctx:Ge,data:Ge,props:Ge,attrs:Ge,slots:Ge,refs:Ge,setupState:Ge,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=e?e.root:r,r.emit=AC.bind(null,r),t.ce&&t.ce(r),r}let Vt=null;const Vo=()=>Vt||Pt;let Bl,df;{const t=Ru(),e=(n,s)=>{let i;return(i=t[n])||(i=t[n]=[]),i.push(s),r=>{i.length>1?i.forEach(o=>o(r)):i[0](r)}};Bl=e("__VUE_INSTANCE_SETTERS__",n=>Vt=n),df=e("__VUE_SSR_SETTERS__",n=>Ga=n)}const bc=t=>{const e=Vt;return Bl(t),t.scope.on(),()=>{t.scope.off(),Bl(e)}},hf=()=>{Vt&&Vt.scope.off(),Bl(null)};function pT(t){return t.vnode.shapeFlag&4}let Ga=!1;function tP(t,e=!1,n=!1){e&&df(e);const{props:s,children:i}=t.vnode,r=pT(t);NC(t,s,r,e),LC(t,i,n||e);const o=r?nP(t,e):void 0;return e&&df(!1),o}function nP(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,_C);const{setup:s}=n;if(s){ni();const i=t.setupContext=s.length>1?iP(t):null,r=bc(t),o=vc(s,t,0,[t.props,i]),a=Kw(o);if(si(),r(),(a||t.sp)&&!Qs(t)&&Uv(t),a){if(o.then(hf,hf),e)return o.then(c=>{ff(t,c,e)}).catch(c=>{Tc(c,t,0)});t.asyncDep=o}else ff(t,o,e)}else mT(t,e)}function ff(t,e,n){ue(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Re(e)&&(t.setupState=_v(e)),mT(t,n)}let Ay;function mT(t,e,n){const s=t.type;if(!t.render){if(!e&&Ay&&!s.render){const i=s.template||qp(t).template;if(i){const{isCustomElement:r,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:c}=s,l=ot(ot({isCustomElement:r,delimiters:a},o),c);s.render=Ay(i,l)}}t.render=s.render||Ps}{const i=bc(t);ni();try{IC(t)}finally{si(),i()}}}const sP={get(t,e){return Lt(t,"get",""),t[e]}};function iP(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,sP),slots:t.slots,emit:t.emit,expose:e}}function qu(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(_v(Mp(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Ia)return Ia[n](t)},has(e,n){return n in e||n in Ia}})):t.proxy}function pf(t,e=!0){return ue(t)?t.displayName||t.name:t.name||e&&t.__name}function rP(t){return ue(t)&&"__vccOpts"in t}const xn=(t,e)=>WA(t,e,Ga);function Fn(t,e,n){try{Gl(-1);const s=arguments.length;return s===2?Re(e)&&!re(e)?gr(e)?rt(t,null,[e]):rt(t,e):rt(t,null,e):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&gr(n)&&(n=[n]),rt(t,e,n))}finally{Gl(1)}}const gT="3.5.34";/**
17* @vue/runtime-dom v3.5.34
18* (c) 2018-present Yuxi (Evan) You and Vue contributors
19* @license MIT
20**/let mf;const Cy=typeof window<"u"&&window.trustedTypes;if(Cy)try{mf=Cy.createPolicy("vue",{createHTML:t=>t})}catch{}const yT=mf?t=>mf.createHTML(t):t=>t,oP="http://www.w3.org/2000/svg",aP="http://www.w3.org/1998/Math/MathML",Bs=typeof document<"u"?document:null,Py=Bs&&Bs.createElement("template"),cP={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,s)=>{const i=e==="svg"?Bs.createElementNS(oP,t):e==="mathml"?Bs.createElementNS(aP,t):n?Bs.createElement(t,{is:n}):Bs.createElement(t);return t==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:t=>Bs.createTextNode(t),createComment:t=>Bs.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Bs.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,s,i,r){const o=n?n.previousSibling:e.lastChild;if(i&&(i===r||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{Py.innerHTML=yT(s==="svg"?`<svg>${t}</svg>`:s==="mathml"?`<math>${t}</math>`:t);const a=Py.content;if(s==="svg"||s==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},gi="transition",Xo="animation",Ba=Symbol("_vtc"),_T={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},lP=ot({},Av,_T),uP=t=>(t.displayName="Transition",t.props=lP,t),IT=uP((t,{slots:e})=>Fn(iC,dP(t),e)),Qi=(t,e=[])=>{re(t)?t.forEach(n=>n(...e)):t&&t(...e)},Ry=t=>t?re(t)?t.some(e=>e.length>1):t.length>1:!1;function dP(t){const e={};for(const O in t)O in _T||(e[O]=t[O]);if(t.css===!1)return e;const{name:n="v",type:s,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:c=r,appearActiveClass:l=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=t,m=hP(i),v=m&&m[0],b=m&&m[1],{onBeforeEnter:D,onEnter:w,onEnterCancelled:y,onLeave:_,onLeaveCancelled:S,onBeforeAppear:P=D,onAppear:x=w,onAppearCancelled:M=y}=e,C=(O,ne,_e,Te)=>{O._enterCancelled=Te,Xi(O,ne?u:a),Xi(O,ne?l:o),_e&&_e()},N=(O,ne)=>{O._isLeaving=!1,Xi(O,d),Xi(O,f),Xi(O,h),ne&&ne()},X=O=>(ne,_e)=>{const Te=O?x:w,W=()=>C(ne,O,_e);Qi(Te,[ne,W]),ky(()=>{Xi(ne,O?c:r),qs(ne,O?u:a),Ry(Te)||Uy(ne,s,v,W)})};return ot(e,{onBeforeEnter(O){Qi(D,[O]),qs(O,r),qs(O,o)},onBeforeAppear(O){Qi(P,[O]),qs(O,c),qs(O,l)},onEnter:X(!1),onAppear:X(!0),onLeave(O,ne){O._isLeaving=!0;const _e=()=>N(O,ne);qs(O,d),O._enterCancelled?(qs(O,h),My(O)):(My(O),qs(O,h)),ky(()=>{O._isLeaving&&(Xi(O,d),qs(O,f),Ry(_)||Uy(O,s,b,_e))}),Qi(_,[O,_e])},onEnterCancelled(O){C(O,!1,void 0,!0),Qi(y,[O])},onAppearCancelled(O){C(O,!0,void 0,!0),Qi(M,[O])},onLeaveCancelled(O){N(O),Qi(S,[O])}})}function hP(t){if(t==null)return null;if(Re(t))return[ch(t.enter),ch(t.leave)];{const e=ch(t);return[e,e]}}function ch(t){return Qw(t)}function qs(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Ba]||(t[Ba]=new Set)).add(e)}function Xi(t,e){e.split(/\s+/).forEach(s=>s&&t.classList.remove(s));const n=t[Ba];n&&(n.delete(e),n.size||(t[Ba]=void 0))}function ky(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let fP=0;function Uy(t,e,n,s){const i=t._endId=++fP,r=()=>{i===t._endId&&s()};if(n!=null)return setTimeout(r,n);const{type:o,timeout:a,propCount:c}=pP(t,e);if(!o)return s();const l=o+"end";let u=0;const d=()=>{t.removeEventListener(l,h),r()},h=f=>{f.target===t&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},a+1),t.addEventListener(l,h)}function pP(t,e){const n=window.getComputedStyle(t),s=m=>(n[m]||"").split(", "),i=s(`${gi}Delay`),r=s(`${gi}Duration`),o=Ny(i,r),a=s(`${Xo}Delay`),c=s(`${Xo}Duration`),l=Ny(a,c);let u=null,d=0,h=0;e===gi?o>0&&(u=gi,d=o,h=r.length):e===Xo?l>0&&(u=Xo,d=l,h=c.length):(d=Math.max(o,l),u=d>0?o>l?gi:Xo:null,h=u?u===gi?r.length:c.length:0);const f=u===gi&&/\b(?:transform|all)(?:,|$)/.test(s(`${gi}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:f}}function Ny(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,s)=>xy(n)+xy(t[s])))}function xy(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function My(t){return(t?t.ownerDocument:document).body.offsetHeight}function mP(t,e,n){const s=t[Ba];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Oy=Symbol("_vod"),gP=Symbol("_vsh"),yP=Symbol(""),_P=/(?:^|;)\s*display\s*:/;function IP(t,e,n){const s=t.style,i=ze(n);let r=!1;if(n&&!i){if(e)if(ze(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&aa(s,a,"")}else for(const o in e)n[o]==null&&aa(s,o,"");for(const o in n){o==="display"&&(r=!0);const a=n[o];a!=null?vP(t,o,!ze(e)&&e?e[o]:void 0,a)||aa(s,o,a):aa(s,o,"")}}else if(i){if(e!==n){const o=s[yP];o&&(n+=";"+o),s.cssText=n,r=_P.test(n)}}else e&&t.removeAttribute("style");Oy in t&&(t[Oy]=r?s.display:"",t[gP]&&(s.display="none"))}const Ly=/\s*!important$/;function aa(t,e,n){if(re(n))n.forEach(s=>aa(t,e,s));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const s=wP(t,e);Ly.test(n)?t.setProperty(Cr(s),n.replace(Ly,""),"important"):t[s]=n}}const Fy=["Webkit","Moz","ms"],lh={};function wP(t,e){const n=lh[e];if(n)return n;let s=Xt(e);if(s!=="filter"&&s in t)return lh[e]=s;s=Cu(s);for(let i=0;i<Fy.length;i++){const r=Fy[i]+s;if(r in t)return lh[e]=r}return e}function vP(t,e,n,s){return t.tagName==="TEXTAREA"&&(e==="width"||e==="height")&&ze(s)&&n===s}const Vy="http://www.w3.org/1999/xlink";function qy(t,e,n,s,i,r=yA(e)){s&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Vy,e.slice(6,e.length)):t.setAttributeNS(Vy,e,n):n==null||r&&!Xw(n)?t.removeAttribute(e):t.setAttribute(e,r?"":Gn(n)?
vendor: 4,736 bytes, line 20
20String(n):n)}function Gy(t,e,n,s,i){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?yT(n):n);return}const r=t.tagName;if(e==="value"&&r!=="PROGRESS"&&!r.includes("-")){const a=r==="OPTION"?t.getAttribute("value")||"":t.value,c=n==null?t.type==="checkbox"?"on":"":String(n);(a!==c||!("_value"in t))&&(t.value=c),n==null&&t.removeAttribute(e),t._value=n;return}let o=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=Xw(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{t[e]=n}catch{}o&&t.removeAttribute(i||e)}function bi(t,e,n,s){t.addEventListener(e,n,s)}function TP(t,e,n,s){t.removeEventListener(e,n,s)}const By=Symbol("_vei");function bP(t,e,n,s,i=null){const r=t[By]||(t[By]={}),o=r[e];if(s&&o)o.value=s;else{const[a,c]=EP(e);if(s){const l=r[e]=AP(s,i);bi(t,a,l,c)}else o&&(TP(t,a,o,c),r[e]=void 0)}}const jy=/(?:Once|Passive|Capture)$/;function EP(t){let e;if(jy.test(t)){e={};let s;for(;s=t.match(jy);)t=t.slice(0,t.length-s[0].length),e[s[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Cr(t.slice(2)),e]}let uh=0;const SP=Promise.resolve(),DP=()=>uh||(SP.then(()=>uh=0),uh=Date.now());function AP(t,e){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;us(CP(s,n.value),e,5,[s])};return n.value=t,n.attached=DP(),n}function CP(t,e){if(re(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(s=>i=>!i._stopped&&s&&s(i))}else return e}const $y=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,PP=(t,e,n,s,i,r)=>{const o=i==="svg";e==="class"?mP(t,s,o):e==="style"?IP(t,n,s):Ic(e)?Su(e)||bP(t,e,n,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):RP(t,e,s,o))?(Gy(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&qy(t,e,s,o,r,e!=="value")):t._isVueCE&&(kP(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!ze(s)))?Gy(t,Xt(e),s,r,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),qy(t,e,s,o))};function RP(t,e,n,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&$y(e)&&ue(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return $y(e)&&ze(n)?!1:e in t}function kP(t,e){const n=t._def.props;if(!n)return!1;const s=Xt(e);return Array.isArray(n)?n.some(i=>Xt(i)===s):Object.keys(n).some(i=>Xt(i)===s)}const To=t=>{const e=t.props["onUpdate:modelValue"]||!1;return re(e)?n=>ro(e,n):e};function UP(t){t.target.composing=!0}function Hy(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Xs=Symbol("_assign");function Wy(t,e,n){return e&&(t=t.trim()),n&&(t=Pu(t)),t}const P$={created(t,{modifiers:{lazy:e,trim:n,number:s}},i){t[Xs]=To(i);const r=s||i.props&&i.props.type==="number";bi(t,e?"change":"input",o=>{o.target.composing||t[Xs](Wy(t.value,n,r))}),(n||r)&&bi(t,"change",()=>{t.value=Wy(t.value,n,r)}),e||(bi(t,"compositionstart",UP),bi(t,"compositionend",Hy),bi(t,"change",Hy))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:s,trim:i,number:r}},o){if(t[Xs]=To(o),t.composing)return;const a=(r||t.type==="number")&&!/^0\d/.test(t.value)?Pu(t.value):t.value,c=e??"";if(a===c)return;const l=t.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===t&&t.type!=="range"&&(s&&e===n||i&&t.value.trim()===c)||(t.value=c)}},R$={deep:!0,created(t,e,n){t[Xs]=To(n),bi(t,"change",()=>{const s=t._modelValue,i=ja(t),r=t.checked,o=t[Xs];if(re(s)){const a=Ap(s,i),c=a!==-1;if(r&&!c)o(s.concat(i));else if(!r&&c){const l=[...s];l.splice(a,1),o(l)}}else if(Oo(s)){const a=new Set(s);r?a.add(i):a.delete(i),o(a)}else o(wT(t,r))})},mounted:Ky,beforeUpdate(t,e,n){t[Xs]=To(n),Ky(t,e,n)}};function Ky(t,{value:e,oldValue:n},s){t._modelValue=e;let i;if(re(e))i=Ap(e,s.props.value)>-1;else if(Oo(e))i=e.has(s.props.value);else{if(e===n)return;i=Fo(e,wT(t,!0))}t.checked!==i&&(t.checked=i)}const k$={deep:!0,created(t,{value:e,modifiers:{number:n}},s){const i=Oo(e);bi(t,"change",()=>{const r=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?Pu(ja(o)):ja(o));t[Xs](t.multiple?i?new Set(r):r:r[0]),t._assigning=!0,ui(()=>{t._assigning=!1})}),t[Xs]=To(s)},mounted(t,{value:e}){zy(t,e)},beforeUpdate(t,e,n){t[Xs]=To(n)},updated(t,{value:e}){t._assigning||zy(t,e)}};function zy(t,e){const n=t.multiple,s=re(e);if(!(n&&!s&&!Oo(e))){for(let i=0,r=t.options.length;i<r;i++){const o=t.options[i],a=ja(o);if(n)if(s){const c=typeof a;
20c==="string"||c==="number"?o.selected=e.some(l=>String(l)===String(a)):o.selected=Ap(e,a)>-1}else o.selected=e.has(a);else if(Fo(ja(o),e)){t.selectedIndex!==i&&(t.selectedIndex=i);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function ja(t){return"_value"in t?t._value:t.value}function wT(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const NP=["ctrl","shift","alt","meta"],xP={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>NP.some(n=>t[`${n}Key`]&&!e.includes(n))},U$=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),s=e.join(".");return n[s]||(n[s]=(i,...r)=>{for(let o=0;o<e.length;o++){const a=xP[e[o]];if(a&&a(i,e))return}return t(i,...r)})},vT=ot({patchProp:PP},cP);let ba,Jy=!1;function MP(){return ba||(ba=VC(vT))}function OP(){return ba=Jy?ba:qC(vT),Jy=!0,ba}const LP=(...t)=>{const e=MP().createApp(...t),{mount:n}=e;return e.mount=s=>{const i=bT(s);if(!i)return;const r=e._component;!ue(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,TT(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e},FP=(...t)=>{const e=OP().createApp(...t),{mount:n}=e;return e.mount=s=>{const i=bT(s);if(i)return n(i,!0,TT(i))},e};function TT(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function bT(t){return ze(t)?document.querySelector(t):t}const VP=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,qP=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,GP=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function BP(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){jP(t);return}return e}function jP(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function jl(t,e={}){if(typeof t!="string")return t;const n=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return n.slice(1,-1);if(n.length<=9){const s=n.toLowerCase();if(s==="true")return!0;if(s==="false")return!1;if(s==="undefined")return;if(s==="null")return null;if(s==="nan")return Number.NaN;if(s==="infinity")return Number.POSITIVE_INFINITY;if(s==="-infinity")return Number.NEGATIVE_INFINITY}if(!GP.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(VP.test(t)||qP.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,BP)}return JSON.parse(t)}catch(s){if(e.strict)throw s;return t}}const $P=/#/g,HP=/&/g,WP=/\//g,KP=/=/g,Hp=/\+/g,zP=/%5e/gi,JP=/%60/gi,YP=/%7c/gi,QP=/%20/gi;function XP(t){return encodeURI(""+t).replace(YP,"|")}function gf(t){return XP(typeof t=="string"?t:JSON.stringify(t)).replace(Hp,"%2B").replace(QP,"+").replace($P,"%23").replace(HP,"%26").replace(JP,"`").replace(zP,"^").replace(WP,"%2F")}function dh(t){return gf(t).replace(KP,"%3D")}function $l(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function ZP(t){return $l(t.replace(Hp," "))}function eR(t){return $l(t.replace(Hp," "))}function tR(t=""){const e={};t[0]==="?"&&(t=t.slice(1));for(const n of t.split("&")){const s=n.match(/([^=]+)=?(.*)/)||[];if(s.length<2)continue;const i=ZP(s[1]);if(i==="__proto__"||i==="constructor")continue;const r=eR(s[2]||"");e[i]===void 0?e[i]=r:Array.isArray(e[i])?e[i].push(r):e[i]=[e[i],r]}return e}function nR(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(n=>`${dh(t)}=${gf(n)}`).join("&"):`${dh(t)}=${gf(e)}`:dh(t)}function sR(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>nR(e,t[e])).filter(Boolean).join("&")}const iR=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,rR=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,oR=/^([/\\]\s*){2,}[^/\\]/,aR=/^[\s\0]*(blob|data|javascript|vbscript):$/i,cR=/\/$|\/\?|\/#/,lR=/^\.?\//;function Pr(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?iR.test(t):rR.test(t)||(e.acceptRelative?oR.test(t):!1)}function uR(t){return!!t&&aR.test(t)}function yf(t="",e){return e?cR.test(t):t.endsWith("/")}function Wp(t="",e){if(!e)return(yf(t)?t.slice(0,-1):t)||"/";if(!yf(t,!0))return t||"/";let n=t,s="";const i=t.indexOf("#");i>=0&&(n=t.slice(0,i),s=t.slice(i));const[r,...o]=n.split("?");return((r.endsWith("/")?r.slice(0,-1):r)||"/")+(o.length>0?`?${o.join("?")}`:"")+s}function _f(t="",e){if(!e)return t.endsWith("/")?t:t+"/";if(yf(t,!0))return t||"/";let n=t,s="";const i=t.indexOf("#");if(i>=0&&(n=t.slice(0,i),s=t.slice(i),!n))return s;const[r,...o]=n.split("?");return r+"/"+(o.length>0?`?${o.join("?")}`:"")+s}function dR(t=""){return t.startsWith("/")}function Yy(t=""){return dR(t)?t:"/"+t}function hR(t,e){if(ST(e)||Pr(t))return t;const n=Wp(e);return t.startsWith(n)?t:Kp(n,t)}function Qy(t,e){if(ST(e))return t;const n=Wp(e);if(!t.startsWith(n))return t;const s=t.slice(n.length);return s[0]==="/"?s:"/"+s}function ET(t,e){const n=Gu(t),s={...tR(n.search),...e};return n.search=sR(s),mR(n)}function ST(t){return!t||t==="/"}function fR(t){return t&&t!=="/"}function Kp(t,...e){let n=t||"";for(const s of e.filter(i=>fR(i)))if(n){const i=s.replace(lR,"");n=_f(n)+i}else n=s;return n}function DT(...t){var o,a,c,l;const e=/\/(?!\/)/,n=t.filter(Boolean),s=[];let i=0;for(const u of n)if(!(!u||u==="/")){for(const[d,h]of u.split(e).entries())if(!(!h||h===".")){if(h===".."){if(s.length===1&&Pr(s[0]))continue;s.pop(),i--;continue}if(d===1&&((o=s[s.length-1])!=null&&o.endsWith(":/"))){s[s.length-1]+="/"+h;continue}s.push(h),i++}}let r=s.join("/");return i>=0?(a=n[0])!=null&&a.startsWith("/")&&!r.startsWith("/")?r="/"+r:(c=n[0])!=null&&c.startsWith("./")&&!r.startsWith("./")&&(r="./"+r):r="../".repeat(-1*i)+r,(l=n[n.length-1])!=null&&l.endsWith("/")&&!r.endsWith("/")&&(r+="/"),r}function pR(t,e,n={}){return n.trailingSlash||(t=_f(t),e=_f(e)),n.leadingSlash||(t=Yy(t),e=Yy(e)),n.encoding||(t=$l(t),e=$l(e)),t===e}const AT=Symbol.for("ufo:protocolRelative");function Gu(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,d,h=""]=n;return{protocol:d.toLowerCase(),pathname:h,href:d+h,auth:"",host:"",search:"",hash:""}}if(!Pr(t,{acceptRelative:!0}))return e?Gu(e+t):Xy(t);const[,s="",i,r=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o="",a=""]=r.match(/([^#/?]*)(.*)?/)||[],{pathname:c,search:l,hash:u}=Xy(a.replace(/\/(?=[A-Za-z]:)/,""));return{protocol:s.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:o,pathname:c,search:l,hash:u,[AT]:!s}}function Xy(t=""){const[e="",n="",s=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:s}}function mR(t){const e=t.pathname||"",n=t.search?(t.search.startsWith("?")?""
20:"?")+t.search:"",s=t.hash||"",i=t.auth?t.auth+"@":"",r=t.host||"";return(t.protocol||t[AT]?(t.protocol||"")+"//":"")+i+r+e+n+s}class gR extends Error{constructor(e,n){super(e,n),this.name="FetchError",n!=null&&n.cause&&!this.cause&&(this.cause=n.cause)}}function yR(t){var c,l,u,d,h;const e=((c=t.error)==null?void 0:c.message)||((l=t.error)==null?void 0:l.toString())||"",n=((u=t.request)==null?void 0:u.method)||((d=t.options)==null?void 0:d.method)||"GET",s=((h=t.request)==null?void 0:h.url)||String(t.request)||"/",i=`[${n}] ${JSON.stringify(s)}`,r=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",o=`${i}: ${r}${e?` ${e}`:""}`,a=new gR(o,t.error?{cause:t.error}:void 0);for(const f of["request","options","response"])Object.defineProperty(a,f,{get(){return t[f]}});for(const[f,m]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,f,{get(){return t.response&&t.response[m]}});return a}const _R=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function Zy(t="GET"){return _R.has(t.toUpperCase())}function IR(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const wR=new Set(["image/svg","application/xml","application/xhtml","application/html"]),vR=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function TR(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return vR.test(e)?"json":wR.has(e)||e.startsWith("text/")?"text":"blob"}function bR(t,e,n=globalThis.Headers){const s={...e,...t};if(e!=null&&e.params&&(t!=null&&t.params)&&(s.params={...e==null?void 0:e.params,...t==null?void 0:t.params}),e!=null&&e.query&&(t!=null&&t.query)&&(s.query={...e==null?void 0:e.query,...t==null?void 0:t.query}),e!=null&&e.headers&&(t!=null&&t.headers)){s.headers=new n((e==null?void 0:e.headers)||{});for(const[i,r]of new n((t==null?void 0:t.headers)||{}))s.headers.set(i,r)}return s}const ER=new Set([408,409,425,429,500,502,503,504]),SR=new Set([101,204,205,304]);function CT(t={}){const{fetch:e=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:s=globalThis.AbortController}=t;async function i(a){const c=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!c){let u;typeof a.options.retry=="number"?u=a.options.retry:u=Zy(a.options.method)?0:1;const d=a.response&&a.response.status||500;if(u>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(d):ER.has(d))){const h=a.options.retryDelay||0;return h>0&&await new Promise(f=>setTimeout(f,h)),r(a.request,{...a.options,retry:u-1})}}const l=yR(a);throw Error.captureStackTrace&&Error.captureStackTrace(l,r),l}const r=async function(c,l={}){var f;const u={request:c,options:bR(l,t.defaults,n),response:void 0,error:void 0};u.options.method=(f=u.options.method)==null?void 0:f.toUpperCase(),u.options.onRequest&&await u.options.onRequest(u),typeof u.request=="string"&&(u.options.baseURL&&(u.request=hR(u.request,u.options.baseURL)),(u.options.query||u.options.params)&&(u.request=ET(u.request,{...u.options.params,...u.options.query}))),u.options.body&&Zy(u.options.method)&&(IR(u.options.body)?(u.options.body=typeof u.options.body=="string"?u.options.body:JSON.stringify(u.options.body),u.options.headers=new n(u.options.headers||{}),u.options.headers.has("content-type")||u.options.headers.set("content-type","application/json"),u.options.headers.has("accept")||u.options.headers.set("accept","application/json")):("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half")));let d;if(!u.options.signal&&u.options.timeout){const m=new s;d=setTimeout(()=>m.abort(),u.options.timeout),u.options.signal=m.signal}try{u.response=await e(u.request,u.options)}catch(m){return u.error=m,u.options.onRequestError&&await u.options.onRequestError(u),await i(u)}finally{d&&clearTimeout(d)}if(u.response.body&&!SR.has(u.response.status)&&u.options.method!=="HEAD"){const m=(u.options.parseResponse?"json":u.options.responseType)||TR(u.response.headers.get("content-type")||"");switch(m){case"json":{const v=await u.response.text(),b=u.options.parseResponse||jl;u.response._data=b(v);break}case"stream":{u.response._data=u.response.body;break}default:u.response._data=await u.response[m]()}}return u.options.onResponse&&await u.options.onResponse(u),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await u.options.onResponseError(u),await i(u)):u.response},o=async function(c,l){return(await r(c,l))._data};return o.raw=r,o.native=(...a)=>e(...a),o.create=(a={})=>CT({...t,defaults:{...t.defaults,...a}}),o}const zp=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),DR=zp.fetch||(()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!"))),AR=zp.Headers,CR=zp.AbortController,PR=CT({fetch:DR,Headers:AR,AbortController:CR}),RR=PR,kR=()=>{var t;return((t=window==null?void 0:window.__NUXT__)==null?void 0:t.config)||{}},Hl=kR().app,UR=()=>Hl.baseURL,NR=()=>Hl.buildAssetsDir,Jp=(...t)=>DT(PT(),NR(),...t),PT=(...t)=>{const e=Hl.cdnURL||Hl.baseURL;return t.length?DT(e,...t):e};globalThis.__buildAssetsURL=Jp,globalThis.__publicAssetsURL=PT;globalThis.$fetch||(globalThis.$fetch=RR.create({baseURL:UR()}));function If(t,e={},n){for(const s in t){const i=t[s],r=n?`${n}:${s}`:s;typeof i=="object"&&i!==null?If(i,e,r):typeof i=="function"&&(e[r]=i)}return e}const xR={run:t=>t()},MR=()=>xR,RT=typeof console.createTask<"u"?console.createTask:MR;function OR(t,e){const n=e.shift(),s=RT(n);return t.reduce((i,r)=>i.then(()=>s.run(()=>r(...e))),Promise.resolve())}function LR(t,e){const n=e.shift(),s=RT(n);return Promise.all(t.map(i=>s.run(()=>i(...e))))}function hh(t,e){for(const n of[...t])n(e)}class FR{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,n,s={}){if(!e||typeof n!="function")return()=>{};const i=e;let r;for(;this._deprecatedHooks[e];)r=this._deprecatedHooks[e],e=r.to;if(r&&!s.allowDeprecated){let o=r.message;o||(o=`${i} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(o)||
20(console.warn(o),this._deprecatedMessages.add(o))}if(!n.name)try{Object.defineProperty(n,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(n),()=>{n&&(this.removeHook(e,n),n=void 0)}}hookOnce(e,n){let s,i=(...r)=>(typeof s=="function"&&s(),s=void 0,i=void 0,n(...r));return s=this.hook(e,i),s}removeHook(e,n){if(this._hooks[e]){const s=this._hooks[e].indexOf(n);s!==-1&&this._hooks[e].splice(s,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,n){this._deprecatedHooks[e]=typeof n=="string"?{to:n}:n;const s=this._hooks[e]||[];delete this._hooks[e];for(const i of s)this.hook(e,i)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const n in e)this.deprecateHook(n,e[n])}addHooks(e){const n=If(e),s=Object.keys(n).map(i=>this.hook(i,n[i]));return()=>{for(const i of s.splice(0,s.length))i()}}removeHooks(e){const n=If(e);for(const s in n)this.removeHook(s,n[s])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...n){return n.unshift(e),this.callHookWith(OR,e,...n)}callHookParallel(e,...n){return n.unshift(e),this.callHookWith(LR,e,...n)}callHookWith(e,n,...s){const i=this._before||this._after?{name:n,args:s,context:{}}:void 0;this._before&&hh(this._before,i);const r=e(n in this._hooks?[...this._hooks[n]]:[],s);return r instanceof Promise?r.finally(()=>{this._after&&i&&hh(this._after,i)}):(this._after&&i&&hh(this._after,i),r)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const n=this._before.indexOf(e);n!==-1&&this._before.splice(n,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const n=this._after.indexOf(e);n!==-1&&this._after.splice(n,1)}}}}function kT(){return new FR}function VR(t={}){let e,n=!1;const s=o=>{if(e&&e!==o)throw new Error("Context conflict")};let i;if(t.asyncContext){const o=t.AsyncLocalStorage||globalThis.AsyncLocalStorage;o?i=new o:console.warn("[unctx] `AsyncLocalStorage` is not provided.")}const r=()=>{if(i&&e===void 0){const o=i.getStore();if(o!==void 0)return o}return e};return{use:()=>{const o=r();if(o===void 0)throw new Error("Context is not available");return o},tryUse:()=>r(),set:(o,a)=>{a||s(o),e=o,n=!0},unset:()=>{e=void 0,n=!1},call:(o,a)=>{s(o),e=o;try{return i?i.run(o,a):a()}finally{n||(e=void 0)}},async callAsync(o,a){e=o;const c=()=>{e=o},l=()=>e===o?c:void 0;wf.add(l);try{const u=i?i.run(o,a):a();return n||(e=void 0),await u}finally{wf.delete(l)}}}}function qR(t={}){const e={};return{get(n,s={}){return e[n]||(e[n]=VR({...t,...s})),e[n],e[n]}}}const Wl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:typeof window<"u"?window:{},e_="__unctx__",GR=Wl[e_]||(Wl[e_]=qR()),BR=(t,e={})=>GR.get(t,e),t_="__unctx_async_handlers__",wf=Wl[t_]||(Wl[t_]=new Set);function $a(t){const e=[];for(const i of wf){const r=i();r&&e.push(r)}const n=()=>{for(const i of e)i()};let s=t();return s&&typeof s=="object"&&"catch"in s&&(s=s.catch(i=>{throw n(),i})),[s,n]}const UT=BR("nuxt-app",{asyncContext:!1}),jR="__nuxt_plugin";function $R(t){let e=0;const n={_scope:Cp(),provide:void 0,globalName:"nuxt",versions:{get nuxt(){return"3.11.2"},get vue(){return n.vueApp.version}},payload:Os({data:{},state:{},once:new Set,_errors:{},...window.__NUXT__??{}}),static:{data:{}},runWithContext:i=>n._scope.run(()=>KR(n,i)),isHydrating:!0,deferHydration(){if(!n.isHydrating)return()=>{};e++;let i=!1;return()=>{if(!i&&(i=!0,e--,e===0))return n.isHydrating=!1,n.callHook("app:suspense:resolve")}},_asyncDataPromises:{},_asyncData:{},_payloadRevivers:{},...t};n.hooks=kT(),n.hook=n.hooks.hook,n.callHook=n.hooks.callHook,n.provide=(i,r)=>{const o="$"+i;nl(n,o,r),nl(n.vueApp.config.globalProperties,o,r)},nl(n.vueApp,"$nuxt",n),nl(n.vueApp.config.globalProperties,"$nuxt",n);{window.addEventListener("nuxt.preloadError",r=>{n.callHook("app:chunkError",{error:r.payload})}),window.useNuxtApp=window.useNuxtApp||We;const i=n.hook("app:error",(...r)=>{console.error("[nuxt] error caught during app initialization",...r)});n.hook("app:mounted",i)}const s=n.payload.config;return n.provide("config",s),n}async function HR(t,e){if(e.hooks&&t.hooks.addHooks(e.hooks),typeof e=="function"){const{provide:n}=await t.runWithContext(()=>e(t))||{};if(n&&typeof n=="object")for(const s in n)t.provide(s,n[s])}}async function WR(t,e){const n=[],s=[],i=[],r=[];let o=0;async function a(c){var u;
20const l=((u=c.dependsOn)==null?void 0:u.filter(d=>e.some(h=>h._name===d)&&!n.includes(d)))??[];if(l.length>0)s.push([new Set(l),c]);else{const d=HR(t,c).then(async()=>{c._name&&(n.push(c._name),await Promise.all(s.map(async([h,f])=>{h.has(c._name)&&(h.delete(c._name),h.size===0&&(o++,await a(f)))})))});c.parallel?i.push(d.catch(h=>r.push(h))):await d}}for(const c of e)await a(c);if(await Promise.all(i),o)for(let c=0;c<o;c++)await Promise.all(i);if(r.length)throw r[0]}function Qn(t){if(typeof t=="function")return t;const e=t._name||t.name;return delete t.name,Object.assign(t.setup||(()=>{}),t,{[jR]:!0,_name:e})}function KR(t,e,n){const s=()=>e();return UT.set(t),t.vueApp.runWithContext(s)}function zR(){var e;let t;return Fp()&&(t=(e=Vo())==null?void 0:e.appContext.app.$nuxt),t=t||UT.tryUse(),t||null}function We(){const t=zR();if(!t)throw new Error("[nuxt] instance unavailable");return t}function Bu(t){return We().$config}function nl(t,e,n){Object.defineProperty(t,e,{get:()=>n})}function JR(t,e){return{ctx:{table:t},matchAll:n=>xT(n,t)}}function NT(t){const e={};for(const n in t)e[n]=n==="dynamic"?new Map(Object.entries(t[n]).map(([s,i])=>[s,NT(i)])):new Map(Object.entries(t[n]));return e}function YR(t){return JR(NT(t))}function xT(t,e,n){t.endsWith("/")&&(t=t.slice(0,-1)||"/");const s=[];for(const[r,o]of n_(e.wildcard))(t===r||t.startsWith(r+"/"))&&s.push(o);for(const[r,o]of n_(e.dynamic))if(t.startsWith(r+"/")){const a="/"+t.slice(r.length).split("/").splice(2).join("/");s.push(...xT(a,o))}const i=e.static.get(t);return i&&s.push(i),s.filter(Boolean)}function n_(t){return[...t.entries()].sort((e,n)=>e[0].length-n[0].length)}function fh(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function vf(t,e,n=".",s){if(!fh(e))return vf(t,{},n,s);const i=Object.assign({},e);for(const r in t){if(r==="__proto__"||r==="constructor")continue;const o=t[r];o!=null&&(s&&s(i,r,o,n)||(Array.isArray(o)&&Array.isArray(i[r])?i[r]=[...o,...i[r]]:fh(o)&&fh(i[r])?i[r]=vf(o,i[r],(n?`${n}.`:"")+r.toString(),s):i[r]=o))}return i}function MT(t){return(...e)=>e.reduce((n,s)=>vf(n,s,"",t),{})}const OT=MT(),QR=MT((t,e,n)=>{if(t[e]!==void 0&&typeof n=="function")return t[e]=n(t[e]),!0});function XR(t,e){try{return e in t}catch{return!1}}var ZR=Object.defineProperty,ek=(t,e,n)=>e in t?ZR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,er=(t,e,n)=>(ek(t,typeof e!="symbol"?e+"":e,n),n);class Tf extends Error{constructor(e,n={}){super(e,n),er(this,"statusCode",500),er(this,"fatal",!1),er(this,"unhandled",!1),er(this,"statusMessage"),er(this,"data"),er(this,"cause"),n.cause&&!this.cause&&(this.cause=n.cause)}toJSON(){const e={message:this.message,statusCode:Ef(this.statusCode,500)};return this.statusMessage&&(e.statusMessage=LT(this.statusMessage)),this.data!==void 0&&(e.data=this.data),e}}er(Tf,"__h3_error__",!0);function bf(t){if(typeof t=="string")return new Tf(t);if(tk(t))return t;const e=new Tf(t.message??t.statusMessage??"",{cause:t.cause||t});if(XR(t,"stack"))try{Object.defineProperty(e,"stack",{get(){return t.stack}})}catch{try{e.stack=t.stack}catch{}}if(t.data&&(e.data=t.data),t.statusCode?e.statusCode=Ef(t.statusCode,e.statusCode):t.status&&(e.statusCode=Ef(t.status,e.statusCode)),t.statusMessage?e.statusMessage=t.statusMessage:t.statusText&&(e.statusMessage=t.statusText),e.statusMessage){const n=e.statusMessage;LT(e.statusMessage)!==n&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return t.fatal!==void 0&&(e.fatal=t.fatal),t.unhandled!==void 0&&(e.unhandled=t.unhandled),e}function tk(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.__h3_error__)===!0}const nk=/[^\u0009\u0020-\u007E]/g;function LT(t=""){return t.replace(nk,"")}function Ef(t,e=200){return!t||(typeof t=="string"&&(t=Number.parseInt(t,10)),t<100||t>999)?e:t}const FT=Symbol("layout-meta"),Ec=Symbol("route"),Ls=()=>{var t;return(t=We())==null?void 0:t.$router},ju=()=>Fp()?Gt(Ec,We()._route):We()._route;function N$(t){return t}const sk=()=>{try{if(We()._processingMiddleware)return!0}catch{return!1}return!1},qt=(t,e)=>{t||(t="/");const n=typeof t=="string"?t:ET(t.path||"/",t.query||{})+(t.hash||"");
20if(e!=null&&e.open){const{target:a="_blank",windowFeatures:c={}}=e.open,l=Object.entries(c).filter(([u,d])=>d!==void 0).map(([u,d])=>`${u.toLowerCase()}=${d}`).join(", ");return open(n,a,l),Promise.resolve()}const s=(e==null?void 0:e.external)||Pr(n,{acceptRelative:!0});if(s){if(!(e!=null&&e.external))throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");const a=Gu(n).protocol;if(a&&uR(a))throw new Error(`Cannot navigate to a URL with '${a}' protocol.`)}const i=sk();if(!s&&i)return t;const r=Ls(),o=We();return s?(o._scope.stop(),e!=null&&e.replace?location.replace(n):location.href=n,i?o.isHydrating?new Promise(()=>{}):!1:Promise.resolve()):e!=null&&e.replace?r.replace(t):r.push(t)},VT="__nuxt_error",$u=()=>Iv(We().payload,"error"),eo=t=>{const e=Hu(t);try{const n=We(),s=$u();n.hooks.callHook("app:error",e),s.value=s.value||e}catch{throw e}return e},qT=async(t={})=>{const e=We(),n=$u();e.callHook("app:error:cleared",t),t.redirect&&await Ls().replace(t.redirect),n.value=null},ik=t=>!!t&&typeof t=="object"&&VT in t,Hu=t=>{const e=bf(t);return Object.defineProperty(e,VT,{value:!0,configurable:!1,writable:!1}),e},rk=-1,ok=-2,ak=-3,ck=-4,lk=-5,uk=-6;function dk(t,e){return hk(JSON.parse(t),e)}function hk(t,e){if(typeof t=="number")return i(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const n=t,s=Array(n.length);function i(r,o=!1){if(r===rk)return;if(r===ak)return NaN;if(r===ck)return 1/0;if(r===lk)return-1/0;if(r===uk)return-0;if(o)throw new Error("Invalid input");if(r in s)return s[r];const a=n[r];if(!a||typeof a!="object")s[r]=a;else if(Array.isArray(a))if(typeof a[0]=="string"){const c=a[0],l=e==null?void 0:e[c];if(l)return s[r]=l(i(a[1]));switch(c){case"Date":s[r]=new Date(a[1]);break;case"Set":const u=new Set;s[r]=u;for(let f=1;f<a.length;f+=1)u.add(i(a[f]));break;case"Map":const d=new Map;s[r]=d;for(let f=1;f<a.length;f+=2)d.set(i(a[f]),i(a[f+1]));break;case"RegExp":s[r]=new RegExp(a[1],a[2]);break;case"Object":s[r]=Object(a[1]);break;case"BigInt":s[r]=BigInt(a[1]);break;case"null":const h=Object.create(null);s[r]=h;for(let f=1;f<a.length;f+=2)h[a[f]]=i(a[f+1]);break;default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(a.length);s[r]=c;for(let l=0;l<a.length;l+=1){const u=a[l];u!==ok&&(c[l]=i(u))}}else{const c={};s[r]=c;for(const l in a){const u=a[l];c[l]=i(u)}}return s[r]}return i(0)}function fk(t){return Array.isArray(t)?t:[t]}const pk=["title","titleTemplate","script","style","noscript"],Il=["base","meta","link","style","script","noscript"],mk=["title","titleTemplate","templateParams","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"],gk=["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"],GT=["tagPosition","tagPriority","tagDuplicateStrategy","children","innerHTML","textContent","processTemplateParams"],yk=typeof window<"u";function Yp(t){let e=9;for(let n=0;n<t.length;)e=Math.imul(e^t.charCodeAt(n++),9**9);return((e^e>>>9)+65536).toString(16).substring(1,8).toLowerCase()}function s_(t){return t._h||Yp(t._d?t._d:`${t.tag}:${t.textContent||t.innerHTML||""}:${Object.entries(t.props).map(([e,n])=>`${e}:${String(n)}`).join(",")}`)}function BT(t,e){const{props:n,tag:s}=t;if(gk.includes(s))return s;if(s==="link"&&n.rel==="canonical")return"canonical";if(n.charset)return"charset";const i=["id"];s==="meta"&&i.push("name","property","http-equiv");for(const r of i)if(typeof n[r]<"u"){const o=String(n[r]);return`${s}:${r}:${o}`}return!1}function i_(t,e){return t==null?e||null:typeof t=="function"?t(e):t}async function _k(t,e,n){const s={tag:t,props:await jT(typeof e=="object"&&typeof e!="function"&&!(e instanceof Promise)?{...e}:{[["script","noscript","style"].includes(t)?"innerHTML":"textContent"]:e},["templateParams","titleTemplate"].includes(t))};return GT.forEach(i=>{const r=typeof s.props[i]<"u"?s.props[i]:n[i];typeof r<"u"&&((!["innerHTML","textContent","children"].includes(i)||pk.includes(s.tag))&&(s[i==="children"?"innerHTML":i]=r),delete s.props[i])}),s.props.body&&(s.tagPosition="bodyClose",delete s.props.body),s.tag==="script"&&typeof s.innerHTML=="object"&&(s.innerHTML=JSON.stringify(s.innerHTML),s.props.type=s.props.type||"application/json"),Array.isArray(s.props.content)?s.props.content.map(i=>({...s,props:{...s.props,content:i}})):s}function Ik(t,e){var s;const n=t==="class"?" ":";";return typeof e=="object"&&!Array.isArray(e)&&(e=Object.entries(e).filter(([,i])=>i).map(([i,r])=>t==="style"?`${i}:${r}`:i)),(s=Array.isArray(e)?e.join(n):e)==null?void 0:s.split(n).filter(i=>
20i.trim()).filter(Boolean).join(n)}async function jT(t,e){for(const n of Object.keys(t)){if(["class","style"].includes(n)){t[n]=Ik(n,t[n]);continue}if(t[n]instanceof Promise&&(t[n]=await t[n]),!e&&!GT.includes(n)){const s=String(t[n]),i=n.startsWith("data-");s==="true"||s===""?t[n]=i?"true":!0:t[n]||(i&&s==="false"?t[n]="false":delete t[n])}}return t}const wk=10;async function vk(t){const e=[];return Object.entries(t.resolvedInput).filter(([n,s])=>typeof s<"u"&&mk.includes(n)).forEach(([n,s])=>{const i=fk(s);e.push(...i.map(r=>_k(n,r,t)).flat())}),(await Promise.all(e)).flat().filter(Boolean).map((n,s)=>(n._e=t._i,t.mode&&(n._m=t.mode),n._p=(t._i<<wk)+s,n))}const r_={base:-10,title:10},o_={critical:-80,high:-10,low:20};function Kl(t){let e=100;const n=t.tagPriority;return typeof n=="number"?n:(t.tag==="meta"?(t.props["http-equiv"]==="content-security-policy"&&(e=-30),t.props.charset&&(e=-20),t.props.name==="viewport"&&(e=-15)):t.tag==="link"&&t.props.rel==="preconnect"?e=20:t.tag in r_&&(e=r_[t.tag]),typeof n=="string"&&n in o_?e+o_[n]:e)}const Tk=[{prefix:"before:",offset:-1},{prefix:"after:",offset:1}],a_=["onload","onerror","onabort","onprogress","onloadstart"],yi="%separator";function wl(t,e,n){if(typeof t!="string"||!t.includes("%"))return t;function s(o){let a;return["s","pageTitle"].includes(o)?a=e.pageTitle:o.includes(".")?a=o.split(".").reduce((c,l)=>c&&c[l]||void 0,e):a=e[o],typeof a<"u"?(a||"").replace(/"/g,'\\"'):!1}let i=t;try{i=decodeURI(t)}catch{}return(i.match(/%(\w+\.+\w+)|%(\w+)/g)||[]).sort().reverse().forEach(o=>{const a=s(o.slice(1));typeof a=="string"&&(t=t.replace(new RegExp(`\\${o}(\\W|$)`,"g"),(c,l)=>`${a}${l}`).trim())}),t.includes(yi)&&(t.endsWith(yi)&&(t=t.slice(0,-yi.length).trim()),t.startsWith(yi)&&(t=t.slice(yi.length).trim()),t=t.replace(new RegExp(`\\${yi}\\s*\\${yi}`,"g"),yi),t=wl(t,{separator:n},n)),t}async function $T(t,e={}){var u;const n=e.document||t.resolvedOptions.document;if(!n||!t.dirty)return;const s={shouldRender:!0,tags:[]};if(await t.hooks.callHook("dom:beforeRender",s),!s.shouldRender)return;const i=(await t.resolveTags()).map(d=>({tag:d,id:Il.includes(d.tag)?s_(d):d.tag,shouldRender:!0}));let r=t._dom;if(!r){r={elMap:{htmlAttrs:n.documentElement,bodyAttrs:n.body}};for(const d of["body","head"]){const h=(u=n[d])==null?void 0:u.children,f=[];for(const m of[...h].filter(v=>Il.includes(v.tagName.toLowerCase()))){const v={tag:m.tagName.toLowerCase(),props:await jT(m.getAttributeNames().reduce((w,y)=>({...w,[y]:m.getAttribute(y)}),{})),innerHTML:m.innerHTML};let b=1,D=BT(v);for(;D&&f.find(w=>w._d===D);)D=`${D}:${b++}`;v._d=D||void 0,f.push(v),r.elMap[m.getAttribute("data-hid")||s_(v)]=m}}}r.pendingSideEffects={...r.sideEffects||{}},r.sideEffects={};function o(d,h,f){const m=`${d}:${h}`;r.sideEffects[m]=f,delete r.pendingSideEffects[m]}function a({id:d,$el:h,tag:f}){const m=f.tag.endsWith("Attrs");r.elMap[d]=h,m||(["textContent","innerHTML"].forEach(v=>{f[v]&&f[v]!==h[v]&&(h[v]=f[v])}),o(d,"el",()=>{var v;(v=r.elMap[d])==null||v.remove(),delete r.elMap[d]}));for(const[v,b]of Object.entries(f._eventHandlers||{}))h.getAttribute(`data-${v}`)!==""&&((f.tag==="bodyAttrs"?n.defaultView:h).addEventListener(v.replace("on",""),b.bind(h)),h.setAttribute(`data-${v}`,""));Object.entries(f.props).forEach(([v,b])=>{const D=`attr:${v}`;if(v==="class")for(const w of(b||"").split(" ").filter(Boolean))m&&o(d,`${D}:${w}`,()=>h.classList.remove(w)),!h.classList.contains(w)&&h.classList.add(w);else if(v==="style")for(const w of(b||"").split(";").filter(Boolean)){const[y,..._]=w.split(":").map(S=>S.trim());o(d,`${D}
20:${w}:${y}`,()=>{h.style.removeProperty(y)}),h.style.setProperty(y,_.join(":"))}else h.getAttribute(v)!==b&&h.setAttribute(v,b===!0?"":String(b)),m&&o(d,D,()=>h.removeAttribute(v))})}const c=[],l={bodyClose:void 0,bodyOpen:void 0,head:void 0};for(const d of i){const{tag:h,shouldRender:f,id:m}=d;if(f){if(h.tag==="title"){n.title=h.textContent;continue}d.$el=d.$el||r.elMap[m],d.$el?a(d):Il.includes(h.tag)&&c.push(d)}}for(const d of c){const h=d.tag.tagPosition||"head";d.$el=n.createElement(d.tag.tag),a(d),l[h]=l[h]||n.createDocumentFragment(),l[h].appendChild(d.$el)}for(const d of i)await t.hooks.callHook("dom:renderTag",d,n,o);l.head&&n.head.appendChild(l.head),l.bodyOpen&&n.body.insertBefore(l.bodyOpen,n.body.firstChild),l.bodyClose&&n.body.appendChild(l.bodyClose),Object.values(r.pendingSideEffects).forEach(d=>d()),t._dom=r,t.dirty=!1,await t.hooks.callHook("dom:rendered",{renders:i})}async function bk(t,e={}){const n=e.delayFn||(s=>setTimeout(s,10));return t._domUpdatePromise=t._domUpdatePromise||new Promise(s=>n(async()=>{await $T(t,e),delete t._domUpdatePromise,s()}))}function Ek(t){return e=>{var s,i;const n=((i=(s=e.resolvedOptions.document)==null?void 0:s.head.querySelector('script[id="unhead:payload"]'))==null?void 0:i.innerHTML)||!1;return n&&e.push(JSON.parse(n)),{mode:"client",hooks:{"entries:updated":function(r){bk(r,t)}}}}}const Sk=["templateParams","htmlAttrs","bodyAttrs"],Dk={hooks:{"tag:normalise":function({tag:t}){["hid","vmid","key"].forEach(s=>{t.props[s]&&(t.key=t.props[s],delete t.props[s])});const n=BT(t)||(t.key?`${t.tag}:${t.key}`:!1);n&&(t._d=n)},"tags:resolve":function(t){const e={};t.tags.forEach(s=>{const i=(s.key?`${s.tag}:${s.key}`:s._d)||s._p,r=e[i];if(r){let a=s==null?void 0:s.tagDuplicateStrategy;if(!a&&Sk.includes(s.tag)&&(a="merge"),a==="merge"){const c=r.props;["class","style"].forEach(l=>{c[l]&&(s.props[l]?(l==="style"&&!c[l].endsWith(";")&&(c[l]+=";"),s.props[l]=`${c[l]} ${s.props[l]}`):s.props[l]=c[l])}),e[i].props={...c,...s.props};return}else if(s._e===r._e){r._duped=r._duped||[],s._d=`${r._d}:${r._duped.length+1}`,r._duped.push(s);return}else if(Kl(s)>Kl(r))return}const o=Object.keys(s.props).length+(s.innerHTML?1:0)+(s.textContent?1:0);if(Il.includes(s.tag)&&o===0){delete e[i];return}e[i]=s});const n=[];Object.values(e).forEach(s=>{const i=s._duped;delete s._duped,n.push(s),i&&n.push(...i)}),t.tags=n,t.tags=t.tags.filter(s=>!(s.tag==="meta"&&(s.props.name||s.props.property)&&!s.props.content))}}},Ak={mode:"server",hooks:{"tags:resolve":function(t){const e={};t.tags.filter(n=>["titleTemplate","templateParams","title"].includes(n.tag)&&n._m==="server").forEach(n=>{e[n.tag]=n.tag.startsWith("title")?n.textContent:n.props}),Object.keys(e).length&&t.tags.push({tag:"script",innerHTML:JSON.stringify(e),props:{id:"unhead:payload",type:"application/json"}})}}},Ck=["script","link","bodyAttrs"],Pk=t=>({hooks:{"tags:resolve":function(e){for(const n of e.tags.filter(s=>Ck.includes(s.tag)))Object.entries(n.props).forEach(([s,i])=>{s.startsWith("on")&&typeof i=="function"&&(t.ssr&&a_.includes(s)?n.props[s]=`this.dataset.${s}fired = true`:delete n.props[s],n._eventHandlers=n._eventHandlers||{},n._eventHandlers[s]=i)}),t.ssr&&n._eventHandlers&&(n.props.src||n.props.href)&&(n.key=n.key||Yp(n.props.src||n.props.href))},"dom:renderTag":function({$el:e,tag:n}){var s,i;for(const r of Object.keys((e==null?void 0:e.dataset)||{}).filter(o=>a_.some(a=>`${a}fired`===o))){const o=r.replace("fired","");(i=(s=n._eventHandlers)==null?void 0:s[o])==null||i.call(e,new Event(o.replace("on","")))}}}}),Rk=["link","style","script","noscript"],kk={hooks:{"tag:normalise":({tag:t})=>{t.key&&Rk.includes(t.tag)&&(t.props["data-hid"]=t._h=Yp(t.key))}}},Uk={hooks:{"tags:resolve":t=>{const e=n=>{var s;return(s=t.tags.find(i=>i._d===n))==null?void 0:s._p};for(const{prefix:n,offset:s}of Tk)for(const i of t.tags.filter(r=>typeof r.tagPriority=="string"&&r.tagPriority.startsWith(n))){const r=e(i.tagPriority.replace(n,""));typeof r<"u"&&(i._p=r+s)}t.tags.sort((n,s)=>n._p-s._p).sort((n,s)=>Kl(n)-Kl(s))}}},Nk={meta:"content",link:"href",htmlAttrs:"lang"},xk=t=>({hooks:{"tags:resolve":e=>{var a;const{tags:n}=e,s=(a=n.find(c=>c.tag==="title"))==null?void 0:a.textContent,i=n.findIndex(c=>c.tag==="templateParams"),r=i!==-1?n[i].props:{},o=r.separator||"|";delete r.separator,r.pageTitle=wl(r.pageTitle||s||"",r,o);for(const c of n.filter(l=>l.processTemplateParams!==!1)){const l=Nk[c.tag];l&&typeof c.props[l]=="string"?c.props[l]=wl(c.props[l],r,o):(c.processTemplateParams===!0||["titleTemplate","title"].includes(c.tag))&&["
20innerHTML","textContent"].forEach(u=>{typeof c[u]=="string"&&(c[u]=wl(c[u],r,o))})}t._templateParams=r,t._separator=o,e.tags=n.filter(c=>c.tag!=="templateParams")}}}),Mk={hooks:{"tags:resolve":t=>{const{tags:e}=t;let n=e.findIndex(i=>i.tag==="titleTemplate");const s=e.findIndex(i=>i.tag==="title");if(s!==-1&&n!==-1){const i=i_(e[n].textContent,e[s].textContent);i!==null?e[s].textContent=i||e[s].textContent:delete e[s]}else if(n!==-1){const i=i_(e[n].textContent);i!==null&&(e[n].textContent=i,e[n].tag="title",n=-1)}n!==-1&&delete e[n],t.tags=e.filter(Boolean)}}},Ok={hooks:{"tags:afterResolve":function(t){for(const e of t.tags)typeof e.innerHTML=="string"&&(e.innerHTML&&["application/ld+json","application/json"].includes(e.props.type)?e.innerHTML=e.innerHTML.replace(/</g,"\\u003C"):e.innerHTML=e.innerHTML.replace(new RegExp(`</${e.tag}`,"g"),`<\\/${e.tag}`))}}};let HT;function Lk(t={}){const e=Fk(t);return e.use(Ek()),HT=e}function c_(t,e){return!t||t==="server"&&e||t==="client"&&!e}function Fk(t={}){const e=kT();e.addHooks(t.hooks||{}),t.document=t.document||(yk?document:void 0);const n=!t.document,s=()=>{a.dirty=!0,e.callHook("entries:updated",a)};let i=0,r=[];const o=[],a={plugins:o,dirty:!1,resolvedOptions:t,hooks:e,headEntries(){return r},use(c){const l=typeof c=="function"?c(a):c;(!l.key||!o.some(u=>u.key===l.key))&&(o.push(l),c_(l.mode,n)&&e.addHooks(l.hooks||{}))},push(c,l){l==null||delete l.head;const u={_i:i++,input:c,...l};return c_(u.mode,n)&&(r.push(u),s()),{dispose(){r=r.filter(d=>d._i!==u._i),e.callHook("entries:updated",a),s()},patch(d){r=r.map(h=>(h._i===u._i&&(h.input=u.input=d),h)),s()}}},async resolveTags(){const c={tags:[],entries:[...r]};await e.callHook("entries:resolve",c);for(const l of c.entries){const u=l.resolvedInput||l.input;if(l.resolvedInput=await(l.transform?l.transform(u):u),l.resolvedInput)for(const d of await vk(l)){const h={tag:d,entry:l,resolvedOptions:a.resolvedOptions};await e.callHook("tag:normalise",h),c.tags.push(h.tag)}}return await e.callHook("tags:beforeResolve",c),await e.callHook("tags:resolve",c),await e.callHook("tags:afterResolve",c),c.tags},ssr:n};return[Dk,Ak,Pk,kk,Uk,xk,Mk,Ok,...(t==null?void 0:t.plugins)||[]].forEach(c=>a.use(c)),a.hooks.callHook("init",a),a}function Vk(){return HT}const qk=gT.startsWith("3");function Gk(t){return typeof t=="function"?t():st(t)}function zl(t,e=""){if(t instanceof Promise)return t;const n=Gk(t);return!t||!n?n:Array.isArray(n)?n.map(s=>zl(s,e)):typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>s==="titleTemplate"||s.startsWith("on")?[s,st(i)]:[s,zl(i,s)])):n}const Bk={hooks:{"entries:resolve":function(t){for(const e of t.entries)e.resolvedInput=zl(e.input)}}},WT="usehead";function jk(t){return{install(n){qk&&(n.config.globalProperties.$unhead=t,n.config.globalProperties.$head=t,n.provide(WT,t))}}.install}function $k(t={}){t.domDelayFn=t.domDelayFn||(n=>ui(()=>setTimeout(()=>n(),0)));const e=Lk(t);return e.use(Bk),e.install=jk(e),e}const Sf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Df="__unhead_injection_handler__";function Hk(t){Sf[Df]=t}function Wk(){if(Df in Sf)return Sf[Df]();const t=Gt(WT);return t||Vk()}function KT(t,e={}){const n=e.head||Wk();if(n)return n.ssr?n.push(t,e):Kk(n,t,e)}function Kk(t,e,n={}){const s=_t(!1),i=_t({});ZA(()=>{i.value=s.value?{}:zl(e)});const r=t.push(i.value,n);return Ui(i,a=>{r.patch(a)}),Vo()&&(Lu(()=>{r.dispose()}),xv(()=>{s.value=!0}),Nv(()=>{s.value=!1})),r}const zk={nuxt:{buildId:"3d62276a-25eb-4420-b002-8efbe556392f"}},Jk=QR(zk);function zT(){const t=We();return t._appConfig||(t._appConfig=Os(Jk)),t._appConfig}const Yk=!1,Af=!1,Qk=!1,x$={componentName:"NuxtLink"},Xk="#__nuxt";let vl,JT;function Zk(){var e;const t=(e=zT().nuxt)==null?void 0:e.buildId;return vl=$fetch(Jp(`builds/meta/${t}.json`)),vl.then(n=>{JT=YR(n.matcher)}),vl}function Wu(){return vl||Zk()}async function Qp(t){return await Wu(),OT({},...JT.matchAll(t).reverse())}function l_(t,e={}){const n=tU(t,e),s=We(),i=s._payloadCache=s._payloadCache||{};return n in i||(i[n]=nU(t).then(r=>r?YT(n).then(o=>o||(delete i[n],null)):(i[n]=null,null))),i[n]}const eU="_payload.json";function tU(t,e={}){var i;const n=new URL(t,"http://localhost");if(n.host!=="localhost"||Pr(n.pathname,{acceptRelative:!0}))throw new Error("Payload URL must not include hostname: "+t);const s=e.hash||(e.fresh?Date.now():(i=zT().nuxt)==null?void 0:i.buildId);return Kp(Bu().app.baseURL,n.pathname,eU+(s?`?${s}`:""))}async function YT(t){const e=fetch(t).then(n=>n.text().then(QT));try{return await e}catch(n){console.warn("[nuxt] Cannot load payload ",t,n)}return null}async function nU(t=ju().path){if(t=Wp(t),(await Wu()).prerendered.includes(t))return!0;const n=await Qp(t);return!!n.prerender&&!n.redirect}let sl=null;async function sU(){if(sl)return sl;const t=document.getElementById("__NUXT_DATA__");if(!t)return{};const e=await QT(t.textContent||""),n=t.dataset.src?await YT(t.dataset.src):void 0;return sl={...e,...n,...window.__NUXT__},sl}async function QT(t){return await dk(t,We()._payloadRevivers)}function iU(t,e){We()._payloadRevivers[t]=e}const u_={NuxtError:t=>Hu(t),EmptyShallowRef:t=>Fa(t==="_"?void 0:t==="0n"?BigInt(0):jl(t)),EmptyRef:t=>_t(t==="_"?void 0:t==="0n"?BigInt(0):jl(t)),ShallowRef:t=>Fa(t),ShallowReactive:t=>wc(t),Ref:t=>_t(t),Reactive:t=>Os(t)},rU=Qn({name:"nuxt:revive-payload:client",order:-30,async setup(t){let e,n;for(const s in u_)iU(s,u_[s]);Object.assign(t.payload,([e,n]=$a(()=>t.runWithContext(sU)),e=await e,n(),e)),window.__NUXT__=t.payload}}),oU=[],aU=Qn({name:"nuxt:head",enforce:"pre",setup(t){const e=$k({plugins:oU});Hk(()=>We().vueApp._context.provides.usehead),t.vueApp.use(e);{let n=!0;const s=async()=>{n=!1,await $T(e)};e.hooks.hook("dom:beforeRender",i=>{i.shouldRender=!n}),t.hooks.hook("page:start",()=>{n=!0}),t.hooks.hook("page:finish",()=>{t.isHydrating||s()}),t.hooks.hook("app:error",s),t.hooks.hook("app:suspense:resolve",s)}}});/*!
21  * vue-router v4.3.2
22  * (c) 2024 Eduardo San Martin Morote
23  * @license MIT
24  */const Yr=typeof document<"u";function cU(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Oe=Object.assign;function ph(t,e){const n={};for(const s in e){const i=e[s];n[s]=ds(i)?i.map(t):t(i)}return n}const Ea=()=>{},ds=Array.isArray,XT=/#/g,lU=/&/g,uU=/\//g,dU=/=/g,hU=/\?/g,ZT=/\+/g,fU=/%5B/g,pU=/%5D/g,eb=/%5E/g,mU=/%60/g,tb=/%7B/g,gU=/%7C/g,nb=/%7D/g,yU=/%20/g;function Xp(t){return encodeURI(""+t).replace(gU,"|").replace(fU,"[").replace(pU,"]")}function _U(t){return Xp(t).replace(tb,"{").replace(nb,"}").replace(eb,"^")}function Cf(t){return Xp(t).replace(ZT,"%2B").replace(yU,"+").replace(XT,"%23").replace(lU,"%26").replace(mU,"`").replace(tb,"{").replace(nb,"}").replace(eb,"^")}function IU(t){return Cf(t).replace(dU,"%3D")}function wU(t){return Xp(t).replace(XT,"%23").replace(hU,"%3F")}function vU(t){return t==null?"":wU(t).replace(uU,"%2F")}function Ha(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const TU=/\/$/,bU=t=>t.replace(TU,"");function mh(t,e,n="/"){let s,i={},r="",o="";const a=e.indexOf("#");let c=e.indexOf("?");return a<c&&a>=0&&(c=-1),c>-1&&(s=e.slice(0,c),r=e.slice(c+1,a>-1?a:e.length),i=t(r)),a>-1&&(s=s||e.slice(0,a),o=e.slice(a,e.length)),s=AU(s??e,n),{fullPath:s+(r&&"?")+r+o,path:s,query:i,hash:Ha(o)}}function EU(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function d_(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function SU(t,e,n){const s=e.matched.length-1,i=n.matched.length-1;return s>-1&&s===i&&bo(e.matched[s],n.matched[i])&&sb(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function bo(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}
vendor: 1,582 bytes, line 24
24function sb(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!DU(t[n],e[n]))return!1;return!0}function DU(t,e){return ds(t)?h_(t,e):ds(e)?h_(e,t):t===e}function h_(t,e){return ds(e)?t.length===e.length&&t.every((n,s)=>n===e[s]):t.length===1&&t[0]===e}function AU(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),s=t.split("/"),i=s[s.length-1];(i===".."||i===".")&&s.push("");let r=n.length-1,o,a;for(o=0;o<s.length;o++)if(a=s[o],a!==".")if(a==="..")r>1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(o).join("/")}var Wa;(function(t){t.pop="pop",t.push="push"})(Wa||(Wa={}));var Sa;(function(t){t.back="back",t.forward="forward",t.unknown=""})(Sa||(Sa={}));function CU(t){if(!t)if(Yr){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),bU(t)}const PU=/^[^#]+#/;function RU(t,e){return t.replace(PU,"#")+e}function kU(t,e){const n=document.documentElement.getBoundingClientRect(),s=t.getBoundingClientRect();return{behavior:e.behavior,left:s.left-n.left-(e.left||0),top:s.top-n.top-(e.top||0)}}const Ku=()=>({left:window.scrollX,top:window.scrollY});function UU(t){let e;if("el"in t){const n=t.el,s=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;e=kU(i,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}
vendor: 4,700 bytes, line 24
24function f_(t,e){return(history.state?history.state.position-e:-1)+t}const Pf=new Map;function NU(t,e){Pf.set(t,e)}function xU(t){const e=Pf.get(t);return Pf.delete(t),e}let MU=()=>location.protocol+"//"+location.host;function ib(t,e){const{pathname:n,search:s,hash:i}=e,r=t.indexOf("#");if(r>-1){let a=i.includes(t.slice(r))?t.slice(r).length:1,c=i.slice(a);return c[0]!=="/"&&(c="/"+c),d_(c,"")}return d_(n,t)+s+i}function OU(t,e,n,s){let i=[],r=[],o=null;const a=({state:h})=>{const f=ib(t,location),m=n.value,v=e.value;let b=0;if(h){if(n.value=f,e.value=h,o&&o===m){o=null;return}b=v?h.position-v.position:0}else s(f);i.forEach(D=>{D(n.value,m,{delta:b,type:Wa.pop,direction:b?b>0?Sa.forward:Sa.back:Sa.unknown})})};function c(){o=n.value}function l(h){i.push(h);const f=()=>{const m=i.indexOf(h);m>-1&&i.splice(m,1)};return r.push(f),f}function u(){const{history:h}=window;h.state&&h.replaceState(Oe({},h.state,{scroll:Ku()}),"")}function d(){for(const h of r)h();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:c,listen:l,destroy:d}}function p_(t,e,n,s=!1,i=!1){return{back:t,current:e,forward:n,replaced:s,position:window.history.length,scroll:i?Ku():null}}function LU(t){const{history:e,location:n}=window,s={value:ib(t,n)},i={value:e.state};i.value||r(s.value,{back:null,current:s.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(c,l,u){const d=t.indexOf("#"),h=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+c:MU()+t+c;try{e[u?"replaceState":"pushState"](l,"",h),i.value=l}catch(f){console.error(f),n[u?"replace":"assign"](h)}}function o(c,l){const u=Oe({},e.state,p_(i.value.back,c,i.value.forward,!0),l,{position:i.value.position});r(c,u,!0),s.value=c}function a(c,l){const u=Oe({},i.value,e.state,{forward:c,scroll:Ku()});r(u.current,u,!0);const d=Oe({},p_(s.value,c,null),{position:u.position+1},l);r(c,d,!1),s.value=c}return{location:s,state:i,push:a,replace:o}}function rb(t){t=CU(t);const e=LU(t),n=OU(t,e.state,e.location,e.replace);function s(r,o=!0){o||n.pauseListeners(),history.go(r)}const i=Oe({location:"",base:t,go:s,createHref:RU.bind(null,t)},e,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>e.state.value}),i}function FU(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),rb(t)}function VU(t){return typeof t=="string"||t&&typeof t=="object"}function ob(t){return typeof t=="string"||typeof t=="symbol"}const ts={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},ab=Symbol("");var m_;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(m_||(m_={}));function Eo(t,e){return Oe(new Error,{type:t,[ab]:!0},e)}function Gs(t,e){return t instanceof Error&&ab in t&&(e==null||!!(t.type&e))}const g_="[^/]+?",qU={sensitive:!1,strict:!1,start:!0,end:!0},GU=/[.+*?^${}()[\]/\\]/g;function BU(t,e){const n=Oe({},qU,e),s=[];let i=n.start?"^":"";const r=[];for(const l of t){const u=l.length?[]:[90];n.strict&&!l.length&&(i+="/");for(let d=0;d<l.length;d++){const h=l[d];let f=40+(n.sensitive?.25:0);if(h.type===0)d||(i+="/"),i+=h.value.replace(GU,"\\$&"),f+=40;else if(h.type===1){const{value:m,repeatable:v,optional:b,regexp:D}=h;r.push({name:m,repeatable:v,optional:b});const w=D||g_;if(w!==g_){f+=10;try{new RegExp(`(${w})`)}catch(_){throw new Error(`Invalid custom RegExp for param "${m}" (${w}): `+_.message)}}let y=v?`((?:${w})(?:/(?:${w}))*)`:`(${w})`;d||(y=b&&l.length<2?`(?:/${y})`:"/"+y),b&&(y+="?"),i+=y,f+=20,b&&(f+=-8),v&&(f+=-20),w===".*"&&(f+=-50)}u.push(f)}s.push(u)}if(n.strict&&n.end){const l=s.length-1;s[l][s[l].length-1]+=.7000000000000001}n.strict||(i+="/?"),n.end?i+="$":n.strict&&(i+="(?:/|$)");const o=new RegExp(i,n.sensitive?"":"i");function a(l){const u=l.match(o),d={};if(!u)return null;for(let h=1;h<u.length;h++){const f=u[h]||"",m=r[h-1];d[m.name]=f&&m.repeatable?f.split("/"):f}return d}function c(l){let u="",d=!1;for(const h of t){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const f of h)if(f.type===0)u+=f.value;else if(f.type===1){const{value:m,repeatable:v,optional:b}=f,D=m in l?l[m]:"";if(ds(D)&&!v)throw new Error(`Provided param "${m}" is an array but it is not repeatable (* or + modifiers)`);const w=ds(D)?D.join("/"):D;if(!w)if(b)h.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${m}"`);u+=w}}return u||"/"}return{re:o,score:s,keys:r,parse:a,stringify:c}
vendor: 4,984 bytes, line 24
24}function jU(t,e){let n=0;for(;n<t.length&&n<e.length;){const s=e[n]-t[n];if(s)return s;n++}return t.length<e.length?t.length===1&&t[0]===80?-1:1:t.length>e.length?e.length===1&&e[0]===80?1:-1:0}function $U(t,e){let n=0;const s=t.score,i=e.score;for(;n<s.length&&n<i.length;){const r=jU(s[n],i[n]);if(r)return r;n++}if(Math.abs(i.length-s.length)===1){if(y_(s))return 1;if(y_(i))return-1}return i.length-s.length}function y_(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const HU={type:0,value:""},WU=/[a-zA-Z0-9_]/;function KU(t){if(!t)return[[]];if(t==="/")return[[HU]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(f){throw new Error(`ERR (${n})/"${l}": ${f}`)}let n=0,s=n;const i=[];let r;function o(){r&&i.push(r),r=[]}let a=0,c,l="",u="";function d(){l&&(n===0?r.push({type:0,value:l}):n===1||n===2||n===3?(r.length>1&&(c==="*"||c==="+")&&e(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:l,regexp:u,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):e("Invalid state to consume buffer"),l="")}function h(){l+=c}for(;a<t.length;){if(c=t[a++],c==="\\"&&n!==2){s=n,n=4;continue}switch(n){case 0:c==="/"?(l&&d(),o()):c===":"?(d(),n=1):h();break;case 4:h(),n=s;break;case 1:c==="("?n=2:WU.test(c)?h():(d(),n=0,c!=="*"&&c!=="?"&&c!=="+"&&a--);break;case 2:c===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:d(),n=0,c!=="*"&&c!=="?"&&c!=="+"&&a--,u="";break;default:e("Unknown state");break}}return n===2&&e(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}function zU(t,e,n){const s=BU(KU(t.path),n),i=Oe(s,{record:t,parent:e,children:[],alias:[]});return e&&!i.record.aliasOf==!e.record.aliasOf&&e.children.push(i),i}function JU(t,e){const n=[],s=new Map;e=w_({strict:!1,end:!0,sensitive:!1},e);function i(u){return s.get(u)}function r(u,d,h){const f=!h,m=YU(u);m.aliasOf=h&&h.record;const v=w_(e,u),b=[m];if("alias"in u){const y=typeof u.alias=="string"?[u.alias]:u.alias;for(const _ of y)b.push(Oe({},m,{components:h?h.record.components:m.components,path:_,aliasOf:h?h.record:m}))}let D,w;for(const y of b){const{path:_}=y;if(d&&_[0]!=="/"){const S=d.record.path,P=S[S.length-1]==="/"?"":"/";y.path=d.record.path+(_&&P+_)}if(D=zU(y,d,v),h?h.alias.push(D):(w=w||D,w!==D&&w.alias.push(D),f&&u.name&&!I_(D)&&o(u.name)),m.children){const S=m.children;for(let P=0;P<S.length;P++)r(S[P],D,h&&h.children[P])}h=h||D,(D.record.components&&Object.keys(D.record.components).length||D.record.name||D.record.redirect)&&c(D)}return w?()=>{o(w)}:Ea}function o(u){if(ob(u)){const d=s.get(u);d&&(s.delete(u),n.splice(n.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=n.indexOf(u);d>-1&&(n.splice(d,1),u.record.name&&s.delete(u.record.name),u.children.forEach(o),u.alias.forEach(o))}}function a(){return n}function c(u){let d=0;for(;d<n.length&&$U(u,n[d])>=0&&(u.record.path!==n[d].record.path||!cb(u,n[d]));)d++;n.splice(d,0,u),u.record.name&&!I_(u)&&s.set(u.record.name,u)}function l(u,d){let h,f={},m,v;if("name"in u&&u.name){if(h=s.get(u.name),!h)throw Eo(1,{location:u});v=h.record.name,f=Oe(__(d.params,h.keys.filter(w=>!w.optional).concat(h.parent?h.parent.keys.filter(w=>w.optional):[]).map(w=>w.name)),u.params&&__(u.params,h.keys.map(w=>w.name))),m=h.stringify(f)}else if(u.path!=null)m=u.path,h=n.find(w=>w.re.test(m)),h&&(f=h.parse(m),v=h.record.name);else{if(h=d.name?s.get(d.name):n.find(w=>w.re.test(d.path)),!h)throw Eo(1,{location:u,currentLocation:d});v=h.record.name,f=Oe({},d.params,u.params),m=h.stringify(f)}const b=[];let D=h;for(;D;)b.unshift(D.record),D=D.parent;return{name:v,path:m,params:f,matched:b,meta:XU(b)}}return t.forEach(u=>r(u)),{addRoute:r,resolve:l,removeRoute:o,getRoutes:a,getRecordMatcher:i}}function __(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n}function YU(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:QU(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function QU(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const s in t.components)e[s]=typeof n=="object"?n[s]:n;return e}function I_(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function XU(t){return t.reduce((e,n)=>Oe(e,n.meta),{})}function w_(t,e){const n={};for(const s in t)n[s]=s in e?e[s]:t[s];return n}function cb(t,e){return e.children.some(n=>n===t||cb(t,n))}function ZU(t){const e={};if(t===""||t==="?")return e;const s=(t[0]==="?"?t.slice(1):t).split("&");for(let i=0;i<s.length;++i){const r=s[i].replace(ZT," "),o=r.indexOf("="),a=Ha(o<0?r:r.slice(0,o)),c=o<0?null:Ha(r.slice(o+1));if(a in e){let l=e[a];ds(l)||(l=e[a]=[l]),l.push(c)}else e[a]=c}return e}function v_(t){let e="";for(let n in t){const s=t[n];if(n=IU(n),s==null){s!==void 0&&(e+=(e.length?"&":"")+n);continue}(ds(s)?s.map(r=>
vendor: 8,585 bytes, line 24
24r&&Cf(r)):[s&&Cf(s)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+n,r!=null&&(e+="="+r))})}return e}function eN(t){const e={};for(const n in t){const s=t[n];s!==void 0&&(e[n]=ds(s)?s.map(i=>i==null?null:""+i):s==null?s:""+s)}return e}const tN=Symbol(""),T_=Symbol(""),Zp=Symbol(""),em=Symbol(""),Rf=Symbol("");function Zo(){let t=[];function e(s){return t.push(s),()=>{const i=t.indexOf(s);i>-1&&t.splice(i,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function vi(t,e,n,s,i,r=o=>o()){const o=s&&(s.enterCallbacks[i]=s.enterCallbacks[i]||[]);return()=>new Promise((a,c)=>{const l=h=>{h===!1?c(Eo(4,{from:n,to:e})):h instanceof Error?c(h):VU(h)?c(Eo(2,{from:e,to:h})):(o&&s.enterCallbacks[i]===o&&typeof h=="function"&&o.push(h),a())},u=r(()=>t.call(s&&s.instances[i],e,n,l));let d=Promise.resolve(u);t.length<3&&(d=d.then(l)),d.catch(h=>c(h))})}function gh(t,e,n,s,i=r=>r()){const r=[];for(const o of t)for(const a in o.components){let c=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(nN(c)){const u=(c.__vccOpts||c)[e];u&&r.push(vi(u,n,s,o,a,i))}else{let l=c();r.push(()=>l.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${o.path}"`));const d=cU(u)?u.default:u;o.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&vi(f,n,s,o,a,i)()}))}}return r}function nN(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function b_(t){const e=Gt(Zp),n=Gt(em),s=xn(()=>{const c=st(t.to);return e.resolve(c)}),i=xn(()=>{const{matched:c}=s.value,{length:l}=c,u=c[l-1],d=n.matched;if(!u||!d.length)return-1;const h=d.findIndex(bo.bind(null,u));if(h>-1)return h;const f=E_(c[l-2]);return l>1&&E_(u)===f&&d[d.length-1].path!==f?d.findIndex(bo.bind(null,c[l-2])):h}),r=xn(()=>i.value>-1&&oN(n.params,s.value.params)),o=xn(()=>i.value>-1&&i.value===n.matched.length-1&&sb(n.params,s.value.params));function a(c={}){return rN(c)?e[st(t.replace)?"replace":"push"](st(t.to)).catch(Ea):Promise.resolve()}return{route:s,href:xn(()=>s.value.href),isActive:r,isExactActive:o,navigate:a}}const sN=di({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:b_,setup(t,{slots:e}){const n=Os(b_(t)),{options:s}=Gt(Zp),i=xn(()=>({[S_(t.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[S_(t.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=e.default&&e.default(n);return t.custom?r:Fn("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),iN=sN;function rN(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function oN(t,e){for(const n in e){const s=e[n],i=t[n];if(typeof s=="string"){if(s!==i)return!1}else if(!ds(i)||i.length!==s.length||s.some((r,o)=>r!==i[o]))return!1}return!0}function E_(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const S_=(t,e,n)=>t??e??n,aN=di({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const s=Gt(Rf),i=xn(()=>t.route||s.value),r=Gt(T_,0),o=xn(()=>{let l=st(r);const{matched:u}=i.value;let d;for(;(d=u[l])&&!d.components;)l++;return l}),a=xn(()=>i.value.matched[o.value]);ur(T_,xn(()=>o.value+1)),ur(tN,a),ur(Rf,i);const c=_t();return Ui(()=>[c.value,a.value,t.name],([l,u,d],[h,f,m])=>{u&&(u.instances[d]=l,f&&f!==u&&l&&l===h&&(u.leaveGuards.size||(u.leaveGuards=f.leaveGuards),u.updateGuards.size||(u.updateGuards=f.updateGuards))),l&&u&&(!f||!bo(u,f)||!h)&&(u.enterCallbacks[d]||[]).forEach(v=>v(l))},{flush:"post"}),()=>{const l=i.value,u=t.name,d=a.value,h=d&&d.components[u];if(!h)return D_(n.default,{Component:h,route:l});const f=d.props[u],m=f?f===!0?l.params:typeof f=="function"?f(l):f:null,b=Fn(h,Oe({},m,e,{onVnodeUnmounted:D=>{D.component.isUnmounted&&(d.instances[u]=null)},ref:c}));return D_(n.default,{Component:b,route:l})||b}}});function D_(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const lb=aN;function cN(t){const e=JU(t.routes,t),n=t.parseQuery||ZU,s=t.stringifyQuery||v_,i=t.history,r=Zo(),o=Zo(),a=Zo(),c=Fa(ts);let l=ts;Yr&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=ph.bind(null,U=>""+U),d=ph.bind(null,vU),h=ph.bind(null,Ha);function f(U,Z){let z,se;return ob(U)?(z=e.getRecordMatcher(U),se=Z):se=U,e.addRoute(se,z)}function m(U){const Z=e.getRecordMatcher(U);Z&&e.removeRoute(Z)}function v(){return e.getRoutes().map(U=>U.record)}function b(U){return!!e.getRecordMatcher(U)}function D(U,Z){if(Z=Oe({},Z||c.value),typeof U=="string"){const I=mh(n,U,Z.path),A=e.resolve({path:I.path},Z),L=i.createHref(I.fullPath);return Oe(I,A,{params:h(A.params),hash:Ha(I.hash),redirectedFrom:void 0,href:L})}let z;if(U.path!=null)z=Oe({},U,{path:mh(n,U.path,Z.path).path});else{const I=Oe({},U.params);for(const A in I)I[A]==null&&delete I[A];z=Oe({},U,{params:d(I)}),Z.params=d(Z.params)}const se=e.resolve(z,Z),ke=U.hash||"";se.params=u(h(se.params));const Ye=EU(s,Oe({},U,{hash:_U(ke),path:se.path})),g=i.createHref(Ye);return Oe({fullPath:Ye,hash:ke,query:s===v_?eN(U.query):U.query||{}},se,{redirectedFrom:void 0,href:g})}function w(U){return typeof U=="string"?mh(n,U,c.value.path):Oe({},U)}function y(U,Z){if(l!==U)return Eo(8,{from:Z,to:U})}function _(U){return x(U)}function S(U){return _(Oe(w(U),{replace:!0}))}function P(U){const Z=U.matched[U.matched.length-1];if(Z&&Z.redirect){const{redirect:z}=Z;let se=typeof z=="function"?z(U):z;return typeof se=="string"&&(se=se.includes("?")||se.includes("#")?se=w(se):{path:se},se.params={}),Oe({query:U.query,hash:U.hash,params:se.path!=null?{}:U.params},se)}}function x(U,Z){const z=l=D(U),se=c.value,ke=U.state,Ye=U.force,g=U.replace===!0,I=P(z);if(I)return x(Oe(w(I),{state:typeof I=="object"?Oe({},ke,I.state):ke,force:Ye,replace:g}),Z||z);const A=z;A.redirectedFrom=Z;let L;return!Ye&&SU(s,se,z)&&(L=Eo(16,{to:A,from:se}),ys(se,se,!0,!1)),(L?Promise.resolve(L):N(A,se)).catch(k=>Gs(k)?Gs(k,2)?k:mi(k):ee(k,A,se)).then(k=>{if(k){if(Gs(k,2))return x(Oe({replace:g},w(k.to),{state:typeof k.to=="object"?Oe({},ke,k.to.state):ke,force:Ye}),Z||A)}else k=O(A,se,!0,g,ke);return X(A,se,k),k})}function M(U,Z){const z=y(U,Z);return z?Promise.reject(z):Promise.resolve()}function C(U){const Z=Br.values().next().value;return Z&&typeof Z.runWithContext=="function"?Z.runWithContext(U):U()}function N(U,Z){let z;const[se,ke,Ye]=lN(U,Z);z=gh(se.reverse(),"beforeRouteLeave",U,Z);for(const I of se)I.leaveGuards.forEach(A=>{z.push(vi(A,U,Z))});const g=M.bind(null,U,Z);return z.push(g),Wn(z).then(()=>{z=[];for(const I of r.list())z.push(vi(I,U,Z));return z.push(g),Wn(z)}).then(()=>{z=gh(ke,"beforeRouteUpdate",U,Z);for(const I of ke)I.updateGuards.forEach(A=>{z.push(vi(A,U,Z))});return z.push(g),Wn(z)}).then(()=>{z=[];for(const I of Ye)if(I.beforeEnter)if(ds(I.beforeEnter))for(const A of I.beforeEnter)z.push(vi(A,U,Z));else z.push(vi(I.beforeEnter,U,Z));return z.push(g),Wn(z)}).then(()=>(U.matched.forEach(I=>I.enterCallbacks={}),z=gh(Ye,"beforeRouteEnter",U,Z,C),z.push(g),Wn(z))).then(()=>{z=[];for(const I of o.list())z.push(vi(I,U,Z));return z.push(g),Wn(z)}).catch(I=>Gs(I,8)?I:Promise.reject(I))}function X(U,Z,z){a.list().forEach(se=>C(()=>se(U,Z,z)))}function O(U,Z,z,se,ke){const Ye=y(U,Z);if(Ye)return Ye;const g=Z===ts,I=Yr?history.state:{};z&&(se||g?i.replace(U.fullPath,Oe({scroll:g&&I&&I.scroll},ke)):i.push(U.fullPath,ke)),c.value=U,ys(U,Z,z,g),mi()}let ne;function _e(){ne||(ne=i.listen((U,Z,z)=>{if(!zc.listening)return;const se=D(U),ke=P(se);if(ke){x(Oe(ke,{replace:!0}),se).catch(Ea);return}l=se;const Ye=c.value;Yr&&NU(f_(Ye.fullPath,z.delta),Ku()),N(se,Ye).catch(g=>Gs(g,12)?g:Gs(g,2)?(x(g.to,se).then(I=>{Gs(I,20)&&!z.delta&&z.type===Wa.pop&&i.go(-1,!1)}).catch(Ea),Promise.reject()):(z.delta&&i.go(-z.delta,!1),ee(g,se,Ye))).then(g=>{g=g||O(se,Ye,!1),g&&(z.delta&&!Gs(g,8)?i.go(-z.delta,!1):z.type===Wa.pop&&Gs(g,20)&&i.go(-1,!1)),X(se,Ye,g)}).catch(Ea)}))}let Te=Zo(),W=Zo(),de;function ee(U,Z,z){mi(U);const se=W.list();return se.length?se.forEach(ke=>ke(U,Z,z)):console.error(U),Promise.reject(U)}function Me(){return de&&c.value!==ts?Promise.resolve():new Promise((U,Z)=>{Te.add([U,Z])})}
24function mi(U){return de||(de=!U,_e(),Te.list().forEach(([Z,z])=>U?z(U):Z()),Te.reset()),U}function ys(U,Z,z,se){const{scrollBehavior:ke}=t;if(!Yr||!ke)return Promise.resolve();const Ye=!z&&xU(f_(U.fullPath,0))||(se||!z)&&history.state&&history.state.scroll||null;return ui().then(()=>ke(U,Z,Ye)).then(g=>g&&UU(g)).catch(g=>ee(g,U,Z))}const tn=U=>i.go(U);let Gr;const Br=new Set,zc={currentRoute:c,listening:!0,addRoute:f,removeRoute:m,hasRoute:b,getRoutes:v,resolve:D,options:t,push:_,replace:S,go:tn,back:()=>tn(-1),forward:()=>tn(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:W.add,isReady:Me,install(U){const Z=this;U.component("RouterLink",iN),U.component("RouterView",lb),U.config.globalProperties.$router=Z,Object.defineProperty(U.config.globalProperties,"$route",{enumerable:!0,get:()=>st(c)}),Yr&&!Gr&&c.value===ts&&(Gr=!0,_(i.location).catch(ke=>{}));const z={};for(const ke in ts)Object.defineProperty(z,ke,{get:()=>c.value[ke],enumerable:!0});U.provide(Zp,Z),U.provide(em,wc(z)),U.provide(Rf,c);const se=U.unmount;Br.add(U),U.unmount=function(){Br.delete(U),Br.size<1&&(l=ts,ne&&ne(),ne=null,c.value=ts,Gr=!1,de=!1),se()}}};function Wn(U){return U.reduce((Z,z)=>Z.then(()=>C(z)),Promise.resolve())}return zc}function lN(t,e){const n=[],s=[],i=[],r=Math.max(e.matched.length,t.matched.length);for(let o=0;o<r;o++){const a=e.matched[o];a&&(t.matched.find(l=>bo(l,a))?s.push(a):n.push(a));const c=t.matched[o];c&&(e.matched.find(l=>bo(l,c))||i.push(c))}return[n,s,i]}function uN(){return Gt(em)}const dN=(t,e)=>e.path.replace(/(:\w+)\([^)]+\)/g,"$1").replace(/(:\w+)[?+*]/g,"$1").replace(/:\w+/g,n=>{var s;return((s=t.params[n.slice(1)])==null?void 0:s.toString())||""}),kf=(t,e)=>{const n=t.route.matched.find(i=>{var r;return((r=i.components)==null?void 0:r.default)===t.Component.type}),s=e??(n==null?void 0:n.meta.key)??(n&&dN(t.route,n));return typeof s=="function"?s(t.route):s},hN=(t,e)=>({default:()=>t?Fn(uC,t===!0?{}:t,e):e});function tm(t){return Array.isArray(t)?t:[t]}const fN="modulepreload",pN=function(t,e){return t[0]==="."?new URL(t,e).href:t},A_={},mN=function(e,n,s){let i=Promise.resolve();if(n&&n.length>0){const r=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(c=>{if(c=pN(c,s),c in A_)return;A_[c]=!0;const l=c.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(!!s)for(let f=r.length-1;f>=0;f--){const m=r[f];if(m.href===c&&(!l||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${u}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":fN,l||(h.as="script",h.crossOrigin=""),h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),l)return new Promise((f,m)=>{h.addEventListener("load",f),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>e()).catch(r=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=r,window.dispatchEvent(o),!o.defaultPrevented)throw r})},ye=(...t)=>mN(...t).catch(e=>{const n=new Event("nuxt.preloadError");throw n.payload=e,window.dispatchEvent(n),e}),hn={middleware:["auth-admin"],layout:"admindash"},fn={middleware:["auth-admin"],layout:"admindash"},pn={middleware:["auth-admin"],layout:"admindash"},mn={middleware:["auth-admin"],layout:"admindash"},gn={middleware:["auth-admin"],layout:"admindash"},yn={middleware:["auth-admin"],layout:"admindash"},_n={middleware:["auth-admin"],layout:"admindash"},In={middleware:["auth-admin"],layout:"admindash"},wn={middleware:["auth-admin"],layout:"admindash"},vn={middleware:["auth-admin"],layout:"admindash"},Tn={middleware:["auth-administration"],layout:"administrationdash"},bn={middleware:["auth-administration"],layout:"administrationdash"},En={middleware:["auth-administration"],layout:"administrationdash"},Sn={middleware:["auth-administration"],layout:"administrationdash"},yh=null,_h=null,Ih=null,wh=null,Dn={middleware:["auth-facilitator"],layout:"facilitatordash"},An={middleware:["auth-facilitator"],layout:"facilitatordash"},Cn={middleware:["auth-facilitator"],layout:"facilitatordash"},Pn={middleware:["auth"]},vh=null,Th=null,bh=null,Rn={middleware:["auth-parents"],layout:"parentsdash"},kn={middleware:["auth-parents"]},Eh=null,C_=[{name:(hn==null?void 0:hn.name)??"admin-dash-errors",path:(hn==null?void 0:hn.path)??"/admin/dash/errors",meta:hn||{},alias:(hn==null?void 0:hn.alias)||[],redirect:hn==null?void 0:hn.redirect,component:()=>ye(()=>import("./BDQ9MDMk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url).then(t=>t.default||t)},{name:(fn==null?void 0:fn.name)??"admin-dash-facilitators",path:(fn==null?void 0:fn.path)??"/admin/dash/facilitators",meta:fn||{},alias:(fn==null?void 0:fn.alias)||[],redirect:fn==null?void 0:fn.redirect,component:()=>ye(()=>import("./BbyXTb7X.js"),__vite__mapDeps([8,1,2,3,9,6,4,5,10]),import.meta.url).then(t=>t.default||t)},{name:(pn==null?void 0:pn.name)??"admin-dash-feedback",path:(pn==null?void 0:pn.path)??"/admin/dash/feedback",meta:pn||{},alias:(pn==null?void 0:pn.alias)||[],redirect:pn==null?void 0:pn.redirect,component:()=>ye(()=>import("./CVJFRJPe.js"),__vite__mapDeps([11,1,2,4,7,6]),import.meta.url).then(t=>t.default||t)},{name:(mn==null?void 0:mn.name)??"admin-dash-files",path:(mn==null?void 0:mn.path)??"/admin/dash/files",meta:mn||{},alias:(mn==null?void 0:mn.alias)||[],redirect:mn==null?void 0:mn.redirect,component:()=>ye(()=>import("./Bsqh1IXA.js"),__vite__mapDeps([12,1,13,6,14,2,10,5,15]),import.meta.url).then(t=>t.default||t)},{name:(gn==null?void 0:gn.name)??"admin-dash-members",path:(gn==null?void 0:gn.path)??"/admin/dash/members",meta:gn||{},alias:(gn==null?void 0:gn.alias)||[],redirect:gn==null?void 0:gn.redirect,component:()=>ye(()=>import("./D_fjAe7V.js"),__vite__mapDeps([16,1,17,13,6,2,9,4,5,7]),import.meta.url).then(t=>t.default||t)},{name:(yn==null?void 0:yn.name)??"admin-dash-nodemailer",path:(yn==null?void 0:yn.path)??"/admin/dash/nodemailer",meta:yn||{},alias:(yn==null?void 0:yn.alias)||[],redirect:yn==null?void 0:yn.redirect,component:()=>ye(()=>import("./DBNSq6wU.js"),__vite__mapDeps([18,1,17,13,6,2,3,4,5,7]),import.meta.url).then(t=>t.default||t)},{name:(_n==null?void 0:_n.name)??"admin-dash-settings",path:(_n==null?void 0:_n.path)??"/admin/dash/settings",meta:_n||{},alias:(_n==null?void 0:_n.alias)||[],redirect:_n==null?void 0:_n.redirect,component:()=>ye(()=>import("./BGORVvuQ.js"),__vite__mapDeps([19,1]),import.meta.url).then(t=>t.default||t)},{name:(In==null?void 0:In.name)??"admin-dash-tasks",path:(In==null?void 0:In.path)??"/admin/dash/tasks",meta:In||{},alias:(In==null?void 0:In.alias)||[],redirect:In==null?void 0:In.redirect,component:()=>ye(()=>import("./PGSAeBI8.js"),__vite__mapDeps([20,1,2,3,4,5,6,7]),import.meta.url).then(t=>t.default||t)},{name:(wn==null?void 0:wn.name)??"admin-dash-warnings",path:(wn==null?void 0:wn.path)??"/admin/dash/warnings",meta:wn||{},alias:(wn==null?void 0:wn.alias)||[],redirect:wn==null?void 0:wn.redirect,component:()=>ye(()=>import("./EOzdEtZU.js"),__vite__mapDeps([21,1,2,3,4,5,6,7]),import.meta.url).then(t=>t.default||t)},{name:(vn==null?void 0:vn.name)??"admin-dash-whatsapp",path:(vn==null?void 0:vn.path)??"/admin/dash/wh
24atsapp",meta:vn||{},alias:(vn==null?void 0:vn.alias)||[],redirect:vn==null?void 0:vn.redirect,component:()=>ye(()=>import("./Pl_vxqg_.js"),__vite__mapDeps([22,1,17,13,6,2,23,5,7]),import.meta.url).then(t=>t.default||t)},{name:(Tn==null?void 0:Tn.name)??"administration-dash-families",path:(Tn==null?void 0:Tn.path)??"/administration/dash/families",meta:Tn||{},alias:(Tn==null?void 0:Tn.alias)||[],redirect:Tn==null?void 0:Tn.redirect,component:()=>ye(()=>import("./B37MJ9Md.js"),__vite__mapDeps([24,25,26,27,28,29,30,31,32,33,34,10,35,36,37,38,1,39,40,41,9,6,42,43,44,45,46,47,48]),import.meta.url).then(t=>t.default||t)},{name:(bn==null?void 0:bn.name)??"administration-dash",path:(bn==null?void 0:bn.path)??"/administration/dash",meta:bn||{},alias:(bn==null?void 0:bn.alias)||[],redirect:bn==null?void 0:bn.redirect,component:()=>ye(()=>import("./BrPgzZLZ.js"),__vite__mapDeps([49,28,50,27,6,34,42,31,35,43,25,44,47,26,48,30,29,23,5,51,10,52,41,1,9,53]),import.meta.url).then(t=>t.default||t)},{name:(En==null?void 0:En.name)??"administration-dash-inquiries",path:(En==null?void 0:En.path)??"/administration/dash/inquiries",meta:En||{},alias:(En==null?void 0:En.alias)||[],redirect:En==null?void 0:En.redirect,component:()=>ye(()=>import("./D7_mnvlw.js"),__vite__mapDeps([54,32,25,30,6,26,27,35,10,31,41,1,9,47,34,48]),import.meta.url).then(t=>t.default||t)},{name:(Sn==null?void 0:Sn.name)??"administration-dash-students",path:(Sn==null?void 0:Sn.path)??"/administration/dash/students",meta:Sn||{},alias:(Sn==null?void 0:Sn.alias)||[],redirect:Sn==null?void 0:Sn.redirect,component:()=>ye(()=>import("./yKXTsfaC.js"),__vite__mapDeps([55,56,25,30,28,46,6,41,1,9,45,47,26,27,34,48,57,31,10,44]),import.meta.url).then(t=>t.default||t)},{name:"apply-facilitators",path:"/apply-facilitators",meta:{},alias:[],redirect:yh==null?void 0:yh.redirect,component:()=>ye(()=>import("./Bx-xPH1L.js"),__vite__mapDeps([58,10,35,26,27,31,5,6,59,60]),import.meta.url).then(t=>t.default||t)},{name:"apply-shivani",path:"/apply-shivani",meta:{},alias:[],redirect:_h==null?void 0:_h.redirect,component:()=>ye(()=>import("./BhTNMIup.js"),__vite__mapDeps([61,62,34,5,6,35,26,27,10,59,60,43]),import.meta.url).then(t=>t.default||t)},{name:"apply-students",path:"/apply-students",meta:{},alias:[],redirect:Ih==null?void 0:Ih.redirect,component:()=>ye(()=>import("./CYXVOzso.js"),__vite__mapDeps([63,62,34,5,6,35,26,27,10,59,60,43]),import.meta.url).then(t=>t.default||t)},{name:"connect-account",path:"/connect-account",meta:{},alias:[],redirect:wh==null?void 0:wh.redirect,component:()=>ye(()=>import("./DCdiYwWB.js"),__vite__mapDeps([64,60,38,10,5,65,6,66,67]),import.meta.url).then(t=>t.default||t)},{name:(Dn==null?void 0:Dn.name)??"facilitators-dash-groupDays",path:(Dn==null?void 0:Dn.path)??"/facilitators/dash/groupDays",meta:Dn||{},alias:(Dn==null?void 0:Dn.alias)||[],redirect:Dn==null?void 0:Dn.redirect,component:()=>ye(()=>import("./BbafVSPm.js"),__vite__mapDeps([68,69,35,70,27,10,6,41,1,9,36]),import.meta.url).then(t=>t.default||t)},{name:(An==null?void 0:An.name)??"facilitators-dash",path:(An==null?void 0:An.path)??"/facilitators/dash",meta:An||{},alias:(An==null?void 0:An.alias)||[],redirect:An==null?void 0:An.redirect,component:()=>ye(()=>import("./CTxAERh2.js"),__vite__mapDeps([71,6,25,69,35,70,27,10,50,34,42,31,43,44,47,26,48,46,32,36,41,1,9,72]),import.meta.url).then(t=>t.default||t)},{name:(Cn==null?void 0:Cn.name)??"facilitators-dash-students",path:(Cn==null?void 0:Cn.path)??"/facilitators/dash/students",meta:Cn||{},alias:(Cn==null?void 0:Cn.alias)||[],redirect:Cn==null?void 0:Cn.redirect,component:()=>ye(()=>import("./L4d6X9Q8.js"),__vite__mapDeps([73,56,25,30,28,46,6,74,44,36,41,1,9,45,47,26,27,34,48,57,31,10]),import.meta.url).then(t=>t.default||t)},{name:(Pn==null?void 0:Pn.name)??"facilitators-settings",path:(Pn==null?void 0:Pn.path)??"/facilitators/settings",meta:Pn||{},alias:(Pn==null?void 0:Pn.alias)||[],redirect:Pn==null?void 0:Pn.redirect,component:()=>ye(()=>import("./DMd4P3Gc.js"),__vite__mapDeps([75,5,6,15]),import.meta.url).then(t=>t.default||t)},{name:"index",path:"/",meta:{},alias:[],redirect:vh==null?void 0:vh.redirect,component:()=>ye(()=>import("./C9ubPts8.js"),__vite__mapDeps([76,5,6]),import.meta.url).then(t=>t.default||t)},{name:"legal-privacy-policy",path:"/legal/privacy-policy",meta:{},alias:[],redirect:Th==null?void 0:Th.redirect,component:()=>ye(()=>import("./BtRBtJJV.js"),__vite__mapDeps([77,78,67,65,5,6]),import.meta.url).then(t=>t.default||t)},{name:"legal-terms-of-service",path:"/legal/terms-of-service",meta:{},alias:[],redirect:bh==null?void 0:bh.redirect,component:()=>ye(()=>import("./BbqxCBGY.js"),__vite__mapDeps([79,5,65,6]),import.meta.url).then(t=>t.default||t)},{name:(Rn==null?void 0:Rn.name)??"parents-dash",path:(Rn==null?void 0:Rn.path)??"/parents/dash",meta:Rn||{},alias:(Rn==null?void 0:Rn.alias)||[],redirect:Rn==null?void 0:Rn.redirect,component:()=>ye(()=>import("./CBNzdYqW.js"),__vite__mapDeps([80,56,25,30,28,46,6,36,34,74,44,35,33,10,26,27,37,38,1,39,40,52,41,9,45,81]),import.meta.url).then(t=>t.default||t)},{name:(kn==null?void 0:kn.name)??"parents-settings",path:(kn==null?void 0:kn.path)??"/parents/settings",meta:kn||{},alias:(kn==null?void 0:kn.alias)||[],redirect:kn==null?void 0:kn.redirect,component:()=>ye(()=>import("./DhtPLRlh.js"),__vite__mapDeps([82,5,15,6]),import.meta.url).then(t=>t.default||t)},{name:"signin",path:"/signin",meta:{},alias:[],redirect:Eh==null?void 0:Eh.redirect,component:()=>ye(()=>import("./CZ4G7yO5.js"),__vite__mapDeps([83,10,5,66,60,67,65,38,6,15]),import.meta.url).then(t=>t.default||t)}],ub=(t,e,n)=>(e=e===!0?{}:e,{default:()=>{var s;return e?Fn(t,e,n):(s=n.default)==null?void 0:s.call(n)}});function P_(t){const e=(t==null?void 0:t.meta.key)??t.path.replace(/(:\w+)\([^)]+\)/g,"$1").replace(/(:\w+)[?+*]/g,"$1").replace(/:\w+/g,n=>{var s;return((s=t.params[n.slice(1)])==null?void 0:s.toString())||""});return typeof e=="function"?e(t):e}function gN(t,e){return t===e||e===ts?!1:P_(t)!==P_(e)?!0:!t.matched.every((s,i)=>{var r,o;return s.components&&s.components.default===((o=(r=e.matched[i])==null?void 0:r.components)==null?void 0:o.default)})}const yN={scrollBehavior(t,e,n){var l;const s=We(),i=((l=Ls().options)==null?void 0:l.scrollBehaviorType)??"auto";let r=n||void 0;const o=typeof t.meta.scrollToTop=="function"?t.meta.scrollToTop(t,e):t.meta.scrollToTop;if(!r&&e&&t&&o!==!1&&gN(t,e)&&(r={left:0,top:0}),t.path===e.path)return e.hash&&!t.hash?{left:0,top:0}:t.hash?{el:t.hash,top:R_(t.hash),behavior:i}:!1;const a=u=>!!(u.meta.pageTransition??Af),c=a(e)&&a(t)?"page:transition:finish":"page:finish";return new Promise(u=>{s.hooks.hookOnce(c,async()=>{await new Promise(d=>setTimeout(d,0)),t.hash&&(r={el:t.hash,top:R_(t.hash),behavior:i}),u(r)})})}};function R_(t){try{const e=document.querySelector(t);if(e)return parseFloat(getComputedStyle(e).scrollMarginTop)}catch{}return 0}const _N={hashMode:!1,scrollBehaviorType:"auto"},Un={..._N,...yN},IN=async t=>{var c;let e,n;if(!((c=t.meta)!=null&&c.validate))return;const s=We(),i=Ls();if(([e,n]=$a(()=>Promise.resolve(t.meta.validate(t))),e=await e,n(),e)===!0)return;const o=Hu({statusCode:404,statusMessage:`Page Not Found: ${t.fullPath}`,data:{path:t.fullPath}}),a=i.beforeResolve(l=>{if(a(),l===t){const u=i.afterEach(async()=>{u(),await s.runWithContext(()=>eo(o)),window.history.pushState({},"",t.fullPath)});return!1}})},wN=async t=>{let e,n;const s=([e,n]=$a(()=>Qp(t.path)),e=await e,n(),e);if(s.redirect)return Pr(s.redirect,{acceptRelative:!0})?(window.location.href=s.redirect,!1):s.redirect},vN=[IN,wN],Da={"auth-admin":()=>ye(()=>import("./CrvH2ZCN.js"),[],import.meta.url),"auth-administration":()=>ye(()=>import("./BPb5Avi2.js"),[],import.meta.url),"auth-facilitator":()=>ye(()=>import("./BI1zr8kC.js"),[],import.meta.url),"auth-parents":()=>ye(()=>import("./BOoAdRB5.js"),[],import.meta.url),"auth-student":()=>ye(()=>import("./tH7td2s0.js"),[],import.meta.url)};function TN(t,e,n){const{pathname:s,search:i,hash:r}=e,o=t.indexOf("#");if(o>-1){const l=r.includes(t.slice(o))?t.slice(o).length:1;let u=r.slice(l);return u[0]!=="/"&&(u="/"+u),Qy(u,"")}const a=Qy(s,t),c=!n||pR(a,n,{trailingSlash:!0})?a:n;
24return c+(c.includes("?")?"":i)+r}const bN=Qn({name:"nuxt:router",enforce:"pre",async setup(t){var b,D;let e,n,s=Bu().app.baseURL;Un.hashMode&&!s.includes("#")&&(s+="#");const i=((b=Un.history)==null?void 0:b.call(Un,s))??(Un.hashMode?FU(s):rb(s)),r=((D=Un.routes)==null?void 0:D.call(Un,C_))??C_;let o;const a=cN({...Un,scrollBehavior:(w,y,_)=>{if(y===ts){o=_;return}if(Un.scrollBehavior){if(a.options.scrollBehavior=Un.scrollBehavior,"scrollRestoration"in window.history){const S=a.beforeEach(()=>{S(),window.history.scrollRestoration="manual"})}return Un.scrollBehavior(w,ts,o||_)}},history:i,routes:r});"scrollRestoration"in window.history&&(window.history.scrollRestoration="auto"),t.vueApp.use(a);const c=Fa(a.currentRoute.value);a.afterEach((w,y)=>{c.value=y}),Object.defineProperty(t.vueApp.config.globalProperties,"previousRoute",{get:()=>c.value});const l=TN(s,window.location,t.payload.path),u=Fa(a.currentRoute.value),d=()=>{u.value=a.currentRoute.value};t.hook("page:finish",d),a.afterEach((w,y)=>{var _,S,P,x;((S=(_=w.matched[0])==null?void 0:_.components)==null?void 0:S.default)===((x=(P=y.matched[0])==null?void 0:P.components)==null?void 0:x.default)&&d()});const h={};for(const w in u.value)Object.defineProperty(h,w,{get:()=>u.value[w]});t._route=wc(h),t._middleware=t._middleware||{global:[],named:{}};try{[e,n]=$a(()=>a.isReady()),await e,n()}catch(w){[e,n]=$a(()=>t.runWithContext(()=>eo(w))),await e,n()}const f=l!==a.currentRoute.value.fullPath?a.resolve(l):a.currentRoute.value;d();const m=t.payload.state._layout;a.beforeEach(async(w,y)=>{var _;await t.callHook("page:loading:start"),w.meta=Os(w.meta),t.isHydrating&&m&&!xs(w.meta.layout)&&(w.meta.layout=m),t._processingMiddleware=!0;{const S=new Set([...vN,...t._middleware.global]);for(const P of w.matched){const x=P.meta.middleware;if(x)for(const M of tm(x))S.add(M)}{const P=await t.runWithContext(()=>Qp(w.path));if(P.appMiddleware)for(const x in P.appMiddleware)P.appMiddleware[x]?S.add(x):S.delete(x)}for(const P of S){const x=typeof P=="string"?t._middleware.named[P]||await((_=Da[P])==null?void 0:_.call(Da).then(C=>C.default||C)):P;if(!x)throw new Error(`Unknown route middleware: '${P}'.`);const M=await t.runWithContext(()=>x(w,y));if(!t.payload.serverRendered&&t.isHydrating&&(M===!1||M instanceof Error)){const C=M||bf({statusCode:404,statusMessage:`Page Not Found: ${l}`});return await t.runWithContext(()=>eo(C)),!1}if(M!==!0&&(M||M===!1))return M}}}),a.onError(async()=>{delete t._processingMiddleware,await t.callHook("page:loading:end")});const v=$u();return a.afterEach(async(w,y,_)=>{delete t._processingMiddleware,!t.isHydrating&&v.value&&await t.runWithContext(qT),_&&await t.callHook("page:loading:end"),w.matched.length===0&&await t.runWithContext(()=>eo(bf({statusCode:404,fatal:!1,statusMessage:`Page not found: ${w.fullPath}`,data:{path:w.fullPath}})))}),t.hooks.hookOnce("app:created",async()=>{try{"name"in f&&(f.name=void 0),await a.replace({...f,force:!0}),a.options.scrollBehavior=Un.scrollBehavior}catch(w){await t.runWithContext(()=>eo(w))}}),{provide:{router:a}}}}),k_=globalThis.requestIdleCallback||(t=>{const e=Date.now(),n={didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-e))};return setTimeout(()=>{t(n)},1)}),M$=globalThis.cancelIdleCallback||(t=>{clearTimeout(t)}),db=t=>{const e=We();e.isHydrating?e.hooks.hookOnce("app:suspense:resolve",()=>{k_(t)}):k_(t)},EN=Qn({name:"nuxt:payload",setup(t){Ls().beforeResolve(async(e,n)=>{if(e.path===n.path)return;const s=await l_(e.path);s&&Object.assign(t.static.data,s.data)}),db(()=>{var e;t.hooks.hook("link:prefetch",async n=>{Gu(n).protocol||await l_(n)}),((e=navigator.connection)==null?void 0:e.effectiveType)!=="slow-2g"&&setTimeout(Wu,1e3)})}}),SN=Qn(t=>{let e;async function n(){const s=await Wu();e&&clearTimeout(e),e=setTimeout(n,1e3*60*60);try{const i=await $fetch(Jp("builds/latest.json")+`?${Date.now()}`);i.id!==s.id&&t.hooks.callHook("app:manifest:update",i)}catch{}}db(()=>{e=setTimeout(n,1e3*60*60)})}),DN=!1;/*!
25 * pinia v2.1.7
26 * (c) 2023 Eduardo San Martin Morote
27 * @license MIT
28 */let hb;const Sc=t=>hb=t,fb=Symbol();function Uf(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Aa;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Aa||(Aa={}));function AN(){const t=Cp(!0),e=t.run(()=>_t({}));let n=[],s=[];const i=Mp({install(r){Sc(i),i._a=r,r.provide(fb,i),r.config.globalProperties.$pinia=i,s.forEac
28h(o=>n.push(o)),s=[]},use(r){return!this._a&&!DN?s.push(r):n.push(r),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return i}const pb=()=>{};function U_(t,e,n,s=pb){t.push(e);const i=()=>{const r=t.indexOf(e);r>-1&&(t.splice(r,1),s())};return!n&&nv()&&wA(i),i}function Hr(t,...e){t.slice().forEach(n=>{n(...e)})}const CN=t=>t();function Nf(t,e){t instanceof Map&&e instanceof Map&&e.forEach((n,s)=>t.set(s,n)),t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const s=e[n],i=t[n];Uf(i)&&Uf(s)&&t.hasOwnProperty(n)&&!Ze(s)&&!os(s)?t[n]=Nf(i,s):t[n]=s}return t}const PN=Symbol();function RN(t){return!Uf(t)||!t.hasOwnProperty(PN)}const{assign:Ii}=Object;function kN(t){return!!(Ze(t)&&t.effect)}function UN(t,e,n,s){const{state:i,actions:r,getters:o}=e,a=n.state.value[t];let c;function l(){a||(n.state.value[t]=i?i():{});const u=BA(n.state.value[t]);return Ii(u,r,Object.keys(o||{}).reduce((d,h)=>(d[h]=Mp(xn(()=>{Sc(n);const f=n._s.get(t);return o[h].call(f,f)})),d),{}))}return c=mb(t,l,e,n,s,!0),c}function mb(t,e,n={},s,i,r){let o;const a=Ii({actions:{}},n),c={deep:!0};let l,u,d=[],h=[],f;const m=s.state.value[t];!r&&!m&&(s.state.value[t]={});let v;function b(M){let C;l=u=!1,typeof M=="function"?(M(s.state.value[t]),C={type:Aa.patchFunction,storeId:t,events:f}):(Nf(s.state.value[t],M),C={type:Aa.patchObject,payload:M,storeId:t,events:f});const N=v=Symbol();ui().then(()=>{v===N&&(l=!0)}),u=!0,Hr(d,C,s.state.value[t])}const D=r?function(){const{state:C}=n,N=C?C():{};this.$patch(X=>{Ii(X,N)})}:pb;function w(){o.stop(),d=[],h=[],s._s.delete(t)}function y(M,C){return function(){Sc(s);const N=Array.from(arguments),X=[],O=[];function ne(W){X.push(W)}function _e(W){O.push(W)}Hr(h,{args:N,name:M,store:S,after:ne,onError:_e});let Te;try{Te=C.apply(this&&this.$id===t?this:S,N)}catch(W){throw Hr(O,W),W}return Te instanceof Promise?Te.then(W=>(Hr(X,W),W)).catch(W=>(Hr(O,W),Promise.reject(W))):(Hr(X,Te),Te)}}const _={_p:s,$id:t,$onAction:U_.bind(null,h),$patch:b,$reset:D,$subscribe(M,C={}){const N=U_(d,M,C.detached,()=>X()),X=o.run(()=>Ui(()=>s.state.value[t],O=>{(C.flush==="sync"?u:l)&&M({storeId:t,type:Aa.direct,events:f},O)},Ii({},c,C)));return N},$dispose:w},S=Os(_);s._s.set(t,S);const x=(s._a&&s._a.runWithContext||CN)(()=>s._e.run(()=>(o=Cp()).run(e)));for(const M in x){const C=x[M];if(Ze(C)&&!kN(C)||os(C))r||(m&&RN(C)&&(Ze(C)?C.value=m[M]:Nf(C,m[M])),s.state.value[t][M]=C);else if(typeof C=="function"){const N=y(M,C);x[M]=N,a.actions[M]=C}}return Ii(S,x),Ii(Ee(S),x),Object.defineProperty(S,"$state",{get:()=>s.state.value[t],set:M=>{b(C=>{Ii(C,M)})}}),s._p.forEach(M=>{Ii(S,o.run(()=>M({store:S,app:s._a,pinia:s,options:a})))}),m&&r&&n.hydrate&&n.hydrate(S.$state,m),l=!0,u=!0,S}function Xn(t,e,n){let s,i;const r=typeof e=="function";typeof t=="string"?(s=t,i=r?n:e):(i=t,s=t.id);function o(a,c){const l=Fp();return a=a||(l?Gt(fb,null):null),a&&Sc(a),a=hb,a._s.has(s)||(r?mb(s,e,i,a):UN(s,i,a)),a._s.get(s)}return o.$id=s,o}function N_(t){{t=Ee(t);const e={};for(const n in t){const s=t[n];(Ze(s)||os(s))&&(e[n]=Iv(t,n))}return e}}function NN(t={}){const e=t.path||window.location.pathname;let n={};try{n=jl(sessionStorage.getItem("nuxt:reload")||"{}")}catch{}if(t.force||(n==null?void 0:n.path)!==e||(n==null?void 0:n.expires)<Date.now()){try{sessionStorage.setItem("nuxt:reload",JSON.stringify({path:e,expires:Date.now()+(t.ttl??1e4)}))}catch{}if(t.persistState)try{sessionStorage.setItem("nuxt:reload:state",JSON.stringify({state:We().payload.state}))}catch{}window.location.pathname!==e?window.location.href=e:window.location.reload()}}const xN=Qn(t=>{const e=AN();return t.vueApp.use(e),Sc(e),t.payload&&t.payload.pinia&&(e.state.value=t.payload.pinia),{provide:{pinia:e}}}),MN=Qn({name:"nuxt:global-components"}),Pi={admindash:()=>ye(()=>import("./8iod1lvZ.js"),__vite__mapDeps([84,6,85,5,14,67,65,15,86,39,10]),import.meta.url).then(t=>t.default||t),administrationdash:()=>ye(()=>import("./CgH9RGFj.js"),__vite__mapDeps([87,6,88,85,5,14,67,65,15,70,27,37,86,39,34,89,90,51]),import.meta.url).then(t=>t.default||t),default:()=>ye(()=>import("./vP2_zCIN.js"),__vite__mapDeps([91,6,86,39,67,65,78,34]),import.meta.url).then(t=>t.default||t),facilitatordash:()=>ye(()=>import("./AyckwrNf.js"),__vite__mapDeps([92,6,88,85,5,14,67,65,15,70,27,37,86,39,34,89,90]),import.meta.url).then(t=>t.default||t),parentsdash:()=>ye(()=>import("./DX6i9xOy.js"),__vite__mapDeps([93,88,85,5,6,14,67,65,15,70,27,37,86,39,34,89,44]),import.meta.url).then(t=>t.default||t)},ON=Qn({name:"nuxt:prefetch",setup(t){const e=Ls();t.hooks.hook("app:mounted",()=>{e.beforeEach(async n=>{var i;const s=(i=n==null?void 0:n.meta)==null?void 0:i.layout;s&&typeof Pi[s]=="function"&&await Pi[s]()})}),t.hooks.hook("link:prefetch",n=>{if(Pr(n))return;const s=e.resolve(n);if(!s)return;const i=s.meta.layout;let r=tm(s.meta.middleware);r=r.filter(o=>
28typeof o=="string");for(const o of r)typeof Da[o]=="function"&&Da[o]();i&&typeof Pi[i]=="function"&&Pi[i]()})}}),LN={favicon:{},transparent:{},maskable:{},apple:{},appleSplashScreen:{}},FN=Qn(()=>{const t={};return ea(t,"transparent"),ea(t,"maskable"),ea(t,"favicon"),ea(t,"apple"),ea(t,"appleSplashScreen"),{provide:{pwaIcons:t}}});function ea(t,e){t[e]=Object.values(LN[e]??{}).reduce((n,s)=>{const i={...s,asImage:{src:s.url,key:`${e}-${s.name}`}};return s.width&&s.height&&(i.asImage.width=s.width,i.asImage.height=s.height),n[s.name]=i,n},{})}function VN(t={}){const{immediate:e=!1,onNeedRefresh:n,onOfflineReady:s,onRegistered:i,onRegisteredSW:r,onRegisterError:o}=t;let a,c,l;const u=async(h=!0)=>{await c,await(l==null?void 0:l())};async function d(){if("serviceWorker"in navigator){if(a=await ye(()=>import("./D5gOYdM7.js"),[],import.meta.url).then(({Workbox:h})=>new h("/sw.js",{scope:"/",type:"classic"})).catch(h=>{o==null||o(h)}),!a)return;l=async()=>{await(a==null?void 0:a.messageSkipWaiting())};{let h=!1;const f=()=>{h=!0,a==null||a.addEventListener("controlling",m=>{m.isUpdate&&window.location.reload()}),n==null||n()};a.addEventListener("installed",m=>{typeof m.isUpdate>"u"?typeof m.isExternal<"u"?m.isExternal?f():!h&&(s==null||s()):m.isExternal?window.location.reload():!h&&(s==null||s()):m.isUpdate||s==null||s()}),a.addEventListener("waiting",f),a.addEventListener("externalwaiting",f)}a.register({immediate:e}).then(h=>{r?r("/sw.js",h):i==null||i(h)}).catch(h=>{o==null||o(h)})}}return c=d(),u}function qN(t={}){const{immediate:e=!0,onNeedRefresh:n,onOfflineReady:s,onRegistered:i,onRegisteredSW:r,onRegisterError:o}=t,a=_t(!1),c=_t(!1);return{updateServiceWorker:VN({immediate:e,onNeedRefresh(){a.value=!0,n==null||n()},onOfflineReady(){c.value=!0,s==null||s()},onRegistered:i,onRegisteredSW:r,onRegisterError:o}),offlineReady:c,needRefresh:a}}const GN="standalone",BN=void 0,jN=Qn(()=>{const t=_t(!1),e=_t(!1),n=_t(!1),s=_t(!0),i=navigator.userAgent,r=i.match(/iPhone|iPad|iPod/),o=`${GN}`,a=window.matchMedia(`(display-mode: ${o})`).matches,c=_t(!!(a||r&&!i.match(/Safari/))),l=_t(c.value);window.matchMedia(`(display-mode: ${o})`).addEventListener("change",w=>{!l.value&&w.matches&&(l.value=!0)});let u;const d=()=>u,{offlineReady:h,needRefresh:f,updateServiceWorker:m}=qN({immediate:!0,onRegisterError(){t.value=!0},onRegisteredSW(w,y){u=y}}),v=async()=>{h.value=!1,f.value=!1};let b=()=>Promise.resolve(),D=()=>{};if(!s.value){let w;const y=_=>{_.preventDefault(),w=_,n.value=!0};window.addEventListener("beforeinstallprompt",y),window.addEventListener("appinstalled",()=>{w=void 0,n.value=!1}),D=()=>{w=void 0,n.value=!1,window.removeEventListener("beforeinstallprompt",y),s.value=!0,localStorage.setItem(BN,"true")},b=async()=>{if(!n.value||!w){n.value=!1;return}n.value=!1,await ui(),w.prompt(),await w.userChoice}}return{provide:{pwa:Os({isInstalled:c,isPWAInstalled:l,showInstallPrompt:n,cancelInstall:D,install:b,swActivated:e,registrationError:t,offlineReady:h,needRefresh:f,updateServiceWorker:m,cancelPrompt:v,getSWRegistration:d})}}}),$N=Qn({name:"nuxt:chunk-reload",setup(t){const e=Ls(),n=Bu(),s=new Set;e.beforeEach(()=>{s.clear()}),t.hook("app:chunkError",({error:r})=>{s.add(r)});function i(r){const a="href"in r&&r.href[0]==="#"?n.app.baseURL+r.href:Kp(n.app.baseURL,r.fullPath);NN({path:a,persistState:!0})}t.hook("app:manifest:update",()=>{e.beforeResolve(i)}),e.onError((r,o)=>{s.has(r)&&i(o)})}});var x_={};/**
29 * @license
30 * Copyright 2017 Google LLC
31 *
32 * Licensed under the Apache License, Version 2.0 (the "License");
33 * you may not use this file except in compliance with the License.
34 * You may obtain a copy of the License at
35 *
36 *   http://www.apache.org/licenses/LICENSE-2.0
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 */const gb=function(t){const e=[];let n=0;for(let s=0;s<t.length;s++){let i=t.charCodeAt(s);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)===55296&&s+1<t.length&&(t.charCodeAt(s+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++s)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},HN=function(t){const e=[];let n=0,s=0;for(;n<t.length;){const i=t[n++];if(i<128)e[s++]=String.fromCharCode(i);else if(i>191&&i<224){const r=t[n++];e[s++]=String.fromCharCode((i&31)<<6|r&63)}else if(i>239&&i<365){const r=t[n++],o=t[n++],a=t[n++],c=((i&7)<<18|(r&63)<<12|(o&63)<<6|a&63)-65536;e[s++]=String.fromCharCode(55296+(c>>10)),e[s++]=String.fromCharCode(56320+(c&1023))}else{const r=t[n++],o=t[n++];e[s++]=String.fromCharCode((i&15)<<12|(r&63)<<6|o&63)}}return e.join("")},nm={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let i=0;i<t.length;
43i+=3){const r=t[i],o=i+1<t.length,a=o?t[i+1]:0,c=i+2<t.length,l=c?t[i+2]:0,u=r>>2,d=(r&3)<<4|a>>4;let h=(a&15)<<2|l>>6,f=l&63;c||(f=64,o||(h=64)),s.push(n[u],n[d],n[h],n[f])}return s.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(gb(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):HN(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let i=0;i<t.length;){const r=n[t.charAt(i++)],a=i<t.length?n[t.charAt(i)]:0;++i;const l=i<t.length?n[t.charAt(i)]:64;++i;const d=i<t.length?n[t.charAt(i)]:64;if(++i,r==null||a==null||l==null||d==null)throw new WN;const h=r<<2|a>>4;if(s.push(h),l!==64){const f=a<<4&240|l>>2;if(s.push(f),d!==64){const m=l<<6&192|d;s.push(m)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class WN extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const KN=function(t){const e=gb(t);return nm.encodeByteArray(e,!0)},Jl=function(t){return KN(t).replace(/\./g,"")},yb=function(t){try{return nm.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
44 * @license
45 * Copyright 2022 Google LLC
46 *
47 * Licensed under the Apache License, Version 2.0 (the "License");
48 * you may not use this file except in compliance with the License.
49 * You may obtain a copy of the License at
50 *
51 *   http://www.apache.org/licenses/LICENSE-2.0
52 *
53 * Unless required by applicable law or agreed to in writing, software
54 * distributed under the License is distributed on an "AS IS" BASIS,
55 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
56 * See the License for the specific language governing permissions and
57 * limitations under the License.
58 */function _b(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
59 * @license
60 * Copyright 2022 Google LLC
61 *
62 * Licensed under the Apache License, Version 2.0 (the "License");
63 * you may not use this file except in compliance with the License.
64 * You may obtain a copy of the License at
65 *
66 *   http://www.apache.org/licenses/LICENSE-2.0
67 *
68 * Unless required by applicable law or agreed to in writing, software
69 * distributed under the License is distributed on an "AS IS" BASIS,
70 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71 * See the License for the specific language governing permissions and
72 * limitations under the License.
73 */const zN=()=>_b().__FIREBASE_DEFAULTS__,JN=()=>{if(typeof process>"u"||typeof x_>"u")return;const t=x_.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},YN=()=>
73{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&yb(t[1]);return e&&JSON.parse(e)},zu=()=>{try{return zN()||JN()||YN()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},Ib=t=>{var e,n;return(n=(e=zu())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},sm=t=>{const e=Ib(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const s=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),s]:[e.substring(0,n),s]},wb=()=>{var t;return(t=zu())===null||t===void 0?void 0:t.config},vb=t=>{var e;return(e=zu())===null||e===void 0?void 0:e[`_${t}`]};/**
74 * @license
75 * Copyright 2017 Google LLC
76 *
77 * Licensed under the Apache License, Version 2.0 (the "License");
78 * you may not use this file except in compliance with the License.
79 * You may obtain a copy of the License at
80 *
81 *   http://www.apache.org/licenses/LICENSE-2.0
82 *
83 * Unless required by applicable law or agreed to in writing, software
84 * distributed under the License is distributed on an "AS IS" BASIS,
85 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86 * See the License for the specific language governing permissions and
87 * limitations under the License.
88 */class Ka{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,s)=>{n?this.reject(n):this.resolve(s),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,s))}}}/**
89 * @license
90 * Copyright 2021 Google LLC
91 *
92 * Licensed under the Apache License, Version 2.0 (the "License");
93 * you may not use this file except in compliance with the License.
94 * You may obtain a copy of the License at
95 *
96 *   http://www.apache.org/licenses/LICENSE-2.0
97 *
98 * Unless required by applicable law or agreed to in writing, software
99 * distributed under the License is distributed on an "AS IS" BASIS,
100 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
101 * See the License for the specific language governing permissions and
102 * limitations under the License.
103 */function Tb(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"}
103,s=e||"demo-project",i=t.iat||0,r=t.sub||t.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${s}`,aud:s,iat:i,exp:i+3600,auth_time:i,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}}},t);return[Jl(JSON.stringify(n)),Jl(JSON.stringify(o)),""].join(".")}/**
104 * @license
105 * Copyright 2017 Google LLC
106 *
107 * Licensed under the Apache License, Version 2.0 (the "License");
108 * you may not use this file except in compliance with the License.
109 * You may obtain a copy of the License at
110 *
111 *   http://www.apache.org/licenses/LICENSE-2.0
112 *
113 * Unless required by applicable law or agreed to in writing, software
114 * distributed under the License is distributed on an "AS IS" BASIS,
115 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116 * See the License for the specific language governing permissions and
117 * limitations under the License.
118 */function xt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function QN(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(xt())}function XN(){var t;const e=(t=zu())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(globalThis.process)==="[object process]"}catch{return!1}}function bb(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function ZN(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function ex(){const t=xt();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function tx(){return!XN()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Ju(){try{return typeof indexedDB=="object"}catch{return!1}}function Eb(){return new Promise((t,e)=>{try{let n=!0;const s="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(s);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(s),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var r;e(((r=i.error)===null||r===void 0?void 0:r.message)||"")}}catch(n){e(n)}})}function nx(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/**
119 * @license
120 * Copyright 2017 Google LLC
121 *
122 * Licensed under the Apache License, Version 2.0 (the "License");
123 * you may not use this file except in compliance with the License.
124 * You may obtain a copy of the License at
125 *
126 *   http://www.apache.org/licenses/LICENSE-2.0
127 *
128 * Unless required by applicable law or agreed to in writing, software
129 * distributed under the License is distributed on an "AS IS" BASIS,
130 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131 * See the License for the specific language governing permissions and
132 * limitations under the License.
133 */const sx="FirebaseError";class Hn extends Error{constructor(e,n,s){super(n),this.code=e,this.customData=s,this.name=sx,Object.setPrototypeOf(this,Hn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ji.prototype.create)}}class ji{constructor(e,n,s){this.service=e,this.serviceName=n,this.errors=s}create(e,...n){const s=n[0]||{},i=`${this.service}/${e}`,r=this.errors[e],o=r?ix(r,s):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new Hn(i,a,s)}}function ix(t,e){return t.replace(rx,(n,s)=>{const i=e[s];return i!=null?String(i):`<${s}?>`})}const rx=/\{\$([^}]+)}/g;function ox(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function za(t,e){if(t===e)return!0;const n=Object.keys(t),s=Object.keys(e);for(const i of n){if(!s.includes(i))return!1;const r=t[i],o=e[i];if(M_(r)&&M_(o)){if(!za(r,o))return!1}else if(r!==o)return!1}for(const i of s)if(!n.includes(i))return!1;return!0}function M_(t){return t!==null&&typeof t=="object"}/**
134 * @license
135 * Copyright 2017 Google LLC
136 *
137 * Licensed under the Apache License, Version 2.0 (the "License");
138 * you may not use this file except in compliance with the License.
139 * You may obtain a copy of the License at
140 *
141 *   http://www.apache.org/licenses/LICENSE-2.0
142 *
143 * Unless required by applicable law or agreed to in writing, software
144 * distributed under the License is distributed on an "AS IS" BASIS,
145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
146 * See the License for the specific language governing permissions and
147 * limitations under the License.
148 */function Dc(t){const e=[];for(const[n,s]of Object.entries(t))Array.isArray(s)?s.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(s));return e.length?"&"+e.join("&"):""}function ca(t){const e={};return t.replace(/^\?/,"").split("&").forEach(s=>{if(s){const[i,r]=s.split("=");e[decodeURIComponent(i)]=decodeURIComponent(r)}}),e}function la(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function ax(t,e){const n=new cx(t,e);return n.subscribe.bind(n)}class cx{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(s=>{this.error(s)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,s){let i;if(e===void 0&&n===void 0&&s===void 0)throw new Error("Missing Observer.");lx(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:s},i.next===void 0&&(i.next=Sh),i.error===void 0&&(i.error=Sh),i.complete===void 0&&(i.complete=Sh);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),r}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(s){typeof console<"u"&&console.error&&console.error(s)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function lx(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function Sh(){}/**
149 * @license
150 * Copyright 2022 Google LLC
151 *
152 * Licensed under the Apache License, Version 2.0 (the "License");
153 * you may not use this file except in compliance with the License.
154 * You may obtain a copy of the License at
155 *
156 *   http://www.apache.org/licenses/LICENSE-2.0
157 *
158 * Unless required by applicable law or agreed to in writing, software
159 * distributed under the License is distributed on an "AS IS" BASIS,
160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
161 * See the License for the specific language governing permissions and
162 * limitations under the License.
163 */const ux=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})};/**
164 * @license
165 * Copyright 2019 Google LLC
166 *
167 * Licensed under the Apache License, Version 2.0 (the "License");
168 * you may not use this file except in compliance with the License.
169 * You may obtain a copy of the License at
170 *
171 *   http://www.apache.org/licenses/LICENSE-2.0
172 *
173 * Unless required by applicable law or agreed to in writing, software
174 * distributed under the License is distributed on an "AS IS" BASIS,
175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
176 * See the License for the specific language governing permissions and
177 * limitations under the License.
178 */const dx=1e3,hx=2,fx=4*60*60*1e3,px=.5;function xf(t,e=dx,n=hx){const s=e*Math.pow(n,t),i=Math.round(px*s*(Math.random()-.5)*2);return Math.min(fx,s+i)}/**
179 * @license
180 * Copyright 2021 Google LLC
181 *
182 * Licensed under the Apache License, Version 2.0 (the "License");
183 * you may not use this file except in compliance with the License.
184 * You may obtain a copy of the License at
185 *
186 *   http://www.apache.org/licenses/LICENSE-2.0
187 *
188 * Unless required by applicable law or agreed to in writing, software
189 * distributed under the License is distributed on an "AS IS" BASIS,
190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
191 * See the License for the specific language governing permissions and
192 * limitations under the License.
193 */function Ae(t){return t&&t._delegate?t._delegate:t}class Zt{constructor(e,n,s){this.name=e,this.instanceFactory=n,this.type=s,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}}/**
194 * @license
195 * Copyright 2019 Google LLC
196 *
197 * Licensed under the Apache License, Version 2.0 (the "License");
198 * you may not use this file except in compliance with the License.
199 * You may obtain a copy of the License at
200 *
201 *   http://www.apache.org/licenses/LICENSE-2.0
202 *
203 * Unless required by applicable law or agreed to in writing, software
204 * distributed under the License is distributed on an "AS IS" BASIS,
205 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
206 * See the License for the specific language governing permissions and
207 * limitations under the License.
208 */const tr="[DEFAULT]";/**
209 * @license
210 * Copyright 2019 Google LLC
211 *
212 * Licensed under the Apache License, Version 2.0 (the "License");
213 * you may not use this file except in compliance with the License.
214 * You may obtain a copy of the License at
215 *
216 *   http://www.apache.org/licenses/LICENSE-2.0
217 *
218 * Unless required by applicable law or agreed to in writing, software
219 * distributed under the License is distributed on an "AS IS" BASIS,
220 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
221 * See the License for the specific language governing permissions and
222 * limitations under the License.
223 */class mx{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const s=new Ka;if(this.instancesDeferred.set(n,s),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&s.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const s=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(s)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:s})}catch(r){if(i)return null;throw r}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(yx(e))try{this.getOrInitializeService({instanceIdentifier:tr})}catch{}for(const[n,s]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const r=this.getOrInitializeService({instanceIdentifier:i});s.resolve(r)}catch{}}}}clearInstance(e=tr){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=tr){return this.instances.has(e)}getOptions(e=tr){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,s=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(s))throw Error(`${this.name}(${s}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:s,options:n});for(const[r,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(r);s===a&&o.resolve(i)}return i}onInit(e,n){var s;const i=this.normalizeInstanceIdentifier(n),r=(s=this.onInitCallbacks.get(i))!==null&&s!==void 0?s:new Set;r.add(e),this.onInitCallbacks.set(i,r);const o=this.instances.get(i);return o&&e(o,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,n){const s=this.onInitCallbacks.get(n);if(s)for(const i of s)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let s=this.instances.get(e);if(!s&&this.component&&(s=this.component.instanceFactory(this.container,{instanceIdentifier:gx(e),options:n}),this.instances.set(e,s),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(s,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,s)}catch{}return s||null}normalizeInstanceIdentifier(e=tr){return this.component?this.component.multipleInstances?e:tr:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function gx(t){return t===tr?void 0:t}function yx(t){return t.instantiationMode==="EAGER"}/**
224 * @license
225 * Copyright 2019 Google LLC
226 *
227 * Licensed under the Apache License, Version 2.0 (the "License");
228 * you may not use this file except in compliance with the License.
229 * You may obtain a copy of the License at
230 *
231 *   http://www.apache.org/licenses/LICENSE-2.0
232 *
233 * Unless required by applicable law or agreed to in writing, software
234 * distributed under the License is distributed on an "AS IS" BASIS,
235 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
236 * See the License for the specific language governing permissions and
237 * limitations under the License.
238 */class _x{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new mx(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/**
239 * @license
240 * Copyright 2017 Google LLC
241 *
242 * Licensed under the Apache License, Version 2.0 (the "License");
243 * you may not use this file except in compliance with the License.
244 * You may obtain a copy of the License at
245 *
246 *   http://www.apache.org/licenses/LICENSE-2.0
247 *
248 * Unless required by applicable law or agreed to in writing, software
249 * distributed under the License is distributed on an "AS IS" BASIS,
250 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
251 * See the License for the specific language governing permissions and
252 * limitations under the License.
253 */var we;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(we||(we={}));const Ix={debug:we.DEBUG,verbose:we.VERBOSE,info:we.INFO,warn:we.WARN,error:we.ERROR,silent:we.SILENT},wx=we.INFO,vx={[we.DEBUG]:"log",[we.VERBOSE]:"log",[we.INFO]:"info",[we.WARN]:"warn",[we.ERROR]:"error"},Tx=(t,e,...n)=>{if(e<t.logLevel)return;const s=new Date().toISOString(),i=vx[e];if(i)console[i](`[${s}]  ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Ac{constructor(e){this.name=e,this._logLevel=wx,this._logHandler=Tx,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in we))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Ix[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,we.DEBUG,...e),this._logHandler(this,we.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,we.VERBOSE,...e),this._logHandler(this,we.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,we.INFO,...e),this._logHandler(this,we.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,we.WARN,...e),this._logHandler(this,we.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,we.ERROR,...e),this._logHandler(this,we.ERROR,...e)}}const bx=(t,e)=>e.some(n=>t instanceof n);let O_,L_;function Ex(){return O_||(O_=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Sx(){return L_||(L_=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Sb=new WeakMap,Mf=new WeakMap,Db=new WeakMap,Dh=new WeakMap,im=new WeakMap;function Dx(t){const e=new Promise((n,s)=>{const i=()=>{t.removeEventListener("success",r),t.removeEventListener("error",o)},r=()=>{n(Ni(t.result)),i()},o=()=>{s(t.error),i()};t.addEventListener("success",r),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&Sb.set(n,t)}).catch(()=>{}),im.set(e,t),e}function Ax(t){if(Mf.has(t))return;const e=new Promise((n,s)=>{const i=()=>{t.removeEventListener("complete",r),t.removeEventListener("error",o),t.removeEventListener("abort",o)},r=()=>{n(),i()},o=()=>{s(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",r),t.addEventListener("error",o),t.addEventListener("abort",o)});Mf.set(t,e)}let Of={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Mf.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Db.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Ni(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Cx(t){Of=t(Of)}function Px(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const s=t.call(Ah(this),e,...n);return Db.set(s,e.sort?e.sort():[e]),Ni(s)}:Sx().includes(t)?function(...e){return t.apply(Ah(this),e),Ni(Sb.get(this))}:function(...e){return Ni(t.apply(Ah(this),e))}}function Rx(t){return typeof t=="function"?Px(t):(t instanceof IDBTransaction&&Ax(t),bx(t,Ex())?new Proxy(t,Of):t)}function Ni(t){if(t instanceof IDBRequest)return Dx(t);if(Dh.has(t))return Dh.get(t);const e=Rx(t);return e!==t&&(Dh.set(t,e),im.set(e,t)),e}const Ah=t=>im.get(t);function Ab(t,e,{blocked:n,upgrade:s,blocking:i,terminated:r}={}){const o=indexedDB.open(t,e),a=Ni(o);return s&&o.addEventListener("upgradeneeded",c=>{s(Ni(o.result),c.oldVersion,c.newVersion,Ni(o.transaction),c)}),n&&o.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),a.then(c=>{r&&c.addEventListener("close",()=>r()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const kx=["get","getKey","getAll","getAllKeys","count"],Ux=["put","add","delete","clear"],Ch=new Map;function F_(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Ch.get(e))return Ch.get(e);const n=e.replace(/FromIndex$/,""),s=e!==n,i=Ux.includes(n);if(!(n in(s?IDBIndex:IDBObjectStore).prototype)||!(i||kx.includes(n)))return;const r=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;
253return s&&(l=l.index(a.shift())),(await Promise.all([l[n](...a),i&&c.done]))[0]};return Ch.set(e,r),r}Cx(t=>({...t,get:(e,n,s)=>F_(e,n)||t.get(e,n,s),has:(e,n)=>!!F_(e,n)||t.has(e,n)}));/**
254 * @license
255 * Copyright 2019 Google LLC
256 *
257 * Licensed under the Apache License, Version 2.0 (the "License");
258 * you may not use this file except in compliance with the License.
259 * You may obtain a copy of the License at
260 *
261 *   http://www.apache.org/licenses/LICENSE-2.0
262 *
263 * Unless required by applicable law or agreed to in writing, software
264 * distributed under the License is distributed on an "AS IS" BASIS,
265 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
266 * See the License for the specific language governing permissions and
267 * limitations under the License.
268 */class Nx{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(xx(n)){const s=n.getImmediate();return`${s.library}/${s.version}`}else return null}).filter(n=>n).join(" ")}}function xx(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Lf="@firebase/app",V_="0.10.2";/**
269 * @license
270 * Copyright 2019 Google LLC
271 *
272 * Licensed under the Apache License, Version 2.0 (the "License");
273 * you may not use this file except in compliance with the License.
274 * You may obtain a copy of the License at
275 *
276 *   http://www.apache.org/licenses/LICENSE-2.0
277 *
278 * Unless required by applicable law or agreed to in writing, software
279 * distributed under the License is distributed on an "AS IS" BASIS,
280 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
281 * See the License for the specific language governing permissions and
282 * limitations under the License.
283 */const yr=new Ac("@firebase/app"),Mx="@firebase/app-compat",Ox="@firebase/analytics-compat",Lx="@firebase/analytics",Fx="@firebase/app-check-compat",Vx="@firebase/app-check",qx="@firebase/auth",Gx="@firebase/auth-compat",Bx="@firebase/database",jx="@firebase/database-compat",$x="@firebase/functions",Hx="@firebase/functions-compat",Wx="@firebase/installations",Kx="@firebase/installations-compat",zx="@firebase/messaging",Jx="@firebase/messaging-compat",Yx="@firebase/performance",Qx="@firebase/performance-compat",Xx="@firebase/remote-config",Zx="@firebase/remote-config-compat",eM="@firebase/storage",tM="@firebase/storage-compat",nM="@firebase/firestore",sM="@firebase/firestore-compat",iM="firebase",rM="10.11.1";/**
284 * @license
285 * Copyright 2019 Google LLC
286 *
287 * Licensed under the Apache License, Version 2.0 (the "License");
288 * you may not use this file except in compliance with the License.
289 * You may obtain a copy of the License at
290 *
291 *   http://www.apache.org/licenses/LICENSE-2.0
292 *
293 * Unless required by applicable law or agreed to in writing, software
294 * distributed under the License is distributed on an "AS IS" BASIS,
295 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
296 * See the License for the specific language governing permissions and
297 * limitations under the License.
298 */const Ff="[DEFAULT]",oM={[Lf]:"fire-core",[Mx]:"fire-core-compat",[Lx]:"fire-analytics",[Ox]:"fire-analytics-compat",[Vx]:"fire-app-check",[Fx]:"fire-app-check-compat",[qx]:"fire-auth",[Gx]:"fire-auth-compat",[Bx]:"fire-rtdb",[jx]:"fire-rtdb-compat",[$x]:"fire-fn",[Hx]:"fire-fn-compat",[Wx]:"fire-iid",[Kx]:"fire-iid-compat",[zx]:"fire-fcm",[Jx]:"fire-fcm-compat",[Yx]:"fire-perf",[Qx]:"fire-perf-compat",[Xx]:"fire-rc",[Zx]:"fire-rc-compat",[eM]:"fire-gcs",[tM]:"fire-gcs-compat",[nM]:"fire-fst",[sM]:"fire-fst-compat","fire-js":"fire-js",[iM]:"fire-js-all"};/**
299 * @license
300 * Copyright 2019 Google LLC
301 *
302 * Licensed under the Apache License, Version 2.0 (the "License");
303 * you may not use this file except in compliance with the License.
304 * You may obtain a copy of the License at
305 *
306 *   http://www.apache.org/licenses/LICENSE-2.0
307 *
308 * Unless required by applicable law or agreed to in writing, software
309 * distributed under the License is distributed on an "AS IS" BASIS,
310 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
311 * See the License for the specific language governing permissions and
312 * limitations under the License.
313 */const Yl=new Map,aM=new Map,Vf=new Map;function q_(t,e){try{t.container.addComponent(e)}catch(n){yr.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function ln(t){const e=t.name;if(Vf.has(e))return yr.debug(`There were multiple attempts to register component ${e}.`),!1;Vf.set(e,t);for(const n of Yl.values())q_(n,t);for(const n of aM.values())q_(n,t);return!0}function ps(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function Ss(t){return t.settings!==void 0}/**
314 * @license
315 * Copyright 2019 Google LLC
316 *
317 * Licensed under the Apache License, Version 2.0 (the "License");
318 * you may not use this file except in compliance with the License.
319 * You may obtain a copy of the License at
320 *
321 *   http://www.apache.org/licenses/LICENSE-2.0
322 *
323 * Unless required by applicable law or agreed to in writing, software
324 * distributed under the License is distributed on an "AS IS" BASIS,
325 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
326 * See the License for the specific language governing permissions and
327 * limitations under the License.
328 */const cM={"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.","invali
328d-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."},xi=new ji("app","Firebase",cM);/**
329 * @license
330 * Copyright 2019 Google LLC
331 *
332 * Licensed under the Apache License, Version 2.0 (the "License");
333 * you may not use this file except in compliance with the License.
334 * You may obtain a copy of the License at
335 *
336 *   http://www.apache.org/licenses/LICENSE-2.0
337 *
338 * Unless required by applicable law or agreed to in writing, software
339 * distributed under the License is distributed on an "AS IS" BASIS,
340 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
341 * See the License for the specific language governing permissions and
342 * limitations under the License.
343 */class lM{constructor(e,n,s){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=s,this.container.addComponent(new Zt("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 xi.create("app-deleted",{appName:this._name})}}/**
344 * @license
345 * Copyright 2019 Google LLC
346 *
347 * Licensed under the Apache License, Version 2.0 (the "License");
348 * you may not use this file except in compliance with the License.
349 * You may obtain a copy of the License at
350 *
351 *   http://www.apache.org/licenses/LICENSE-2.0
352 *
353 * Unless required by applicable law or agreed to in writing, software
354 * distributed under the License is distributed on an "AS IS" BASIS,
355 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
356 * See the License for the specific language governing permissions and
357 * limitations under the License.
358 */const Rr=rM;function Cb(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const s=Object.assign({name:Ff,automaticDataCollectionEnabled:!1},e),i=s.name;if(typeof i!="string"||!i)throw xi.create("bad-app-name",{appName:String(i)});if(n||(n=wb()),!n)throw xi.create("no-options");const r=Yl.get(i);if(r){if(za(n,r.options)&&za(s,r.config))return r;throw xi.create("duplicate-app",{appName:i})}const o=new _x(i);for(const c of Vf.values())o.addComponent(c);const a=new lM(n,s,o);return Yl.set(i,a),a}function qo(t=Ff){const e=Yl.get(t);if(!e&&t===Ff&&wb())return Cb();if(!e)throw xi.create("no-app",{appName:t});return e}function kt(t,e,n){var s;let i=(s=oM[t])!==null&&s!==void 0?s:t;n&&(i+=`-${n}`);const r=i.match(/\s|\//),o=e.match(/\s|\//);if(r||o){const a=[`Unable to register library "${i}" with version "${e}":`];r&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),r&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),yr.warn(a.join(" "));return}ln(new Zt(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
359 * @license
360 * Copyright 2021 Google LLC
361 *
362 * Licensed under the Apache License, Version 2.0 (the "License");
363 * you may not use this file except in compliance with the License.
364 * You may obtain a copy of the License at
365 *
366 *   http://www.apache.org/licenses/LICENSE-2.0
367 *
368 * Unless required by applicable law or agreed to in writing, softw
368are
369 * distributed under the License is distributed on an "AS IS" BASIS,
370 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
371 * See the License for the specific language governing permissions and
372 * limitations under the License.
373 */const uM="firebase-heartbeat-database",dM=1,Ja="firebase-heartbeat-store";let Ph=null;function Pb(){return Ph||(Ph=Ab(uM,dM,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(Ja)}catch(n){console.warn(n)}}}}).catch(t=>{throw xi.create("idb-open",{originalErrorMessage:t.message})})),Ph}async function hM(t){try{const n=(await Pb()).transaction(Ja),s=await n.objectStore(Ja).get(Rb(t));return await n.done,s}catch(e){if(e instanceof Hn)yr.warn(e.message);else{const n=xi.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});yr.warn(n.message)}}}async function G_(t,e){try{const s=(await Pb()).transaction(Ja,"readwrite");await s.objectStore(Ja).put(e,Rb(t)),await s.done}catch(n){if(n instanceof Hn)yr.warn(n.message);else{const s=xi.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});yr.warn(s.message)}}}function Rb(t){return`${t.name}!${t.options.appId}`}/**
374 * @license
375 * Copyright 2021 Google LLC
376 *
377 * Licensed under the Apache License, Version 2.0 (the "License");
378 * you may not use this file except in compliance with the License.
379 * You may obtain a copy of the License at
380 *
381 *   http://www.apache.org/licenses/LICENSE-2.0
382 *
383 * Unless required by applicable law or agreed to in writing, software
384 * distributed under the License is distributed on an "AS IS" BASIS,
385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
386 * See the License for the specific language governing permissions and
387 * limitations under the License.
388 */const fM=1024,pM=30*24*60*60*1e3;class mM{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new yM(n),this._heartbeatsCachePromise=this._storage.read().then(s=>(this._heartbeatsCache=s,s))}async triggerHeartbeat(){var e,n;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=B_();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(o=>o.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const a=new Date(o.date).valueOf();return Date.now()-a<=pM}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;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"";const n=B_(),{heartbeatsToSend:s,unsentEntries:i}=gM(this._heartbeatsCache.heartbeats),r=Jl(JSON.stringify({version:2,heartbeats:s}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}}function B_(){return new Date().toISOString().substring(0,10)}function gM(t,e=fM){const n=[];let s=t.slice();for(const i of t){const r=n.find(o=>o.agent===i.agent);if(r){if(r.dates.push(i.date),j_(n)>e){r.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),j_(n)>e){n.pop();break}s=s.slice(1)}return{heartbeatsToSend:n,unsentEntries:s}}class yM{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Ju()?Eb().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await hM(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return G_(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return G_(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function j_(t){return Jl(JSON.stringify({version:2,heartbeats:t})).length}/**
389 * @license
390 * Copyright 2019 Google LLC
391 *
392 * Licensed under the Apache License, Version 2.0 (the "License");
393 * you may not use this file except in compliance with the License.
394 * You may obtain a copy of the License at
395 *
396 *   http://www.apache.org/licenses/LICENSE-2.0
397 *
398 * Unless required by applicable law or agreed to in writing, software
399 * distributed under the License is distributed on an "AS IS" BASIS,
400 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
401 * See the License for the specific language governing permissions and
402 * limitations under the License.
403 */function _M(t){ln(new Zt("platform-logger",e=>new Nx(e),"PRIVATE")),ln(new Zt("heartbeat",e=>new mM(e),"PRIVATE")),kt(Lf,V_,t),kt(Lf,V_,"esm2017"),kt("fire-js","")}_M("");var IM="firebase",wM="10.11.1";/**
404 * @license
405 * Copyright 2020 Google LLC
406 *
407 * Licensed under the Apache License, Version 2.0 (the "License");
408 * you may not use this file except in compliance with the License.
409 * You may obtain a copy of the License at
410 *
411 *   http://www.apache.org/licenses/LICENSE-2.0
412 *
413 * Unless required by applicable law or agreed to in writing, software
414 * distributed under the License is distributed on an "AS IS" BASIS,
415 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
416 * See the License for the specific language governing permissions and
417 * limitations under the License.
418 */kt(IM,wM,"app");const kb="@firebase/installations",rm="0.6.6";/**
419 * @license
420 * Copyright 2019 Google LLC
421 *
422 * Licensed under the Apache License, Version 2.0 (the "License");
423 * you may not use this file except in compliance with the License.
424 * You may obtain a copy of the License at
425 *
426 *   http://www.apache.org/licenses/LICENSE-2.0
427 *
428 * Unless required by applicable law or agreed to in writing, software
429 * distributed under the License is distributed on an "AS IS" BASIS,
430 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
431 * See the License for the specific language governing permissions and
432 * limitations under the License.
433 */const Ub=1e4,Nb=`w:${rm}`,xb="FIS_v2",vM="https://firebaseinstallations.googleapis.com/v1",TM=60*60*1e3,bM="installations",EM="Installations";/**
434 * @license
435 * Copyright 2019 Google LLC
436 *
437 * Licensed under the Apache License, Version 2.0 (the "License");
438 * you may not use this file except in compliance with the License.
439 * You may obtain a copy of the License at
440 *
441 *   http://www.apache.org/licenses/LICENSE-2.0
442 *
443 * Unless required by applicable law or agreed to in writing, software
444 * distributed under the License is distributed on an "AS IS" BASIS,
445 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
446 * See the License for the specific language governing permissions and
447 * limitations under the License.
448 */const SM={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},_r=new ji(bM,EM,SM);function Mb(t){return t instanceof Hn&&t.code.includes("request-failed")}/**
449 * @license
450 * Copyright 2019 Google LLC
451 *
452 * Licensed under the Apache License, Version 2.0 (the "License");
453 * you may not use this file except in compliance with the License.
454 * You may obtain a copy of the License at
455 *
456 *   http://www.apache.org/licenses/LICENSE-2.0
457 *
458 * Unless required by applicable law or agreed to in writing, software
459 * distributed under the License is distributed on an "AS IS" BASIS,
460 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
461 * See the License for the specific language governing permissions and
462 * limitations under the License.
463 */function Ob({projectId:t}){return`${vM}/projects/${t}/installations`}function Lb(t){return{token:t.token,requestStatus:2,expiresIn:AM(t.expiresIn),creationTime:Date.now()}}async function Fb(t,e){const s=(await e.json()).error;return _r.create("request-failed",{requestName:t,serverCode:s.code,serverMessage:s.message,serverStatus:s.status})}function Vb({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function DM(t,{refreshToken:e}){const n=Vb(t);return n.append("Authorization",CM(e)),n}async function qb(t){const e=await t();return e.status>=500&&e.status<600?t():e}function AM(t){return Number(t.replace("s","000"))}function CM(t){return`${xb} ${t}`}/**
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 */async function PM({appConfig:t,heartbeatServiceProvider:e},{fid:n}){const s=Ob(t),i=Vb(t),r=e.getImmediate({optional:!0});if(r){const l=await r.getHeartbeatsHeader();l&&i.append("x-firebase-client",l)}const o={fid:n,authVersion:xb,appId:t.appId,sdkVersion:Nb},a={method:"POST",headers:i,body:JSON.stringify(o)},c=await qb(()=>fetch(s,a));if(c.ok){const l=await c.json();return{fid:l.fid||n,registrationStatus:2,refreshToken:l.refreshToken,authToken:Lb(l.authToken)}}else throw await Fb("Create Installation",c)}/**
479 * @license
480 * Copyright 2019 Google LLC
481 *
482 * Licensed under the Apache License, Version 2.0 (the "License");
483 * you may not use this file except in compliance with the License.
484 * You may obtain a copy of the License at
485 *
486 *   http://www.apache.org/licenses/LICENSE-2.0
487 *
488 * Unless required by applicable law or agreed to in writing, software
489 * distributed under the License is distributed on an "AS IS" BASIS,
490 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
491 * See the License for the specific language governing permissions and
492 * limitations under the License.
493 */function Gb(t){return new Promise(e=>{setTimeout(e,t)})}/**
494 * @license
495 * Copyright 2019 Google LLC
496 *
497 * Licensed under the Apache License, Version 2.0 (the "License");
498 * you may not use this file except in compliance with the License.
499 * You may obtain a copy of the License at
500 *
501 *   http://www.apache.org/licenses/LICENSE-2.0
502 *
503 * Unless required by applicable law or agreed to in writing, software
504 * distributed under the License is distributed on an "AS IS" BASIS,
505 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
506 * See the License for the specific language governing permissions and
507 * limitations under the License.
508 */function RM(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/**
509 * @license
510 * Copyright 2019 Google LLC
511 *
512 * Licensed under the Apache License, Version 2.0 (the "License");
513 * you may not use this file except in compliance with the License.
514 * You may obtain a copy of the License at
515 *
516 *   http://www.apache.org/licenses/LICENSE-2.0
517 *
518 * Unless required by applicable law or agreed to in writing, software
519 * distributed under the License is distributed on an "AS IS" BASIS,
520 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
521 * See the License for the specific language governing permissions and
522 * limitations under the License.
523 */const kM=/^[cdef][\w-]{21}$/,qf="";function UM(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const n=NM(t);return kM.test(n)?n:qf}catch{return qf}}function NM(t){return RM(t).substr(0,22)}/**
524 * @license
525 * Copyright 2019 Google LLC
526 *
527 * Licensed under the Apache License, Version 2.0 (the "License");
528 * you may not use this file except in compliance with the License.
529 * You may obtain a copy of the License at
530 *
531 *   http://www.apache.org/licenses/LICENSE-2.0
532 *
533 * Unless required by applicable law or agreed to in writing, software
534 * distributed under the License is distributed on an "AS IS" BASIS,
535 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
536 * See the License for the specific language governing permissions and
537 * limitations under the License.
538 */function Yu(t){return`${t.appName}!${t.appId}`}/**
539 * @license
540 * Copyright 2019 Google LLC
541 *
542 * Licensed under the Apache License, Version 2.0 (the "License");
543 * you may not use this file except in compliance with the License.
544 * You may obtain a copy of the License at
545 *
546 *   http://www.apache.org/licenses/LICENSE-2.0
547 *
548 * Unless required by applicable law or agreed to in writing, softw
548are
549 * distributed under the License is distributed on an "AS IS" BASIS,
550 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
551 * See the License for the specific language governing permissions and
552 * limitations under the License.
553 */const Bb=new Map;function jb(t,e){const n=Yu(t);$b(n,e),xM(n,e)}function $b(t,e){const n=Bb.get(t);if(n)for(const s of n)s(e)}function xM(t,e){const n=MM();n&&n.postMessage({key:t,fid:e}),OM()}let sr=null;function MM(){return!sr&&"BroadcastChannel"in self&&(sr=new BroadcastChannel("[Firebase] FID Change"),sr.onmessage=t=>{$b(t.data.key,t.data.fid)}),sr}function OM(){Bb.size===0&&sr&&(sr.close(),sr=null)}/**
554 * @license
555 * Copyright 2019 Google LLC
556 *
557 * Licensed under the Apache License, Version 2.0 (the "License");
558 * you may not use this file except in compliance with the License.
559 * You may obtain a copy of the License at
560 *
561 *   http://www.apache.org/licenses/LICENSE-2.0
562 *
563 * Unless required by applicable law or agreed to in writing, software
564 * distributed under the License is distributed on an "AS IS" BASIS,
565 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
566 * See the License for the specific language governing permissions and
567 * limitations under the License.
568 */const LM="firebase-installations-database",FM=1,Ir="firebase-installations-store";let Rh=null;function om(){return Rh||(Rh=Ab(LM,FM,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(Ir)}}})),Rh}async function Ql(t,e){const n=Yu(t),i=(await om()).transaction(Ir,"readwrite"),r=i.objectStore(Ir),o=await r.get(n);return await r.put(e,n),await i.done,(!o||o.fid!==e.fid)&&jb(t,e.fid),e}async function Hb(t){const e=Yu(t),s=(await om()).transaction(Ir,"readwrite");await s.objectStore(Ir).delete(e),await s.done}async function Qu(t,e){const n=Yu(t),i=(await om()).transaction(Ir,"readwrite"),r=i.objectStore(Ir),o=await r.get(n),a=e(o);return a===void 0?await r.delete(n):await r.put(a,n),await i.done,a&&(!o||o.fid!==a.fid)&&jb(t,a.fid),a}/**
569 * @license
570 * Copyright 2019 Google LLC
571 *
572 * Licensed under the Apache License, Version 2.0 (the "License");
573 * you may not use this file except in compliance with the License.
574 * You may obtain a copy of the License at
575 *
576 *   http://www.apache.org/licenses/LICENSE-2.0
577 *
578 * Unless required by applicable law or agreed to in writing, software
579 * distributed under the License is distributed on an "AS IS" BASIS,
580 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
581 * See the License for the specific language governing permissions and
582 * limitations under the License.
583 */async function am(t){let e;const n=await Qu(t.appConfig,s=>{const i=VM(s),r=qM(t,i);return e=r.registrationPromise,r.installationEntry});return n.fid===qf?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}function VM(t){const e=t||{fid:UM(),registrationStatus:0};return Wb(e)}function qM(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const i=Promise.reject(_r.create("app-offline"));return{installationEntry:e,registrationPromise:i}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},s=GM(t,n);return{installationEntry:n,registrationPromise:s}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:BM(t)}:{installationEntry:e}}async function GM(t,e){try{const n=await PM(t,e);return Ql(t.appConfig,n)}catch(n){throw Mb(n)&&n.customData.serverCode===409?await Hb(t.appConfig):await Ql(t.appConfig,{fid:e.fid,registrationStatus:0}),n}}async function BM(t){let e=await $_(t.appConfig);for(;e.registrationStatus===1;)await Gb(100),e=await $_(t.appConfig);if(e.registrationStatus===0){const{installationEntry:n,registrationPromise:s}=await am(t);return s||n}return e}function $_(t){return Qu(t,e=>{if(!e)throw _r.create("installation-not-found");return Wb(e)})}function Wb(t){return jM(t)?{fid:t.fid,registrationStatus:0}:t}function jM(t){return t.registrationStatus===1&&t.registrationTime+Ub<Date.now()}/**
584 * @license
585 * Copyright 2019 Google LLC
586 *
587 * Licensed under the Apache License, Version 2.0 (the "License");
588 * you may not use this file except in compliance with the License.
589 * You may obtain a copy of the License at
590 *
591 *   http://www.apache.org/licenses/LICENSE-2.0
592 *
593 * Unless required by applicable law or agreed to in writing, software
594 * distributed under the License is distributed on an "AS IS" BASIS,
595 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
596 * See the License for the specific language governing permissions and
597 * limitations under the License.
598 */async function $M({appConfig:t,heartbeatServiceProvider:e},n){const s=HM(t,n),i=DM(t,n),r=e.getImmediate({optional:!0});if(r){const l=await r.getHeartbeatsHeader();l&&i.append("x-firebase-client",l)}const o={installation:{sdkVersion:Nb,appId:t.appId}},a={method:"POST",headers:i,body:JSON.stringify(o)},c=await qb(()=>fetch(s,a));if(c.ok){const l=await c.json();return Lb(l)}else throw await Fb("Generate Auth Token",c)}function HM(t,{fid:e}){return`${Ob(t)}/${e}/authTokens:generate`}/**
599 * @license
600 * Copyright 2019 Google LLC
601 *
602 * Licensed under the Apache License, Version 2.0 (the "License");
603 * you may not use this file except in compliance with the License.
604 * You may obtain a copy of the License at
605 *
606 *   http://www.apache.org/licenses/LICENSE-2.0
607 *
608 * Unless required by applicable law or agreed to in writing, software
609 * distributed under the License is distributed on an "AS IS" BASIS,
610 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
611 * See the License for the specific language governing permissions and
612 * limitations under the License.
613 */async function cm(t,e=!1){let n;const s=await Qu(t.appConfig,r=>{if(!Kb(r))throw _r.create("not-registered");const o=r.authToken;if(!e&&zM(o))return r;if(o.requestStatus===1)return n=WM(t,e),r;{if(!navigator.onLine)throw _r.create("app-offline");const a=YM(r);return n=KM(t,a),a}});return n?await n:s.authToken}async function WM(t,e){let n=await H_(t.appConfig);for(;n.authToken.requestStatus===1;)await Gb(100),n=await H_(t.appConfig);const s=n.authToken;return s.requestStatus===0?cm(t,e):s}function H_(t){return Qu(t,e=>{if(!Kb(e))throw _r.create("not-registered");const n=e.authToken;return QM(n)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function KM(t,e){try{const n=await $M(t,e),s=Object.assign(Object.assign({},e),{authToken:n});return await Ql(t.appConfig,s),n}catch(n){if(Mb(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await Hb(t.appConfig);else{const s=Object.assign(Object.assign({},e),{authToken:{requestStatus:0}});await Ql(t.appConfig,s)}throw n}}function Kb(t){return t!==void 0&&t.registrationStatus===2}function zM(t){return t.requestStatus===2&&!JM(t)}function JM(t){const e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+TM}function YM(t){const e={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},t),{authToken:e})}function QM(t){return t.requestStatus===1&&t.requestTime+Ub<Date.now()}/**
614 * @license
615 * Copyright 2019 Google LLC
616 *
617 * Licensed under the Apache License, Version 2.0 (the "License");
618 * you may not use this file except in compliance with the License.
619 * You may obtain a copy of the License at
620 *
621 *   http://www.apache.org/licenses/LICENSE-2.0
622 *
623 * Unless required by applicable law or agreed to in writing, software
624 * distributed under the License is distributed on an "AS IS" BASIS,
625 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
626 * See the License for the specific language governing permissions and
627 * limitations under the License.
628 */async function XM(t){const e=t,{installationEntry:n,registrationPromise:s}=await am(e);return s?s.catch(console.error):cm(e).catch(console.error),n.fid}/**
629 * @license
630 * Copyright 2019 Google LLC
631 *
632 * Licensed under the Apache License, Version 2.0 (the "License");
633 * you may not use this file except in compliance with the License.
634 * You may obtain a copy of the License at
635 *
636 *   http://www.apache.org/licenses/LICENSE-2.0
637 *
638 * Unless required by applicable law or agreed to in writing, software
639 * distributed under the License is distributed on an "AS IS" BASIS,
640 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
641 * See the License for the specific language governing permissions and
642 * limitations under the License.
643 */async function ZM(t,e=!1){const n=t;return await e1(n),(await cm(n,e)).token}async function e1(t){const{registrationPromise:e}=await am(t);e&&await e}/**
644 * @license
645 * Copyright 2019 Google LLC
646 *
647 * Licensed under the Apache License, Version 2.0 (the "License");
648 * you may not use this file except in compliance with the License.
649 * You may obtain a copy of the License at
650 *
651 *   http://www.apache.org/licenses/LICENSE-2.0
652 *
653 * Unless required by applicable law or agreed to in writing, software
654 * distributed under the License is distributed on an "AS IS" BASIS,
655 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
656 * See the License for the specific language governing permissions and
657 * limitations under the License.
658 */function t1(t){if(!t||!t.options)throw kh("App Configuration");if(!t.name)throw kh("App Name");const e=["projectId","apiKey","appId"];for(const n of e)if(!t.options[n])throw kh(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function kh(t){return _r.create("missing-app-config-values",{valueName:t})}/**
659 * @license
660 * Copyright 2020 Google LLC
661 *
662 * Licensed under the Apache License, Version 2.0 (the "License");
663 * you may not use this file except in compliance with the License.
664 * You may obtain a copy of the License at
665 *
666 *   http://www.apache.org/licenses/LICENSE-2.0
667 *
668 * Unless required by applicable law or agreed to in writing, software
669 * distributed under the License is distributed on an "AS IS" BASIS,
670 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
671 * See the License for the specific language governing permissions and
672 * limitations under the License.
673 */const zb="installations",n1="installations-internal",s1=t=>{const e=t.getProvider("app").getImmediate(),n=t1(e),s=ps(e,"heartbeat");return{app:e,appConfig:n,heartbeatServiceProvider:s,_delete:()=>Promise.resolve()}},i1=t=>{const e=t.getProvider("app").getImmediate(),n=ps(e,zb).getImmediate();return{getId:()=>XM(n),getToken:i=>ZM(n,i)}};function r1(){ln(new Zt(zb,s1,"PUBLIC")),ln(new Zt(n1,i1,"PRIVATE"))}r1();kt(kb,rm);kt(kb,rm,"esm2017");/**
674 * @license
675 * Copyright 2019 Google LLC
676 *
677 * Licensed under the Apache License, Version 2.0 (the "License");
678 * you may not use this file except in compliance with the License.
679 * You may obtain a copy of the License at
680 *
681 *   http://www.apache.org/licenses/LICENSE-2.0
682 *
683 * Unless required by applicable law or agreed to in writing, software
684 * distributed under the License is distributed on an "AS IS" BASIS,
685 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
686 * See the License for the specific language governing permissions and
687 * limitations under the License.
688 */const Xl="analytics",o1="firebase_id",a1="origin",c1=60*1e3,l1="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",lm="https://www.googletagmanager.com/gtag/js";/**
689 * @license
690 * Copyright 2019 Google LLC
691 *
692 * Licensed under the Apache License, Version 2.0 (the "License");
693 * you may not use this file except in compliance with the License.
694 * You may obtain a copy of the License at
695 *
696 *   http://www.apache.org/licenses/LICENSE-2.0
697 *
698 * Unless required by applicable law or agreed to in writing, software
699 * distributed under the License is distributed on an "AS IS" BASIS,
700 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
701 * See the License for the specific language governing permissions and
702 * limitations under the License.
703 */const cn=new Ac("@firebase/analytics");/**
704 * @license
705 * Copyright 2019 Google LLC
706 *
707 * Licensed under the Apache License, Version 2.0 (the "License");
708 * you may not use this file except in compliance with the License.
709 * You may obtain a copy of the License at
710 *
711 *   http://www.apache.org/licenses/LICENSE-2.0
712 *
713 * Unless required by applicable law or agreed to in writing, software
714 * distributed under the License is distributed on an "AS IS" BASIS,
715 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
716 * See the License for the specific language governing permissions and
717 * limitations under the License.
718 */const u1={"already-exists":"A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-intialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}
718","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."},Vn=new ji("analytics","Analytics",u1);/**
719 * @license
720 * Copyright 2019 Google LLC
721 *
722 * Licensed under the Apache License, Version 2.0 (the "License");
723 * you may not use this file except in compliance with the License.
724 * You may obtain a copy of the License at
725 *
726 *   http://www.apache.org/licenses/LICENSE-2.0
727 *
728 * Unless required by applicable law or agreed to in writing, software
729 * distributed under the License is distributed on an "AS IS" BASIS,
730 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
731 * See the License for the specific language governing permissions and
732 * limitations under the License.
733 */function d1(t){if(!t.startsWith(lm)){const e=Vn.create("invalid-gtag-resource",{gtagURL:t});return cn.warn(e.message),""}return t}function Jb(t){return Promise.all(t.map(e=>e.catch(n=>n)))}function h1(t,e){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(t,e)),n}function f1(t,e){const n=h1("firebase-js-sdk-policy",{createScriptURL:d1}),s=document.createElement("script"),i=`${lm}?l=${t}&id=${e}`;s.src=n?n==null?void 0:n.createScriptURL(i):i,s.async=!0,document.head.appendChild(s)}function p1(t){let e=[];return Array.isArray(window[t])?e=window[t]:window[t]=e,e}async function m1(t,e,n,s,i,r){const o=s[i];try{if(o)await e[o];else{const c=(await Jb(n)).find(l=>l.measurementId===i);c&&await e[c.appId]}}catch(a){cn.error(a)}t("config",i,r)}async function g1(t,e,n,s,i){try{let r=[];if(i&&i.send_to){let o=i.send_to;Array.isArray(o)||(o=[o]);const a=await Jb(n);for(const c of o){const l=a.find(d=>d.measurementId===c),u=l&&e[l.appId];if(u)r.push(u);else{r=[];break}}}r.length===0&&(r=Object.values(e)),await Promise.all(r),t("event",s,i||{})}catch(r){cn.error(r)}}function y1(t,e,n,s){async function i(r,...o){try{if(r==="event"){const[a,c]=o;await g1(t,e,n,a,c)}else if(r==="config"){const[a,c]=o;await m1(t,e,n,s,a,c)}else if(r==="consent"){const[a]=o;t("consent","update",a)}else if(r==="get"){const[a,c,l]=o;t("get",a,c,l)}else if(r==="set"){const[a]=o;t("set",a)}else t(r,...o)}catch(a){cn.error(a)}}return i}function _1(t,e,n,s,i){let r=function(...o){window[s].push(arguments)};return window[i]&&typeof window[i]=="function"&&(r=window[i]),window[i]=y1(r,t,e,n),{gtagCore:r,wrappedGtag:window[i]}}function I1(t){const e=window.document.getElementsByTagName("script");for(const n of Object.values(e))if(n.src&&n.src.includes(lm)&&n.src.includes(t))return n;return null}/**
734 * @license
735 * Copyright 2020 Google LLC
736 *
737 * Licensed under the Apache License, Version 2.0 (the "License");
738 * you may not use this file except in compliance with the License.
739 * You may obtain a copy of the License at
740 *
741 *   http://www.apache.org/licenses/LICENSE-2.0
742 *
743 * Unless required by applicable law or agreed to in writing, software
744 * distributed under the License is distributed on an "AS IS" BASIS,
745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
746 * See the License for the specific language governing permissions and
747 * limitations under the License.
748 */const w1=30,v1=1e3;class T1{constructor(e={},n=v1){this.throttleMetadata=e,this.intervalMillis=n}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,n){this.throttleMetadata[e]=n}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}}const Yb=new T1;function b1(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function E1(t){var e;const{appId:n,apiKey:s}=t,i={method:"GET",headers:b1(s)},r=l1.replace("{app-id}",n),o=await fetch(r,i);if(o.status!==200&&o.status!==304){let a="";try{const c=await o.json();!((e=c.error)===null||e===void 0)&&e.message&&(a=c.error.message)}catch{}throw Vn.create("config-fetch-failed",{httpStatus:o.status,responseMessage:a})}return o.json()}async function S1(t,e=Yb,n){const{appId:s,apiKey:i,measurementId:r}=t.options;if(!s)throw Vn.create("no-app-id");
748if(!i){if(r)return{measurementId:r,appId:s};throw Vn.create("no-api-key")}const o=e.getThrottleMetadata(s)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new C1;return setTimeout(async()=>{a.abort()},c1),Qb({appId:s,apiKey:i,measurementId:r},o,a,e)}async function Qb(t,{throttleEndTimeMillis:e,backoffCount:n},s,i=Yb){var r;const{appId:o,measurementId:a}=t;try{await D1(s,e)}catch(c){if(a)return cn.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${c==null?void 0:c.message}]`),{appId:o,measurementId:a};throw c}try{const c=await E1(t);return i.deleteThrottleMetadata(o),c}catch(c){const l=c;if(!A1(l)){if(i.deleteThrottleMetadata(o),a)return cn.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${l==null?void 0:l.message}]`),{appId:o,measurementId:a};throw c}const u=Number((r=l==null?void 0:l.customData)===null||r===void 0?void 0:r.httpStatus)===503?xf(n,i.intervalMillis,w1):xf(n,i.intervalMillis),d={throttleEndTimeMillis:Date.now()+u,backoffCount:n+1};return i.setThrottleMetadata(o,d),cn.debug(`Calling attemptFetch again in ${u} millis`),Qb(t,d,s,i)}}function D1(t,e){return new Promise((n,s)=>{const i=Math.max(e-Date.now(),0),r=setTimeout(n,i);t.addEventListener(()=>{clearTimeout(r),s(Vn.create("fetch-throttle",{throttleEndTimeMillis:e}))})})}function A1(t){if(!(t instanceof Hn)||!t.customData)return!1;const e=Number(t.customData.httpStatus);return e===429||e===500||e===503||e===504}class C1{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function P1(t,e,n,s,i){if(i&&i.global){t("event",n,s);return}else{const r=await e,o=Object.assign(Object.assign({},s),{send_to:r});t("event",n,o)}}/**
749 * @license
750 * Copyright 2020 Google LLC
751 *
752 * Licensed under the Apache License, Version 2.0 (the "License");
753 * you may not use this file except in compliance with the License.
754 * You may obtain a copy of the License at
755 *
756 *   http://www.apache.org/licenses/LICENSE-2.0
757 *
758 * Unless required by applicable law or agreed to in writing, software
759 * distributed under the License is distributed on an "AS IS" BASIS,
760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
761 * See the License for the specific language governing permissions and
762 * limitations under the License.
763 */async function R1(){if(Ju())try{await Eb()}catch(t){return cn.warn(Vn.create("indexeddb-unavailable",{errorInfo:t==null?void 0:t.toString()}).message),!1}else return cn.warn(Vn.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;return!0}async function k1(t,e,n,s,i,r,o){var a;const c=S1(t);c.then(f=>{n[f.measurementId]=f.appId,t.options.measurementId&&f.measurementId!==t.options.measurementId&&cn.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${f.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(f=>cn.error(f)),e.push(c);const l=R1().then(f=>{if(f)return s.getId()}),[u,d]=await Promise.all([c,l]);I1(r)||f1(r,u.measurementId),i("js",new Date);const h=(a=o==null?void 0:o.config)!==null&&a!==void 0?a:{};return h[a1]="firebase",h.update=!0,d!=null&&(h[o1]=d),i("config",u.measurementId,h),u.measurementId}/**
764 * @license
765 * Copyright 2019 Google LLC
766 *
767 * Licensed under the Apache License, Version 2.0 (the "License");
768 * you may not use this file except in compliance with the License.
769 * You may obtain a copy of the License at
770 *
771 *   http://www.apache.org/licenses/LICENSE-2.0
772 *
773 * Unless required by applicable law or agreed to in writing, software
774 * distributed under the License is distributed on an "AS IS" BASIS,
775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
776 * See the License for the specific language governing permissions and
777 * limitations under the License.
778 */class U1{constructor(e){this.app=e}_delete(){return delete Ca[this.app.options.appId],Promise.resolve()}}let Ca={},W_=[];const K_={};let Uh="dataLayer",N1="gtag",z_,Xb,J_=!1;function x1(){const t=[];
778if(bb()&&t.push("This is a browser extension environment."),nx()||t.push("Cookies are not available."),t.length>0){const e=t.map((s,i)=>`(${i+1}) ${s}`).join(" "),n=Vn.create("invalid-analytics-context",{errorInfo:e});cn.warn(n.message)}}function M1(t,e,n){x1();const s=t.options.appId;if(!s)throw Vn.create("no-app-id");if(!t.options.apiKey)if(t.options.measurementId)cn.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw Vn.create("no-api-key");if(Ca[s]!=null)throw Vn.create("already-exists",{id:s});if(!J_){p1(Uh);const{wrappedGtag:r,gtagCore:o}=_1(Ca,W_,K_,Uh,N1);Xb=r,z_=o,J_=!0}return Ca[s]=k1(t,W_,K_,e,z_,Uh,n),new U1(t)}function O1(t=qo()){t=Ae(t);const e=ps(t,Xl);return e.isInitialized()?e.getImmediate():L1(t)}function L1(t,e={}){const n=ps(t,Xl);if(n.isInitialized()){const i=n.getImmediate();if(za(e,n.getOptions()))return i;throw Vn.create("already-initialized")}return n.initialize({options:e})}function F1(t,e,n,s){t=Ae(t),P1(Xb,Ca[t.app.options.appId],e,n,s).catch(i=>cn.error(i))}const Y_="@firebase/analytics",Q_="0.10.2";function V1(){ln(new Zt(Xl,(e,{options:n})=>{const s=e.getProvider("app").getImmediate(),i=e.getProvider("installations-internal").getImmediate();return M1(s,i,n)},"PUBLIC")),ln(new Zt("analytics-internal",t,"PRIVATE")),kt(Y_,Q_),kt(Y_,Q_,"esm2017");function t(e){try{const n=e.getProvider(Xl).getImmediate();return{logEvent:(s,i,r)=>F1(n,s,i,r)}}catch(n){throw Vn.create("interop-component-reg-failed",{reason:n})}}}V1();let Nh;const q1=Qn(async t=>{const e=Bu(),n={apiKey:e.public.FB_API_KEY,authDomain:e.public.FB_AUTH_DOMAIN,projectId:e.public.FB_PROJECT_ID,storageBucket:e.public.FB_STORAGE_BUCKET,messagingSenderId:e.public.FB_MESSAGING_SENDER_ID,appId:e.public.FB_APP_ID};return Nh=Cb(n),O1(Nh),{provide:{firebaseApp:Nh}}}),G1=[rU,aU,bN,EN,SN,xN,MN,ON,FN,jN,$N,q1],X_={pwaInDevEnvironment:!1,webManifest:{href:"/manifest.webmanifest",useCredentials:!1,linkTag:'<link rel="manifest" href="/manifest.webmanifest">'}},B1=di({async setup(){if(X_){const t=_t({link:[]});KT(t);const{webManifest:e}=X_;if(e){const{href:n,useCredentials:s}=e;s?t.value.link.push({rel:"manifest",href:n,crossorigin:"use-credentials"}):t.value.link.push({rel:"manifest",href:n})}}return()=>null}}),j1=di({props:{vnode:{type:Object,required:!0},route:{type:Object,required:!0},vnodeRef:Object,renderKey:String,trackRootNodes:Boolean},setup(t){const e=t.renderKey,n=t.route,s={};for(const i in t.route)Object.defineProperty(s,i,{get:()=>e===t.renderKey?t.route[i]:n[i]});return ur(Ec,wc(s)),()=>Fn(t.vnode,{ref:t.vnodeRef})}}),$1=di({name:"NuxtPage",inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(t,{attrs:e,expose:n}){const s=We(),i=_t(),r=Gt(Ec,null);let o;n({pageRef:i});const a=Gt(FT,null);let c;const l=s.deferHydration();if(s.isHydrating){const u=s.hooks.hookOnce("app:error",l);Ls().beforeEach(u)}return t.pageKey&&Ui(()=>t.pageKey,(u,d)=>{u!==d&&s.callHook("page:loading:start")}),()=>Fn(lb,{name:t.name,route:t.route,...e},{default:u=>{const d=W1(r,u.route,u.Component),h=r&&r.matched.length===u.route.matched.length;if(!u.Component){if(c&&!h)return c;l();return}if(c&&a&&!a.isCurrent(u.route))return c;if(d&&r&&(!a||a!=null&&a.isCurrent(r)))return h?c:null;const f=kf(u,t.pageKey);!s.isHydrating&&!K1(r,u.route,u.Component)&&o===f&&s.callHook("page:loading:end"),o=f;const m=!!(t.transition??u.route.meta.pageTransition??Af),v=m&&H1([t.transition,u.route.meta.pageTransition,Af,{onAfterLeave:()=>{s.callHook("page:transition:finish",u.Component)}}].filter(Boolean)),b=t.keepalive??u.route.meta.keepalive??Qk;return c=ub(IT,m&&v,hN(b,Fn(jp,{suspensible:!0,onPending:()=>s.callHook("page:start",u.Component),onResolve:()=>{ui(()=>s.callHook("page:finish",u.Component).then(()=>s.callHook("page:loading:end")).finally(l))}},{default:()=>{const D=Fn(j1,{key:f||void 0,vnode:u.Component,route:u.route,renderKey:f||void 0,trackRootNodes:m,vnodeRef:i});return b&&(D.type.name=u.Component.type.name||u.Component.type.__name||"RouteProvider"),D}}))).default(),c}})}});function H1(t){const e=t.map(n=>({...n,onAfterLeave:n.onAfterLeave?tm(n.onAfterLeave):void 0}));
778return OT(...e)}function W1(t,e,n){if(!t)return!1;const s=e.matched.findIndex(i=>{var r;return((r=i.components)==null?void 0:r.default)===(n==null?void 0:n.type)});return!s||s===-1?!1:e.matched.slice(0,s).some((i,r)=>{var o,a,c;return((o=i.components)==null?void 0:o.default)!==((c=(a=t.matched[r])==null?void 0:a.components)==null?void 0:c.default)})||n&&kf({route:e,Component:n})!==kf({route:t,Component:n})}function K1(t,e,n){return t?e.matched.findIndex(i=>{var r;return((r=i.components)==null?void 0:r.default)===(n==null?void 0:n.type)})<e.matched.length-1:!1}const z1=di({name:"LayoutLoader",inheritAttrs:!1,props:{name:String,layoutProps:Object},async setup(t,e){const n=await Pi[t.name]().then(s=>s.default||s);return()=>Fn(n,t.layoutProps,e.slots)}}),J1=di({name:"NuxtLayout",inheritAttrs:!1,props:{name:{type:[String,Boolean,Object],default:null},fallback:{type:[String,Object],default:null}},setup(t,e){const n=We(),s=Gt(Ec),i=s===ju()?uN():s,r=xn(()=>{let c=st(t.name)??i.meta.layout??"default";return c&&!(c in Pi)&&t.fallback&&(c=st(t.fallback)),c}),o=_t();e.expose({layoutRef:o});const a=n.deferHydration();if(n.isHydrating){const c=n.hooks.hookOnce("app:error",a);Ls().beforeEach(c)}return()=>{const c=r.value&&r.value in Pi,l=i.meta.layoutTransition??Yk;return ub(IT,c&&l,{default:()=>Fn(jp,{suspensible:!0,onResolve:()=>{ui(a)}},{default:()=>Fn(Y1,{layoutProps:fT(e.attrs,{ref:o}),key:r.value||void 0,name:r.value,shouldProvide:!t.name,hasTransition:!!l},e.slots)})}).default()}}}),Y1=di({name:"NuxtLayoutProvider",inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean}},setup(t,e){const n=t.name;return t.shouldProvide&&ur(FT,{isCurrent:s=>n===(s.meta.layout??"default")}),()=>{var s,i;return!n||typeof n=="string"&&!(n in Pi)?(i=(s=e.slots).default)==null?void 0:i.call(s):Fn(z1,{key:n,layoutProps:t.layoutProps,name:n},e.slots)}}});/**
779 * @license
780 * Copyright 2017 Google LLC
781 *
782 * Licensed under the Apache License, Version 2.0 (the "License");
783 * you may not use this file except in compliance with the License.
784 * You may obtain a copy of the License at
785 *
786 *   http://www.apache.org/licenses/LICENSE-2.0
787 *
788 * Unless required by applicable law or agreed to in writing, software
789 * distributed under the License is distributed on an "AS IS" BASIS,
790 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
791 * See the License for the specific language governing permissions and
792 * limitations under the License.
793 */const Q1="type.googleapis.com/google.protobuf.Int64Value",X1="type.googleapis.com/google.protobuf.UInt64Value";function Zb(t,e){const n={};for(const s in t)t.hasOwnProperty(s)&&(n[s]=e(t[s]));return n}function Gf(t){if(t==null)return null;if(t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&isFinite(t)||t===!0||t===!1||Object.prototype.toString.call(t)==="[object String]")return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map(e=>Gf(e));if(typeof t=="function"||typeof t=="object")return Zb(t,e=>Gf(e));throw new Error("Data cannot be encoded in JSON: "+t)}function Zl(t){if(t==null)return t;if(t["@type"])switch(t["@type"]){case Q1:case X1:{const e=Number(t.value);if(isNaN(e))throw new Error("Data cannot be decoded from JSON: "+t);return e}default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map(e=>Zl(e)):typeof t=="function"||typeof t=="object"?Zb(t,e=>Zl(e)):t}/**
794 * @license
795 * Copyright 2020 Google LLC
796 *
797 * Licensed under the Apache License, Version 2.0 (the "License");
798 * you may not use this file except in compliance with the License.
799 * You may obtain a copy of the License at
800 *
801 *   http://www.apache.org/licenses/LICENSE-2.0
802 *
803 * Unless required by applicable law or agreed to in writing, software
804 * distributed under the License is distributed on an "AS IS" BASIS,
805 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
806 * See the License for the specific language governing permissions and
807 * limitations under the License.
808 */const um="functions";/**
809 * @license
810 * Copyright 2017 Google LLC
811 *
812 * Licensed under the Apache License, Version 2.0 (the "License");
813 * you may not use this file except in compliance with the License.
814 * You may obtain a copy of the License at
815 *
816 *   http://www.apache.org/licenses/LICENSE-2.0
817 *
818 * Unless required by applicable law or agreed to in writing, software
819 * distributed under the License is distributed on an "AS IS" BASIS,
820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
821 * See the License for the specific language governing permissions and
822 * limitations under the License.
823 */const Z_={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"};class lo extends Hn{constructor(e,n,s){super(`${um}/${e}`,n||""),this.details=s}}function Z1(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}function eO(t,e){let n=Z1(t),s=n,i;try{const r=e&&e.error;if(r){const o=r.status;if(typeof o=="string"){if(!Z_[o])return new lo("internal","internal");n=Z_[o],s=o}const a=r.message;typeof a=="string"&&(s=a),i=r.details,i!==void 0&&(i=Zl(i))}}catch{}return n==="ok"?null:new lo(n,s,i)}/**
824 * @license
825 * Copyright 2017 Google LLC
826 *
827 * Licensed under the Apache License, Version 2.0 (the "License");
828 * you may not use this file except in compliance with the License.
829 * You may obtain a copy of the License at
830 *
831 *   http://www.apache.org/licenses/LICENSE-2.0
832 *
833 * Unless required by applicable law or agreed to in writing, software
834 * distributed under the License is distributed on an "AS IS" BASIS,
835 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
836 * See the License for the specific language governing permissions and
837 * limitations under the License.
838 */class tO{constructor(e,n,s){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=e.getImmediate({optional:!0}),this.messaging=n.getImmediate({optional:!0}),this.auth||e.get().then(i=>this.auth=i,()=>{}),this.messaging||n.get().then(i=>this.messaging=i,()=>{}),this.appCheck||s.get().then(i=>this.appCheck=i,()=>{})}async getAuthToken(){if(this.auth)try{const e=await this.auth.getToken();return e==null?void 0:e.accessToken}catch{return}}async getMessagingToken(){if(!(!this.messaging||!("Notification"in self)||Notification.permission!=="granted"))try{return await this.messaging.getToken()}catch{return}}async getAppCheckToken(e){if(this.appCheck){const n=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return n.error?null:n.token}return null}async getContext(e){const n=await this.getAuthToken(),s=await this.getMessagingToken(),i=await this.getAppCheckToken(e);return{authToken:n,messagingToken:s,appCheckToken:i}}}/**
839 * @license
840 * Copyright 2017 Google LLC
841 *
842 * Licensed under the Apache License, Version 2.0 (the "License");
843 * you may not use this file except in compliance with the License.
844 * You may obtain a copy of the License at
845 *
846 *   http://www.apache.org/licenses/LICENSE-2.0
847 *
848 * Unless required by applicable law or agreed to in writing, software
849 * distributed under the License is distributed on an "AS IS" BASIS,
850 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
851 * See the License for the specific language governing permissions and
852 * limitations under the License.
853 */const Bf="us-central1";function nO(t){let e=null;return{promise:new Promise((n,s)=>{e=setTimeout(()=>{s(new lo("deadline-exceeded","deadline-exceeded"))},t)}),cancel:()=>{e&&clearTimeout(e)}}}class sO{constructor(e,n,s,i,r=Bf,o){this.app=e,this.fetchImpl=o,this.emulatorOrigin=null,this.contextProvider=new tO(n,s,i),this.cancelAllRequests=new Promise(a=>{this.deleteService=()=>Promise.resolve(a())});try{const a=new URL(r);this.customDomain=a.origin,this.region=Bf}catch{this.customDomain=null,this.region=r}}_delete(){return this.deleteService()}_url(e){const n=this.app.options.projectId;return this.emulatorOrigin!==null?`${this.emulatorOrigin}/${n}/${this.region}/${e}`:this.customDomain!==null?`${this.customDomain}/${e}`:`https://${this.region}-${n}.cloudfunctions.net/${e}`}}function iO(t,e,n){t.emulatorOrigin=`http://${e}:${n}`}function rO(t,e,n){return s=>aO(t,e,s,{})}async function oO(t,e,n,s){n["Content-Type"]="application/json";let i;try{i=await s(t,{method:"POST",body:JSON.stringify(e),headers:n})}catch{return{status:0,json:null}}let r=null;try{r=await i.json()}catch{}return{status:i.status,json:r}}function aO(t,e,n,s){const i=t._url(e);return cO(t,i,n,s)}async function cO(t,e,n,s){n=Gf(n);const i={data:n}
853,r={},o=await t.contextProvider.getContext(s.limitedUseAppCheckTokens);o.authToken&&(r.Authorization="Bearer "+o.authToken),o.messagingToken&&(r["Firebase-Instance-ID-Token"]=o.messagingToken),o.appCheckToken!==null&&(r["X-Firebase-AppCheck"]=o.appCheckToken);const a=s.timeout||7e4,c=nO(a),l=await Promise.race([oO(e,i,r,t.fetchImpl),c.promise,t.cancelAllRequests]);if(c.cancel(),!l)throw new lo("cancelled","Firebase Functions instance was deleted.");const u=eO(l.status,l.json);if(u)throw u;if(!l.json)throw new lo("internal","Response is not valid JSON object.");let d=l.json.data;if(typeof d>"u"&&(d=l.json.result),typeof d>"u")throw new lo("internal","Response is missing data field.");return{data:Zl(d)}}const eI="@firebase/functions",tI="0.11.4";/**
854 * @license
855 * Copyright 2019 Google LLC
856 *
857 * Licensed under the Apache License, Version 2.0 (the "License");
858 * you may not use this file except in compliance with the License.
859 * You may obtain a copy of the License at
860 *
861 *   http://www.apache.org/licenses/LICENSE-2.0
862 *
863 * Unless required by applicable law or agreed to in writing, software
864 * distributed under the License is distributed on an "AS IS" BASIS,
865 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
866 * See the License for the specific language governing permissions and
867 * limitations under the License.
868 */const lO="auth-internal",uO="app-check-internal",dO="messaging-internal";function hO(t,e){const n=(s,{instanceIdentifier:i})=>{const r=s.getProvider("app").getImmediate(),o=s.getProvider(lO),a=s.getProvider(dO),c=s.getProvider(uO);return new sO(r,o,a,c,i,t)};ln(new Zt(um,n,"PUBLIC").setMultipleInstances(!0)),kt(eI,tI,e),kt(eI,tI,"esm2017")}/**
869 * @license
870 * Copyright 2020 Google LLC
871 *
872 * Licensed under the Apache License, Version 2.0 (the "License");
873 * you may not use this file except in compliance with the License.
874 * You may obtain a copy of the License at
875 *
876 *   http://www.apache.org/licenses/LICENSE-2.0
877 *
878 * Unless required by applicable law or agreed to in writing, software
879 * distributed under the License is distributed on an "AS IS" BASIS,
880 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
881 * See the License for the specific language governing permissions and
882 * limitations under the License.
883 */function fO(t=qo(),e=Bf){const s=ps(Ae(t),um).getImmediate({identifier:e}),i=sm("functions");return i&&pO(s,...i),s}function pO(t,e,n){iO(Ae(t),e,n)}function eE(t,e,n){return rO(Ae(t),e)}hO(fetch.bind(self));/**
884 * @license
885 * Copyright 2020 Google LLC
886 *
887 * Licensed under the Apache License, Version 2.0 (the "License");
888 * you may not use this file except in compliance with the License.
889 * You may obtain a copy of the License at
890 *
891 *   http://www.apache.org/licenses/LICENSE-2.0
892 *
893 * Unless required by applicable law or agreed to in writing, software
894 * distributed under the License is distributed on an "AS IS" BASIS,
895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
896 * See the License for the specific language governing permissions and
897 * limitations under the License.
898 */const jf=new Map,tE={activated:!1,tokenObservers:[]},mO={initialized:!1,enabled:!1};function It(t){return jf.get(t)||Object.assign({},tE)}function gO(t,e){return jf.set(t,e),jf.get(t)}function Xu(){return mO}/**
899 * @license
900 * Copyright 2020 Google LLC
901 *
902 * Licensed under the Apache License, Version 2.0 (the "License");
903 * you may not use this file except in compliance with the License.
904 * You may obtain a copy of the License at
905 *
906 *   http://www.apache.org/licenses/LICENSE-2.0
907 *
908 * Unless required by applicable law or agreed to in writing, software
909 * distributed under the License is distributed on an "AS IS" BASIS,
910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
911 * See the License for the specific language governing permissions and
912 * limitations under the License.
913 */const nE="https://content-firebaseappcheck.googleapis.com/v1",yO="exchangeRecaptchaV3Token",_O="exchangeDebugToken",nI={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},IO=24*60*60*1e3;/**
914 * @license
915 * Copyright 2020 Google LLC
916 *
917 * Licensed under the Apache License, Version 2.0 (the "License");
918 * you may not use this file except in compliance with the License.
919 * You may obtain a copy of the License at
920 *
921 *   http://www.apache.org/licenses/LICENSE-2.0
922 *
923 * Unless required by applicable law or agreed to in writing, software
924 * distributed under the License is distributed on an "AS IS" BASIS,
925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
926 * See the License for the specific language governing permissions and
927 * limitations under the License.
928 */class wO{constructor(e,n,s,i,r){if(this.operation=e,this.retryPolicy=n,this.getWaitDuration=s,this.lowerBound=i,this.upperBound=r,this.pending=null,this.nextErrorWaitInterval=i,i>r)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}async process(e){this.stop();try{this.pending=new Ka,this.pending.promise.catch(n=>{}),await vO(this.getNextRun(e)),this.pending.resolve(),await this.pending.promise,this.pending=new Ka,this.pending.promise.catch(n=>{}),await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch(()=>{})}catch(n){this.retryPolicy(n)?this.process(!1).catch(()=>{}):this.stop()}}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{const n=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),n}}}function vO(t){return new Promise(e=>{setTimeout(e,t)})}/**
929 * @license
930 * Copyright 2020 Google LLC
931 *
932 * Licensed under the Apache License, Version 2.0 (the "License");
933 * you may not use this file except in compliance with the License.
934 * You may obtain a copy of the License at
935 *
936 *   http://www.apache.org/licenses/LICENSE-2.0
937 *
938 * Unless required by applicable law or agreed to in writing, software
939 * distributed under the License is distributed on an "AS IS" BASIS,
940 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
941 * See the License for the specific language governing permissions and
942 * limitations under the License.
943 */const TO={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},an=new ji("appCheck","AppCheck",TO);/**
944 * @license
945 * Copyright 2020 Google LLC
946 *
947 * Licensed under the Apache License, Version 2.0 (the "License");
948 * you may not use this file except in compliance with the License.
949 * You may obtain a copy of the License at
950 *
951 *   http://www.apache.org/licenses/LICENSE-2.0
952 *
953 * Unless required by applicable law or agreed to in writing, software
954 * distributed under the License is distributed on an "AS IS" BASIS,
955 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
956 * See the License for the specific language governing permissions and
957 * limitations under the License.
958 */function sI(t=!1){var e;return t?(e=self.grecaptcha)===null||e===void 0?void 0:e.enterprise:self.grecaptcha}function dm(t){if(!It(t).activated)throw an.create("use-before-activation",{appName:t.name})}function sE(t){const e=Math.round(t/1e3),n=Math.floor(e/(3600*24)),s=Math.floor((e-n*3600*24)/3600),i=Math.floor((e-n*3600*24-s*3600)/60),r=e-n*3600*24-s*3600-i*60;let o="";return n&&(o+=il(n)+"d:"),s&&(o+=il(s)+"h:"),o+=il(i)+"m:"+il(r)+"s",o}function il(t){return t===0?"00":t>=10?t.toString():"0"+t}/**
959 * @license
960 * Copyright 2020 Google LLC
961 *
962 * Licensed under the Apache License, Version 2.0 (the "License");
963 * you may not use this file except in compliance with the License.
964 * You may obtain a copy of the License at
965 *
966 *   http://www.apache.org/licenses/LICENSE-2.0
967 *
968 * Unless required by applicable law or agreed to in writing, software
969 * distributed under the License is distributed on an "AS IS" BASIS,
970 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
971 * See the License for the specific language governing permissions and
972 * limitations under the License.
973 */async function hm({url:t,body:e},n){const s={"Content-Type":"application/json"},i=n.getImmediate({optional:!0});if(i){const d=await i.getHeartbeatsHeader();d&&(s["X-Firebase-Client"]=d)}const r={method:"POST",body:JSON.stringify(e),headers:s};let o;try{o=await fetch(t,r)}catch(d){throw an.create("fetch-network-error",{originalErrorMessage:d==null?void 0:d.message})}if(o.status!==200)throw an.create("fetch-status-error",{httpStatus:o.status});let a;try{a=await o.json()}catch(d){throw an.create("fetch-parse-error",{originalErrorMessage:d==null?void 0:d.message})}const c=a.ttl.match(/^([\d.]+)(s)$/);if(!c||!c[2]||isNaN(Number(c[1])))throw an.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${a.ttl}`});const l=Number(c[1])*1e3,u=Date.now();return{token:a.token,expireTimeMillis:u+l,issuedAtTimeMillis:u}}function bO(t,e){const{projectId:n,appId:s,apiKey:i}=t.options;return{url:`${nE}/projects/${n}/apps/${s}:${yO}?key=${i}`,body:{recaptcha_v3_token:e}}}function iE(t,e){const{projectId:n,appId:s,apiKey:i}=t.options;return{url:`${nE}/projects/${n}/apps/${s}:${_O}?key=${i}`,body:{debug_token:e}}}/**
974 * @license
975 * Copyright 2020 Google LLC
976 *
977 * Licensed under the Apache License, Version 2.0 (the "License");
978 * you may not use this file except in compliance with the License.
979 * You may obtain a copy of the License at
980 *
981 *   http://www.apache.org/licenses/LICENSE-2.0
982 *
983 * Unless required by applicable law or agreed to in writing, software
984 * distributed under the License is distributed on an "AS IS" BASIS,
985 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
986 * See the License for the specific language governing permissions and
987 * limitations under the License.
988 */const EO="firebase-app-check-database",SO=1,Ya="firebase-app-check-store",rE="debug-token";let rl=null;function oE(){return rl||(rl=new Promise((t,e)=>{try{const n=indexedDB.open(EO,SO);n.onsuccess=s=>{t(s.target.result)},n.onerror=s=>{var i;e(an.create("storage-open",{originalErrorMessage:(i=s.target.error)===null||i===void 0?void 0:i.message}))},n.onupgradeneeded=s=>{const i=s.target.result;switch(s.oldVersion){case 0:i.createObjectStore(Ya,{keyPath:"compositeKey"})}}}catch(n){e(an.create("storage-open",{originalErrorMessage:n==null?void 0:n.message}))}}),rl)}function DO(t){return cE(lE(t))}function AO(t,e){return aE(lE(t),e)}function CO(t){return aE(rE,t)}function PO(){return cE(rE)}async function aE(t,e){const s=(await oE()).transaction(Ya,"readwrite"),r=s.objectStore(Ya).put({compositeKey:t,value:e});return new Promise((o,a)=>{r.onsuccess=c=>{o()},s.onerror=c=>{var l;a(an.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})}async function cE(t){const n=(await oE()).transaction(Ya,"readonly"),i=n.objectStore(Ya).get(t);return new Promise((r,o)=>{i.onsuccess=a=>{const c=a.target.result;r(c?c.value:void 0)},n.onerror=a=>{var c;o(an.create("storage-get",{originalErrorMessage:(c=a.target.error)===null||c===void 0?void 0:c.message}))}})}function lE(t){return`${t.options.appId}-${t.name}`}/**
989 * @license
990 * Copyright 2020 Google LLC
991 *
992 * Licensed under the Apache License, Version 2.0 (the "License");
993 * you may not use this file except in compliance with the License.
994 * You may obtain a copy of the License at
995 *
996 *   http://www.apache.org/licenses/LICENSE-2.0
997 *
998 * Unless required by applicable law or agreed to in writing, software
999 * distributed under the License is distributed on an "AS IS" BASIS,
1000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1001 * See the License for the specific language governing permissions and
1002 * limitations under the License.
1003 */const Qa=new Ac("@firebase/app-check");/**
1004 * @license
1005 * Copyright 2020 Google LLC
1006 *
1007 * Licensed under the Apache License, Version 2.0 (the "License");
1008 * you may not use this file except in compliance with the License.
1009 * You may obtain a copy of the License at
1010 *
1011 *   http://www.apache.org/licenses/LICENSE-2.0
1012 *
1013 * Unless required by applicable law or agreed to in writing, software
1014 * distributed under the License is distributed on an "AS IS" BASIS,
1015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1016 * See the License for the specific language governing permissions and
1017 * limitations under the License.
1018 */async function RO(t){if(Ju()){let e;try{e=await DO(t)}catch(n){Qa.warn(`Failed to read token from IndexedDB. Error: ${n}`)}return e}}function xh(t,e){return Ju()?AO(t,e).catch(n=>{Qa.warn(`Failed to write token to IndexedDB. Error: ${n}`)}):Promise.resolve()}async function kO(){let t;try{t=await PO()}catch{}if(t)return t;{const e=ux();return CO(e).catch(n=>Qa.warn(`Failed to persist debug token to IndexedDB. Error: ${n}`)),e}}/**
1019 * @license
1020 * Copyright 2020 Google LLC
1021 *
1022 * Licensed under the Apache License, Version 2.0 (the "License");
1023 * you may not use this file except in compliance with the License.
1024 * You may obtain a copy of the License at
1025 *
1026 *   http://www.apache.org/licenses/LICENSE-2.0
1027 *
1028 * Unless required by applicable law or agreed to in writing, software
1029 * distributed under the License is distributed on an "AS IS" BASIS,
1030 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1031 * See the License for the specific language governing permissions and
1032 * limitations under the License.
1033 */function fm(){return Xu().enabled}async function pm(){const t=Xu();if(t.enabled&&t.token)return t.token.promise;throw Error(`
1034            Can't get debug token in production mode.
1035        `)}function UO(){const t=_b(),e=Xu();if(e.initialized=!0,typeof t.FIREBASE_APPCHECK_DEBUG_TOKEN!="string"&&t.FIREBASE_APPCHECK_DEBUG_TOKEN!==!0)return;e.enabled=!0;const n=new Ka;e.token=n,typeof t.FIREBASE_APPCHECK_DEBUG_TOKEN=="string"?n.resolve(t.FIREBASE_APPCHECK_DEBUG_TOKEN):n.resolve(kO())}/**
1036 * @license
1037 * Copyright 2020 Google LLC
1038 *
1039 * Licensed under the Apache License, Version 2.0 (the "License");
1040 * you may not use this file except in compliance with the License.
1041 * You may obtain a copy of the License at
1042 *
1043 *   http://www.apache.org/licenses/LICENSE-2.0
1044 *
1045 * Unless required by applicable law or agreed to in writing, software
1046 * distributed under the License is distributed on an "AS IS" BASIS,
1047 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1048 * See the License for the specific language governing permissions and
1049 * limitations under the License.
1050 */const NO={error:"UNKNOWN_ERROR"};function xO(t){return nm.encodeString(JSON.stringify(t),!1)}async function $f(t,e=!1){const n=t.app;dm(n);const s=It(n);let i=s.token,r;if(i&&!to(i)&&(s.token=void 0,i=void 0),!i){const c=await s.cachedTokenPromise;c&&(to(c)?i=c:await xh(n,void 0))}if(!e&&i&&to(i))return{token:i.token};let o=!1;if(fm()){s.exchangeTokenPromise||(s.exchangeTokenPromise=hm(iE(n,await pm()),t.heartbeatServiceProvider).finally(()=>{s.exchangeTokenPromise=void 0}),o=!0);const c=await s.exchangeTokenPromise;return await xh(n,c),s.token=c,{token:c.token}}try{s.exchangeTokenPromise||(s.exchangeTokenPromise=s.provider.getToken().finally(()=>{s.exchangeTokenPromise=void 0}),o=!0),i=await It(n).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?Qa.warn(c.message):Qa.error(c),r=c}let a;return i?r?to(i)?a={token:i.token,internalError:r}:a=rI(r):(a={token:i.token},s.token=i,await xh(n,i)):a=rI(r),o&&hE(n,a),a}async function MO(t){const e=t.app;dm(e);const{provider:n}=It(e);if(fm()){const s=await pm(),{token:i}=await hm(iE(e,s),t.heartbeatServiceProvider);return{token:i}}else{const{token:s}=await n.getToken();return{token:s}}}function uE(t,e,n,s){const{app:i}=t,r=It(i),o={next:n,error:s,type:e};if(r.tokenObservers=[...r.tokenObservers,o],r.token&&to(r.token)){const a=r.token;Promise.resolve().then(()=>{n({token:a.token}),iI(t)}).catch(()=>{})}r.cachedTokenPromise.then(()=>iI(t))}function dE(t,e){const n=It(t),s=n.tokenObservers.filter(i=>i.next!==e);s.length===0&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=s}function iI(t){const{app:e}
1050=t,n=It(e);let s=n.tokenRefresher;s||(s=OO(t),n.tokenRefresher=s),!s.isRunning()&&n.isTokenAutoRefreshEnabled&&s.start()}function OO(t){const{app:e}=t;return new wO(async()=>{const n=It(e);let s;if(n.token?s=await $f(t,!0):s=await $f(t),s.error)throw s.error;if(s.internalError)throw s.internalError},()=>!0,()=>{const n=It(e);if(n.token){let s=n.token.issuedAtTimeMillis+(n.token.expireTimeMillis-n.token.issuedAtTimeMillis)*.5+3e5;const i=n.token.expireTimeMillis-5*60*1e3;return s=Math.min(s,i),Math.max(0,s-Date.now())}else return 0},nI.RETRIAL_MIN_WAIT,nI.RETRIAL_MAX_WAIT)}function hE(t,e){const n=It(t).tokenObservers;for(const s of n)try{s.type==="EXTERNAL"&&e.error!=null?s.error(e.error):s.next(e)}catch{}}function to(t){return t.expireTimeMillis-Date.now()>0}function rI(t){return{token:xO(NO),error:t}}/**
1051 * @license
1052 * Copyright 2020 Google LLC
1053 *
1054 * Licensed under the Apache License, Version 2.0 (the "License");
1055 * you may not use this file except in compliance with the License.
1056 * You may obtain a copy of the License at
1057 *
1058 *   http://www.apache.org/licenses/LICENSE-2.0
1059 *
1060 * Unless required by applicable law or agreed to in writing, software
1061 * distributed under the License is distributed on an "AS IS" BASIS,
1062 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1063 * See the License for the specific language governing permissions and
1064 * limitations under the License.
1065 */class LO{constructor(e,n){this.app=e,this.heartbeatServiceProvider=n}_delete(){const{tokenObservers:e}=It(this.app);for(const n of e)dE(this.app,n.next);return Promise.resolve()}}function FO(t,e){return new LO(t,e)}function VO(t){return{getToken:e=>$f(t,e),getLimitedUseToken:()=>MO(t),addTokenListener:e=>uE(t,"INTERNAL",e),removeTokenListener:e=>dE(t.app,e)}}const qO="@firebase/app-check",GO="0.8.3";/**
1066 * @license
1067 * Copyright 2020 Google LLC
1068 *
1069 * Licensed under the Apache License, Version 2.0 (the "License");
1070 * you may not use this file except in compliance with the License.
1071 * You may obtain a copy of the License at
1072 *
1073 *   http://www.apache.org/licenses/LICENSE-2.0
1074 *
1075 * Unless required by applicable law or agreed to in writing, software
1076 * distributed under the License is distributed on an "AS IS" BASIS,
1077 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1078 * See the License for the specific language governing permissions and
1079 * limitations under the License.
1080 */const BO="https://www.google.com/recaptcha/api.js";function jO(t,e){const n=new Ka,s=It(t);s.reCAPTCHAState={initialized:n};const i=$O(t),r=sI(!1);return r?oI(t,e,r,i,n):KO(()=>{const o=sI(!1);if(!o)throw new Error("no recaptcha");oI(t,e,o,i,n)}),n.promise}function oI(t,e,n,s,i){n.ready(()=>{WO(t,e,n,s),i.resolve(n)})}function $O(t){const e=`fire_app_check_${t.name}`,n=document.createElement("div");return n.id=e,n.style.display="none",document.body.appendChild(n),e}async function HO(t){dm(t);const n=await It(t).reCAPTCHAState.initialized.promise;return new Promise((s,i)=>{const r=It(t).reCAPTCHAState;n.ready(()=>{s(n.execute(r.widgetId,{action:"fire_app_check"}))})})}function WO(t,e,n,s){const i=n.render(s,{sitekey:e,size:"invisible",callback:()=>{It(t).reCAPTCHAState.succeeded=!0},"error-callback":()=>{It(t).reCAPTCHAState.succeeded=!1}}),r=It(t);r.reCAPTCHAState=Object.assign(Object.assign({},r.reCAPTCHAState),{widgetId:i})}function KO(t){const e=document.createElement("script");e.src=BO,e.onload=t,document.head.appendChild(e)}/**
1081 * @license
1082 * Copyright 2021 Google LLC
1083 *
1084 * Licensed under the Apache License, Version 2.0 (the "License");
1085 * you may not use this file except in compliance with the License.
1086 * You may obtain a copy of the License at
1087 *
1088 *   http://www.apache.org/licenses/LICENSE-2.0
1089 *
1090 * Unless required by applicable law or agreed to in writing, software
1091 * distributed under the License is distributed on an "AS IS" BASIS,
1092 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1093 * See the License for the specific language governing permissions and
1094 * limitations under the License.
1095 */class mm{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){var e,n,s;JO(this._throttleData);const i=await HO(this._app).catch(o=>{throw an.create("recaptcha-error")});if(!(!((e=It(this._app).reCAPTCHAState)===null||e===void 0)&&e.succeeded))throw an.create("recaptcha-error");let r;try{r=await hm(bO(this._app,i),this._heartbeatServiceProvider)}catch(o){throw!((n=o.code)===null||n===void 0)&&n.includes("fetch-status-error")?(this._throttleData=zO(Number((s=o.customData)===null||s===void 0?void 0:s.httpStatus),this._throttleData),an.create("throttled",{time:sE(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):o}return this._throttleData=null,r}initialize(e){this._app=e,this._heartbeatServiceProvider=ps(e,"heartbeat"),jO(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof mm?this._siteKey===e._siteKey:!1}}function zO(t,e){if(t===404||t===403)return{backoffCount:1,allowRequestsAfter:Date.now()+IO,httpStatus:t};{const n=e?e.backoffCount:0,s=xf(n,1e3,2);return{backoffCount:n+1,allowRequestsAfter:Date.now()+s,httpStatus:t}}}function JO(t){if(t&&Date.now()-t.allowRequestsAfter<=0)throw an.create("throttled",{time:sE(t.allowRequestsAfter-Date.now()),httpStatus:t.httpStatus})}/**
1096 * @license
1097 * Copyright 2020 Google LLC
1098 *
1099 * Licensed under the Apache License, Version 2.0 (the "License");
1100 * you may not use this file except in compliance with the License.
1101 * You may obtain a copy of the License at
1102 *
1103 *   http://www.apache.org/licenses/LICENSE-2.0
1104 *
1105 * Unless required by applicable law or agreed to in writing, software
1106 * distributed under the License is distributed on an "AS IS" BASIS,
1107 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1108 * See the License for the specific language governing permissions and
1109 * limitations under the License.
1110 */function YO(t=qo(),e){t=Ae(t);const n=ps(t,"app-check");if(Xu().initialized||UO(),fm()&&pm().then(i=>console.log(`App Check debug token: ${i}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),n.isInitialized()){const i=n.getImmediate(),r=n.getOptions();if(r.isTokenAutoRefreshEnabled===e.isTokenAutoRefreshEnabled&&r.provider.isEqual(e.provider))return i;throw an.create("already-initialized",{appName:t.name})}const s=n.initialize({options:e});return QO(t,e.provider,e.isTokenAutoRefreshEnabled),It(t).isTokenAutoRefreshEnabled&&uE(s,"INTERNAL",()=>{}),s}function QO(t,e,n){const s=gO(t,Object.assign({},tE));s.activated=!0,s.provider=e,s.cachedTokenPromise=RO(t).then(i=>(i&&to(i)&&(s.token=i,hE(t,{token:i.token})),i)),s.isTokenAutoRefreshEnabled=n===void 0?t.automaticDataCollectionEnabled:n,s.provider.initialize(t)}const XO="app-check",aI="app-check-internal";function ZO(){ln(new Zt(XO,t=>{const e=t.getProvider("app").getImmediate(),n=t.getProvider("heartbeat");return FO(e,n)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,e,n)=>{t.getProvider(aI).initialize()})),ln(new Zt(aI,t=>{const e=t.getProvider("app-check").getImmediate();return VO(e)},"PUBLIC").setInstantiationMode("EXPLICIT")),kt(qO,GO)}ZO();const eL=[{item:"Members",count:0,action:"members",to:"/admin/dash/members"},{item:"Files",count:0,action:"files",to:"/admin/dash/files"},{item:"Scheduled Tasks",count:0,action:"scheduledTasks",to:"/admin/dash/tasks"},{item:"System Errors",count:0,action:"systemErrors",to:"/admin/dash/errors"},{item:"Warnings",count:0,action:"warnings",to:"/admin/dash/warnings"},{item:"Node Mailer",count:0,action:"nodeMailer",to:"/admin/dash/nodemailer"},{item:"WhatsApp",count:0,action:"whatsapp",to:"/admin/dash/whatsapp"},{item:"Feedback",count:0,action:"feedback",to:"/admin/dash/feedback"},{item:"Facilitators",count:0,action:"facilitators",to:"/admin/dash/facilitators"}],tL=[{title:"All",action:"all",count:0,default:!0},{title:"Guardians",action:"guardian",count:0,default:!1},{title:"Students",action:"student",count:0,default:!1},{title:"Facilitators",action:"facilitator",count:0,default:!1},{title:"Administration",action:"administration",count:0,default:!1},{title:"Blocked",action:"blocked",count:0,default:!1}],nL=[{title:"All",action:"all",count:0,default:!0},{title:"Inquiries",action:"Inquiry",count:0,default:!1},{title:"Admissions",action:"Admissions",count:0,default:!1},{title:"Feedback",action:"Student Feedback",count:0,default:!1},{title:"Payments",action:"Payment Receipt",count:0,default:!1},{title:"Webmail",action:"Webmail",count:0,default:!1},{title:"Members",action:"Members",count:0,default:!1},{title:"Contribiutions",action:"Contribiution Receipt",count:0,default:!1}],sL=[{title:"Name",action:"name",default:!0},{title:"Newest",action:"created",default:!1},{title:"Frequent",action:"signinCount",default:!1}],iL=[{title:"Description",action:"alt",default:!1},{title:"Created",action:"created",default:!0},{title:"Size",action:"size",default:!1}],fE=Xn("adminStore",{state:()=>({hasFiles:!1,hasErrors:!1,errors:[],hasNodeMails:!1,nodeMails:[],hasTasks:!1,tasks:[],hasWarnings:!1,warnings:[],hasFeedbacks:!1,feedbacks:[],hasFacilitators:!1,facilitators:[],hasWhatsApps:!1,whatsappNumbers:[],whatsappMessages:[],latestWhatsAppMessage:null,whatsappMessage:{message:"",to:""},initWhatsApp:!1,whatsAppFetching:!1,whatsAppScrolling:!1,sidePaneItems:eL,selectedMember:{},membersCount:{},memberFilters:tL,memberSorting:sL,filesSorting:iL,nodeMailerFilters:nL,showMessagePane:!1,facilitatorEdit:{facilitatorname:"",facilitatorEmail:"",facilitatorUUID:"",facilitatorAuth:"",status:""},dialogNotifications:{show:!1,title:"",notifications:[]},dialogMembersLoginHistory:{show:!1,title:"",items:[]},dialogFacilitators:{show:!1,title:"Please select corresponding facilitator",facilitators:[]},dialogFacilitatorEdit:{show:!1,title:"Add facilitator",action:"add"},lastDocument:null}),actions:{setMembersCount(t){this.membersCount=t},setMemberCount(t){this.sidePaneItems[0].count=t},setFilesCount(t){this.sidePaneItems[1].count=t},clearFacilitatorEdit(){this.facilitatorEdit={facilitatorname:"",facilitatorEmail:"",facilitatorUUID:"",facilitatorAuth:"",status:""}}}}),rL=[{color:1,bg:"bg-orange-300"},{color:2,bg:"bg-yellow-300"},{color:3,bg:"bg-lime-300"},{color:4,bg:"bg-green-300"},{color:5,bg:"bg-red-300"},{color:6,bg:"bg-amber-300"},{color:7,bg:"bg-emerald-300"},{color:8,bg:"bg-teal-300"},{color:9,bg:"bg-cyan-300"},{color:10,bg:"bg-sky-300"},{color:11,bg:"bg-blue-300"},{color:12,bg:"bg-indigo-300"},{color:13,bg:"bg-violet-300"},{color:14,bg:"bg-purple-300"},{color:15,bg:"bg-fuchsia-300"},{color:16,bg:"bg-pink-300"},{color:17,bg:"bg-rose-300"},{color:18,bg:"bg-rose-300"}],Qe=Xn("appStore",{state:()=>({isLoaded:!1,sessionTimings:null,sessionTimingsVersion:"0",facilitators:null,facilitatorsVersion:"0",subjects:null,subjectsVersion:"0",classrooms:null,classroomsVersion:"0",groups:null,groupsVersion:"0",selectedGroup:null,studentsVersion:"0",students:null,calendarVersion:"0",topicsVersion:"0",topics:null,defaultTopics:[],defaultTopicsVersion:"0",families:[],feeTariffs:[],feeTariffsVersion:"0",groupFamilies:[],subjectColors:rL,mixedGroups:[],mixedGroupsVersion:"0",subjectMixedGroups:[],selectedMixedGroup:null,mixedGroupsCombined:[],mixedGroupsCombinedVersion:"0",selectedMixedGroupCombined:null,availableMixedGroupStudents:[],mixedGroupStudents:[]}),actions:{async loadFromLocalStorage(t){if(!this.isLoaded){const e=localStorage.getItem("sessionTimings"),n=localStorage.getItem("sessionTimingsVersion");e&&n?(this.sessionTimings=JSON.parse(e),this.sessionTimingsVersion=n):localStorage.setItem("sessionTimingsVersion","0");const s=localStorage.getItem("subjects"),i=localStorage.getItem("subjectsVersion");s&&i?(this.subjects=JSON.parse(s),this.subjects=this.subjects.filter(N=>!N.mixedGroup),this.subjectsVersion=i):localStorage.setItem("subjectsVersion","0");const r=localStorage.getItem("classrooms"),o=localStorage.getItem("classroomsVersion");r&&o?(this.classrooms=JSON.parse(r),this.classroomsVersion=o):localStorage.setItem("classroomsVersion","0");const a=localStorage.getItem("calendar"),c=localStorage.getItem("calendarVersion");if(c&&a){this.calendarVersion=c;const N=ri();N.groupSessions=JSON.parse(a)}else localStorage.setItem("calendarVersion","0");const l=localStorage.getItem("groups"),u=localStorage.getItem("groupsVersion");l&&u?(this.groups=cI(l),this.groupsVersion=u):localStorage.setItem("groupsVersion","0");const d=localStorage.getItem("mixedGroups"),h=localStorage.getItem("mixedGroupsVersion");d&&h?(this.mixedGroups=JSON.parse(d),this.mixedGroupsVersion=h):localStorage.setItem("mixedGroupsVersion","0");const f=localStorage.getItem("mixedGroupsCombined"),m=localStorage.getItem("mixedGroupsCombinedVersion");if(f&&m?(this.mixedGroupsCombined=JSON.parse(f),this.mixedGroupsCombinedVersion=m):localStorage.setItem("mixedGroupsCombinedVersion","0"),T().isParentFacilitator){const N=localStorage.getItem("topics"),X=localStorage.getItem("topicsVersion");N&&X?(this.topics=JSON.parse(N),this.topicsVersion=X):localStorage.setItem("topicsVersion","0");const O=localStorage.getItem("facilitators"),ne=localStorage.getItem("facilitatorsVersion");O&&ne?(this.facilitators=JSON.parse(O),this.facilitatorsVersion=ne):localStorage.setItem("facilitatorsVersion","0")}const v=localStorage.getItem("facilitators"),b=localStorage.getItem("facilitatorsVersion");v&&b?(this.facilitators=JSON.parse(v),this.facilitatorsVersion=b):localStorage.setItem("facilitatorsVersion","0");const D=localStorage.getItem("topics"),w=localStorage.getItem("topicsVersion");D&&w?(this.topics=JSON.parse(D),this.topicsVersion=w):localStorage.setItem("topicsVersion","0");const y=localStorage.getItem("defaultFacilitatorTopics"),_=localStorage.getItem("defaultFacilitatorTopicsVersion");if(y&&_?(this.defaultTopics=JSON.parse(y),this.defaultTopicsVersion=_):localStorage.setItem("defaultFacilitatorTopicsVersion","0"),t==="parents"||t==="students"){this.isLoaded=!0;return}t==="facilitators"&&jc("");const S=localStorage.getItem("students"),P=localStorage.getItem("studentsVersion");S&&P?(this.students=JSON.parse(S),this.studentsVersion=P):localStorage.setItem("studentsVersion","0");const x=localStorage.getItem("feeTariffs"),M=localStorage.getItem("feeTariffsVersion");x&&M?(this.feeTariffs=JSON.parse(x),this.feeTariffsVersion=M):localStorage.setItem("feeTariffsVersion","0");const C=localStorage.getItem("selectedGroup");C?this.selectedGroup=JSON.parse(C):(localStorage.setItem("selectedGroup",JSON.stringify(this.groups[0])),this.selectedGroup=JSON.parse(C)),this.isLoaded=!0}},loadParentFacilitator(){const t=localStorage.getItem("students"),e=localStorage.getItem("studentsVersion");t&&e?(this.students=JSON.parse(t),this.studentsVersion=e):localStorage.setItem("studentsVersion","0");const n=localStorage.getItem("selectedGroup");n?this.selectedGroup=JSON.parse(n):(localStorage.setItem("selectedGroup",JSON.stringify(this.groups[0])),this.selectedGroup=JSON.parse(n))},saveSessionTimings(t,e){this.sessionTimings=JSON.parse(t),this.sessionTimingsVersion=e,localStorage.setItem("sessionTimings",t),localStorage.setItem("sessionTimingsVersion",e)},saveSubjects(t,e){this.subjects=JSON.parse(t),this.subjectsVersion=e,localStorage.setItem("subjects",t),localStorage.setItem("subjectsVersion",e)},saveClassrooms(t,e){this.classrooms=JSON.parse(t),this.classroomsVersion=e,localStorage.setItem("classrooms",t),localStorage.setItem("classroomsVersion",e)},saveFacilitators(t,e){this.facilitators=JSON.parse(t),this.facilitatorsVersion=e,localStorage.setItem("facilitators",t),localStorage.setItem("facilitatorsVersion",e)},saveMixedGroups(t,e){this.mixedGroups=JSON.parse(t),this.mixedGroupsVersion=e,localStorage.setItem("mixedGroups",t),localStorage.setItem("mixedGroupsVersion",e)},saveMixedGroupsCombined(t,e){this.mixedGroupsCombined=t,this.mixedGroupsCombinedVersion=e,localStorage.setItem("mixedGroupsCombined",JSON.stringify(t)),localStorage.setItem("mixedGroupsCombinedVersion",e)},saveGroups(t,e){this.groupsVersion=e,this.groups=cI(t),localStorage.setItem("groups",t),localStorage.setItem("groupsVersion",e);const n=localStorage.getItem("selectedGroup");n&&(this.selectedGroup=JSON.parse(n),this.groups.forEach(s=>{s.groupUUID===this.selectedGroup.groupUUID&&(this.selectedGroup=s,localStorage.setItem("selectedGroup",JSON.stringify(s)))}))},saveStudents(t,e){this.students=JSON.parse(t),this.studentsVersion=e,localStorage.setItem("students",t),localStorage.setItem("studentsVersion",e)},saveCalendar(t,e){const n=ri();n.groupSessions=JSON.parse(t),this.calendarVersion=e,localStorage.setItem("calendar",t),localStorage.setItem("calendarVersion",e)},saveTopics(t,e){this.topics=JSON.parse(t),this.topicsVersion=e,localStorage.setItem("topics",t),localStorage.setItem("topicsVersion",e)},saveDefaultTopics(t,e){this.defaultTopics=JSON.parse(t),this.defaultTopicsVersion=e,localStorage.setItem("defaultFacilitatorTopics",t),localStorage.setItem("defaultFacilitatorTopicsVersion",e)},saveFeeTariffs(t,e){const n=JSON.parse(t);n.sort((s,i)=>s.amount-i.amount),this.feeTariffs=n,this.familiesVersion=e,localStorage.setItem("feeTariffs",JSON.stringify(n)),localStorage.setItem("feeTariffsVersion",e)},setSelectedGroup(t){this.selectedGroup=t,localStorage.setItem("selectedGroup",JSON.stringify(t)),this.setGroupFamilies(t.groupUUID,!1)},getGroupDefaultTopics(t){const e=this.defaultTopics.find(n=>n.groupUUID===t);return e?e.subjects:[]},getGroupSubjectDefaultTopics(t,e){const n=this.getGroupDefaultTopics(t);return n?n.find(i=>i.subjectUUID===e):[]},setGroupFamilies(t,e){this.groupFamilies=[],this.families.forEac
1110h(n=>{e?JSON.parse(n.groupUUIDs).includes(t)&&this.groupFamilies.push(n):n.groupUUIDs.includes(t)&&this.groupFamilies.push(n)})},setMixedGroupCombinedStudents(){this.availableMixedGroupStudents=[...this.students],this.mixedGroupStudents=[...this.groups],this.selectedMixedGroupCombined.mixedGroups.forEach(t=>{t.students.forEach(e=>{const n=this.availableMixedGroupStudents.findIndex(s=>s.studentUUID===e.studentUUID);n>-1&&this.availableMixedGroupStudents.splice(n,1)})}),this.mixedGroupStudents.forEach(t=>{t.students=[]}),this.availableMixedGroupStudents.forEach(t=>{this.mixedGroupStudents.find(n=>n.groupUUID===t.groupUUID).students.push(t)})},initMixedGroupsPage(){this.mixedGroupsCombined.forEach(t=>{t.mixedGroups.forEach(e=>{e.combinedGroupStudents=[],e.students.forEach(n=>{const s=e.combinedGroupStudents.find(i=>i.groupUUID===n.groupUUID);if(s)s.students.push(n.student);else{const i={groupUUID:n.groupUUID,groupName:n.group,students:[n.student]};e.combinedGroupStudents.push(i)}})})})}}});function cI(t){let e=JSON.parse(t);return e.forEach(n=>{let s=[];try{typeof n.students=="string"?s=JSON.parse(n.students)||[]:s=n.students||[]}catch(i){console.log("error: ",i)}s.forEach(i=>{i.age=mu(new Date(i.dob))}),n.students=s,n.students.sort((i,r)=>i.name<r.name?-1:i.name>r.name?1:0)}),e}const fi=Xn("dashStore",{state:()=>({isOnline:!0,isSlowInternet:!1,isMobile:!1,isEdit:!1,isSafari:!1,disableInputs:!1,progress:!1,pageLoading:!1,showProgressBar:!1,progressLabel:"uploading file",progressStyle:"width: 5%",progressText:"5%",progressCount:0,quickSettings:!1,blogGroupSettings:!0,blogSubGroupSettings:!0,pagLimit:15,pagTotal:0,pagCount:0,pagActive:0,pagNextDisabled:!0,pagPrevDisabled:!0,pagLabel:"",pagLastDocRef:null,pagCollection:[],pagCollectionStack:[],pagSelectedItem:null,selectedFilter:null,selectedSort:null,dropdownFilter:!1,dropdownSort:!1,tabDetailProgress:!1,tabDetailTitle:"No item selected",activeSidePane:"members",activeMainPage:"",activeListItem:"",activeListItemString:"",activePrimaryButton:"",fDetailPage:!1,navTitle:"",navDetailTitle:"",activeDashboard:"",sidePaneItems:[],sidePaneItemsMobile:[],profilePage:!1,bottomPanel:!1,bottomPanelMenu:!0,bottomPanelGroups:!1,bottomPanelActions:!1,dialogBlogGroups:!1,dialogBlogTags:!1,dialogFileFolders:!1,dialogDocumentUpload:!1,dialogBlogGroupsTitle:"Add Group",dialogBlogGroupsValue:"",dialogBlogGroupsGroup:null,dialogBlogTagsValue:"",dialogFileFoldersValue:"",dialogFileSelector:!1,dialogConfirm:!1,dialogConfirmTitle:"",dialogConfirmMessage:"",dialogConfirmAction:""}),actions:{setIsMobile(t){this.isMobile=t},setUILoading(t){this.disableInputs=t,this.progress=t},setDisableInputs(t){this.disableInputs=t},setProgress(t){this.progress=t},setProgressCount(t){this.progressCount=t},setProgressLabel(t){this.progressLabel=t},setShowProgressBar(t){this.showProgressBar=t},setProgressStyle(t){this.progressStyle=t},setProgressText(t){this.progressText=t},setPageLoading(t){this.pageLoading=t},setQuickSettings(t){this.quickSettings=t},setPagLimit(t){this.pagLimit=t},setPagCollectionItem(t){this.pagCollection.push(t)},setPagCollectionStackItem(t){this.pagCollectionStack.push(t)},setPagSelectedItem(t){this.pagSelectedItem=t},clearPagCollection(){this.pagCollection=[],this.pagCollectionStack=[],this.pagSelectedItem=null},setPagTotal(t){this.pagTotal=t},setPagLabel(t){this.pagLabel=t},setPagination(t){this.pagNextDisabled=!0,this.pagPrevDisabled=!0;let e=1,n=this.pagLimit;t==="init"?(this.pagActive=1,this.pagCount=Math.floor(this.pagTotal/this.pagLimit)+1,n>=this.pagTotal?n=this.pagTotal:this.pagNextDisabled=!1):t==="next"?(this.pagActive+1!==this.pagCount&&(this.pagNextDisabled=!1),e=this.pagLimit*this.pagActive+1,n=e+this.pagLimit-1,n>=this.pagTotal&&(n=this.pagTotal),this.pagPrevDisabled=!1,this.pagActive=this.pagActive+1):t==="prev"&&(this.pagNextDisabled=!1,this.pagActive=this.pagActive-1,this.pagActive>1&&(this.pagPrevDisabled=!1),this.pagActive===1?n=this.pagLimit:(e=(this.pagActive-1)*this.pagLimit+1,n=e+this.pagLimit-1)),this.pagLabel=`${e}-${n} of ${this.pagTotal}`},getPagCollectionStack(t){this.pagCollection=[];let e=0,n=this.pagLimit-1,s=this.pagActive;t==="prev"?s--:s++,s>1&&(e=(s-1)*this.pagLimit,n=e+this.pagLimit-1);for(let i=0;i<this.pagCollectionStack.length;i++)i>=e&&i<=n&&i<=this.pagCollectionStack.length&&this.pagCollection.push(this.pagCollectionStack[i])},setPagLastDocRef(t){this.pagLastDocRef=t}
1110,setDefaultFilter(t){t.forEach(e=>{e.default&&(this.selectedFilter=e)})},setSelectedFilter(t){this.selectedFilter=t},setSelectedSort(t){this.selectedSort=t},setDropDownFilter(t){this.dropdownFilter=t},setDropDownSort(t){this.dropdownSort=t},setActiveSidePane(t){this.activeSidePane=t},setActiveMainPage(t){this.activeMainPage=t},setActiveListItem(t){this.activeListItem=t},setActivePrimaryButton(t){this.activePrimaryButton=t},setTabDetailTitle(t){this.tabDetailTitle=t},setTabDetailProgress(t){this.tabDetailProgress=t},setDialogBlogGroups(t){this.dialogBlogGroups=t},setDialogBlogTags(t){this.dialogBlogTags=t},setDialogFileFolders(t){this.dialogFileFolders=t},setdialogDocumentUpload(t){this.dialogDocumentUpload=t},setDialogBlogGroupsTitle(t){this.dialogBlogGroupsTitle=t},setDialogBlogGroupsGroup(t){this.dialogBlogGroupsGroup=t},setDialogFileSelector(t){this.dialogFileSelector=t},showDialogConfirm(t,e,n){this.dialogConfirm=!0,this.dialogConfirmTitle=t,this.dialogConfirmMessage=e,this.dialogConfirmAction=n},closeDialogConfirm(){this.dialogConfirm=!1,this.dialogConfirmMessage="",this.dialogConfirmTitle="",this.dialogConfirmAction=""}}}),gm=Xn("facilitatorStore",{state:()=>({profileCompleted:!1,showMessagePane:!1,familyStudents:[],lessons:[],hasLessons:!1,missedLessons:[],showTopicModal:!1,selectedTopic:null,showSubtopicModal:!1,selectedSubtopic:null,hasMissedLessons:!1,missedLessonsWeek:[],missedLessonsGroup:[],selectedAssignment:{assignmentUUID:"",title:"",description:"",subjectUUID:"",topicUUID:"",subTopicUUID:"",facilitatorUUID:"",resources:[]},assignmentDueDate:new Date,assignments:[],assignmentsToDelete:[],assignmentsToCreate:[],pendingAssignments:[],hasPendingAssignments:!1,pendingAssignment:null,resources:[],hasResources:!1,selectedFeedbackTerm:null,selectedFeedbackGroupTermCompleted:!0,feedbacksubjects:[],feedbackSubjectsList:[],feedbackFacilitators:[],feedbackPdfs:[],feedbackPdfsUUID:"",selectedSubjectFeedback:null,selectedStudentFeedback:null,trialFamilies:[],trialFamiliesData:!1,hasTrials:!1,studentNotes:[]}),getters:{selectedGroup:t=>Qe().selectedGroup},actions:{setSelectedGroup(t){Qe().setSelectedGroup(t)},setShowMessagePane(t){this.showMessagePane=t},setMissedLessonsGroup(t){this.missedLessonsGroup=[],this.missedLessonsWeek.forEach(e=>{if(e.groupUUID===t){this.missedLessonsGroup=e;return}})},setNewAssignment(t){let n=`Assignment - ${this.assignments.length+1}`;this.selectedAssignment.assignmentUUID="",this.selectedAssignment.title=n,this.selectedAssignment.description="",this.selectedAssignment.subjectUUID=t.subjectUUID,this.selectedAssignment.topicUUID=t.topicUUID||"",this.selectedAssignment.subTopicUUID=t.subtopicUUID||"",this.selectedAssignment.facilitatorUUID=t.facilitatorUUID,this.selectedAssignment.resources=[]}}}),pE=Xn("fileStore",{state:()=>({fileCount:0,fileFolders:[],files:[],fileCollection:[],folderPath:"/",currentFolder:null,uploadFile:{name:"",alt:"",type:"",size:"",url:"",thumbUrl:"",created:"",uid:"",parent:"",useCount:0},uplFile:null,filesSelected:!1,selectedFile:null,deleteFile:null,loadMoreFiles:!1,isSelector:!1}),actions:{setFileCount(t){this.fileCount=t},setFileFolders(t){this.fileFolders=t},setCurrentFolder(t){this.folderPath=t.path,this.currentFolder=t,this.filterFolders()},addCurrentFolderCount(t){const e=this.currentFolder.fileCount+t;this.currentFolder.fileCount=e},navigateFolder(){this.currentFolder&&(this.folderPath=this.currentFolder.parent,this.filterFolders(),this.folderPath==="/"&&(this.currentFolder=null))},filterFolders(){this.fileCollection=[],this.fileFolders.forEach(t=>{t.parent===this.folderPath&&this.fileCollection.push(t),this.folderPath!=="/"&&t.path===this.folderPath&&(this.currentFolder=t)})},setUploadFileUrl(t){this.uploadFile.url=URL.createObjectURL(t),this.uploadFile.name=t.name,this.uploadFile.size=(t.size/(1024*1024)).toFixed(2),this.uploadFile.type=t.type,this.uplFile=t},clearUploadFile(){this.uploadFile={name:"",alt:"",type:"",size:"",url:"",thumbUrl:"",created:"",uid:"",parent:"",useCount:0},this.uplFile=null},setSelectedFile(t){this.selectedFile=t,this.filesSelected=t!==null},setDeleteFile(t){this.deleteFile=JSON.parse(JSON.stringify(t))},setIsSelector(t){this.isSelector=t}}}),oL=[{country:"Afghanistan",code:"AF",name:"Afghan"},{country:"Albania",code:"AL",name:"Albanian"},{country:"Algeria",code:"DZ",name:"Algerian"},{country:"Andorra",code:"AD",name:"Andorran"}
1110,{country:"Angola",code:"AO",name:"Angolan"},{country:"Antigua and Barbuda",code:"AG",name:"Antiguan, Barbudan"},{country:"Argentina",code:"AR",name:"Argentine"},{country:"Armenia",code:"AM",name:"Armenian"},{country:"Australia",code:"AU",name:"Australian"},{country:"Austria",code:"AT",name:"Austrian"},{country:"Azerbaijan",code:"AZ",name:"Azerbaijani"},{country:"Bahamas",code:"BS",name:"Bahamian"},{country:"Bahrain",code:"BH",name:"Bahraini"},{country:"Bangladesh",code:"BD",name:"Bangladeshi"},{country:"Barbados",code:"BB",name:"Barbadian"},{country:"Belarus",code:"BY",name:"Belarusian"},{country:"Belgium",code:"BE",name:"Belgian"},{country:"Belize",code:"BZ",name:"Belizean"},{country:"Benin",code:"BJ",name:"Beninese"},{country:"Bhutan",code:"BT",name:"Bhutanese"},{country:"Bolivia",code:"BO",name:"Bolivian"},{country:"Bosnia and Herzegovina",code:"BA",name:"Bosnian, Herzegovinian"},{country:"Botswana",code:"BW",name:"Motswana, Botswanan"},{country:"Brazil",code:"BR",name:"Brazilian"},{country:"Brunei",code:"BN",name:"Bruneian"},{country:"Bulgaria",code:"BG",name:"Bulgarian"},{country:"Burkina Faso",code:"BF",name:"Burkinabe"},{country:"Burundi",code:"BI",name:"Burundian"},{country:"Cambodia",code:"KH",name:"Cambodian"},{country:"Cameroon",code:"CM",name:"Cameroonian"},{country:"Canada",code:"CA",name:"Canadian"},{country:"Cape Verde",code:"CV",name:"Cape Verdean"},{country:"Central African Republic",code:"CF",name:"Central African"},{country:"Chad",code:"TD",name:"Chadian"},{country:"Chile",code:"CL",name:"Chilean"},{country:"China",code:"CN",name:"Chinese"},{country:"Colombia",code:"CO",name:"Colombian"},{country:"Comoros",code:"KM",name:"Comoran, Comorian"},{country:"Congo (Congo-Brazzaville)",code:"CG",name:"Congolese"},{country:"Costa Rica",code:"CR",name:"Costa Rican"},{country:"Croatia",code:"HR",name:"Croatian"},{country:"Cuba",code:"CU",name:"Cuban"},{country:"Cyprus",code:"CY",name:"Cypriot"},{country:"Czech Republic (Czechia)",code:"CZ",name:"Czech"},{country:"Democratic Republic of the Congo",code:"CD",name:"Congolese"},{country:"Denmark",code:"DK",name:"Danish"},{country:"Djibouti",code:"DJ",name:"Djiboutian"},{country:"Dominica",code:"DM",name:"Dominican"},{country:"Dominican Republic",code:"DO",name:"Dominican"},{country:"Ecuador",code:"EC",name:"Ecuadorian"},{country:"Egypt",code:"EG",name:"Egyptian"},{country:"El Salvador",code:"SV",name:"Salvadoran"},{country:"Equatorial Guinea",code:"GQ",name:"Equatorial Guinean"},{country:"Eritrea",code:"ER",name:"Eritrean"},{country:"Estonia",code:"EE",name:"Estonian"},{country:"Eswatini",code:"SZ",name:"Swazi"},{country:"Ethiopia",code:"ET",name:"Ethiopian"},{country:"Fiji",code:"FJ",name:"Fijian"},{country:"Finland",code:"FI",name:"Finnish"},{country:"France",code:"FR",name:"French"},{country:"Gabon",code:"GA",name:"Gabonese"},{country:"Gambia",code:"GM",name:"Gambian"},{country:"Georgia",code:"GE",name:"Georgian"},{country:"Germany",code:"DE",name:"German"},{country:"Ghana",code:"GH",name:"Ghanaian"},{country:"Greece",code:"GR",name:"Greek"},{country:"Grenada",code:"GD",name:"Grenadian"},{country:"Guatemala",code:"GT",name:"Guatemalan"},{country:"Guinea",code:"GN",name:"Guinean"},{country:"Guinea-Bissau",code:"GW",name:"Bissau-Guinean"},{country:"Guyana",code:"GY",name:"Guyanese"},{country:"Haiti",code:"HT",name:"Haitian"},{country:"Honduras",code:"HN",name:"Honduran"},{country:"Hungary",code:"HU",name:"Hungarian"},{country:"Iceland",code:"IS",name:"Icelander"},{country:"India",code:"IN",name:"Indian"},{country:"Indonesia",code:"ID",name:"Indonesian"},{country:"Iran",code:"IR",name:"Iranian"},{country:"Iraq",code:"IQ",name:"Iraqi"},{country:"Ireland",code:"IE",name:"Irish"},{country:"Israel",code:"IL",name:"Israeli"},{country:"Italy",code:"IT",name:"Italian"},{country:"Jamaica",code:"JM",name:"Jamaican"},{country:"Japan",code:"JP",name:"Japanese"},{country:"Jordan",code:"JO",name:"Jordanian"},{country:"Kazakhstan",code:"KZ",name:"Kazakhstani"},{country:"Kenya",code:"KE",name:"Kenyan"},{country:"Kiribati",code:"KI",name:"I-Kiribati"},{country:"Kuwait",code:"KW",name:"Kuwaiti"},{country:"Kyrgyzstan",code:"KG",name:"Kyrgyzstani"},{country:"Laos",code:"LA",name:"Lao"},{country:"Latvia",code:"LV",name:"Latvian"},{country:"Lebanon",code:"LB",name:"Lebanese"}
1110,{country:"Lesotho",code:"LS",name:"Basotho"},{country:"Liberia",code:"LR",name:"Liberian"},{country:"Libya",code:"LY",name:"Libyan"},{country:"Liechtenstein",code:"LI",name:"Liechtensteiner"},{country:"Lithuania",code:"LT",name:"Lithuanian"},{country:"Luxembourg",code:"LU",name:"Luxembourger"},{country:"Madagascar",code:"MG",name:"Malagasy"},{country:"Malawi",code:"MW",name:"Malawian"},{country:"Malaysia",code:"MY",name:"Malaysian"},{country:"Maldives",code:"MV",name:"Maldivian"},{country:"Mali",code:"ML",name:"Malian"},{country:"Malta",code:"MT",name:"Maltese"},{country:"Marshall Islands",code:"MH",name:"Marshallese"},{country:"Mauritania",code:"MR",name:"Mauritanian"},{country:"Mauritius",code:"MU",name:"Mauritian"},{country:"Mexico",code:"MX",name:"Mexican"},{country:"Micronesia",code:"FM",name:"Micronesian"},{country:"Moldova",code:"MD",name:"Moldovan"},{country:"Monaco",code:"MC",name:"Monacan"},{country:"Mongolia",code:"MN",name:"Mongolian"},{country:"Montenegro",code:"ME",name:"Montenegrin"},{country:"Morocco",code:"MA",name:"Moroccan"},{country:"Mozambique",code:"MZ",name:"Mozambican"},{country:"Myanmar (formerly Burma)",code:"MM",name:"Burmese"},{country:"Namibia",code:"NA",name:"Namibian"},{country:"Nauru",code:"NR",name:"Nauruan"},{country:"Nepal",code:"NP",name:"Nepalese"},{country:"Netherlands",code:"NL",name:"Dutch"},{country:"New Zealand",code:"NZ",name:"New Zealander"},{country:"Nicaragua",code:"NI",name:"Nicaraguan"},{country:"Niger",code:"NE",name:"Nigerien"},{country:"Nigeria",code:"NG",name:"Nigerian"},{country:"North Korea",code:"KP",name:"North Korean"},{country:"North Macedonia (formerly Macedonia)",code:"MK",name:"Macedonian"},{country:"Norway",code:"NO",name:"Norwegian"},{country:"Oman",code:"OM",name:"Omani"},{country:"Pakistan",code:"PK",name:"Pakistani"},{country:"Palau",code:"PW",name:"Palauan"},{country:"Palestine State",code:"PS",name:"Palestinian"},{country:"Panama",code:"PA",name:"Panamanian"},{country:"Papua New Guinea",code:"PG",name:"Papua New Guinean"},{country:"Paraguay",code:"PY",name:"Paraguayan"},{country:"Peru",code:"PE",name:"Peruvian"},{country:"Philippines",code:"PH",name:"Filipino"},{country:"Poland",code:"PL",name:"Polish"},{country:"Portugal",code:"PT",name:"Portuguese"},{country:"Qatar",code:"QA",name:"Qatari"},{country:"Romania",code:"RO",name:"Romanian"},{country:"Russia",code:"RU",name:"Russian"},{country:"Rwanda",code:"RW",name:"Rwandan"},{country:"Saint Kitts and Nevis",code:"KN",name:"Kittitian or Nevisian"},{country:"Saint Lucia",code:"LC",name:"Saint Lucian"},{country:"Saint Vincent and the Grenadines",code:"VC",name:"Vincentian"},{country:"Samoa",code:"WS",name:"Samoan"},{country:"San Marino",code:"SM",name:"Sammarinese"},{country:"Sao Tome and Principe",code:"ST",name:"Sao Tomean"},{country:"Saudi Arabia",code:"SA",name:"Saudi, Saudi Arabian"},{country:"Senegal",code:"SN",name:"Senegalese"},{country:"Serbia",code:"RS",name:"Serbian"},{country:"Seychelles",code:"SC",name:"Seychellois"},{country:"Sierra Leone",code:"SL",name:"Sierra Leonean"},{country:"Singapore",code:"SG",name:"Singaporean"},{country:"Slovakia",code:"SK",name:"Slovak"},{country:"Slovenia",code:"SI",name:"Slovenian"},{country:"Solomon Islands",code:"SB",name:"Solomon Islander"},{country:"Somalia",code:"SO",name:"Somali"},{country:"South Africa",code:"ZA",name:"South African"},{country:"South Korea",code:"KR",name:"Korean"},{country:"South Sudan",code:"SS",name:"South Sudanese"},{country:"Spain",code:"ES",name:"Spanish"},{country:"Sri Lanka",code:"LK",name:"Sri Lankan"},{country:"Sudan",code:"SD",name:"Sudanese"},{country:"Suriname",code:"SR",name:"Surinamese"},{country:"Sweden",code:"SE",name:"Swedish"},{country:"Switzerland",code:"CH",name:"Swiss"},{country:"Syria",code:"SY",name:"Syrian"},{country:"Tajikistan",code:"TJ",name:"Tajikistani"},{country:"Tanzania",code:"TZ",name:"Tanzanian"},{country:"Thailand",code:"TH",name:"Thai"},{country:"Timor-Leste",code:"TL",name:"Timorese"},{country:"Togo",code:"TG",name:"Togolese"},{country:"Tonga",code:"TO",name:"Tongan"},{country:"Trinidad and Tobago",code:"TT",name:"Trinidadian or Tobagonian"},{country:"Tunisia",code:"TN",name:"Tunisian"},{country:"Turkey",code:"TR",name:"Turkish"},{country:"Turkmenistan",code:"TM",name:"Turkmen"},{country:"Tuvalu",code:"TV",name:"Tuvaluan"},{country:"Uganda",code:"UG",name:"Ugandan"},{country:"Ukraine",code:"UA",name:"Ukrainian"},{country:"United Arab Emirates",code:"AE",name:"Emirati"},{country:"United Kingdom",code:"GB",name:"British"},{country:"United States",code:"US",name:"American"},{country:"Uruguay",code:"UY",name:"Uruguayan"},{country:"Uzbekistan",code:"UZ",name:"Uzbekistani"},{country:"Vanuatu",code:"VU",name:"Ni-Vanuatu"},{country:"Vatican City",code:"VA",name:"Vatican"},{country:"Venezuela",code:"VE",name:"Venezuelan"},{country:"Vietnam",code:"VN",name:"Vietnamese"},{country:"Yemen",code:"YE",name:"Yemeni"},{country:"Zambia",code:"ZM",name:"Zambian"},{country:"Zimbabwe",code:"ZW",name:"Zimbabwean"}],aL=[{q:"What are some of your most cherished personal interests and/or hobbies that you actively pursue?",a:""},{q:"What is your favorite meal as a family? Why is it your favorite?",a:""},{q:"How do you enjoy spending time with your child?",a:""},{q:"How is time spent during holidays?",a:""},{q:"Briefly describe your personal parenting style/ method.",a:""},{q:"Who or what has significantly shaped your child’s life until now? Please elaborate on these important influences on your child.",a:""},{q:"How do you gauge and understand your child’s growth and learning? What do you think are some of the important criteria for you to track y
1110our child’s journey? And why have you chosen them?",a:""},{q:"In what ways do you think that a learning space/ an educational institution can support you in fulfilling your vision for your child?",a:""},{q:"Why are you moving away from your current situation? What are you seeking for your child, family and yourself by making this change?",a:""},{q:"What are some of the challenges you anticipate going forward on this journey?  And what are you most looking forward to?",a:""},{q:"Why do you want to enroll your child at TLC? How did you hear about us?",a:""},{q:"Is there anything else you would like to share with us?",a:""}],lI=[{q:"Why are you looking to move away from your current place of work?",a:""},{q:"What are some of the key elements you are seeking at your place of work? Why?",a:""},{q:"If you have spent less than three years in your previous work place(s) please explain your reasons for moving.",a:""},{q:"Please do share what age groups you have been working with?",a:""},{q:"Are there any people whose work or philosophy of education inspire you? Who and how?",a:""},{q:"Please do share the curriculum you follow or not and why you choose to do so or not?",a:""},{q:"What is it about being with children that makes you want to wake up and go to be with them?",a:""},{q:"Anything that will help us understand your approach to children and education.",a:""},{q:"Lastly, how did you hear about us and why would you like to be part of our team?",a:""}],cL=[{q:"Briefly describe your personal parenting style/ method.",a:""},{q:"Is there any specific activity that you enjoy doing with your child? Please elaborate.",a:""},{q:"How do you spend your free time/ What are your interests/hobbies?",a:""},{q:"What is your favourite meal to have as a family?",a:""},{q:"What is your understanding of education? Where do you draw that understanding from?",a:""},{q:"What (in your mind) is the role of a parent, and an educational institution in a child’s life?",a:""},{q:"What does competition mean to you? Does it play a role in your personal/ professional life? Please elaborate.",a:""},{q:"What is your understanding of the phrase 'successful person'? Would you apply this understanding on your child and yourself? Please elaborate on your response.",a:""},{q:"Why do you want to enrol your child at TLC?",a:""},{q:"How did you hear about TLC?",a:""},{q:"Is there anything else you would like to share with us?",a:""}],lL=[{country:"Afghanistan",countryCode:"AF",prefix:"+93",digits:9},{country:"Albania",countryCode:"AL",prefix:"+355",digits:9},{country:"Algeria",countryCode:"DZ",prefix:"+213",digits:9},{country:"Andorra",countryCode:"AD",prefix:"+376",digits:6},{country:"Angola",countryCode:"AO",prefix:"+244",digits:9},{country:"Antigua and Barbuda",countryCode:"AG",prefix:"+1-268",digits:10},{country:"Argentina",countryCode:"AR",prefix:"+54",digits:10},{country:"Armenia",countryCode:"AM",prefix:"+374",digits:8},{country:"Australia",countryCode:"AU",prefix:"+61",digits:9},{country:"Austria",countryCode:"AT",prefix:"+43",digits:10},{country:"Azerbaijan",countryCode:"AZ",prefix:"+994",digits:9},{country:"Bahamas",countryCode:"BS",prefix:"+1-242",digits:10},{country:"Bahrain",countryCode:"BH",prefix:"+973",digits:8},{country:"Bangladesh",countryCode:"BD",prefix:"+880",digits:10},{country:"Barbados",countryCode:"BB",prefix:"+1-246",digits:10},{country:"Belarus",countryCode:"BY",prefix:"+375",digits:9},{country:"Belgium",countryCode:"BE",prefix:"+32",digits:9},{country:"Belize",countryCode:"BZ",prefix:"+501",digits:7},{country:"Benin",countryCode:"BJ",prefix:"+229",digits:8},{country:"Bhutan",countryCode:"BT",prefix:"+975",digits:8},{country:"Bolivia",countryCode:"BO",prefix:"+591",digits:8},{country:"Bosnia and Herzegovina",countryCode:"BA",prefix:"+387",digits:8},{country:"Botswana",countryCode:"BW",prefix:"+267",digits:8},{country:"Brazil",countryCode:"BR",prefix:"+55",digits:11},{country:"Brunei",countryCode:"BN",prefix:"+673",digits:7},{country:"Bulgaria",countryCode:"BG",prefix:"+359",digits:9},{country:"Burkina Faso",countryCode:"BF",prefix:"+226",digits:8},{country:"Burundi",countryCode:"BI",prefix:"+257",digits:8},{country:"Cambodia",countryCode:"KH",prefix:"+855",digits:9},{country:"Cameroon",countryCode:"CM",prefix:"+237",digits:9},{country:"Canada",countryCode:"CA",prefix:"+1",digits:10},{country:"Cape Verde",countryCode:"CV",prefix:"+238",digits:7},{country:"Central African Republic",countryCode:"CF",prefix:"+236",digits:8},{country:"Chad",countryCode:"TD",prefix:"+235",digits:8},{country:"Chile",countryCode:"CL",prefix:"+56",digits:9},{country:"China",countryCode:"CN",prefix:"+86",digits:11},{country:"Colombia",countryCode:"CO",prefix:"+57",digits:10},{country:"Comoros",countryCode:"KM",prefix:"+269",digits:7},{country:"Congo (Congo-Brazzaville)",countryCode:"CG",prefix:"+242",digits:9},{country:"Costa Rica",countryCode:"CR",prefix:"+506",digits:8},{country:"Croatia",countryCode:"HR",prefix:"+385",digits:9},{country:"Cuba",countryCode:"CU",prefix:"+53",digits:8},{country:"Cyprus",countryCode:"CY",prefix:"+357",digits:8},{country:"Czech Republic (Czechia)",countryCode:"CZ",prefix:"+420",digits:9},{country:"Democratic Republic of the Congo",countryCode:"CD",prefix:"+243",digits:9},{country:"Denmark",countryCode:"DK",prefix:"+45",digits:8},{country:"Djibouti",countryCode:"DJ",prefix:"+253",digits:8},{country:"Dominica",countryCode:"DM",prefix:"+1-767",digits:10},{country:"Dominican Republic",countryCode:"DO",prefix:"+1-809",digits:10},{country:"Ecuador",countryCode:"EC",prefix:"+593",digits:9},{country:"Egypt",countryCode:"EG",prefix:"+20",digits:10},{country:"El Salvador",countryCode:"SV",prefix:"+503",digits:8},{country:"Equatorial Guinea",countryCode:"GQ",prefix:"+240",digits:9},{country:"Eritrea",countryCode:"ER",prefix:"+291",digits:7},{country:"Estonia",countryCode:"EE",prefix:"+372",digits:8},{country:"Eswatini",countryCode:"SZ",prefix:"+268",digits:8},{country:"Ethiopia",countryCode:"ET",prefix:"+251",digits:9},{country:"Fiji",countryCode:"FJ",prefix:"+679",digits:7},{country:"Finland",countryCode:"FI",prefix:"+358",digits:9},{country:"France",countryCode:"FR",prefix:"+33",digits:9},{country:"Gabon",countryCode:"GA",prefix:"+241",digits:7},{country:"Gambia",countryCode:"GM",prefix:"+220",digits:7},{country:"Georgia",countryCode:"GE",prefix:"+995",digits:9},{country:"Germany",countryCode:"DE",prefix:"+49",digits:11},{country:"Ghana",countryCode:"GH",prefix:"+233",digits:9},{country:"Greece",countryCode:"GR",prefix:"+30",digits:10},{country:"Grenada",countryCode:"GD",prefix:"+1-473",digits:10},{country:"Guatemala",countryCode:"GT",prefix:"+502",digits:8},{country:"Guinea",countryCode:"GN",prefix:"+224",digits:8},{country:"Guinea-Bissau",countryCode:"GW",prefix:"+245",digits:7},{country:"Guyana",countryCode:"GY",prefix:"+592",digits:7},{country:"Haiti",countryCode:"HT",prefix:"+509",digits:8},{country:"Honduras",countryCode:"HN",prefix:"+504",digits:8},{country:"Hungary",countryCode:"HU",prefix:"+36",digits:9},{country:"Iceland",countryCode:"IS",prefix:"+354",digits:7},{country:"India",countryCode:"IN",prefix:"+91",digits:10},{country:"Indonesia",countryCode:"ID",prefix:"+62",digits:9},{country:"Iran",countryCode:"IR",prefix:"+98",digits:10},{country:"Iraq",countryCode:"IQ",prefix:"+964",digits:10},{country:"Ireland",countryCode:"IE",prefix:"+353",digits:9},{country:"Israel",countryCode:"IL",prefix:"+972",digits:9},{country:"Italy",countryCode:"IT",prefix:"+39",digits:10},{country:"Jamaica",countryCode:"JM",prefix:"+1-876",digits:10},{country:"Japan",countryCode:"JP",prefix:"+81",digits:10},{country:"Jordan",countryCode:"JO",prefix:"+962",digits:9},{country:"Kazakhstan",countryCode:"KZ",prefix:"+7",digits:10},{country:"Kenya",countryCode:"KE",prefix:"+254",digits:10},{country:"Kiribati",countryCode:"KI",prefix:"+686",digits:5},{country:"Kuwait",countryCode:"KW",prefix:"+965",digits:8},{country:"Kyrgyzstan",countryCode:"KG",prefix:"+996",digits:9},{country:"Laos",countryCode:"LA",prefix:"+856",digits:9},{country:"Latvia",countryCode:"LV",prefix:"+371",digits:8},{country:"Lebanon",countryCode:"LB",prefix:"+961",digits:8}
1110,{country:"Lesotho",countryCode:"LS",prefix:"+266",digits:8},{country:"Liberia",countryCode:"LR",prefix:"+231",digits:8},{country:"Libya",countryCode:"LY",prefix:"+218",digits:9},{country:"Liechtenstein",countryCode:"LI",prefix:"+423",digits:7},{country:"Lithuania",countryCode:"LT",prefix:"+370",digits:8},{country:"Luxembourg",countryCode:"LU",prefix:"+352",digits:9},{country:"Madagascar",countryCode:"MG",prefix:"+261",digits:9},{country:"Malawi",countryCode:"MW",prefix:"+265",digits:9},{country:"Malaysia",countryCode:"MY",prefix:"+60",digits:9},{country:"Maldives",countryCode:"MV",prefix:"+960",digits:7},{country:"Mali",countryCode:"ML",prefix:"+223",digits:8},{country:"Malta",countryCode:"MT",prefix:"+356",digits:8},{country:"Marshall Islands",countryCode:"MH",prefix:"+692",digits:7},{country:"Mauritania",countryCode:"MR",prefix:"+222",digits:8},{country:"Mauritius",countryCode:"MU",prefix:"+230",digits:7},{country:"Mexico",countryCode:"MX",prefix:"+52",digits:10},{country:"Micronesia",countryCode:"FM",prefix:"+691",digits:7},{country:"Moldova",countryCode:"MD",prefix:"+373",digits:8},{country:"Monaco",countryCode:"MC",prefix:"+377",digits:8},{country:"Mongolia",countryCode:"MN",prefix:"+976",digits:8},{country:"Montenegro",countryCode:"ME",prefix:"+382",digits:8},{country:"Morocco",countryCode:"MA",prefix:"+212",digits:9},{country:"Mozambique",countryCode:"MZ",prefix:"+258",digits:9},{country:"Myanmar (formerly Burma)",countryCode:"MM",prefix:"+95",digits:9},{country:"Namibia",countryCode:"NA",prefix:"+264",digits:9},{country:"Nauru",countryCode:"NR",prefix:"+674",digits:7},{country:"Nepal",countryCode:"NP",prefix:"+977",digits:10},{country:"Netherlands",countryCode:"NL",prefix:"+31",digits:9},{country:"New Zealand",countryCode:"NZ",prefix:"+64",digits:9},{country:"Nicaragua",countryCode:"NI",prefix:"+505",digits:8},{country:"Niger",countryCode:"NE",prefix:"+227",digits:8},{country:"Nigeria",countryCode:"NG",prefix:"+234",digits:10},{country:"North Korea",countryCode:"KP",prefix:"+850",digits:8},{country:"North Macedonia (formerly Macedonia)",countryCode:"MK",prefix:"+389",digits:8},{country:"Norway",countryCode:"NO",prefix:"+47",digits:8},{country:"Oman",countryCode:"OM",prefix:"+968",digits:8},{country:"Pakistan",countryCode:"PK",prefix:"+92",digits:10},{country:"Palau",countryCode:"PW",prefix:"+680",digits:7},{country:"Palestine State",countryCode:"PS",prefix:"+970",digits:9},{country:"Panama",countryCode:"PA",prefix:"+507",digits:8},{country:"Papua New Guinea",countryCode:"PG",prefix:"+675",digits:7},{country:"Paraguay",countryCode:"PY",prefix:"+595",digits:9},{country:"Peru",countryCode:"PE",prefix:"+51",digits:9},{country:"Philippines",countryCode:"PH",prefix:"+63",digits:10},{country:"Poland",countryCode:"PL",prefix:"+48",digits:9},{country:"Portugal",countryCode:"PT",prefix:"+351",digits:9},{country:"Qatar",countryCode:"QA",prefix:"+974",digits:8},{country:"Romania",countryCode:"RO",phonePrefix:"+40",digits:10},{country:"Russia",countryCode:"RU",phonePrefix:"+7",digits:10},{country:"Rwanda",countryCode:"RW",phonePrefix:"+250",digits:9},{country:"Saint Kitts and Nevis",countryCode:"KN",phonePrefix:"+1-869",digits:10},{country:"Saint Lucia",countryCode:"LC",phonePrefix:"+1-758",digits:10},{country:"Saint Vincent and the Grenadines",countryCode:"VC",phonePrefix:"+1-784",digits:10},{country:"Samoa",countryCode:"WS",phonePrefix:"+685",digits:7},{country:"San Marino",countryCode:"SM",phonePrefix:"+378",digits:10},{country:"Sao Tome and Principe",countryCode:"ST",phonePrefix:"+239",digits:7},{country:"Saudi Arabia",countryCode:"SA",phonePrefix:"+966",digits:9},{country:"Senegal",countryCode:"SN",phonePrefix:"+221",digits:9},{country:"Serbia",countryCode:"RS",phonePrefix:"+381",digits:9},{country:"Seychelles",countryCode:"SC",phonePrefix:"+248",digits:7},{country:"Sierra Leone",countryCode:"SL",phonePrefix:"+232",digits:8},{country:"Singapore",countryCode:"SG",phonePrefix:"+65",digits:8},{country:"Slovakia",countryCode:"SK",phonePrefix:"+421",digits:9},{country:"Slovenia",countryCode:"SI",phonePrefix:"+386",digits:8},{country:"Solomon Islands",countryCode:"SB",phonePrefix:"+677",digits:7},{country:"Somalia",countryCode:"SO",phonePrefix:"+252",digits:8},{country:"South Africa",countryCode:"ZA",phonePrefix:"+27",digits:9},{country:"South Korea",countryCode:"KR",phonePrefix:"+82",digits:11},{country:"South Sudan",countryCode:"SS",phonePrefix:"+211",digits:9},{country:"Spain",countryCode:"ES",phonePrefix:"+34",digits:9},{country:"Sri Lanka",countryCode:"LK",phonePrefix:"+94",digits:9},{country:"Sudan",countryCode:"SD",phonePrefix:"+249",digits:9},{country:"Suriname",countryCode:"SR",phonePrefix:"+597",digits:7},{country:"Sweden",countryCode:"SE",phonePrefix:"+46",digits:10},{country:"Switzerland",countryCode:"CH",phonePrefix:"+41",digits:9},{country:"Syria",countryCode:"SY",phonePrefix:"+963",digits:9},{country:"Tajikistan",countryCode:"TJ",phonePrefix:"+992",digits:9},{country:"Tanzania",countryCode:"TZ",phonePrefix:"+255",digits:9},{country:"Thailand",countryCode:"TH",phonePrefix:"+66",digits:9},{country:"Timor-Leste",countryCode:"TL",phonePrefix:"+670",digits:8},{country:"Togo",countryCode:"TG",phonePrefix:"+228",digits:8},{country:"Tonga",countryCode:"TO",phonePrefix:"+676",digits:7},{country:"Trinidad and Tobago",countryCode:"TT",phonePrefix:"+1-868",digits:10},{country:"Tunisia",countryCode:"TN",phonePrefix:"+216",digits:8},{country:"Turkey",countryCode:"TR",phonePrefix:"+90",digits:10},{country:"Turkmenistan",countryCode:"TM",phonePrefix:"+993",digits:8},{country:"Tuvalu",countryCode:"TV",phonePrefix:"+688",digits:6}
1110,{country:"Uganda",countryCode:"UG",phonePrefix:"+256",digits:9},{country:"Ukraine",countryCode:"UA",phonePrefix:"+380",digits:9},{country:"United Arab Emirates",countryCode:"AE",phonePrefix:"+971",digits:9},{country:"United Kingdom",countryCode:"GB",phonePrefix:"+44",digits:10},{country:"United States",countryCode:"US",phonePrefix:"+1",digits:10},{country:"Uruguay",countryCode:"UY",phonePrefix:"+598",digits:9},{country:"Uzbekistan",countryCode:"UZ",phonePrefix:"+998",digits:9},{country:"Vanuatu",countryCode:"VU",phonePrefix:"+678",digits:7},{country:"Vatican City",countryCode:"VA",phonePrefix:"+379",digits:10},{country:"Venezuela",countryCode:"VE",phonePrefix:"+58",digits:10},{country:"Vietnam",countryCode:"VN",phonePrefix:"+84",digits:10},{country:"Yemen",countryCode:"YE",phonePrefix:"+967",digits:9},{country:"Zambia",countryCode:"ZM",phonePrefix:"+260",digits:9},{country:"Zimbabwe",countryCode:"ZW",phonePrefix:"+263",digits:9}],uL=Xn("formsStore",{state:()=>({disableInputs:!1,progress:!1,genderList:[{name:"Male"},{name:"Female"},{name:"Non binary"},{name:"Other"}],maritalStatusList:[{name:"Married"},{name:"Separated"},{name:"Divorced"},{name:"Widowed"},{name:"Civil Partnership"}],inquiryList:[],applyForm:{children:[],guardians:[],maritalStatus:"Select Marital Status",applyDate:new Date},applyFormChild:{firstName:"",middleName:"",lastName:"",dob:new Date,gender:"Select Gender",nationality:"Select Nationality",previousSchools:[],editMode:!1},applyFormGuardian:{about:"",firstName:"",middleName:"",lastName:"",dob:new Date,occupation:"",jobDescription:"",workPlace:"",mobile:"",prefix:"+91",email:"",address:"",nationality:"Select Nationality",gender:"Select Gender",questions:[],editMode:!1},applyFormChildSchool:{school:"",grade:"",years:""},selectedCountryCode:{country:"India",prefix:"+91",code:"IN",digits:10},applyFormFacilitators:{firstName:"",middleName:"",lastName:"",dob:new Date,email:"",prefix:"+91",mobile:"",gender:"Select Gender",nationality:"Indian",workplace:"",yearsOfExperience:0,facilitatingSubjects:"",statementOfInterest:"",referenceOne:{name:"",email:"",relationship:""},referenceTwo:{name:"",email:"",relationship:""},questions:lI},facilitatorResume:null,applyFormGuardinaQuestions:null,applyFromEmailHtml:`Dear #parents#,
1111
1112Thank you for your interest in The Learning Centre, we have received your form!
1113
1114Please give us a few days to get back to you.
1115
1116Warmly,
1117Shivani
1118`,applyFromFacilitatorEmailHtml:`Dear #applicant#, 
1119
1120Thank you for your interest in our centre. 
1121
1122Please give us a few days to respond.
1123
1124Warmly,
1125Nandita 
1126Co-founder, The Learning Center
1127`,applyFormState:"form",childFormState:"child",flagOnboarding:!1,country_list:oL,countryCodes:lL,enableSubmit:!0,formCounter:5}),actions:{SetFlagOnboarding(t){this.flagOnboarding=t,t?this.applyFormGuardinaQuestions=cL:this.applyFormGuardinaQuestions=aL},setApplication(t){this.applyForm=t,this.applyForm.guardians.forEach(e=>{e.dob=new Date(e.dob)}),this.applyForm.children.forEach(e=>{e.dob=new Date(e.dob)}),this.setEnableSubmit()},setApplyFormState(t){this.applyFormState=t},clearApplyForm(){this.applyForm={children:[],guardians:[],maritalStatus:"Select Marital Status",applyDate:new Date}},clearApplyFromChild(){this.applyFormChild={firstName:"",middleName:"",lastName:"",dob:new Date,gender:"Select Gender",nationality:"Indian",previousSchools:[],editMode:!1}},clearApplyFormChildSchool(){this.applyFormChildSchool={school:"",grade:"",years:""}},clearApplyFromGuardian(){this.applyFormGuardian={about:"",firstName:"",middleName:"",lastName:"",dob:new Date,occupation:"",jobDescription:"",workPlace:"",mobile:"",prefix:"+91",email:"",address:"",nationality:"Indian",gender:"Select Gender",questions:[],editMode:!1},this.applyFormGuardinaQuestions.forEach(t=>{t.a=""})},clearApplyFromFacilitator(){this.applyFormFacilitators={firstName:"",middleName:"",lastName:"",dob:new Date,mobile:"",prefix:"+91",email:"",nationality:"Indian",gender:"Select Gender",workplace:"",yearsOfExperience:0,facilitatingSubjects:"",statementOfInterest:"",referenceOne:{name:"",email:"",relationship:""},referenceTwo:{name:"",email:"",relationship:""},questions:lI},this.applyFormFacilitators.questions.forEach(t=>{t.a=""}),this.facilitatorResumee=null},setChild(t){this.applyFormChild=t,this.applyFormChild.editMode=!0},setGuardian(t){this.applyFormGuardian=t,this.applyFormGuardinaQuestions=t.questions,this.applyFormGuardian.editMode=!0},setGuardianGender(t){this.applyFormGuardian.gender=t},setFacilitatorGender(t){this.applyFormFacilitators.gender=t},setChildGender(t){this.applyFormChild.gender=t},setGuardianNationality(t){this.applyFormGuardian.nationality=t},setChildNationality(t){this.applyFormChild.nationality=t},setFacilitatorNationality(t){this.applyFormFacilitators.nationality=t},setMaritalStatus(t){this.applyForm.maritalStatus=t,localStorage.setItem("tlc-application",JSON.stringify(this.applyForm)),this.setEnableSubmit()},setEnableSubmit(){this.enableSubmit=!1,this.applyForm.maritalStatus==="Select Marital Status"?this.enableSubmit=!0:this.applyForm.children.length>0&&this.applyForm.guardians.length>0&&(this.applyForm.guardians.length===1&&this.applyForm.maritalStatus==="Married"?this.enableSubmit=!0:this.applyForm.guardians.length>1&&(this.enableSubmit=!1))},removeChild(t){this.applyForm.children.splice(this.applyForm.children.indexOf(t),1),localStorage.setItem("tlc-application",JSON.stringify(this.applyForm)),this.setEnableSubmit()},removeGuardian(t){this.applyForm.guardians.splice(this.applyForm.guardians.indexOf(t),1),localStorage.setItem("tlc-application",JSON.stringify(this.applyForm)),this.setEnableSubmit()}
1127,removeChildSchool(t,e){this.applyForm.children[t].previousSchools.splice(e,1)},setChildFormState(t){this.childFormState=t},setUILoading(t){this.disableInputs=t,this.progress=t}}}),Rs=Xn("membersStore",{state:()=>({authUser:null,authLogin:!1,authVerified:!1,memberRole:"member",memberToken:"",signinState:"signin",memberData:{email:"",name:"",password:"",repeatPassword:"",persist:!0,oobCode:"",whatsapp:"",facilitatorUUID:"",facilitatorAuthOld:""},memberOnboard:{email:"",token:"",password:""},connectToken:"",connectAccountData:{email:"",name:"",password:"",repeatPassword:"",persist:!0,oobCode:"",whatsApp:"",prefix:"+91",digits:10},enrollmentData:null,registerState:"init",registerProgressMessage:"Verifying your phone number...",resetState:"pending"}),actions:{setOnboardMemberEmail(t){this.memberOnboard.email=t},setOnboardMemberToken(t){this.memberOnboard.token=t},setEnrollmentData(t){this.enrollmentData=t},clearMember(){this.authUser=null,this.authLogin=!1,this.authVerified=!1},setAuthUser(t,e){this.authUser=t,this.authVerified=e,(t.uid==="XYy9RyulQqfkiVyjykxI8xJhaZm1"||t.uid==="ROlzAmyQajhrYr4xLwqzLkk0S5E2")&&(t.sendEmails=!0)},setMemberRole(t){this.memberRole=t},setMemberToken(t){this.memberToken=t},setEmail(t){this.memberData.email=t},setPassword(t){this.memberData.password=t},setName(t){this.memberData.name=t},setAuthLogin(t){this.authLogin=t},setSigninState(t){this.signinState=t},setRegisterState(t){this.registerState=t},setResetState(t){this.resetState=t},setOobCode(t){this.memberData.oobCode=t}}}),dL=[{q:"How did you spend your time at TLC during the trial week?",a:""},{q:"What are some of your general observations and takeaways of the trial week?",a:""},{q:"Which part of the trial week resonated with you the most and why?  What did not and why?",a:""},{q:"What are the deciding factors for wanting to enroll your child at TLC?",a:""},{q:"Is there anything else you would like to share with us?",a:""}],hL=[{q:"Conducting a workshop (specify)",a:""},{q:"Facilitation (specify)",a:""},{q:"Assisting a facilitator when required (specify)",a:""},{q:"Monetary assistance (specify)",a:""},{q:"Events Organisation",a:""},{q:"Member of a Committee (Finance, Construction, Medical, etc)",a:""},{q:"Giving your time at TLC as required (specify areas that you are interested in)",a:""}],fL=[{q:"Is there a day in the week that you like more than the others? Why?*",a:""},{q:"What is your favorite activity to do on your own? How many hours can you spend doing it?*",a:""},{q:"Which part of the TLC trial did you enjoy, and what did you not?*",a:""}],ym=Xn("parentsStore",{state:()=>({currentStep:1,formsPending:0,documentsPending:0,documentsExpired:0,orgProfileData:null,profileData:null,profileVersion:1,profileDocuments:[],profileCompleted:!1,completeProfileModal:!1,completeProfileText:"",profileUpdated:!1,isAdmission:!1,isTLCPlus:!1,bottomPanel:!1,studentsCalendar:[],isMainFolder:!0,folderName:"",studentToFeedbackFolder:null,feedback:{message:""},memberFeedbacks:[],profileSteps:["Personal Data","Children's Data","Additional Data","Documents"],validDocuments:[{name:"Passport",width:"6in",height:"4in"},{name:"Aadhaar Card",width:"3.37in",height:"2.125in"},{name:"PAN Card",width:"3.37in",height:"2.125in"},{name:"Voter Identification Card",width:"3.37in",height:"2.125in"},{name:"Driving License",width:"3.37in",height:"2.125in"},{name:"Birth Certificate",width:"3.37in",height:"2.125in"}],bloodGroups:[{name:"A positive"},{name:"A negative"},{name:"B positive"},{name:"B negative"},{name:"AB positive"},{name:"AB negative"},{name:"O positive"},{name:"O negative"}],questionsYesNo:[{name:"Yes"},{name:"No"},{name:"Not Sure"}],selectedParent:null,studentLessons:[],studentGroup:[],validVisa:[{name:"Visa"},{name:"OCI"}],basicInfo:{firstName:"",middleName:"",lastName:"",dob:new Date,occupation:"",jobDescription:"",workPlace:"",gender:"Select Gender",nationality:"Indian",maritalStatus:"Select Marital Status"},medicalInfo:{fAllergies:"Please select",allergies:"",fVacinations:"Please select",vacinations:"",bloodGroup:"Select Blood Group"},emergencyInfos:[{name:"",relation:"",mobilePhone:"",officePhone:"",residencePhone:"",email:"",address:"",type:"Doctor’s Details"},{name:"",relation:"",mobilePhone:"",officePhone:"",residencePhone:"",email:"",address:"",type:"First Contact Person"},{name:"",relation:"",mobilePhone:"",officePhone:"",residencePhone:"",email:"",address:"",type:"Second Contact Person"}],profileSummary:[],studentQuestions:fL,parentsQuestionsOne:dL,parentsQuestionsTwo:hL,forms:[{name:"Joining Papers",fileName:"Joining Papers.pdf",path:"",downloadUrl:"https://firebasestorage.googleapis.com/v0/b/thelearningcenter-app.appspot.com/o/TLC%20Joining%20Papers.pdf?alt=media&token=8924368b-859c-4d76-ad50-ca14eb17282c"}],legalGuardianDocuments:[],familyPayments:[],familyFeedbacks:[],showMessagePane:!1,messages:[],selectedMessage:null,latestMessage:null,upcomingMeeting:null,upcomingEvents:[],messageComment:"",messageComments:[],hasMessages:!1,tlc_sessions:[{name:"Session 1",description:"(has t
1127wo terms as it is for a longer duration)",terms:[{name:"Term 1",description:"11 June 2026 - 28 August 2026"},{name:"Term 2",description:"8 September 2026 - 4 December 2026"}]},{name:"Session 2",description:"12 January 2027 - 2 April 2027",terms:[{name:"Term 3",description:"12 January 2027 - 2 April 2027"}]}],dialogCalendar:{show:!1,title:"",showSubject:!1}}),getters:{enrolledChildren:t=>{var e;return(((e=t.profileData)==null?void 0:e.children)??[]).filter(n=>n.status!=="unenrolled")},profileInfo:t=>t.documentsPending>0||t.documentsExpired>0||t.formsPending>0},actions:{setProfileData(t){this.profileData=t},setShowMessagePane(t){this.showMessagePane=t},nextStep(){this.currentStep<4?(this.currentStep++,localStorage.setItem("currentStep",this.currentStep.toString())):this.profileCompleted=!0},previousStep(){this.currentStep>1&&(this.currentStep--,localStorage.setItem("currentStep",this.currentStep.toString()))},showModalCompleteProfile(t){this.completeProfileText=t,this.completeProfileModal=!0,setTimeout(()=>{this.completeProfileModal=!1},5e3)},getIDProofSize(t){return this.validDocuments.find(n=>n.name===t)},isProfileCompleted(){return pL()},setStudentGroup(t){Qe().$state.groups.forEach(n=>{n.groupUUID===t&&(this.studentGroup=n)}),this.studentGroup.students.sort((n,s)=>n.name.localeCompare(s.name))},setStudentsCalendar(t,e){ri().$state.groupSessions.forEach(s=>{s.groupName===t&&(this.studentsCalendar=s.days)}),this.studentsCalendar.forEach(s=>{s.sessions.forEach(i=>{i.subjectColor=Bi(i.subjectUUID),i.isMixedGroup&&(i.mixedGroupSubjectUUID&&(i.mainMixedGroupUUID=i.mixedGroupSubjectUUID,delete i.mixedGroupSubjectUUID),Vg(i,e))})})}}}),pL=()=>{let t=!0;return J().profileData.forms||(t=!1),J().profileData.forms&&J().profileData.forms.length<1&&(t=!1),J().profileData.guardians.forEach(e=>{e.identityProof||(t=!1),e.nationality!=="Indian"&&e.identityProof.length<2&&(t=!1),e.identityProof.forEach(n=>{n.fileURL===""&&(t=!1)}),e.maritalStatus!=="Married"&&(J().profileData.legalGuardianDocuments||(t=!1))}),J().profileData.children.forEach(e=>{e.identityProof||(t=!1),e.nationality!=="Indian"&&e.identityProof.length<2&&(t=!1),e.identityProof.forEach(n=>{n.fileURL===""&&(t=!1)})}),t},mL=[{item:1,name:"2023-24 Term 01",description:"June-August 2023",action:"2023_24_01"},{item:2,name:"2023-24 Term 02",description:"September-December 2023",action:"2023_24_02"},{item:3,name:"2023-24 Term 03",description:"January-April 2024",action:"2023_24_03"},{item:4,name:"2024-25 Term 01",description:"June-August 2024",action:"2024_25_01"},{item:5,name:"2024-25 Term 02",description:"September-December 2024",action:"2024_25_02"},{item:6,name:"2024-25 Term 03",description:"January-April 2025",action:"2024_25_03"},{item:7,name:"2025-26 Term 01",description:"June-August 2025",action:"2025_26_01"},{item:8,name:"2025-26 Term 02",description:"September-December 2025",action:"2025_26_02"},{item:9,name:"2025-26 Term 03",description:"January-April 2026",action:"2025_26_03"},{item:10,name:"2026-27 Term 01",description:"June-August 2026",action:"2026_27_01"},{item:11,name:"2026-27 Term 02",description:"September-December 2026",action:"2026_27_02"},{item:12,name:"2026-27 Term 03",description:"January-April 2027",action:"2026_27_03"}],gL=[{item:1,name:"2024-25 Term 01",description:"June-August 2024",action:"2024_25_01"},{item:2,name:"2024-25 Term 02",description:"September-December 2024",action:"2024_25_02"},{item:3,name:"2024-25 Term 03",description:"January-April 2025",action:"2024_25_03"},{item:4,name:"2025-26 Term 01",description:"June-August 2025",action:"2025_26_01"},{item:5,name:"2025-26 Term 02",description:"September-December 2025",action:"2025_26_02"},{item:6,name:"2025-26 Term 03",description:"January-April 2026",action:"2025_26_03"},{item:7,name:"2026-27 Term 01",description:"June-August 2026",action:"2026_27_01"},{item:8,name:"2026-27 Term 02",description:"September-December 2026",action:"2026_27_02"},{item:9,name:"2026-27 Term 03",description:"January-April 2027",action:"2026_27_03"}],uI=[{description:"Summer Break",startDate:"8 April 2023",endDate:"5 June 2023",singleDay:!1,academicYear:"2023-24"},{description:"Independence Day Holiday",startDate:"15 August 2023",endDate:"15 August 2023",singleDay:!0,academicYear:"2023-24"},{description:"Term Break for Students, Faculty Retreat & Planning",startDate:"2 September 2023",endDate:"11 September 2023",singleDay:!1,academicYear:"2023-24"},{description:"Gandhi Jayanti Holiday",startDate:"2 October 2023",endDate:"2 October 2023",singleDay:!0,academicYear:"2023-24"},{description:"Winter Break",startDate:"9 December 2023",endDate:"8 January 2024",singleDay:!1,academicYear:"2023-24"},{description:"Republic Day Holiday",startDate:"26 January 2024",endDate:"26 January 2024",singleDay:!0,academicYear:"2023-24"},{description:"Summer Break",startDate:"6 April 2024",endDate:"6 April 2024",singleDay:!0,academicYear:"2023-24"},{description:"Summer Break",startDate:"7 April 2024",endDate:"10 June 2024",singleDay:!1,academicYear:"2024-25"},{description:"Independence Day Holiday",startDate:"15 August 2024",endDate:"15 August 2024",singleDay:!0,academicYear:"2024-25"},{description:"Term Break for Students, Faculty Retreat & Planning",startDate:"31 August 2024",endDate:"09 September 2024",singleDay:!1,academicYear:"2024-25"},{description:"Gandhi Jayanti Holiday",startDate:"2 October 2024",endDate:"2 October 2024",singleDay:!0,academicYear:"2024-25"},{description:"Winter Break",startDate:"7 December 2024",endDate:"6 January 2025",singleDay:!1,academicYear:"2024-25"},{description:"Republic Day Holiday",startDate:"26 January 2025",endDate:"26 January 2025",singleDay:!0,academicYear:"2024-25"},{description:"Summer Break",startDate:"5 April 2025",endDate:"9 June 2025",singleDay:!0,academicYear:"2024-25"},{description:"Independence Day Holiday",startDate:"15 August 2025",endDate:"15 August 2025",singleDay:!0,academicYear:"2025-26"},{description:"Term Break for Students, Faculty Retreat & Planning",startDate:"30 August 2025",endDate:"08 September 2025",singleDay:!1,academicYear:"2025-26"},{description:"Gandhi Jayanti Holiday",startDate:"2 October 2025",endDate:"2 October 2025",singleDay:!0,academicYear:"2025-26"},{description:"Winter Break",startDate:"6 December 2025",endDate:"5 January 2026",singleDay:!1,academicYear:"2025-26"},{description:"Republic Day Holiday",startDate:"26 January 2026",endDate:"26 January 2026",singleDay:!0,academicYear:"2025-26"},{description:"Summer Break",startDate:"4 April 2026",endDate:"8 June 2026",singleDay:!1,academicYear:"2026-27"},{description:"Independence Day Holiday",startDate:"15 August 2026",endDate:"15 August 2026",singleDay:!0,academicYear:"2026-27"},{description:"Term Break for Students, Faculty Retreat & Planning",startDate:"29 August 2026",endDate:"7 September 2026",singleDay:!1,academicYear:"2026-27"},{description:"Gandhi Jayanti Holiday",startDate:"2 October 2026",endDate:"2 October 2026",singleDay:!0,academicYear:"2026-27"},{description:"Winter Break",startDate:"5 December 2026",endDate:"11 January 2027",singleDay:!1,academicYear:"2026-27"},{description:"Republic Day Holiday",startDate:"26 January 2027",endDate:"26 January 2027",singleDay:!0,academicYear:"2026-27"},{description:"Summer Break",startDate:"3 April 2027",endDate:"8 June 2027",singleDay:!1,academicYear:"2026-27"}],yL=[{title:"Trip to Sirsi",eventUUID:"b9d5583b-de16-4754-a863-0d41021c49d4",startDate:"12 February 2024",endDate:"16 February 2024",groups:["3f6f9837-be24-4fc2-975b-fac5c25a6bcc","008563fa-bc09-4d1b-bc4a-8a6ca642f278","c619cf80-c6da-447e-8fb8-ec6d4e0437f8"],academicYear:"2023-24"},{description:"Trip to Karnataka and Tamil Nadu",eventUUID:"53505306-f109-4d1c-b21f-d45e875bc31c",startDate:"7 February 2024",endDate:"21 February 2024",groups:["3ba5b3ab-806d-429e-ad2b
1127-8ebafb293031"],academicYear:"2023-24"},{description:"Trip to Bondla Wildlife Sanctuary",eventUUID:"2c84e0c5-a1a0-4ab0-b8c3-1694cfd5f92e",startDate:"14 February 2024",endDate:"15 February 2024",groups:["008563fa-bc09-4d1b-bc4a-8a6ca642f278","bc46ab43-ff05-4c91-9c2b-110343f67a6e"],academicYear:"2023-24"},{description:"Trip to Sapna Ranch, Maharashtra",eventUUID:"f66932d7-5563-4ab3-95a0-8a183ee6f4a4",startDate:"11 February 2024",endDate:"18 February 2024",groups:["b9b4bc8a-c995-4833-8765-6ea72d0b353e"],academicYear:"2023-24"}],Fs=Xn("store",{state:()=>({appVersion:"1.0.54",isFacilitatorAdmin:!1,facilitatorAuthUUID:"",isSystemAdmin:!1,isProfileAdmin:!1,isParentFacilitator:!1,selectedFacilitator:null,isLoggingIn:!1,appName:"The Learning Centre",appDomain:"https://thelearningcenter-app.web.app/",appFrom:"Team TLC",refeshRoute:"",preventRefresh:!1,isProduction:!0,darkMode:!1,mobileMenu:!1,authUserMenu:!1,authUserPath:"/parents/settings",appStoragePath:"files",emailCC:["[email protected]"],emailSenderAccounts:[{senderName:"Nandita",account:"mailer_nandita"},{senderName:"Divya Raj",account:"mailer_divya"},{senderName:"TLC Admissions",account:"mailer_admissions"},{senderName:"Team TLC",account:"mailer_teamtlc"}],mailerAccountDivya:{account:"mailer_divya",senderName:"Divya Raj"},mailerAccountAdmissions:{account:"mailer_admissions",senderName:"TLC Admissions"},mailerAccountTeamtlc:{account:"mailer_accounts",senderName:"Accounts Team"},mailerAccountAccounts:{account:"mailer_teamtlc",senderName:"Team TLC"},mailerAccountNandita:{account:"mailer_nandita",senderName:"Nandita"},title:"",signinState:"email",contactQuery:{email:"",name:"",message:""},whatsAppInfo:null,whatsAppListening:!1,showRequired:!1,scrollTop:!1,contactState:"form",notificationState:"init",notificationsCount:"0",notifications:{show:!1,pendingNotifications:!1,items:[]},selectedNotification:null,dialog:{show:!1,title:"",message:"",result:!1},dialogWelcomeMember:{show:!1,title:"",message:""},dialogGroupSelector:{show:!1,title:"",selectedGroupUUID:"",assignedGroupUUID:"",studentUUID:"",studentName:"",selectedGroupName:""},dialogAssignments:{show:!1,title:"",selectedGroupUUID:"",selectedGroupName:""},dialogRemoveAbsence:{show:!1,student:null,lesson:null,day:""},dialogAddAbsence:{show:!1,day:"",date:""},dialogEmailPreview:{selectSender:!1,emailSender:null,show:!1,emailTitle:"",email:[],subject:"",body:"",emailAction:"",htmlBody:""},dialogEditLesson:{show:!1,title:"the title",lesson:null,feedbackTerm:"",projectedCurriculum:"",coveredCurriculum:"",feedbackUUID:""},dialogFeedbackGroup:{show:!1,subject:null,facilitator:null,projectedCurriculum:"",coveredCurriculum:"",feedbackUUID:""},dialogFeedbackStudent:{show:!1,studentName:null,studentUUID:null,feedbackUUID:"",feedback:"",groupFeedbackUUID:"",status:"",notParticipating:!1},dialogFeedbackGenerate:{show:!1,students:[],selectedStudent:null,feedback:"",includeStudentFeedback:!0},dialogDocumentUpload:{show:!1,preview:!1,file:null,document:null,documentType:"",person:null,expiryDate:new Date},dialogFormUpload:{show:!1,file:null,formName:"",formType:""},dialogStudentFeedback:{show:!1,title:"",feedback:"",groupFeedback:"",color:0},dialogWhatsApp:{show:!1,title:"",whatsAppUUID:""},dialogEditCalendar:{show:!1,lesson:null,editColor:0,editClassroom:"",editSubject:""},dialogMemberDetails:{show:!1,member:null,type:""},dialogStudentFeeDeposit:{show:!1,title:"",selectedStudent:null},dialogWhatsAppGroup:{show:!1,groupTitle:"",groupDescription:"",members:[],groupUUID:""},dialogReminders:{show:!1,title:"",text:"",reminders:[]},dialogMeetings:{show:!1,meetingData:{date:new Date,description:"",title:"",startTime:"15:30",endTime:"17:00",participants:[],filteredParticipants:[]},status:"insert",attendance:{accepted:0,declined:0,pending:0}},dialogEvents:{show:!1,eventData:{type:"",description:"",itinerary:"",packingList:"",title:"",fee:0,startDate:new Date,endDate:new Date,participants:[],facilitators:[],parents:[],groups:[]},status:"insert"},alert:{show:!1,type:"info",message:"hello hello hello",preventClose:!1},runningTask:{show:!1,running:!0,type:"success",text:"processing"},resource:{resourceUUID:"",type:"link",link:"",description:"",fileExtension:""},modalTaskRunning:!1,showResourceModal:!1,facilitatorDashGroupUUID:"",facilitatorDashGroupName:"",facilitatorDashFamilyUUID:"",groupTopics:[],subjectTopics:[],subjectSubTopics:[],facilitatorTopics:[],selectedTopic:{topic:"",topicUUID:""},selectedSubTopic:{subtopic:"",subTopicUUID:""},newTopic:{topic:"",description:"",topicUUID:"",subjectUUID:""},newSubTopic:{subtopic:"",description:"",subtopicUUID:"",topicUUID:""},listTopics:!0,showStudentsModal:!1,studentsModalGroup:null,selectedStudent:{studentUUID:""},showPendingAssignmentsModal:!1,pendingAssignmentsModalTitle:"",terms:mL,termsAdmission:gL,holidays:uI,fieldTrips:yL,isT
1127LCHoliday:!1,isTLCFieldTrip:!1,whatsAppGroups:[],whatsAppMembers:[]}),getters:{sessionTimingsVersion(){return Qe().$state.sessionTimingsVersion},sessionTimings(){return Qe().$state.sessionTimings},facilitators(){return Qe().$state.facilitators},facilitatorsVersion(){return Qe().$state.facilitatorsVersion},subjects(){return Qe().$state.subjects},subjectsVersion(){return Qe().$state.subjectsVersion},classrooms(){return Qe().$state.classrooms},classroomsVersion(){return Qe().$state.classroomsVersion},groups(){return Qe().$state.groups},students(){return Qe().$state.students},groupsVersion(){return Qe().$state.groupsVersion},topics(){return Qe().$state.topics},authUser(){return Rs().$state.authUser},authLogin(){return Rs().$state.authLogin},role(){return Rs().$state.memberRole},showSessionDetail(){return ri().$state.showSessionDetail}},actions:{setFacilitatorTopics(t){this.facilitatorTopics=[],this.subjectTopics=[];const e=this.topics.find(s=>s.facilitatorUUID===t);if(!e)return;const n=[];e.topics.forEach(s=>{const i=n.find(r=>r.subjectUUID===s.subjectUUID);i?i.topics.push(s):n.push({subjectUUID:s.subjectUUID,subject:jd(s.subjectUUID),topics:[s]})}),this.subjectTopics=n,this.facilitatorTopics=n[0].topics},setShowSessionDetail(t){const e=ri();e.showSessionDetail=t},setTitle(t){this.title=t},setDarkMode(t){this.darkMode=t},setMobileMenu(t){this.mobileMenu=t},setAuthUserMenu(t){this.authUserMenu=t},setDialog(t,e){this.dialog.show=!0,this.dialog.title=t,this.dialog.message=e},setDialogWelcomeMember(t,e){this.dialogWelcomeMember.show=!0,this.dialogWelcomeMember.title=t,this.dialogWelcomeMember.message=e},closeDialog(){this.dialog.show=!1},closeDialogWelcomeMember(){this.dialogWelcomeMember.show=!1},setAlert(t,e){this.alert.show=!0,this.alert.type=t,this.alert.message=e,this.alert.preventClose=!0,setTimeout(()=>{this.alert.preventClose=!1},0)},closeAlert(){this.alert.preventClose||(this.alert.show=!1)},setContactState(t){this.contactState=t},initRunningTask(t){this.runningTask.show=!0,this.runningTask.running=!0,this.runningTask.text=t},finishRunningTask(t,e){this.runningTask.running=!1,this.runningTask.text=t,this.runningTask.type=e;let n=2e3;e==="error"&&(n=3e3),setTimeout(()=>{this.runningTask.show=!1},n)},stopRunningTask(){this.runningTask.show=!1,this.runningTask.running=!0},clearResource(){this.resource.description="",this.resource.link="",this.resource.type="link",this.resource.fileExtension="",this.resource.resourceUUID=""},clearNewTopic(){this.newTopic.topic="",this.newTopic.description="",this.newTopic.topicUUID="",this.newTopic.subjectUUID=""},clearNewSubtopic(){this.newSubTopic.subtopic="",this.newSubTopic.description="",this.newSubTopic.subtopicUUID="",this.newSubTopic.topicUUID=""},initdialogDocumentUpload(t,e,n,s){this.dialogDocumentUpload.show=!0,this.dialogDocumentUpload.preview=!1,this.dialogDocumentUpload.file=t,this.dialogDocumentUpload.document=e,this.dialogDocumentUpload.documentType=s,this.dialogDocumentUpload.person=n,this.dialogDocumentUpload.expiryDate=new Date},cleardialogDocumentUpload(){this.dialogDocumentUpload.show=!1,this.dialogDocumentUpload.preview=!1,this.dialogDocumentUpload.file=null,this.dialogDocumentUpload.document=null,this.dialogDocumentUpload.documentType="",this.dialogDocumentUpload.person=null,this.dialogDocumentUpload.expiryDate=new Date},cleardialogFormUpload(){this.dialogFormUpload.show=!1,this.dialogFormUpload.file=null,this.dialogFormUpload.formName="",this.dialogFormUpload.formType=""},clearDialogEditCalendar(){this.dialogEditCalendar.show=!1,this.dialogEditCalendar.editSubject="",this.dialogEditCalendar.editColor=0,this.dialogEditCalendar.editClassroom="",this.dialogEditCalendar.toggleValue=!1,this.dialogEditCalendar.lesson=null},getEmailSenderAccount(){switch(this.authUser.uid){case"LeP803BweYcnSUT1ESsawyG2N6y2":return this.mailerAccountDivya;case"ROlzAmyQajhrYr4xLwqzLkk0S5E2":return this.mailerAccountAdmissions;case"GItf3pdcvQcHDEUs79FkrmsAzCC2":return this.mailerAccountNandita;case"XYy9RyulQqfkiVyjykxI8xJhaZm1":return this.mailerAccountTeamtlc}},setHolidays(){const t="2026-27";this.holidays=uI.filter(e=>e.academicYear===t),this.isTLCHoliday=vG(new Date)}}}),ri=Xn("sessionStore",{state:()=>
1127({sessionDays:["Monday","Tuesday","Wednesday","Thursday","Friday"],sessionDaysObjects:[{fullName:"Monday",shortName:"Mo"},{fullName:"Tuesday",shortName:"Tu"},{fullName:"Wednesday",shortName:"We"},{fullName:"Thursday",shortName:"Th"},{fullName:"Friday",shortName:"Fr"}],useLocalCalendar:!0,editLesson:null,session:null,sessionDetail:null,orgSessionDetail:null,sessionChanged:!1,remoteSessionDetail:null,lesson:null,showTopicModal:!1,showSessionDetail:!1,groupSessions:[],selectedGroupSessions:[],selectedGroupSessionsDay:[],missedStudentLessons:[],selectedDayTitle:"",selectedDay:"",selectedDate:"",facilitatorSessions:[{day:"Monday",sessions:[]},{day:"Tuesday",sessions:[]},{day:"Wednesday",sessions:[]},{day:"Thursday",sessions:[]},{day:"Friday",sessions:[]}],facilitatorSessionsDay:{sessions:[]},calendar:null,calendarGroupLessons:[],calendarMixedGroupsLessons:[],calendarGroupStudents:[],calendarMixedGroupStudents:[],calendarWeek:"",selectedWeek:"",calendarMonth:"",calendarYear:"",calendarTerm:"",editCalendar:!1,calendarChanges:0,calendarChangedLessons:[],groupSessionTimings:[],facilitatorLeaningPlans:[],lessonLearningPlan:null,selectedLessonStudent:null,studentNote:""}),getters:{effectiveWeek(t){return t.selectedWeek||t.calendarWeek}},actions:{clearFacilitatorSessions(){this.facilitatorSessions=[{day:"Monday",sessions:[]},{day:"Tuesday",sessions:[]},{day:"Wednesday",sessions:[]},{day:"Thursday",sessions:[]},{day:"Friday",sessions:[]}],this.calendarGroupLessons&&this.calendarGroupLessons[0]&&this.calendarGroupLessons[0].days.forEach((t,e)=>{this.facilitatorSessions[e].date=t.date})},setCalendar(t){this.calendar=t,this.calendarMixedGroupsLessons=JSON.parse(t.mixedGroupLessons),this.calendarGroupLessons=JSON.parse(t.groupLessons)},setLessonTopics(t){},setLesson(t){this.lesson=t,this.lesson.comments.forEach(e=>{const n=e.createdAt.toDate(),s=new Date,r=n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()&&n.getDate()===s.getDate()?"Today":n.toLocaleDateString(),o=n.toLocaleTimeString();e.commentDateTime=`${r} - ${o}`})},setNewLesson(){this.lesson={classroomUUID:this.sessionDetail.classroomUUID,subjectUUID:this.sessionDetail.subjectUUID,timingUUID:this.sessionDetail.timingUUID,groupUUID:this.sessionDetail.groupUUID,topicUUID:this.sessionDetail.topicUUID,topic:this.sessionDetail.topic,subtopicUUID:this.sessionDetail.subtopicUUID,subtopic:this.sessionDetail.subtopic,facilitatorUUID:this.sessionDetail.facilitatorUUID,lessonUUID:"",lessonDetails:{fComments:0,fResources:0,fAssignments:0},comments:[],resources:[],assignments:[]}},setSelectedDay(t){this.selectedDay=t},setSelectedDate(t){const e=this.groupSessions[0].days.find(n=>n.day===t);e&&e.date?this.selectedDate=e.date:this.selectedDate="01/01/2011"},setShowSessionDetail(t){this.showSessionDetail=t},setSessionDetail(t){this.orgSessionDetail=JSON.parse(JSON.stringify(t)),this.sessionDetail=t},cancelSessionChanges(){!this.orgSessionDetail.topicUUID&&this.sessionDetail.topicUUID&&(this.sessionDetail.topic="",this.sessionDetail.topicUUID=""),(this.orgSessionDetail.topicUUID!==this.sessionDetail.topicUUID||this.orgSessionDetail.subtopicUUID!==this.sessionDetail.subtopicUUID)&&(this.sessionDetail.topic=this.orgSessionDetail.topic,this.sessionDetail.topicUUID=this.orgSessionDetail.topicUUID,this.sessionDetail.subtopic=this.orgSessionDetail.subtopic,this.sessionDetail.subtopicUUID=this.orgSessionDetail.subtopicUUID),this.orgSessionDetail=null,this.sessionChanged=!1},setMixedGroupSessionDetail(t,e,n){e.day=n,e.isMixedGroup=!0,this.sessionDetail=e;const s=this.calendarMixedGroupsLessons.find(o=>o.mainMixedGroupUUID===t.mainMixedGroupUUID&&o.day===n&&o.timingUUID===t.timingUUID),i=t.mixedGroupCombined.mixedGroups.find(o=>o.mixedGroupUUID===e.mixedGroupUUID);if(i.subjectColor=Bi(i.subjectUUID),i.lessonDetailUUID="",i.lessonDetails={fComments:0,fResources:0,fAssignments:0},i.timing=t.mixedGroupCombined.timing,i.timingUUID=t.mixedGroupCombined.timingUUID,i.topic="",i.topicUUID="",i.subtopic="",i.subtopicUUID="",!s)return;const r=s.mixedGroups.find(o=>o.mixedGroupUUID===i.mixedGroupUUID);
1127r&&(e.lessonDetails=r.lessonDetails,e.lessonDetailUUID=r.lessonDetailUUID,i.topic=r.topic||"",i.topicUUID=r.topicUUID||"",i.subtopic=r.subtopic||"",i.subtopicUUID=r.subtopicUUID||"",r.facilitatorUUID!==i.facilitatorUUID&&(e.facilitatorUUID=r.facilitatorUUID,e.facilitator=Lg(r.facilitatorUUID)),r.subjectUUID!==i.subjectUUID&&(e.subjectUUID=r.subjectUUID,e.subject=jd(r.subjectUUID),e.subjectColor=Bi(r.subjectUUID)))},getRemoteLessonDetailGroup(t,e,n){return this.calendarGroupLessons.find(o=>o.groupUUID===t).days.find(o=>o.day===e).sessions.find(o=>o.lessonDetailUUID===n)},getRemoteLessonDetailMixedGroup(t,e,n){return this.calendarMixedGroupsLessons.find(r=>r.mainMixedGroupUUID===t&&r.day===e).mixedGroups.find(r=>r.lessonDetailUUID===n)},setSelectedGroupSessions(t){this.selectedGroupSessions=[],this.groupSessions.forEach(e=>{if(e.groupUUID===t){this.selectedGroupSessions=e;return}}),this.selectedGroupSessions.days.forEach(e=>{e.sessions.forEach(n=>{if(n.mainMixedGroupUUID!==""){const s=this.calendarMixedGroupsLessons.find(i=>i.mainMixedGroupUUID===n.mainMixedGroupUUID&&i.day===e.day&&i.timingUUID===n.timingUUID);n.mixedGroupCombined.mixedGroups.forEach(i=>{if(!s)return;const r=s.mixedGroups.find(o=>o.mixedGroupUUID===i.mixedGroupUUID);if(r&&(i.lessonDetailUUID=r.lessonDetailUUID,i.lessonDetails=r.lessonDetails,r.topicUUID)){Fg(r,r.topicUUID,r.subtopicUUID);const o=n.mixedGroupCombined.mixedGroups.find(a=>a.lessonDetailUUID===r.lessonDetailUUID);o.topic=r.topic,o.topicUUID=r.topicUUID,o.subtopic=r.subtopic||"",o.subtopicUUID=r.subtopicUUID||""}})}})})},setSelectedGroupSessionsDay(t){this.selectedDayTitle=t,this.selectedGroupSessionsDay=[],this.selectedGroupSessions.days.forEach(e=>{if(e.day===t){this.selectedGroupSessionsDay=e;return}})},setSelectedFacilitatorSessionsDay(t){this.selectedDayTitle=t,this.facilitatorSessionsDay={sessions:[]},this.facilitatorSessions.forEach(e=>{if(e.day===t){this.facilitatorSessionsDay=e;return}})},getCalendarGroupDays(t){const e=this.groupSessions.find(s=>s.groupUUID===t);return JSON.parse(JSON.stringify(e.days))},setGroupSessionTimings(t,e){const s=[...Qe().sessionTimings];this.groupSessionTimings=[];let i=1;(t==="3ba5b3ab-806d-429e-ad2b-8ebafb293031"||t==="b9b4bc8a-c995-4833-8765-6ea72d0b353e"||t==="72b8fd55-b85d-4a30-8628-58fc419eed61")&&(i=2),e>0&&(i=e),s.forEach(r=>{if(r.group===i){const o={timingUUID:r.timingUUID,timing:r.timing};this.groupSessionTimings.push(o)}})}}}),_L=[{item:"Initial Inquiry",count:0,action:"initialInquiry"},{item:"Meeting",count:0,action:"meeting"},{item:"Trial",count:0,action:"trial"},{item:"On Hold",count:0,action:"onHold"},{item:"Not Proceeding",count:0,action:"notProceeding"},{item:"Admission",count:0,action:"admission"},{item:"All",count:0,action:"all"}],mE=Xn("admissionStore",{state:()=>({inquiryStatuses:_L,contribiutionTypes:[{name:"Monthly"},{name:"Term"},{name:"Annual"},{name:"None"}],selectedStatus:{item:"Initial Inquiry",count:0,action:"initialInquiry"},selectedInquiry:null,selectedFamilyMember:null,selectedFamilyMembers:[],selectedFamily:null,selectedInfo:null,meetingsData:{date:new Date,startTime:"",endTime:"",meetingPOC:"",formattedMeetingDate:""},trialData:{trialStart:new Date,trialEnd:new Date,trialChild:null,trialGroup:null,formattedTrialStart:""},admissionData:{admissionTerm:"",admissionTermDescription:"",monthlyFee:0,feeTariffUUID:"",admissionFee:0,admissionGroupUUID:"",admissionGroupName:"",admissionChild:null,contribiutionType:"",contribiutionFee:0,depositFee:45e3},inquiryData:{nextSteps:"",meetingNote:"",trialNote:"",notes:"",editNote:""},studentToEnroll:null,studentToRemove:null,curriculumForm:{filename:"TLC Curriculum.pdf",path:"https://firebasestorage.googleapis.com/v0/b/thelearningcenter-app.appspot.com/o/TLC%20Curriculum.pdf?alt=media&token=9c3e78ac-6819-4da3-9e78-667ce1306ef1"},emailType:"",hasInquiries:!1,inquiries:[],initialInquiries:[],meetingInquiries:[],trialInquiries:[],onHoldInquiries:[],notProceedingInquiries:[],admissionInquiries:[],allInquiries:[],inquiriesPageStatus:"status",dialogInquiryStatus:{show:!1,selectedStatus:null},dialogRemoveStudent:{show:!1,student:null,terminationNotes:"Sad to 
1127see you go..."},dialogEnrollStudent:{show:!1,title:"Trial a student",firstName:"",lastName:"",dob:new Date,nationality:"Indian",gender:"Select Gender",group:null,trial:!0,admissionFee:0,depositFee:0,feeTariffUUID:""},meetingEmailBody:`Dear  #student#, #parents#,
1128
1129We would like to invite you all to TLC to meet with us on #meetingDate#.
1130Please let us know if this works for you.
1131
1132Click here to open the location pin.
1133
1134Warmly, 
1135Shivani
1136+91 9899028782`,trialEmailBody:`Dear #student#, #parents#,
1137
1138We hope you have all been well!
1139
1140As we had discussed earlier, we would like to invite #student2# (and the both of you!) to trial at TLC for the week of #trialDate#.
1141
1142Here are a few details that will be useful:
1143
1144- TLC hours are from 9:30am to 3pm with a snack break at 11am (we provide a fruit snack).
1145
1146- Lunch break is from 12:30-1:30 (you will need to carry a packed lunch with you). Please let us know if you need help with this.
1147
1148- Comfortable clothes for your child (preferably shorts/tights and a t-shirt), which she would be willing to get dirty, and perhaps an extra change of clothes for her as well.
1149
1150- It is expected that both parents are present at TLC through the days of the trial. This will give you an opportunity to observe various sessions through all age-groups, and also allow you to interact with the facilitators and some of the parents.
1151
1152The TLC Curriculum is attached with this email, we hope it will give you a better insight into our approach and methodology.
1153
1154Please let me know if you have any queries regarding the above details, we look forward to seeing you all next week!
1155
1156Warmly, 
1157Shivani
1158`,admissionEmailBody:`Dear #student#, #parents#,
1159    
1160We are delighted to have you all join the TLC community!  Welcome.
1161
1162You have already completed the first step of our admissions process by submitting the Joining Papers, congratulations! The next two steps are as follows :
1163
1164Financials:
1165Here is your breakup for Admission financials:
1166Admission Deposit                      Rs. #admissionDeposit#/- (Refundable)
1167Admission Fees                          Rs. #monthlyFee#/- per child (Non- refundable)
1168Payment Details:
1169NAAN EDUCATIONAL FOUNDATION
1170ACT NO 18300200002073
1171Federal Bank Branch Porvorim
1172IFSC: FDRL0001830
1173A/c Type: Current
1174
1175The payment process for session fees and contribution (if any) will be shared once this part of the admission process is complete. 
1176
1177
1178Family Profile:
1179Please click on our #appLink# and complete in as much detail as possible. This information will allow you to access schedules, payments, feedback etc. and help us with our planning for the year.
1180
1181We request you to complete the above 2 steps within a week of receiving this email.
1182
1183Please feel free to contact us if you need any support in completing this process.
1184
1185Warmly,
1186Team TLC`,enrollStudentEmailBody:`Dear #student#, #parents#,
1187
1188Thank you for your patience and detailed information. We appreciate the time and effort you have put into the entire application process.  
1189
1190You can now log into your #appLink# and access the information such as the calendar for the academic year,  your child's schedule for the term and other relevant information that will help you settle into the term.  Please feel free to reach out should you need any support.
1191
1192Once again, welcome to the TLC family.  We look forward to getting to know all of you better over the coming year.
1193
1194Smiles,
1195Team TLC`}),getters:{groups(){return Qe().$state.groups}},actions:{setAdmissionTerm(t){this.admissionData.admissionTerm=t.name,this.admissionData.admissionTermDescription=t.description},setTrailGroup(t){this.trialData.trialGroup=t},setAdmissionGroup(t){this.admissionData.admissionGroupName=t.groupName,this.admissionData.admissionGroupUUID=t.groupUUID,this.admissionData.admissionFee=t.groupFee},setAdmissionContribiutionType(t){this.admissionData.contribiutionType=t},setSelectedInquiryStatus(t){this.selectedStatus=t,localStorage.setItem("selectedInquiryStatus",JSON.stringify(t))}}}),IL=[{groupUUID:"3f6f9837-be24-4fc2-975b-fac5c25a6bcc",groupFee:"14500"},{groupUUID:"008563fa-bc09-4d1b-bc4a-8a6ca642f278",groupFee:"14500"},{groupUUID:"b9b4bc8a-c995-4833-8765-6ea72d0b353e",groupFee:"14500"},{groupUUID:"c619cf80-c6da-447e-8fb8-ec6d4e0437f8",groupFee:"14500"},{groupUUID:"bc46ab43-ff05-4c91-9c2b-110343f67a6e",groupFee:"14500"}
1195,{groupUUID:"3ba5b3ab-806d-429e-ad2b-8ebafb293031",groupFee:"16700"}],wL=[{text:"January to May",value:"january-may",months:5},{text:"June to December",value:"june-december",months:7}],vL=[{text:"January to March",value:"january-march",months:3},{text:"April to May",value:"april-may",months:2},{text:"June to August",value:"june-august",months:3},{text:"September to December",value:"september-december",months:4}],TL=[{text:"January",value:"january"},{text:"February",value:"february"},{text:"March",value:"march"},{text:"April",value:"april"},{text:"May",value:"may"},{text:"June",value:"june"},{text:"July",value:"july"},{text:"August",value:"august"},{text:"September",value:"september"},{text:"October",value:"october"},{text:"November",value:"november"},{text:"December",value:"december"}],bL=[{text:"Cash",value:"cash"},{text:"UPI",value:"upi"},{text:"Indian Bank Transfer",value:"indian bank transfer"},{text:"Federal Bank Transfer",value:"federal bank transfer"}],EL=[{text:"Session Fee",value:"session fee"},{text:"Term Fee",value:"term fee"},{text:"Monthly Fee",value:"monthly fee"},{text:"Yearly Fee",value:"yearly fee"}],SL=[{text:"June to May",value:"june-may"}],_m=Xn("administrationStore",{state:()=>({hasYearlyFees:!1,yearTotals:[],fYearTotals:[],groupFees:IL,dialogFeePayments:{show:!1,paymentType:null,paymentOption:null,paymentPeriod:null,receivedFrom:null,paymentAmount:0,paymentDate:new Date,paymentSettings:null,studentsFee:0,yearPaymentTotal:0,sendEmail:!0},dialogContribution:{show:!1,family:null,amount:0,paymentDate:new Date,receivedFrom:null,paymentOption:null,sendEmail:!0},feePaymentSessions:wL,feePaymentTerms:vL,feePaymentMonths:TL,feePaymentOptions:bL,feePaymentType:EL,feePaymentYear:SL,paymentGroups:[],selectedPaymentGroup:null,selectedStudent:null,selectedStudentFamily:null,selectedStudentMissedLessonsMonth:[],selectedStudentMissedLessonsTerm:[],selectedStudentTermFeedbackList:[],selectedStudentTermLearningPlan:[],selectedStudentTermFeedback:"",selectedStudentTermFeedbackPDF:"",selectedPaymentPeriods:[],selectedStudentLessons:[],reminders:[],selectedReminder:null,pendingPayments:[],paymentsOverview:{totalStudents:0,totalnotpaying:0,totalpending:0,totalpaid:0,totalpendingAmount:0,totalpaidAmount:0,studentsNotPaying:[],studentsPending:[],studentsPaid:[],currentMonth:"",currentTerm:"",currentSession:"",currentYear:""},pendingPayment:null,meetings:[],selectedMeeting:null,events:[],selectedEvent:null,archiveFamilies:[],academicYear:Mg(),dialogPaymentsList:{show:!1},paymentList:[],feePaymentEmailBody:`Dear Parent,
1196
1197Please find attached the receipt for the #paymentType# for #paymentPeriod# for #student#.
1198
1199Warm regards,
1200Team TLC`,contributionEmailBody:`Dear #parent#,
1201
1202Thank you for your support.  Please find attached, the receipt for your donation.
1203
1204Smiles,
1205Nandita`}),getters:{},actions:{setSelectedPaymentGroup(t){this.selectedPaymentGroup=t,localStorage.setItem("selectedPaymentGroup",JSON.stringify(t.groupUUID))},setPaymentPeriods(){switch(this.dialogFeePayments.paymentType.value){case"monthly fee":this.selectedPaymentPeriods=this.feePaymentMonths;break;case"session fee":this.selectedPaymentPeriods=this.feePaymentSessions;break;case"term fee":this.selectedPaymentPeriods=this.feePaymentTerms;break;case"yearly fee":this.selectedPaymentPeriods=this.feePaymentYear;break}},setPaymentPeriodAmounts(){const t=this.dialogFeePayments.studentsFee/12,e=new Date().getMonth(),n=ve().feePaymentMonths[e].text;switch(ve().feePaymentTerms[pw(e)].text,this.dialogFeePayments.paymentType.value){case"monthly fee":this.dialogFeePayments.paymentAmount=Math.round(t);break;case"session fee":const s=z0(n);this.dialogFeePayments.paymentAmount=Math.round(t*s);break;case"term fee":const i=J0(e);this.dialogFeePayments.paymentAmount=Math.round(t*i);break;case"yearly fee":this.dialogFeePayments.paymentAmount=this.dialogFeePayments.studentsFee;break}},setPaymentPeriod(){const t=new Date().getMonth();switch(this.dialogFeePayments.paymentType.value){case"monthly fee":this.dialogFeePayments.paymentPeriod=this.feePaymentMonths[t];break;case"session fee":this.dialogFeePayments.paymentPeriod=this.feePaymentSessions[mG(t)];break;case"term fee":this.dialogFeePayments.paymentPeriod=this.feePaymentTerms[pw(t)];break;case"yearly fee":this.dialogFeePayments.paymentPeriod=this.feePaymentYear[0];break}},setGroupFee(t){let e=0;try{e=this.groupFees.find(n=>n.groupUUID===t).groupFee}catch{}this.dialogFeePayments.studentsFee=e},clearDialogFeePayments(){this.dialogFeePayments.show=!1,this.dialogFeePayments.paymentType=null,this.dialogFeePayments.paymentOption=null,this.dialogFeePayments.paymentPeriod=null,this.dialogFeePayments.receivedFrom=null,this.dialogFeePayments.paymentAmount=0,this.dialogFeePayments.paymentDate=new Date,this.dialogFeePayments.paymentSettings=null,this.dialogFeePayments.studentsFee=0,this.dialogFeePayments.yearPaymentTotal=0},setSelectedStudentLessons(t,e){this.selectedStudentLessons=[];const n=W0(new Date);if(n==="Saturday"||n==="Sunday")return;const i=pc().groupSessions.filter(r=>r.groupName===t)[0].days.filter(r=>r.day===n);this.selectedStudentLessons=i[0].sessions,this.selectedStudentLessons.forEach(r=>{r.isMixedGroup&&(r.mixedGroupSubjectUUID&&(r.mainMixedGroupUUID=r.mixedGroupSubjectUUID,delete r.mixedGroupSubjectUUID),Vg(r,e))})}}});let eu,ua,Hf;const gE=async()=>
1205{if(!eu){const{$firebaseApp:t}=We();Hf=Fs(),ua=fi(),YO(t,{provider:new mm("6Lc-CewkAAAAABwKuHVJTfDpJWRmRhx8yvYK_Sox"),isTokenAutoRefreshEnabled:!0}),eu=fO(t,"asia-south1")}},O$=async t=>{await gE();const n=await eE(eu,`${t}`)({warmup:!0});n.data.type==="error"&&console.log(n.data)},et=async(t,e,n,s)=>new Promise(async i=>{await gE(),n&&ua.setUILoading(!0),ua.progress=!0;try{const o=await eE(eu,`${t}`)(e);s&&Hf.setAlert(o.data.type,o.data.message),i(o)}catch(r){Hf.setAlert("error",r)}finally{ua.progress=!1,n&&ua.setUILoading(!1)}});var DL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},H,Im=Im||{},pe=DL||self;function Zu(t){var e=typeof t;return e=e!="object"?e:t?Array.isArray(t)?"array":e:"null",e=="array"||e=="object"&&typeof t.length=="number"}function ed(t){var e=typeof t;return e=="object"&&t!=null||e=="function"}function AL(t){return Object.prototype.hasOwnProperty.call(t,Mh)&&t[Mh]||(t[Mh]=++CL)}var Mh="closure_uid_"+(1e9*Math.random()>>>0),CL=0;function PL(t,e,n){return t.call.apply(t.bind,arguments)}function RL(t,e,n){if(!t)throw Error();if(2<arguments.length){var s=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,s),t.apply(e,i)}}return function(){return t.apply(e,arguments)}}function Bt(t,e,n){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?Bt=PL:Bt=RL,Bt.apply(null,arguments)}function ol(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var s=n.slice();return s.push.apply(s,arguments),t.apply(this,s)}}function Et(t,e){function n(){}n.prototype=e.prototype,t.$=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.ac=function(s,i,r){for(var o=Array(arguments.length-2),a=2;a<arguments.length;a++)o[a-2]=arguments[a];return e.prototype[i].apply(s,o)}}function $i(){this.s=this.s,this.o=this.o}var kL=0;$i.prototype.s=!1;$i.prototype.sa=function(){!this.s&&(this.s=!0,this.N(),kL!=0)&&AL(this)};$i.prototype.N=function(){if(this.o)for(;this.o.length;)this.o.shift()()};const yE=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if(typeof t=="string")return typeof e!="string"||e.length!=1?-1:t.indexOf(e,0);for(let n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1};function wm(t){const e=t.length;if(0<e){const n=Array(e);for(let s=0;s<e;s++)n[s]=t[s];return n}return[]}function dI(t,e){for(let n=1;n<arguments.length;n++){const s=arguments[n];if(Zu(s)){const i=t.length||0,r=s.length||0;t.length=i+r;for(let o=0;o<r;o++)t[i+o]=s[o]}else t.push(s)}}function jt(t,e){this.type=t,this.g=this.target=e,this.defaultPrevented=!1}jt.prototype.h=function(){this.defaultPrevented=!0};var UL=function(){if(!pe.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{const n=()=>{};pe.addEventListener("test",n,e),pe.removeEventListener("test",n,e)}catch{}return t}();function Xa(t){return/^[\s\xa0]*$/.test(t)}function td(){var t=pe.navigator;return t&&(t=t.userAgent)?t:""}function Es(t){return td().indexOf(t)!=-1}function vm(t){return vm[" "](t),t}vm[" "]=function(){};function NL(t,e){var n=DF;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}var xL=Es("Opera"),So=Es("Trident")||Es("MSIE"),_E=Es("Edge"),Wf=_E||So,IE=Es("Gecko")&&!(td().toLowerCase().indexOf("webkit")!=-1&&!Es("Edge"))&&!(Es("Trident")||Es("MSIE"))&&!Es("Edge"),ML=td().toLowerCase().indexOf("webkit")!=-1&&!Es("Edge");function wE(){var t=pe.document;return t?t.documentMode:void 0}var Kf;e:{var Oh="",Lh=function(){var t=td();if(IE)return/rv:([^\);]+)(\)|;)/.exec(t);if(_E)return/Edge\/([\d\.]+)/.exec(t);if(So)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t);if(ML)return/WebKit\/(\S+)/.exec(t);if(xL)return/(?:Version)[ \/]?(\S+)/.exec(t)}();if(Lh&&(Oh=Lh?Lh[1]:""),So){var Fh=wE();if(Fh!=null&&Fh>parseFloat(Oh)){Kf=String(Fh);break e}}Kf=Oh}var zf;if(pe.document&&So){var hI=wE();zf=hI||parseInt(Kf,10)||void 0}else zf=void 0;var OL=zf;function Za(t,e){if(jt.call(this,t?t.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,t){var n=this.type=t.type,s=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.g=e,e=t.relatedTarget){if(IE){e:{try{vm(e.nodeName);var i=!0;break e}catch{}i=!1}i||(e=null)}}else n=="mouseover"?e=t.fromElement:n=="mouseout"&&(e=t.toElement);
1205this.relatedTarget=e,s?(this.clientX=s.clientX!==void 0?s.clientX:s.pageX,this.clientY=s.clientY!==void 0?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.screenY||0):(this.clientX=t.clientX!==void 0?t.clientX:t.pageX,this.clientY=t.clientY!==void 0?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType=typeof t.pointerType=="string"?t.pointerType:LL[t.pointerType]||"",this.state=t.state,this.i=t,t.defaultPrevented&&Za.$.h.call(this)}}Et(Za,jt);var LL={2:"touch",3:"pen",4:"mouse"};Za.prototype.h=function(){Za.$.h.call(this);var t=this.i;t.preventDefault?t.preventDefault():t.returnValue=!1};var nd="closure_listenable_"+(1e6*Math.random()|0),FL=0;function VL(t,e,n,s,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!s,this.la=i,this.key=++FL,this.fa=this.ia=!1}function sd(t){t.fa=!0,t.listener=null,t.proxy=null,t.src=null,t.la=null}function Tm(t,e,n){for(const s in t)e.call(n,t[s],s,t)}function qL(t,e){for(const n in t)e.call(void 0,t[n],n,t)}function vE(t){const e={};for(const n in t)e[n]=t[n];return e}const fI="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function TE(t,e){let n,s;for(let i=1;i<arguments.length;i++){s=arguments[i];for(n in s)t[n]=s[n];for(let r=0;r<fI.length;r++)n=fI[r],Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}}function id(t){this.src=t,this.g={},this.h=0}id.prototype.add=function(t,e,n,s,i){var r=t.toString();t=this.g[r],t||(t=this.g[r]=[],this.h++);var o=Yf(t,e,s,i);return-1<o?(e=t[o],n||(e.ia=!1)):(e=new VL(e,this.src,r,!!s,i),e.ia=n,t.push(e)),e};function Jf(t,e){var n=e.type;if(n in t.g){var s=t.g[n],i=yE(s,e),r;(r=0<=i)&&Array.prototype.splice.call(s,i,1),r&&(sd(e),t.g[n].length==0&&(delete t.g[n],t.h--))}}function Yf(t,e,n,s){for(var i=0;i<t.length;++i){var r=t[i];if(!r.fa&&r.listener==e&&r.capture==!!n&&r.la==s)return i}return-1}var bm="closure_lm_"+(1e6*Math.random()|0),Vh={};function bE(t,e,n,s,i){if(Array.isArray(e)){for(var r=0;r<e.length;r++)bE(t,e[r],n,s,i);return null}return n=DE(n),t&&t[nd]?t.O(e,n,ed(s)?!!s.capture:!!s,i):GL(t,e,n,!1,s,i)}function GL(t,e,n,s,i,r){if(!e)throw Error("Invalid event type");var o=ed(i)?!!i.capture:!!i,a=Sm(t);if(a||(t[bm]=a=new id(t)),n=a.add(e,n,s,o,r),n.proxy)return n;if(s=BL(),n.proxy=s,s.src=t,s.listener=n,t.addEventListener)UL||(i=o),i===void 0&&(i=!1),t.addEventListener(e.toString(),s,i);else if(t.attachEvent)t.attachEvent(SE(e.toString()),s);else if(t.addListener&&t.removeListener)t.addListener(s);else throw Error("addEventListener and attachEvent are unavailable.");return n}function BL(){function t(n){return e.call(t.src,t.listener,n)}const e=jL;return t}function EE(t,e,n,s,i){if(Array.isArray(e))for(var r=0;r<e.length;r++)EE(t,e[r],n,s,i);else s=ed(s)?!!s.capture:!!s,n=DE(n),t&&t[nd]?(t=t.i,e=String(e).toString(),e in t.g&&(r=t.g[e],n=Yf(r,n,s,i),-1<n&&(sd(r[n]),Array.prototype.splice.call(r,n,1),r.length==0&&(delete t.g[e],t.h--)))):t&&(t=Sm(t))&&(e=t.g[e.toString()],t=-1,e&&(t=Yf(e,n,s,i)),(n=-1<t?e[t]:null)&&Em(n))}function Em(t){if(typeof t!="number"&&t&&!t.fa){var e=t.src;if(e&&e[nd])Jf(e.i,t);else{var n=t.type,s=t.proxy;e.removeEventListener?e.removeEventListener(n,s,t.capture):e.detachEvent?e.detachEvent(SE(n),s):e.addListener&&e.removeListener&&e.removeListener(s),(n=Sm(e))?(Jf(n,t),n.h==0&&(n.src=null,e[bm]=null)):sd(t)}}}function SE(t){return t in Vh?Vh[t]:Vh[t]="on"+t}function jL(t,e){if(t.fa)t=!0;else{e=new Za(e,this);var n=t.listener,s=t.la||t.src;t.ia&&Em(t),t=n.call(s,e)}return t}function Sm(t){return t=t[bm],t instanceof id?t:null}var qh="__closure_events_fn_"+(1e9*Math.random()>>>0);function DE(t){return typeof t=="function"?t:(t[qh]||(t[qh]=function(e){return t.handleEvent(e)}),t[qh])}function bt(){$i.call(this),this.i=new id(this),this.S=this,this.J=null}Et(bt,$i);bt.prototype[nd]=!0;bt.prototype.removeEventListener=function(t,e,n,s){EE(this,t,e,n,s)};function Ut(t,e){var n,s=t.J;if(s)for(n=[];s;s=s.J)n.push(s);if(t=t.S,s=e.type||e,typeof e=="string")e=new jt(e,t);else if(e instanceof jt)e.target=e.target||t;else{var i=e;e=new jt(s,t),TE(e,i)}if(i=!0,n)for(var r=n.length-1;0<=r;r--){var o=e.g=n[r];i=al(o,s,!0,e)&&i}if(o=e.g=t,i=al(o,s,!0,e)&&i,i=al(o,s,!1,e)&&i,n)for(r=0;r<n.length;r++)o=e.g=n[r],i=al(o,s,!1,e)&&i}bt.prototype.N=function(){if(bt.$.N.call(this),this.i){var t=this.i,e;for(e in t.g){for(var n=t.g[e],s=0;s<n.length;s++)sd(n[s]);delete t.g[e],t.h--}}this.J=null};bt.prototype.O=function(t,e,n,s){return this.i.add(String(t),e,!1,n,s)};bt.prototype.P=function(t,e,n,s){return this.i.add(String(t),e,!0,n,s)};function al(t,e,n,s){if(e=t.i.g[String(e)],!e)return!0;e=e.concat();for(var i=!0,r=0;r<e.length;++r){var o=e[r];if(o&&!o.fa&&o.capture==n){var a=o.listener,c=o.la||o.src;o.ia&&Jf(t.i,o),i=a.call(c,s)!==!1&&i}}return i&&!s.defaultPrevented}var Dm=pe.JSON.stringify;class $L{constructor(e,n){this.i=e,this.j=n,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}function HL(){var t=Am;let e=null;return t.g&&(e=t.g,t.g=t.g.next,t.g||(t.h=null),e.next=null),e}class WL{constructor(){this.h=this.g=null}add(e,n){const s=AE.get();s.set(e,n),this.h?this.h.next=s:this.g=s,this.h=s}}var AE=new $L(()=>new KL,t=>t.reset());class KL{constructor(){this.next=this.g=this.h=null}set(e,n){this.h=e,this.g=n,this.next=null}reset(){this.next=this.g=this.h=null}}function zL(t){var e=1;t=t.split(":");const n=[];for(;0<e&&t.length;)n.push(t.shift()),e--;return t.length&&n.push(t.join(":")),n}function JL(t){pe.setTimeout(()=>{throw t},0)}let ec,tc=!1,Am=new WL,CE=()=>{const t=pe.Promise.resolve(void 0);ec=()=>{t.then(YL)}};var YL=()=>{for(var t;t=HL();){try{t.h.call(t.g)}catch(n){JL(n)}var e=AE;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}tc=!1};function rd(t,e){bt.call(this),this.h=t||1,this.g=e||pe,this.j=Bt(this.qb,this),this.l=Date.now()}Et(rd,bt);H=rd.prototype;H.ga=!1;H.T=null;H.qb=function(){if(this.ga){var t=Date.now()-this.l;0<t&&t<.8*this.h?this.T=this.g.setTimeout(this.j,this.h-t):(this.T&&(this.g.clearTimeout(this.T),this.T=null),Ut(this,"tick"),this.ga&&(Cm(this),this.start()))}};H.start=function(){this.ga=!0,this.T||(this.T=this.g.setTimeout(this.j,this.h),this.l=Date.now())};function Cm(t){t.ga=!1,t.T&&(t.g.clearTimeout(t.T),t.T=null)}H.N=function(){rd.$.N.call(this),Cm(this),delete this.g};function Pm(t,e,n){if(typeof t=="function")n&&(t=Bt(t,n));else if(t&&typeof t.handleEvent=="function")t=Bt(t.handleEvent,t);else throw Error("Invalid listener argument");return 2147483647<Number(e)?-1:pe.setTimeout(t,e||0)}function PE(t){t.g=Pm(()=>{t.g=null,t.i&&(t.i=!1,PE(t))},t.j);const e=t.h;t.h=null,t.m.apply(null,e)}class QL extends $i{constructor(e,n){super(),this.m=e,this.j=n,this.h=null,this.i=!1,this.g=null}l(e){this.h=arguments,this.g?this.i=!0:PE(this)}N(){super.N(),this.g&&(pe.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function nc(t){$i.call(this),this.h=t,this.g={}}Et(nc,$i);var pI=[];function RE(t,e,n,s){Array.isArray(n)||(n&&(pI[0]=n.toString()),n=pI);for(var i=0;i<n.length;i++){var r=bE(e,n[i],s||t.handleEvent,!1,t.h||t);if(!r)break;t.g[r.key]=r}}function kE(t){Tm(t.g,function(e,n){this.g.hasOwnProperty(n)&&Em(e)},t),t.g={}}nc.prototype.N=function(){nc.$.N.call(this),kE(this)};nc.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};function od(){this.g=!0}od.prototype.Ea=function(){this.g=!1};function XL(t,e,n,s,i,r){t.info(function(){if(t.g)if(r)for(var o="",a=r.split("&"),c=0;c<a.length;c++){var l=a[c].split("=");if(1<l.length){var u=l[0];l=l[1];var d=u.split("_");o=2<=d.length&&d[1]=="type"?o+(u+"="+l+"&"):o+(u+"=redacted&")}}else o=null;else o=r;return"XMLHTTP REQ ("+s+") [attempt "+i+"]: "+e+`
1206`+n+`
1207`+o})}function ZL(t,e,n,s,i,r,o){t.info(function(){return"XMLHTTP RESP ("+s+") [ attempt "+i+"]: "+e+`
1208`+n+`
1209`+r+" "+o})}function no(t,e,n,s){t.info(function(){return"XMLHTTP TEXT ("+e+"): "+tF(t,n)+(s?" "+s:"")})}function eF(t,e){t.info(function(){return"TIMEOUT: "+e})}od.prototype.info=function(){};function tF(t,e){if(!t.g)return e;if(!e)return null;try{var n=JSON.parse(e);if(n){for(t=0;t<n.length;t++)if(Array.isArray(n[t])){var s=n[t];if(!(2>s.length)){var i=s[1];if(Array.isArray(i)&&!(1>i.length)){var r=i[0];if(r!="noop"&&r!="stop"&&r!="close")for(var o=1;o<i.length;o++)i[o]=""}}}}return Dm(n)}catch{return e}}var kr={},mI=null;function ad(){return mI=mI||new bt}kr.Ta="serverreachability";function UE(t){jt.call(this,kr.Ta,t)}Et(UE,jt);function sc(t){const e=ad();Ut(e,new UE(e))}kr.STAT_EVENT="statevent";function NE(t,e){jt.call(this,kr.STAT_EVENT,t),this.stat=e}Et(NE,jt);function Qt(t){const e=ad();
1209Ut(e,new NE(e,t))}kr.Ua="timingevent";function xE(t,e){jt.call(this,kr.Ua,t),this.size=e}Et(xE,jt);function Cc(t,e){if(typeof t!="function")throw Error("Fn must not be null and must be a function");return pe.setTimeout(function(){t()},e)}var cd={NO_ERROR:0,rb:1,Eb:2,Db:3,yb:4,Cb:5,Fb:6,Qa:7,TIMEOUT:8,Ib:9},ME={wb:"complete",Sb:"success",Ra:"error",Qa:"abort",Kb:"ready",Lb:"readystatechange",TIMEOUT:"timeout",Gb:"incrementaldata",Jb:"progress",zb:"downloadprogress",$b:"uploadprogress"};function Rm(){}Rm.prototype.h=null;function gI(t){return t.h||(t.h=t.i())}function OE(){}var Pc={OPEN:"a",vb:"b",Ra:"c",Hb:"d"};function km(){jt.call(this,"d")}Et(km,jt);function Um(){jt.call(this,"c")}Et(Um,jt);var Qf;function ld(){}Et(ld,Rm);ld.prototype.g=function(){return new XMLHttpRequest};ld.prototype.i=function(){return{}};Qf=new ld;function Rc(t,e,n,s){this.l=t,this.j=e,this.m=n,this.W=s||1,this.U=new nc(this),this.P=nF,t=Wf?125:void 0,this.V=new rd(t),this.I=null,this.i=!1,this.u=this.B=this.A=this.L=this.G=this.Y=this.C=null,this.F=[],this.g=null,this.o=0,this.s=this.v=null,this.ca=-1,this.J=!1,this.O=0,this.M=null,this.ba=this.K=this.aa=this.S=!1,this.h=new LE}function LE(){this.i=null,this.g="",this.h=!1}var nF=45e3,FE={},Xf={};H=Rc.prototype;H.setTimeout=function(t){this.P=t};function Zf(t,e,n){t.L=1,t.A=dd(oi(e)),t.u=n,t.S=!0,VE(t,null)}function VE(t,e){t.G=Date.now(),kc(t),t.B=oi(t.A);var n=t.B,s=t.W;Array.isArray(s)||(s=[String(s)]),KE(n.i,"t",s),t.o=0,n=t.l.J,t.h=new LE,t.g=pS(t.l,n?e:null,!t.u),0<t.O&&(t.M=new QL(Bt(t.Pa,t,t.g),t.O)),RE(t.U,t.g,"readystatechange",t.nb),e=t.I?vE(t.I):{},t.u?(t.v||(t.v="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.g.ha(t.B,t.v,t.u,e)):(t.v="GET",t.g.ha(t.B,t.v,null,e)),sc(),XL(t.j,t.v,t.B,t.m,t.W,t.u)}H.nb=function(t){t=t.target;const e=this.M;e&&Ds(t)==3?e.l():this.Pa(t)};H.Pa=function(t){try{if(t==this.g)e:{const u=Ds(this.g);var e=this.g.Ia();const d=this.g.da();if(!(3>u)&&(u!=3||Wf||this.g&&(this.h.h||this.g.ja()||wI(this.g)))){this.J||u!=4||e==7||(e==8||0>=d?sc(3):sc(2)),ud(this);var n=this.g.da();this.ca=n;t:if(qE(this)){var s=wI(this.g);t="";var i=s.length,r=Ds(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){ir(this),Pa(this);var o="";break t}this.h.i=new pe.TextDecoder}for(e=0;e<i;e++)this.h.h=!0,t+=this.h.i.decode(s[e],{stream:r&&e==i-1});s.length=0,this.h.g+=t,this.o=0,o=this.h.g}else o=this.g.ja();if(this.i=n==200,ZL(this.j,this.v,this.B,this.m,this.W,u,n),this.i){if(this.aa&&
1209!this.K){t:{if(this.g){var a,c=this.g;if((a=c.g?c.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!Xa(a)){var l=a;break t}}l=null}if(n=l)no(this.j,this.m,n,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,ep(this,n);else{this.i=!1,this.s=3,Qt(12),ir(this),Pa(this);break e}}this.S?(GE(this,u,o),Wf&&this.i&&u==3&&(RE(this.U,this.V,"tick",this.mb),this.V.start())):(no(this.j,this.m,o,null),ep(this,o)),u==4&&ir(this),this.i&&!this.J&&(u==4?uS(this.l,this):(this.i=!1,kc(this)))}else bF(this.g),n==400&&0<o.indexOf("Unknown SID")?(this.s=3,Qt(12)):(this.s=0,Qt(13)),ir(this),Pa(this)}}}catch{}finally{}};function qE(t){return t.g?t.v=="GET"&&t.L!=2&&t.l.Ha:!1}function GE(t,e,n){let s=!0,i;for(;!t.J&&t.o<n.length;)if(i=sF(t,n),i==Xf){e==4&&(t.s=4,Qt(14),s=!1),no(t.j,t.m,null,"[Incomplete Response]");break}else if(i==FE){t.s=4,Qt(15),no(t.j,t.m,n,"[Invalid Chunk]"),s=!1;break}else no(t.j,t.m,i,null),ep(t,i);qE(t)&&t.o!=0&&(t.h.g=t.h.g.slice(t.o),t.o=0),e!=4||n.length!=0||t.h.h||(t.s=1,Qt(16),s=!1),t.i=t.i&&s,s?0<n.length&&!t.ba&&(t.ba=!0,e=t.l,e.g==t&&e.ca&&!e.M&&(e.l.info("Great, no buffering proxy detected. Bytes received: "+n.length),Fm(e),e.M=!0,Qt(11))):(no(t.j,t.m,n,"[Invalid Chunked Response]"),ir(t),Pa(t))}H.mb=function(){if(this.g){var t=Ds(this.g),e=this.g.ja();this.o<e.length&&(ud(this),GE(this,t,e),this.i&&t!=4&&kc(this))}};function sF(t,e){var n=t.o,s=e.indexOf(`
1210`,n);return s==-1?Xf:(n=Number(e.substring(n,s)),isNaN(n)?FE:(s+=1,s+n>e.length?Xf:(e=e.slice(s,s+n),t.o=s+n,e)))}H.cancel=function(){this.J=!0,ir(this)};function kc(t){t.Y=Date.now()+t.P,BE(t,t.P)}function BE(t,e){if(t.C!=null)throw Error("WatchDog timer not null");t.C=Cc(Bt(t.lb,t),e)}function ud(t){t.C&&(pe.clearTimeout(t.C),t.C=null)}H.lb=function(){this.C=null;const t=Date.now();0<=t-this.Y?(eF(this.j,this.B),this.L!=2&&(sc(),Qt(17)),ir(this),this.s=2,Pa(this)):BE(this,this.Y-t)};function Pa(t){t.l.H==0||t.J||uS(t.l,t)}function ir(t){ud(t);var e=t.M;e&&typeof e.sa=="function"&&e.sa(),t.M=null,Cm(t.V),kE(t.U),t.g&&(e=t.g,t.g=null,e.abort(),e.sa())}function ep(t,e){try{var n=t.l;if(n.H!=0&&(n.g==t||tp(n.i,t))){if(!t.K&&tp(n.i,t)&&n.H==3){try{var s=n.Ja.g.parse(e)}catch{s=null}if(Array.isArray(s)&&s.length==3){var i=s;if(i[0]==0){e:if(!n.u){if(n.g)if(n.g.G+3e3<t.G)su(n),pd(n);else break e;Lm(n),Qt(18)}}else n.Fa=i[1],0<n.Fa-n.V&&37500>i[2]&&n.G&&n.A==0&&!n.v&&(n.v=Cc(Bt(n.ib,n),6e3));if(1>=YE(n.i)&&n.oa){try{n.oa()}catch{}n.oa=void 0}}else rr(n,11)}else if((t.K||n.g==t)&&su(n),!Xa(e))for(i=n.Ja.g.parse(e),e=0;e<i.length;e++){let l=i[e];if(n.V=l[0],l=l[1],n.H==2)if(l[0]=="c"){n.K=l[1],n.pa=l[2];const u=l[3];u!=null&&(n.ra=u,n.l.info("VER="+n.ra));const d=l[4];d!=null&&(n.Ga=d,n.l.info("SVER="+n.Ga));const h=l[5];h!=null&&typeof h=="number"&&0<h&&(s=1.5*h,n.L=s,n.l.info("backChannelRequestTimeoutMs_="+s)),s=n;const f=t.g;if(f){const m=f.g?f.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(m){var r=s.i;r.g||m.indexOf("spdy")==-1&&m.indexOf("quic")==-1&&m.indexOf("h2")==-1||(r.j=r.l,r.g=new Set,r.h&&(Nm(r,r.h),r.h=null))}if(s.F){const v=f.g?f.g.getResponseHeader("X-HTTP-Session-Id"):null;v&&(s.Da=v,Ke(s.I,s.F,v))}}n.H=3,n.h&&n.h.Ba(),n.ca&&(n.S=Date.now()-t.G,n.l.info("Handshake RTT: "+n.S+"ms")),s=n;var o=t;if(s.wa=fS(s,s.J?s.pa:null,s.Y),o.K){QE(s.i,o);var a=o,c=s.L;c&&a.setTimeout(c),a.C&&(ud(a),kc(a)),s.g=o}else cS(s);0<n.j.length&&md(n)}else l[0]!="stop"&&l[0]!="close"||rr(n,7);else n.H==3&&(l[0]=="stop"||l[0]=="close"?l[0]=="stop"?rr(n,7):Om(n):l[0]!="noop"&&n.h&&n.h.Aa(l),n.A=0)}}sc(4)}catch{}}function iF(t){if(t.Z&&typeof t.Z=="function")return t.Z();if(typeof Map<"u"&&t instanceof Map||typeof Set<"u"&&t instanceof Set)return Array.from(t.values());if(typeof t=="string")return t.split("");if(Zu(t)){for(var e=[],n=t.length,s=0;s<n;s++)e.push(t[s]);return e}e=[],n=0;for(s in t)e[n++]=t[s];return e}function rF(t){if(t.ta&&typeof t.ta=="function")return t.ta();if(!t.Z||typeof t.Z!="function"){if(typeof Map<"u"&&t instanceof Map)return Array.from(t.keys());if(!(typeof Set<"u"&&t instanceof Set)){if(Zu(t)||typeof t=="string"){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}e=[],n=0;for(const s in t)e[n++]=s;return e}}}function jE(t,e){if(t.forEach&&typeof t.forEach=="function")t.forEach(e,void 0);else if(Zu(t)||typeof t=="string")Array.prototype.forEach.call(t,e,void 0);else for(var n=rF(t),s=iF(t),i=s.length,r=0;r<i;r++)e.call(void 0,s[r],n&&n[r],t)}var $E=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function oF(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var s=t[n].indexOf("="),i=null;if(0<=s){var r=t[n].substring(0,s);i=t[n].substring(s+1)}else r=t[n];e(r,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}function fr(t){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,t instanceof fr){this.h=t.h,tu(this,t.j),this.s=t.s,this.g=t.g,nu(this,t.m),this.l=t.l;var e=t.i,n=new ic;n.i=e.i,e.g&&(n.g=new Map(e.g),n.h=e.h),yI(this,n),this.o=t.o}else t&&(e=String(t).match($E))?(this.h=!1,tu(this,e[1]||"",!0),this.s=da(e[2]||""),this.g=da(e[3]||"",!0),nu(this,e[4]),this.l=da(e[5]||"",!0),yI(this,e[6]||"",!0),this.o=da(e[7]||"")):(this.h=!1,this.i=new ic(null,this.h))}fr.prototype.toString=function(){var t=[],e=this.j;e&&t.push(ha(e,_I,!0),":");var n=this.g;
vendor: 2,025 bytes, line 1210
1210return(n||e=="file")&&(t.push("//"),(e=this.s)&&t.push(ha(e,_I,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n=this.m,n!=null&&t.push(":",String(n))),(n=this.l)&&(this.g&&n.charAt(0)!="/"&&t.push("/"),t.push(ha(n,n.charAt(0)=="/"?lF:cF,!0))),(n=this.i.toString())&&t.push("?",n),(n=this.o)&&t.push("#",ha(n,dF)),t.join("")};function oi(t){return new fr(t)}function tu(t,e,n){t.j=n?da(e,!0):e,t.j&&(t.j=t.j.replace(/:$/,""))}function nu(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.m=e}else t.m=null}function yI(t,e,n){e instanceof ic?(t.i=e,hF(t.i,t.h)):(n||(e=ha(e,uF)),t.i=new ic(e,t.h))}function Ke(t,e,n){t.i.set(e,n)}function dd(t){return Ke(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function da(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function ha(t,e,n){return typeof t=="string"?(t=encodeURI(t).replace(e,aF),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function aF(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(t&15).toString(16)}var _I=/[#\/\?@]/g,cF=/[#\?:]/g,lF=/[#\?]/g,uF=/[#\?@]/g,dF=/#/g;function ic(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function Hi(t){t.g||(t.g=new Map,t.h=0,t.i&&oF(t.i,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}H=ic.prototype;H.add=function(t,e){Hi(this),this.i=null,t=Go(this,t);var n=this.g.get(t);return n||this.g.set(t,n=[]),n.push(e),this.h+=1,this};function HE(t,e){Hi(t),e=Go(t,e),t.g.has(e)&&(t.i=null,t.h-=t.g.get(e).length,t.g.delete(e))}function WE(t,e){return Hi(t),e=Go(t,e),t.g.has(e)}H.forEach=function(t,e){Hi(this),this.g.forEach(function(n,s){n.forEach(function(i){t.call(e,i,s,this)},this)},this)};H.ta=function(){Hi(this);const t=Array.from(this.g.values()),e=Array.from(this.g.keys()),n=[];for(let s=0;s<e.length;s++){const i=t[s];for(let r=0;r<i.length;r++)n.push(e[s])}return n};H.Z=function(t){Hi(this);let e=[];
1210if(typeof t=="string")WE(this,t)&&(e=e.concat(this.g.get(Go(this,t))));else{t=Array.from(this.g.values());for(let n=0;n<t.length;n++)e=e.concat(t[n])}return e};H.set=function(t,e){return Hi(this),this.i=null,t=Go(this,t),WE(this,t)&&(this.h-=this.g.get(t).length),this.g.set(t,[e]),this.h+=1,this};H.get=function(t,e){return t?(t=this.Z(t),0<t.length?String(t[0]):e):e};function KE(t,e,n){HE(t,e),0<n.length&&(t.i=null,t.g.set(Go(t,e),wm(n)),t.h+=n.length)}H.toString=function(){if(this.i)return this.i;if(!this.g)return"";const t=[],e=Array.from(this.g.keys());for(var n=0;n<e.length;n++){var s=e[n];const r=encodeURIComponent(String(s)),o=this.Z(s);for(s=0;s<o.length;s++){var i=r;o[s]!==""&&(i+="="+encodeURIComponent(String(o[s]))),t.push(i)}}return this.i=t.join("&")};function Go(t,e){return e=String(e),t.j&&(e=e.toLowerCase()),e}function hF(t,e){e&&!t.j&&(Hi(t),t.i=null,t.g.forEach(function(n,s){var i=s.toLowerCase();s!=i&&(HE(this,s),KE(this,i,n))},t)),t.j=e}var fF=class{constructor(t,e){this.g=t,this.map=e}};function zE(t){this.l=t||pF,pe.PerformanceNavigationTiming?(t=pe.performance.getEntriesByType("navigation"),t=0<t.length&&(t[0].nextHopProtocol=="hq"||t[0].nextHopProtocol=="h2")):t=!!(pe.g&&pe.g.Ka&&pe.g.Ka()&&pe.g.Ka().dc),this.j=t?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var pF=10;function JE(t){return t.h?!0:t.g?t.g.size>=t.j:!1}function YE(t){return t.h?1:t.g?t.g.size:0}function tp(t,e){return t.h?t.h==e:t.g?t.g.has(e):!1}function Nm(t,e){t.g?t.g.add(e):t.h=e}function QE(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}zE.prototype.cancel=function(){if(this.i=XE(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const t of this.g.values())t.cancel();this.g.clear()}};function XE(t){if(t.h!=null)return t.i.concat(t.h.F);if(t.g!=null&&t.g.size!==0){let e=t.i;for(const n of t.g.values())e=e.concat(n.F);return e}return wm(t.i)}var mF=class{stringify(t){return pe.JSON.stringify(t,void 0)}parse(t){return pe.JSON.parse(t,void 0)}};function gF(){this.g=new mF}function yF(t,e,n){const s=n||"";try{jE(t,function(i,r){let o=i;ed(i)&&(o=Dm(i)),e.push(s+r+"="+encodeURIComponent(o))})}catch(i){throw e.push(s+"type="+encodeURIComponent("_badmap")),i}}function _F(t,e){const n=new od;if(pe.Image){const s=new Image;s.onload=ol(cl,n,s,"TestLoadImage: loaded",!0,e),s.onerror=ol(cl,n,s,"TestLoadImage: error",!1,e),s.onabort=ol(cl,n,s,"TestLoadImage: abort",!1,e),s.ontimeout=ol(cl,n,s,"TestLoadImage: timeout",!1,e),pe.setTimeout(function(){s.ontimeout&&s.ontimeout()},1e4),s.src=t}else e(!1)}function cl(t,e,n,s,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(s)}catch{}}function Uc(t){this.l=t.ec||null,this.j=t.ob||!1}Et(Uc,Rm);Uc.prototype.g=function(){return new hd(this.l,this.j)};Uc.prototype.i=function(t){return function(){return t}}({});function hd(t,e){bt.call(this),this.F=t,this.u=e,this.m=void 0,this.readyState=xm,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}Et(hd,bt);var xm=0;H=hd.prototype;H.open=function(t,e){if(this.readyState!=xm)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,rc(this)};H.send=function(t){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.F||pe).fetch(new Request(this.B,e)).then(this.$a.bind(this),this.ka.bind(this))};H.abort=function(){this.response=this.responseText="",this.v=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,Nc(this)),this.readyState=xm};H.$a=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,rc(this)),this.g&&(this.readyState=3,rc(this),this.g)))if(this.responseType==="arraybuffer")t.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(typeof pe.ReadableStream<"u"&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;ZE(this)}else t.text().then(this.Za.bind(this),this.ka.bind(this))};function ZE(t){t.j.read().then(t.Xa.bind(t)).catch(t.ka.bind(t))}H.Xa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?Nc(this):rc(this),this.readyState==3&&ZE(this)}};H.Za=function(t){this.g&&(this.response=this.responseText=t,Nc(this))};H.Ya=function(t){this.g&&(this.response=t,Nc(this))};H.ka=function(){this.g&&Nc(this)};function Nc(t){t.readyState=4,t.l=null,t.j=null,t.A=null,rc(t)}H.setRequestHeader=function(t,e){this.v.append(t,e)};H.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""};H.getAllResponseHeaders=function(){if(!this.h)return"";const t=[],e=this.h.entries();for(var n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join(`\r
1211`)};function rc(t){t.onreadystatechange&&t.onreadystatechange.call(t)}Object.defineProperty(hd.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(t){this.m=t?"include":"same-origin"}});var IF=pe.JSON.parse;function it(t){bt.call(this),this.headers=new Map,this.u=t||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=eS,this.L=this.M=!1}Et(it,bt);var eS="",wF=/^https?$/i,vF=["POST","PUT"];H=it.prototype;H.Oa=function(t){this.M=t};H.ha=function(t,e,n,s){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+t);e=e?e.toUpperCase():"GET",this.I=t,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():
1211Qf.g(),this.C=this.u?gI(this.u):gI(Qf),this.g.onreadystatechange=Bt(this.La,this);try{this.G=!0,this.g.open(e,String(t),!0),this.G=!1}catch(r){II(this,r);return}if(t=n||"",n=new Map(this.headers),s)if(Object.getPrototypeOf(s)===Object.prototype)for(var i in s)n.set(i,s[i]);else if(typeof s.keys=="function"&&typeof s.get=="function")for(const r of s.keys())n.set(r,s.get(r));else throw Error("Unknown input type for opt_headers: "+String(s));s=Array.from(n.keys()).find(r=>r.toLowerCase()=="content-type"),i=pe.FormData&&t instanceof pe.FormData,!(0<=yE(vF,e))||s||i||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[r,o]of n)this.g.setRequestHeader(r,o);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{sS(this),0<this.B&&((this.L=TF(this.g))?(this.g.timeout=this.B,this.g.ontimeout=Bt(this.ua,this)):this.A=Pm(this.ua,this.B,this)),this.v=!0,this.g.send(t),this.v=!1}catch(r){II(this,r)}};function TF(t){return So&&typeof t.timeout=="number"&&t.ontimeout!==void 0}H.ua=function(){typeof Im<"u"&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,Ut(this,"timeout"),this.abort(8))};function II(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,tS(t),fd(t)}function tS(t){t.F||(t.F=!0,Ut(t,"complete"),Ut(t,"error"))}H.abort=function(t){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=t||7,Ut(this,"complete"),Ut(this,"abort"),fd(this))};H.N=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),fd(this,!0)),it.$.N.call(this)};H.La=function(){this.s||(this.G||this.v||this.l?nS(this):this.kb())};H.kb=function(){nS(this)};function nS(t){if(t.h&&typeof Im<"u"&&(!t.C[1]||Ds(t)!=4||t.da()!=2)){if(t.v&&Ds(t)==4)Pm(t.La,0,t);else if(Ut(t,"readystatechange"),Ds(t)==4){t.h=!1;try{const o=t.da();e:switch(o){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break e;default:e=!1}var n;if(!(n=e)){var s;if(s=o===0){var i=String(t.I).match($E)[1]||null;!i&&pe.self&&pe.self.location&&(i=pe.self.location.protocol.slice(0,-1)),s=!wF.test(i?i.toLowerCase():"")}n=s}if(n)Ut(t,"complete"),Ut(t,"success");else{t.m=6;try{var r=2<Ds(t)?t.g.statusText:""}catch{r=""}t.j=r+" ["+t.da()+"]",tS(t)}}finally{fd(t)}}}}function fd(t,e){if(t.g){sS(t);const n=t.g,s=t.C[0]?()=>{}:null;t.g=null,t.C=null,e||Ut(t,"ready");try{n.onreadystatechange=s}catch{}}}function sS(t){t.g&&t.L&&(t.g.ontimeout=null),t.A&&(pe.clearTimeout(t.A),t.A=null)}H.isActive=function(){return!!this.g};function Ds(t){return t.g?t.g.readyState:0}H.da=function(){try{return 2<Ds(this)?this.g.status:-1}catch{return-1}};H.ja=function(){try{return this.g?this.g.responseText:""}catch{return""}};H.Wa=function(t){if(this.g){var e=this.g.responseText;return t&&e.indexOf(t)==0&&(e=e.substring(t.length)),IF(e)}};function wI(t){try{if(!t.g)return null;if("response"in t.g)return t.g.response;switch(t.K){case eS:case"text":return t.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in t.g)return t.g.mozResponseArrayBuffer}return null}catch{return null}}function bF(t){const e={};t=(t.g&&2<=Ds(t)&&t.g.getAllResponseHeaders()||"").split(`\r
1212`);for(let s=0;s<t.length;s++){if(Xa(t[s]))continue;var n=zL(t[s]);const i=n[0];if(n=n[1],typeof n!="string")continue;n=n.trim();const r=e[i]||[];e[i]=r,r.push(n)}qL(e,function(s){return s.join(", ")})}H.Ia=function(){return this.m};H.Sa=function(){return typeof this.j=="string"?this.j:String(this.j)};function iS(t){let e="";return Tm(t,function(n,s){e+=s,e+=":",e+=n,e+=`\r
1213`}),e}function Mm(t,e,n){e:{for(s in n){var s=!1;break e}s=!0}s||(n=iS(n),typeof t=="string"?n!=null&&encodeURIComponent(String(n)):Ke(t,e,n))}function ta(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function rS(t){this.Ga=0,this.j=[],this.l=new od,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=ta("failFast",!1,t),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=ta("baseRetryDelayMs",5e3,t),this.hb=ta("retryDelaySeedMs",1e4,t),this.eb=ta("forwardChannelMaxRetries",2,t),this.xa=ta("forwardChannelRequestTimeoutMs",2e4,t),this.va=t&&t.xmlHttpFactory||void 0,this.Ha=t&&t.useFetchStreams||!1,this.L=void 0,this.J=t&&t.supportsCrossDomainXhr||!1,this.K="",this.i=new zE(t&&t.concurrentRequestLimit),this.Ja=new gF,this.P=t&&t.fastHandshake||!1,this.O=t&&t.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=t&&t.bc||!1,t&&t.Ea&&this.l.Ea(),t&&t.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&t&&t.detectBufferingProxy||!1,this.qa=void 0,t&&t.longPollingTimeout&&0<t.longPollingTimeout&&(this.qa=t.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}H=rS.prototype;H.ra=8;H.H=1;
vendor: 16,044 bytes, line 1213
1213function Om(t){if(oS(t),t.H==3){var e=t.W++,n=oi(t.I);if(Ke(n,"SID",t.K),Ke(n,"RID",e),Ke(n,"TYPE","terminate"),xc(t,n),e=new Rc(t,t.l,e),e.L=2,e.A=dd(oi(n)),n=!1,pe.navigator&&pe.navigator.sendBeacon)try{n=pe.navigator.sendBeacon(e.A.toString(),"")}catch{}!n&&pe.Image&&(new Image().src=e.A,n=!0),n||(e.g=pS(e.l,null),e.g.ha(e.A)),e.G=Date.now(),kc(e)}hS(t)}function pd(t){t.g&&(Fm(t),t.g.cancel(),t.g=null)}function oS(t){pd(t),t.u&&(pe.clearTimeout(t.u),t.u=null),su(t),t.i.cancel(),t.m&&(typeof t.m=="number"&&pe.clearTimeout(t.m),t.m=null)}function md(t){if(!JE(t.i)&&!t.m){t.m=!0;var e=t.Na;ec||CE(),tc||(ec(),tc=!0),Am.add(e,t),t.C=0}}function EF(t,e){return YE(t.i)>=t.i.j-(t.m?1:0)?!1:t.m?(t.j=e.F.concat(t.j),!0):t.H==1||t.H==2||t.C>=(t.cb?0:t.eb)?!1:(t.m=Cc(Bt(t.Na,t,e),dS(t,t.C)),t.C++,!0)}H.Na=function(t){if(this.m)if(this.m=null,this.H==1){if(!t){this.W=Math.floor(1e5*Math.random()),t=this.W++;const i=new Rc(this,this.l,t);let r=this.s;if(this.U&&(r?(r=vE(r),TE(r,this.U)):r=this.U),this.o!==null||this.O||(i.I=r,r=null),this.P)e:{for(var e=0,n=0;n<this.j.length;n++){t:{var s=this.j[n];if("__data__"in s.map&&(s=s.map.__data__,typeof s=="string")){s=s.length;break t}s=void 0}if(s===void 0)break;if(e+=s,4096<e){e=n;break e}if(e===4096||n===this.j.length-1){e=n+1;break e}}e=1e3}else e=1e3;e=aS(this,i,e),n=oi(this.I),Ke(n,"RID",t),Ke(n,"CVER",22),this.F&&Ke(n,"X-HTTP-Session-Id",this.F),xc(this,n),r&&(this.O?e="headers="+encodeURIComponent(String(iS(r)))+"&"+e:this.o&&Mm(n,this.o,r)),Nm(this.i,i),this.bb&&Ke(n,"TYPE","init"),this.P?(Ke(n,"$req",e),Ke(n,"SID","null"),i.aa=!0,Zf(i,n,null)):Zf(i,n,e),this.H=2}}else this.H==3&&(t?vI(this,t):this.j.length==0||JE(this.i)||vI(this))};function vI(t,e){var n;e?n=e.m:n=t.W++;const s=oi(t.I);Ke(s,"SID",t.K),Ke(s,"RID",n),Ke(s,"AID",t.V),xc(t,s),t.o&&t.s&&Mm(s,t.o,t.s),n=new Rc(t,t.l,n,t.C+1),t.o===null&&(n.I=t.s),e&&(t.j=e.F.concat(t.j)),e=aS(t,n,1e3),n.setTimeout(Math.round(.5*t.xa)+Math.round(.5*t.xa*Math.random())),Nm(t.i,n),Zf(n,s,e)}function xc(t,e){t.na&&Tm(t.na,function(n,s){Ke(e,s,n)}),t.h&&jE({},function(n,s){Ke(e,s,n)})}function aS(t,e,n){n=Math.min(t.j.length,n);var s=t.h?Bt(t.h.Va,t.h,t):null;e:{var i=t.j;let r=-1;for(;;){const o=["count="+n];r==-1?0<n?(r=i[0].g,o.push("ofs="+r)):r=0:o.push("ofs="+r);let a=!0;for(let c=0;c<n;c++){let l=i[c].g;const u=i[c].map;if(l-=r,0>l)r=Math.max(0,i[c].g-100),a=!1;else try{yF(u,o,"req"+l+"_")}catch{s&&s(u)}}if(a){s=o.join("&");break e}}}return t=t.j.splice(0,n),e.F=t,s}function cS(t){if(!t.g&&!t.u){t.ba=1;var e=t.Ma;ec||CE(),tc||(ec(),tc=!0),Am.add(e,t),t.A=0}}function Lm(t){return t.g||t.u||3<=t.A?!1:(t.ba++,t.u=Cc(Bt(t.Ma,t),dS(t,t.A)),t.A++,!0)}H.Ma=function(){if(this.u=null,lS(this),this.ca&&!(this.M||this.g==null||0>=this.S)){var t=2*this.S;this.l.info("BP detection timer enabled: "+t),this.B=Cc(Bt(this.jb,this),t)}};H.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,Qt(10),pd(this),lS(this))};function Fm(t){t.B!=null&&(pe.clearTimeout(t.B),t.B=null)}function lS(t){t.g=new Rc(t,t.l,"rpc",t.ba),t.o===null&&(t.g.I=t.s),t.g.O=0;var e=oi(t.wa);Ke(e,"RID","rpc"),Ke(e,"SID",t.K),Ke(e,"AID",t.V),Ke(e,"CI",t.G?"0":"1"),!t.G&&t.qa&&Ke(e,"TO",t.qa),Ke(e,"TYPE","xmlhttp"),xc(t,e),t.o&&t.s&&Mm(e,t.o,t.s),t.L&&t.g.setTimeout(t.L);var n=t.g;t=t.pa,n.L=1,n.A=dd(oi(e)),n.u=null,n.S=!0,VE(n,t)}H.ib=function(){this.v!=null&&(this.v=null,pd(this),Lm(this),Qt(19))};function su(t){t.v!=null&&(pe.clearTimeout(t.v),t.v=null)}function uS(t,e){var n=null;if(t.g==e){su(t),Fm(t),t.g=null;var s=2}else if(tp(t.i,e))n=e.F,QE(t.i,e),s=1;else return;if(t.H!=0){if(e.i)if(s==1){n=e.u?e.u.length:0,e=Date.now()-e.G;var i=t.C;s=ad(),Ut(s,new xE(s,n)),md(t)}else cS(t);else if(i=e.s,i==3||i==0&&0<e.ca||!(s==1&&EF(t,e)||s==2&&Lm(t)))switch(n&&0<n.length&&(e=t.i,e.i=e.i.concat(n)),i){case 1:rr(t,5);break;case 4:rr(t,10);break;case 3:rr(t,6);break;default:rr(t,2)}}}function dS(t,e){let n=t.ab+Math.floor(Math.random()*t.hb);return t.isActive()||(n*=2),n*e}function rr(t,e){if(t.l.info("Error code "+e),e==2){var n=null;t.h&&(n=null);var s=Bt(t.pb,t);n||(n=new fr("//www.google.com/images/cleardot.gif"),pe.location&&pe.location.protocol=="http"||tu(n,"https"),dd(n)),_F(n.toString(),s)}else Qt(2);t.H=0,t.h&&t.h.za(e),hS(t),oS(t)}H.pb=function(t){t?(this.l.info("Successfully pinged google.com"),Qt(2)):(this.l.info("Failed to ping google.com"),Qt(1))};function hS(t){if(t.H=0,t.ma=[],t.h){const e=XE(t.i);(e.length!=0||t.j.length!=0)&&(dI(t.ma,e),dI(t.ma,t.j),t.i.i.length=0,wm(t.j),t.j.length=0),t.h.ya()}}function fS(t,e,n){var s=n instanceof fr?oi(n):new fr(n);if(s.g!="")e&&(s.g=e+"."+s.g),nu(s,s.m);else{var i=pe.location;s=i.protocol,e=e?e+"."+i.hostname:i.hostname,i=+i.port;var r=new fr(null);s&&tu(r,s),e&&(r.g=e),i&&nu(r,i),n&&(r.l=n),s=r}return n=t.F,e=t.Da,n&&e&&Ke(s,n,e),Ke(s,"VER",t.ra),xc(t,s),s}function pS(t,e,n){if(e&&!t.J)throw Error("Can't create secondary domain capable XhrIo object.");return e=t.Ha&&!t.va?new it(new Uc({ob:n})):new it(t.va),e.Oa(t.J),e}H.isActive=function(){return!!this.h&&this.h.isActive(this)};function mS(){}H=mS.prototype;H.Ba=function(){};H.Aa=function(){};H.za=function(){};H.ya=function(){};H.isActive=function(){return!0};H.Va=function(){};function iu(){if(So&&!(10<=Number(OL)))throw Error("Environmental error: no available transport.")}iu.prototype.g=function(t,e){return new Bn(t,e)};function Bn(t,e){bt.call(this),this.g=new rS(e),this.l=t,this.h=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.s=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.Ca&&(t?t["X-WebChannel-Client-Profile"]=e.Ca:t={"X-WebChannel-Client-Profile":e.Ca}),this.g.U=t,(t=e&&e.cc)&&!Xa(t)&&(this.g.o=t),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!Xa(e)&&(this.g.F=e,t=this.h,t!==null&&e in t&&(t=this.h,e in t&&delete t[e])),this.j=new Bo(this)}Et(Bn,bt);Bn.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var t=this.g,e=this.l,n=this.h||void 0;Qt(0),t.Y=e,t.na=n||{},t.G=t.aa,t.I=fS(t,null,t.Y),md(t)};Bn.prototype.close=function(){Om(this.g)};Bn.prototype.u=function(t){var e=this.g;if(typeof t=="string"){var n={};n.__data__=t,t=n}else this.v&&(n={},n.__data__=Dm(t),t=n);e.j.push(new fF(e.fb++,t)),e.H==3&&md(e)};Bn.prototype.N=function(){this.g.h=null,delete this.j,Om(this.g),delete this.g,Bn.$.N.call(this)};function gS(t){km.call(this),t.__headers__&&(this.headers=t.__headers__,this.statusCode=t.__status__,delete t.__headers__,delete t.__status__);var e=t.__sm__;if(e){e:{for(const n in e){t=n;break e}t=void 0}(this.i=t)&&(t=this.i,e=e!==null&&t in e?e[t]:void 0),this.data=e}else this.data=t}Et(gS,km);function yS(){Um.call(this),this.status=1}Et(yS,Um);function Bo(t){this.g=t}Et(Bo,mS);Bo.prototype.Ba=function(){Ut(this.g,"a")};Bo.prototype.Aa=function(t){Ut(this.g,new gS(t))};Bo.prototype.za=function(t){Ut(this.g,new yS)};Bo.prototype.ya=function(){Ut(this.g,"b")};function SF(){this.blockSize=-1}function hs(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}Et(hs,SF);hs.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0};function Gh(t,e,n){n||(n=0);var s=Array(16);if(typeof e=="string")for(var i=0;16>i;++i)s[i]=e.charCodeAt(n++)|e.charCodeAt(n++)<<8|e.charCodeAt(n++)<<16|e.charCodeAt(n++)<<24;else for(i=0;16>i;++i)s[i]=e[n++]|e[n++]<<8|e[n++]<<16|e[n++]<<24;e=t.g[0],n=t.g[1],i=t.g[2];var r=t.g[3],o=e+(r^n&(i^r))+s[0]+3614090360&4294967295;e=n+(o<<7&4294967295|o>>>25),o=r+(i^e&(n^i))+s[1]+3905402710&4294967295,r=e+(o<<12&4294967295|o>>>20),o=i+(n^r&(e^n))+s[2]+606105819&4294967295,i=r+(o<<17&4294967295|o>>>15),o=n+(e^i&(r^e))+s[3]+3250441966&4294967295,n=i+(o<<22&4294967295|o>>>10),o=e+(r^n&(i^r))+s[4]+4118548399&4294967295,e=n+(o<<7&4294967295|o>>>25),o=r+(i^e&(n^i))+s[5]+1200080426&4294967295,r=e+(o<<12&4294967295|o>>>20),o=i+(n^r&(e^n))+s[6]+2821735955&4294967295,i=r+(o<<17&4294967295|o>>>15),o=n+(e^i&(r^e))+s[7]+4249261313&4294967295,n=i+(o<<22&4294967295|o>>>10),o=e+(r^n&(i^r))+s[8]+1770035416&4294967295,e=n+(o<<7&4294967295|o>>>25),o=r+(i^e&(n^i))+s[9]+2336552879&4294967295,r=e+(o<<12&4294967295|o>>>20),o=i+(n^r&(e^n))+s[10]+4294925233&4294967295,i=r+(o<<17&4294967295|o>>>15),o=n+(e^i&(r^e))+s[11]+2304563134&4294967295,n=i+(o<<22&4294967295|o>>>10),o=e+(r^n&(i^r))+s[12]+1804603682&4294967295,e=n+(o<<7&4294967295|o>>>25),o=r+(i^e&(n^i))+s[13]+4254626195&4294967295,r=e+(o<<12&4294967295|o>>>20),o=i+(n^r&(e^n))+s[14]+2792965006&4294967295,i=r+(o<<17&4294967295|o>>>15),o=n+(e^i&(r^e))+s[15]+1236535329&4294967295,n=i+(o<<22&4294967295|o>>>10),o=e+(i^r&(n^i))+s[1]+4129170786&4294967295,e=n+(o<<5&4294967295|o>>>27),o=r+(n^i&(e^n))+s[6]+3225465664&4294967295,r=e+(o<<9&4294967295|o>>>23),o=i+(e^n&(r^e))+s[11]+643717713&4294967295,i=r+(o<<14&4294967295|o>>>18),o=n+(r^e&(i^r))+s[0]+3921069994&4294967295,n=i+(o<<20&4294967295|o>>>12),o=e+(i^r&(n^i))+s[5]+3593408605&4294967295,e=n+(o<<5&4294967295|o>>>27),o=r+(n^i&(e^n))+s[10]+38016083&4294967295,r=e+(o<<9&4294967295|o>>>23),o=i+(e^n&(r^e))+s[15]+3634488961&4294967295,i=r+(o<<14&4294967295|o>>>18),o=n+(r^e&(i^r))+s[4]+3889429448&4294967295,n=i+(o<<20&4294967295|o>>>12),o=e+(i^r&(n^i))+s[9]+568446438&4294967295,e=n+(o<<5&4294967295|o>>>27),o=r+(n^i&(e^n))+s[14]+3275163606&4294967295,r=e+(o<<9&4294967295|o>>>23),o=i+(e^n&(r^e))+s[3]+4107603335&4294967295,i=r+(o<<14&4294967295|o>>>18),o=n+(r^e&(i^r))+s[8]+1163531501&4294967295,n=i+(o<<20&4294967295|o>>>12),o=e+(i^r&(n^i))+s[13]+2850285829&4294967295,e=n+(o<<5&4294967295|o>>>27),o=r+(n^i&(e^n))+s[2]+4243563512&4294967295,r=e+(o<<9&4294967295|o>>>23),o=i+(e^n&(r^e))+s[7]+1735328473&4294967295,i=r+(o<<14&4294967295|o>>>18),o=n+(r^e&(i^r))+s[12]+2368359562&4294967295,n=i+(o<<20&4294967295|o>>>12),o=e+(n^i^r)+s[5]+4294588738&4294967295,e=n+(o<<4&4294967295|o>>>28),o=r+(e^n^i)+s[8]+2272392833&4294967295,r=e+(o<<11&4294967295|o>>>21),o=i+(r^e^n)+s[11]+1839030562&4294967295,i=r+(o<<16&4294967295|o>>>16),o=n+(i^r^e)+s[14]+4259657740&4294967295,n=i+(o<<23&4294967295|o>>>9),o=e+(n^i^r)+s[1]+2763975236&4294967295,e=n+(o<<4&4294967295|o>>>28),o=r+(e^n^i)+s[4]+1272893353&4294967295,r=e+(o<<11&4294967295|o>>>21),o=i+(r^e^n)+s[7]+4139469664&4294967295,i=r+(o<<16&4294967295|o>>>16),o=n+(i^r^e)+s[10]+3200236656&4294967295,n=i+(o<<23&4294967295|o>>>9),o=e+(n^i^r)+s[13]+681279174&4294967295,e=n+(o<<4&4294967295|o>>>28),o=r+(e^n^i)+s[0]+3936430074&4294967295,r=e+(o<<11&4294967295|o>>>21),o=i+(r^e^n)+s[3]+3572445317&4294967295,i=r+(o<<16&4294967295|o>>>16),o=n+(i^r^e)+s[6]+76029189&4294967295,n=i+(o<<23&4294967295|o>>>9),o=e+(n^i^r)+s[9]+3654602809&4294967295,e=n+(o<<4&4294967295|o>>>28),o=r+(e^n^i)+s[12]+3873151461&4294967295,r=e+(o<<11&4294967295|o>>>21),o=i+(r^e^n)+s[15]+530742520&4294967295,i=r+(o<<16&4294967295|o>>>16),o=n+(i^r^e)+s[2]+3299628645&4294967295,n=i+(o<<23&4294967295|o>>>9),o=e+(i^(n|~r))+s[0]+4096336452&4294967295,e=n+(o<<6&4294967295|o>>>26),o=r+(n^(e|~i))+s[7]+1126891415&4294967295,r=e+(o<<10&4294967295|o>>>22),o=i+(e^(r|~n))+s[14]+2878612391&4294967295,i=r+(o<<15&4294967295|o>>>17),o=n+(r^(i|~e))+s[5]+4237533241&4294967295,n=i+(o<<21&4294967295|o>>>11),o=e+(i^(n|~r))+s[12]+1700485571&4294967295,e=n+(o<<6&4294967295|o>>>26),o=r+(n^(e|~i))+s[3]+2399980690&4294967295,r=e+(o<<10&4294967295|o>>>22),o=i+(e^(r|~n))+s[10]+4293915773&4294967295,i=r+(o<<15&4294967295|o>>>17),o=n+(r^(i|~e))+s[1]+2240044497&4294967295,n=i+(o<<21&4294967295|o>>>11),o=e+(i^(n|~r))+s[8]+1873313359&4294967295,e=n+(o<<6&4294967295|o>>>26),o=r+(n^(e|~i))+s[15]+4264355552&4294967295,r=e+(o<<10&4294967295|o>>>22),o=i+(e^(r|~n))+s[6]+2734768916&4294967295,i=r+(o<<15&4294967295|o>>>17),o=n+(r^(i|~e))+s[13]+1309151649&4294967295,n=i+(o<<21&4294967295|o>>>11),o=e+(i^(n|~r))+s[4]+4149444226&4294967295,e=n+(o<<6&4294967295|o>>>26),o=r+(n^(e|~i))+s[11]+3174756917&4294967295,r=e+(o<<10&4294967295|o>>>22),o=i+(e^(r|~n))+s[2]+718787259&4294967295,i=r+(o<<15&4294967295|o>>>17),o=n+(r^(i|~e))+s[9]+3951481745&4294967295,t.g[0]=t.g[0]+e&4294967295,t.g[1]=t.g[1]+(i+(o<<21&4294967295|o>>>11))&4294967295,t.g[2]=t.g[2]+i&4294967295,t.g[3]=t.g[3]+r&4294967295}hs.prototype.j=function(t,e){e===void 0&&(e=t.length);for(var n=e-this.blockSize,s=this.m,i=this.h,r=0;r<e;){if(i==0)for(;r<=n;)Gh(this,t,r),r+=this.blockSize;if(typeof t=="string"){for(;r<e;)if(s[i++]=t.charCodeAt(r++),i==this.blockSize){Gh(this,s),i=0;break}}else for(;r<e;)if(s[i++]=t[r++],i==this.blockSize){Gh(this,s),i=0;break}}this.h=i,this.i+=e};hs.prototype.l=function(){var t=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);t[0]=128;for(var e=1;e<t.length-8;++e)t[e]=0;var n=8*this.i;for(e=t.length-8;e<t.length;++e)t[e]=n&255,n/=256;for(this.j(t),t=Array(16),e=n=0;4>e;++e)for(var s=0;32>s;s+=8)t[n++]=this.g[e]>>>s&255;return t};function Le(t,e){this.h=e;for(var n=[],s=!0,i=t.length-1;0<=i;i--){var r=t[i]|0;s&&r==e||(n[i]=r,s=!1)}this.g=n}var DF={};function Vm(t){return-128<=t&&128>t?NL(t,function(e){return new Le([e|0],0>e?-1:0)}):new Le([t|0],0>t?-1:0)}function As(t){if(isNaN(t)||!isFinite(t))return uo;if(0>t)return At(As(-t));for(var e=[],n=1,s=0;t>=n;s++)e[s]=t/n|0,n*=np;return new Le(e,0)}function _S(t,e){if(t.length==0)throw Error("number format error: empty string");if(e=e||10,2>e||36<e)throw Error("radix out of range: "+e);if(t.charAt(0)=="-")return At(_S(t.substring(1),e));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var n=As(Math.pow(e,8)),s=uo,i=0;i<t.length;i+=8){var r=Math.min(8,t.length-i),o=parseInt(t.substring(i,i+r),e);8>r?(r=As(Math.pow(e,r)),s=s.R(r).add(As(o))):(s=s.R(n),s=s.add(As(o)))}return s}var np=4294967296,uo=Vm(0),sp=Vm(1),TI=Vm(16777216);H=Le.prototype;H.ea=function(){if(zn(this))return-At(this).ea();for(var t=0,e=1,n=0;n<this.g.length;n++){var s=this.D(n);t+=(0<=s?s:np+s)*e,e*=np}return t};H.toString=function(t){if(t=t||10,2>t||36<t)throw Error("radix out of range: "+t);if(Ks(this))return"0";if(zn(this))return"-"+At(this).toString(t);for(var e=As(Math.pow(t,6)),n=this,s="";;){var i=ou(n,e).g;n=ru(n,i.R(e));var r=((0<n.g.length?n.g[0]:n.h)>>>0).toString(t);if(n=i,Ks(n))return r+s;for(;6>r.length;)r="0"+r;s=r+s}};H.D=function(t){return 0>t?0:t<this.g.length?this.g[t]:this.h};function Ks(t){if(t.h!=0)return!1;for(var e=0;e<t.g.length;e++)if(t.g[e]!=0)return!1;return!0}function zn(t){return t.h==-1}H.X=function(t){return t=ru(this,t),zn(t)?-1:Ks(t)?0:1};function At(t){for(var e=t.g.length,n=[],s=0;s<e;s++)n[s]=~t.g[s];return new Le(n,~t.h).add(sp)}H.abs=function(){return zn(this)?At(this):this};H.add=function(t){for(var e=Math.max(this.g.length,t.g.length),n=[],s=0,i=0;i<=e;i++){var r=s+(this.D(i)&65535)+(t.D(i)&65535),o=(r>>>16)+(this.D(i)>>>16)+(t.D(i)>>>16);s=o>>>16,r&=65535,o&=65535,n[i]=o<<16|r}return new Le(n,n[n.length-1]&-2147483648?-1:0)};function ru(t,e){return t.add(At(e))}H.R=function(t){if(Ks(this)||Ks(t))return uo;if(zn(this))return zn(t)?At(this).R(At(t)):At(At(this).R(t));if(zn(t))return At(this.R(At(t)));if(0>this.X(TI)&&0>t.X(TI))return As(this.ea()*t.ea());for(var e=this.g.length+t.g.length,n=[],s=0;s<2*e;s++)n[s]=0;for(s=0;s<this.g.length;s++)for(var i=0;i<t.g.length;i++){var r=this.D(s)>>>16,o=this.D(s)&65535,a=t.D(i)>>>16,c=t.D(i)&65535;n[2*s+2*i]+=o*c,ll(n,2*s+2*i),n[2*s+2*i+1]+=r*c,ll(n,2*s+2*i+1),n[2*s+2*i+1]+=o*a,ll(n,2*s+2*i+1),n[2*s+2*i+2]+=r*a,ll(n,2*s+2*i+2)}for(s=0;s<e;s++)n[s]=n[2*s+1]<<16|n[2*s];for(s=e;s<2*e;s++)n[s]=0;return new Le(n,0)};function ll(t,e){for(;(t[e]&65535)!=t[e];)t[e+1]+=t[e]>>>16,t[e]&=65535,e++}function na(t,e){this.g=t,this.h=e}function ou(t,e){if(Ks(e))throw Error("division by zero");if(Ks(t))return new na(uo,uo);
1213if(zn(t))return e=ou(At(t),e),new na(At(e.g),At(e.h));if(zn(e))return e=ou(t,At(e)),new na(At(e.g),e.h);if(30<t.g.length){if(zn(t)||zn(e))throw Error("slowDivide_ only works with positive integers.");for(var n=sp,s=e;0>=s.X(t);)n=bI(n),s=bI(s);var i=Wr(n,1),r=Wr(s,1);for(s=Wr(s,2),n=Wr(n,2);!Ks(s);){var o=r.add(s);0>=o.X(t)&&(i=i.add(n),r=o),s=Wr(s,1),n=Wr(n,1)}return e=ru(t,i.R(e)),new na(i,e)}for(i=uo;0<=t.X(e);){for(n=Math.max(1,Math.floor(t.ea()/e.ea())),s=Math.ceil(Math.log(n)/Math.LN2),s=48>=s?1:Math.pow(2,s-48),r=As(n),o=r.R(e);zn(o)||0<o.X(t);)n-=s,r=As(n),o=r.R(e);Ks(r)&&(r=sp),i=i.add(r),t=ru(t,o)}return new na(i,t)}H.gb=function(t){return ou(this,t).h};H.and=function(t){for(var e=Math.max(this.g.length,t.g.length),n=[],s=0;s<e;s++)n[s]=this.D(s)&t.D(s);return new Le(n,this.h&t.h)};H.or=function(t){for(var e=Math.max(this.g.length,t.g.length),n=[],s=0;s<e;s++)n[s]=this.D(s)|t.D(s);return new Le(n,this.h|t.h)};H.xor=function(t){for(var e=Math.max(this.g.length,t.g.length),n=[],s=0;s<e;s++)n[s]=this.D(s)^t.D(s);return new Le(n,this.h^t.h)};function bI(t){for(var e=t.g.length+1,n=[],s=0;s<e;s++)n[s]=t.D(s)<<1|t.D(s-1)>>>31;return new Le(n,t.h)}function Wr(t,e){var n=e>>5;e%=32;for(var s=t.g.length-n,i=[],r=0;r<s;r++)i[r]=0<e?t.D(r+n)>>>e|t.D(r+n+1)<<32-e:t.D(r+n);return new Le(i,t.h)}iu.prototype.createWebChannel=iu.prototype.g;Bn.prototype.send=Bn.prototype.u;Bn.prototype.open=Bn.prototype.m;Bn.prototype.close=Bn.prototype.close;cd.NO_ERROR=0;cd.TIMEOUT=8;cd.HTTP_ERROR=6;ME.COMPLETE="complete";OE.EventType=Pc;Pc.OPEN="a";Pc.CLOSE="b";Pc.ERROR="c";Pc.MESSAGE="d";bt.prototype.listen=bt.prototype.O;it.prototype.listenOnce=it.prototype.P;it.prototype.getLastError=it.prototype.Sa;it.prototype.getLastErrorCode=it.prototype.Ia;it.prototype.getStatus=it.prototype.da;it.prototype.getResponseJson=it.prototype.Wa;it.prototype.getResponseText=it.prototype.ja;it.prototype.send=it.prototype.ha;it.prototype.setWithCredentials=it.prototype.Oa;hs.prototype.digest=hs.prototype.l;hs.prototype.reset=hs.prototype.reset;hs.prototype.update=hs.prototype.j;Le.prototype.add=Le.prototype.add;Le.prototype.multiply=Le.prototype.R;Le.prototype.modulo=Le.prototype.gb;Le.prototype.compare=Le.prototype.X;Le.prototype.toNumber=Le.prototype.ea;Le.prototype.toString=Le.prototype.toString;Le.prototype.getBits=Le.prototype.D;Le.fromNumber=As;Le.fromString=_S;var AF=function(){return new iu},CF=function(){return ad()},Bh=cd,PF=ME,RF=kr,EI={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},kF=Uc,ul=OE,UF=it,NF=hs,ho=Le;const SI="@firebase/firestore";/**
1214 * @license
1215 * Copyright 2017 Google LLC
1216 *
1217 * Licensed under the Apache License, Version 2.0 (the "License");
1218 * you may not use this file except in compliance with the License.
1219 * You may obtain a copy of the License at
1220 *
1221 *   http://www.apache.org/licenses/LICENSE-2.0
1222 *
1223 * Unless required by applicable law or agreed to in writing, software
1224 * distributed under the License is distributed on an "AS IS" BASIS,
1225 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1226 * See the License for the specific language governing permissions and
1227 * limitations under the License.
1228 */class Ot{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}}Ot.UNAUTHENTICATED=new Ot(null),Ot.GOOGLE_CREDENTIALS=new Ot("google-credentials-uid"),Ot.FIRST_PARTY=new Ot("first-party-uid"),Ot.MOCK_USER=new Ot("mock-user");/**
1229 * @license
1230 * Copyright 2017 Google LLC
1231 *
1232 * Licensed under the Apache License, Version 2.0 (the "License");
1233 * you may not use this file except in compliance with the License.
1234 * You may obtain a copy of the License at
1235 *
1236 *   http://www.apache.org/licenses/LICENSE-2.0
1237 *
1238 * Unless required by applicable law or agreed to in writing, software
1239 * distributed under the License is distributed on an "AS IS" BASIS,
1240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1241 * See the License for the specific language governing permissions and
1242 * limitations under the License.
1243 */let jo="10.11.1";/**
1244 * @license
1245 * Copyright 2017 Google LLC
1246 *
1247 * Licensed under the Apache License, Version 2.0 (the "License");
1248 * you may not use this file except in compliance with the License.
1249 * You may obtain a copy of the License at
1250 *
1251 *   http://www.apache.org/licenses/LICENSE-2.0
1252 *
1253 * Unless required by applicable law or agreed to in writing, software
1254 * distributed under the License is distributed on an "AS IS" BASIS,
1255 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1256 * See the License for the specific language governing permissions and
1257 * limitations under the License.
1258 */const wr=new Ac("@firebase/firestore");function sa(){return wr.logLevel}function te(t,...e){if(wr.logLevel<=we.DEBUG){const n=e.map(qm);wr.debug(`Firestore (${jo}): ${t}`,...n)}}function ai(t,...e){if(wr.logLevel<=we.ERROR){const n=e.map(qm);wr.error(`Firestore (${jo}): ${t}`,...n)}}function Do(t,...e){if(wr.logLevel<=we.WARN){const n=e.map(qm);wr.warn(`Firestore (${jo}): ${t}`,...n)}}function qm(t){if(typeof t=="string")return t;try{/**
1259* @license
1260* Copyright 2020 Google LLC
1261*
1262* Licensed under the Apache License, Version 2.0 (the "License");
1263* you may not use this file except in compliance with the License.
1264* You may obtain a copy of the License at
1265*
1266*   http://www.apache.org/licenses/LICENSE-2.0
1267*
1268* Unless required by applicable law or agreed to in writing, software
1269* distributed under the License is distributed on an "AS IS" BASIS,
1270* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1271* See the License for the specific language governing permissions and
1272* limitations under the License.
1273*/return function(n){return JSON.stringify(n)}(t)}catch{return t}}/**
1274 * @license
1275 * Copyright 2017 Google LLC
1276 *
1277 * Licensed under the Apache License, Version 2.0 (the "License");
1278 * you may not use this file except in compliance with the License.
1279 * You may obtain a copy of the License at
1280 *
1281 *   http://www.apache.org/licenses/LICENSE-2.0
1282 *
1283 * Unless required by applicable law or agreed to in writing, software
1284 * distributed under the License is distributed on an "AS IS" BASIS,
1285 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1286 * See the License for the specific language governing permissions and
1287 * limitations under the License.
1288 */function fe(t="Unexpected state"){const e=`FIRESTORE (${jo}) INTERNAL ASSERTION FAILED: `+t;throw ai(e),new Error(e)}function He(t,e){t||fe()}function ge(t,e){return t}/**
1289 * @license
1290 * Copyright 2017 Google LLC
1291 *
1292 * Licensed under the Apache License, Version 2.0 (the "License");
1293 * you may not use this file except in compliance with the License.
1294 * You may obtain a copy of the License at
1295 *
1296 *   http://www.apache.org/licenses/LICENSE-2.0
1297 *
1298 * Unless required by applicable law or agreed to in writing, software
1299 * distributed under the License is distributed on an "AS IS" BASIS,
1300 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1301 * See the License for the specific language governing permissions and
1302 * limitations under the License.
1303 */const R={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"};class $ extends Hn{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
1304 * @license
1305 * Copyright 2017 Google LLC
1306 *
1307 * Licensed under the Apache License, Version 2.0 (the "License");
1308 * you may not use this file except in compliance with the License.
1309 * You may obtain a copy of the License at
1310 *
1311 *   http://www.apache.org/licenses/LICENSE-2.0
1312 *
1313 * Unless required by applicable law or agreed to in writing, software
1314 * distributed under the License is distributed on an "AS IS" BASIS,
1315 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1316 * See the License for the specific language governing permissions and
1317 * limitations under the License.
1318 */class Zs{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/**
1319 * @license
1320 * Copyright 2017 Google LLC
1321 *
1322 * Licensed under the Apache License, Version 2.0 (the "License");
1323 * you may not use this file except in compliance with the License.
1324 * You may obtain a copy of the License at
1325 *
1326 *   http://www.apache.org/licenses/LICENSE-2.0
1327 *
1328 * Unless required by applicable law or agreed to in writing, software
1329 * distributed under the License is distributed on an "AS IS" BASIS,
1330 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1331 * See the License for the specific language governing permissions and
1332 * limitations under the License.
1333 */class IS{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class xF{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(Ot.UNAUTHENTICATED))}shutdown(){}}class MF{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class OF{constructor(e){this.t=e,this.currentUser=Ot.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){let s=this.i;const i=c=>this.i!==s?(s=this.i,n(c)):Promise.resolve();let r=new Zs;this.o=()=>{this.i++,this.currentUser=this.u(),r.resolve(),r=new Zs,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const c=r;e.enqueueRetryable(async()=>{await c.promise,await i(this.currentUser)})},a=c=>{te("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.auth.addAuthTokenListener(this.o),o()};this.t.onInit(c=>a(c)),setTimeout(()=>{if(!this.auth){const c=this.t.getImmediate({optional:!0});c?a(c):(te("FirebaseAuthCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Zs)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(s=>this.i!==e?(te("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):s?(He(typeof s.accessToken=="string"),new IS(s.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return He(e===null||typeof e=="string"),new Ot(e)}}class LF{constructor(e,n,s){this.l=e,this.h=n,this.P=s,this.type="FirstParty",this.user=Ot.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class FF{constructor(e,n,s){this.l=e,this.h=n,this.P=s}getToken(){return Promise.resolve(new LF(this.l,this.h,this.P))}start(e,n){e.enqueueRetryable(()=>n(Ot.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class VF{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class qF{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,n){const s=r=>{r.error!=null&&te("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${r.error.message}`);const o=r.token!==this.R;return this.R=r.token,te("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(r.token):Promise.resolve()};this.o=r=>{e.enqueueRetryable(()=>s(r))};const i=r=>{te("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=r,this.appCheck.addTokenListener(this.o)};this.A.onInit(r=>i(r)),setTimeout(()=>{if(!this.appCheck){const r=this.A.getImmediate({optional:!0});r?i(r):te("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(He(typeof n.token=="string"),this.R=n.token,new VF(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/**
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 */function GF(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let s=0;s<t;s++)n[s]=Math.floor(256*Math.random());return n}/**
1349 * @license
1350 * Copyright 2017 Google LLC
1351 *
1352 * Licensed under the Apache License, Version 2.0 (the "License");
1353 * you may not use this file except in compliance with the License.
1354 * You may obtain a copy of the License at
1355 *
1356 *   http://www.apache.org/licenses/LICENSE-2.0
1357 *
1358 * Unless required by applicable law or agreed to in writing, software
1359 * distributed under the License is distributed on an "AS IS" BASIS,
1360 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1361 * See the License for the specific language governing permissions and
1362 * limitations under the License.
1363 */class wS{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=Math.floor(256/e.length)*e.length;let s="";for(;s.length<20;){const i=GF(40);for(let r=0;r<i.length;++r)s.length<20&&i[r]<n&&(s+=e.charAt(i[r]%e.length))}return s}}function Pe(t,e){return t<e?-1:t>e?1:0}function Ao(t,e,n){return t.length===e.length&&t.every((s,i)=>n(s,e[i]))}/**
1364 * @license
1365 * Copyright 2017 Google LLC
1366 *
1367 * Licensed under the Apache License, Version 2.0 (the "License");
1368 * you may not use this file except in compliance with the License.
1369 * You may obtain a copy of the License at
1370 *
1371 *   http://www.apache.org/licenses/LICENSE-2.0
1372 *
1373 * Unless required by applicable law or agreed to in writing, software
1374 * distributed under the License is distributed on an "AS IS" BASIS,
1375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1376 * See the License for the specific language governing permissions and
1377 * limitations under the License.
1378 */class wt{constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new $(R.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new $(R.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<-62135596800)throw new $(R.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new $(R.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return wt.fromMillis(Date.now())}static fromDate(e){return wt.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),s=Math.floor(1e6*(e-1e3*n));return new wt(n,s)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?Pe(this.nanoseconds,e.nanoseconds):Pe(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(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/**
1379 * @license
1380 * Copyright 2017 Google LLC
1381 *
1382 * Licensed under the Apache License, Version 2.0 (the "License");
1383 * you may not use this file except in compliance with the License.
1384 * You may obtain a copy of the License at
1385 *
1386 *   http://www.apache.org/licenses/LICENSE-2.0
1387 *
1388 * Unless required by applicable law or agreed to in writing, software
1389 * distributed under the License is distributed on an "AS IS" BASIS,
1390 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1391 * See the License for the specific language governing permissions and
1392 * limitations under the License.
1393 */class me{constructor(e){this.timestamp=e}static fromTimestamp(e){return new me(e)}static min(){return new me(new wt(0,0))}static max(){return new me(new wt(253402300799,999999999))}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}}/**
1394 * @license
1395 * Copyright 2017 Google LLC
1396 *
1397 * Licensed under the Apache License, Version 2.0 (the "License");
1398 * you may not use this file except in compliance with the License.
1399 * You may obtain a copy of the License at
1400 *
1401 *   http://www.apache.org/licenses/LICENSE-2.0
1402 *
1403 * Unless required by applicable law or agreed to in writing, software
1404 * distributed under the License is distributed on an "AS IS" BASIS,
1405 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1406 * See the License for the specific language governing permissions and
1407 * limitations under the License.
1408 */class oc{constructor(e,n,s){n===void 0?n=0:n>e.length&&fe(),s===void 0?s=e.length-n:s>e.length-n&&fe(),this.segments=e,this.offset=n,this.len=s}get length(){return this.len}isEqual(e){return oc.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof oc?e.forEach(s=>{n.push(s)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}forEach(e){for(let n=this.offset,s=this.limit();n<s;n++)e(this.segments[n])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,n){const s=Math.min(e.length,n.length);for(let i=0;i<s;i++){const r=e.get(i),o=n.get(i);if(r<o)return-1;if(r>o)return 1}return e.length<n.length?-1:e.length>n.length?1:0}}class $e extends oc{construct(e,n,s){return new $e(e,n,s)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const n=[];for(const s of e){if(s.indexOf("//")>=0)throw new $(R.INVALID_ARGUMENT,`Invalid segment (${s}). Paths must not contain // in them.`);n.push(...s.split("/").filter(i=>i.length>0))}return new $e(n)}static emptyPath(){return new $e([])}}const BF=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Ct extends oc{construct(e,n,s){return new Ct(e,n,s)}static isValidIdentifier(e){return BF.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Ct.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new Ct(["__name__"])}static fromServerFormat(e){const n=[];let s="",i=0;const r=()=>{if(s.length===0)throw new $(R.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(s),s=""};let o=!1;for(;i<e.length;){const a=e[i];if(a==="\\"){if(i+1===e.length)throw new $(R.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const c=e[i+1];if(c!=="\\"&&c!=="."&&c!=="`")throw new $(R.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);s+=c,i+=2}else a==="`"?(o=!o,i++):a!=="."||o?(s+=a,i++):(r(),i++)}if(r(),o)throw new $(R.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new Ct(n)}static emptyPath(){return new Ct([])}}/**
1409 * @license
1410 * Copyright 2017 Google LLC
1411 *
1412 * Licensed under the Apache License, Version 2.0 (the "License");
1413 * you may not use this file except in compliance with the License.
1414 * You may obtain a copy of the License at
1415 *
1416 *   http://www.apache.org/licenses/LICENSE-2.0
1417 *
1418 * Unless required by applicable law or agreed to in writing, software
1419 * distributed under the License is distributed on an "AS IS" BASIS,
1420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1421 * See the License for the specific language governing permissions and
1422 * limitations under the License.
1423 */class oe{constructor(e){this.path=e}static fromPath(e){return new oe($e.fromString(e))}static fromName(e){return new oe($e.fromString(e).popFirst(5))}static empty(){return new oe($e.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&&$e.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return $e.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new oe(new $e(e.slice()))}}function jF(t,e){const n=t.toTimestamp().seconds,s=t.toTimestamp().nanoseconds+1,i=me.fromTimestamp(s===1e9?new wt(n+1,0):new wt(n,s));return new Fi(i,oe.empty(),e)}function $F(t){return new Fi(t.readTime,t.key,-1)}class Fi{constructor(e,n,s){this.readTime=e,this.documentKey=n,this.largestBatchId=s}static min(){return new Fi(me.min(),oe.empty(),-1)}static max(){return new Fi(me.max(),oe.empty(),-1)}}function HF(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=oe.comparator(t.documentKey,e.documentKey),n!==0?n:Pe(t.largestBatchId,e.largestBatchId))}/**
1424 * @license
1425 * Copyright 2020 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 */const WF="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class KF{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/**
1439 * @license
1440 * Copyright 2017 Google LLC
1441 *
1442 * Licensed under the Apache License, Version 2.0 (the "License");
1443 * you may not use this file except in compliance with the License.
1444 * You may obtain a copy of the License at
1445 *
1446 *   http://www.apache.org/licenses/LICENSE-2.0
1447 *
1448 * Unless required by applicable law or agreed to in writing, software
1449 * distributed under the License is distributed on an "AS IS" BASIS,
1450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1451 * See the License for the specific language governing permissions and
1452 * limitations under the License.
1453 */async function Mc(t){if(t.code!==R.FAILED_PRECONDITION||t.message!==WF)throw t;te("LocalStore","Unexpectedly lost primary lease")}/**
1454 * @license
1455 * Copyright 2017 Google LLC
1456 *
1457 * Licensed under the Apache License, Version 2.0 (the "License");
1458 * you may not use this file except in compliance with the License.
1459 * You may obtain a copy of the License at
1460 *
1461 *   http://www.apache.org/licenses/LICENSE-2.0
1462 *
1463 * Unless required by applicable law or agreed to in writing, software
1464 * distributed under the License is distributed on an "AS IS" BASIS,
1465 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1466 * See the License for the specific language governing permissions and
1467 * limitations under the License.
1468 */class q{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&fe(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new q((s,i)=>{this.nextCallback=r=>{this.wrapSuccess(e,r).next(s,i)},this.catchCallback=r=>{this.wrapFailure(n,r).next(s,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof q?n:q.resolve(n)}catch(n){return q.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):q.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):q.reject(n)}static resolve(e){return new q((n,s)=>{n(e)})}static reject(e){return new q((n,s)=>{s(e)})}static waitFor(e){return new q((n,s)=>{let i=0,r=0,o=!1;e.forEach(a=>{++i,a.next(()=>{++r,o&&r===i&&n()},c=>s(c))}),o=!0,r===i&&n()})}static or(e){let n=q.resolve(!1);for(const s of e)n=n.next(i=>i?q.resolve(i):s());return n}static forEach(e,n){const s=[];return e.forEach((i,r)=>{s.push(n.call(this,i,r))}),this.waitFor(s)}static mapArray(e,n){return new q((s,i)=>{const r=e.length,o=new Array(r);let a=0;for(let c=0;c<r;c++){const l=c;n(e[l]).next(u=>{o[l]=u,++a,a===r&&s(o)},u=>i(u))}})}static doWhile(e,n){return new q((s,i)=>{const r=()=>{e()===!0?n().next(()=>{r()},i):s()};r()})}}function zF(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function Oc(t){return t.name==="IndexedDbTransactionError"}/**
1469 * @license
1470 * Copyright 2018 Google LLC
1471 *
1472 * Licensed under the Apache License, Version 2.0 (the "License");
1473 * you may not use this file except in compliance with the License.
1474 * You may obtain a copy of the License at
1475 *
1476 *   http://www.apache.org/licenses/LICENSE-2.0
1477 *
1478 * Unless required by applicable law or agreed to in writing, softw
1478are
1479 * distributed under the License is distributed on an "AS IS" BASIS,
1480 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1481 * See the License for the specific language governing permissions and
1482 * limitations under the License.
1483 */class Gm{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=s=>this.ie(s),this.se=s=>n.writeSequenceNumber(s))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}Gm.oe=-1;function gd(t){return t==null}function au(t){return t===0&&1/t==-1/0}function JF(t){return typeof t=="number"&&Number.isInteger(t)&&!au(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/**
1484 * @license
1485 * Copyright 2017 Google LLC
1486 *
1487 * Licensed under the Apache License, Version 2.0 (the "License");
1488 * you may not use this file except in compliance with the License.
1489 * You may obtain a copy of the License at
1490 *
1491 *   http://www.apache.org/licenses/LICENSE-2.0
1492 *
1493 * Unless required by applicable law or agreed to in writing, software
1494 * distributed under the License is distributed on an "AS IS" BASIS,
1495 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1496 * See the License for the specific language governing permissions and
1497 * limitations under the License.
1498 */function DI(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Ur(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function vS(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}/**
1499 * @license
1500 * Copyright 2017 Google LLC
1501 *
1502 * Licensed under the Apache License, Version 2.0 (the "License");
1503 * you may not use this file except in compliance with the License.
1504 * You may obtain a copy of the License at
1505 *
1506 *   http://www.apache.org/licenses/LICENSE-2.0
1507 *
1508 * Unless required by applicable law or agreed to in writing, software
1509 * distributed under the License is distributed on an "AS IS" BASIS,
1510 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1511 * See the License for the specific language governing permissions and
1512 * limitations under the License.
1513 */class tt{constructor(e,n){this.comparator=e,this.root=n||Dt.EMPTY}insert(e,n){return new tt(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Dt.BLACK,null,null))}remove(e){return new tt(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Dt.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){const s=this.comparator(e,n.key);if(s===0)return n.value;s<0?n=n.left:s>0&&(n=n.right)}return null}indexOf(e){let n=0,s=this.root;for(;!s.isEmpty();){const i=this.comparator(e,s.key);if(i===0)return n+s.left.size;i<0?s=s.left:(n+=s.left.size+1,s=s.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,s)=>(e(n,s),!1))}toString(){const e=[];return this.inorderTraversal((n,s)=>(e.push(`${n}:${s}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new dl(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new dl(this.root,e,this.comparator,!1)}getReverseIterator(){return new dl(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new dl(this.root,e,this.comparator,!0)}}class dl{constructor(e,n,s,i){this.isReverse=i,this.nodeStack=[];let r=1;for(;!e.isEmpty();)if(r=n?s(e.key,n):1,n&&i&&(r*=-1),r<0)e=this.isReverse?e.left:e.right;else{if(r===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Dt{constructor(e,n,s,i,r){this.key=e,this.value=n,this.color=s??Dt.RED,this.left=i??Dt.EMPTY,this.right=r??Dt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,s,i,r){return new Dt(e??this.key,n??this.value,s??this.color,i??this.left,r??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,s){let i=this;const r=s(e,i.key);return i=r<0?i.copy(null,null,null,i.left.insert(e,n,s),null):r===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,s)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Dt.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let s,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return Dt.EMPTY;s=i.right.min(),i=i.copy(s.key,s.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Dt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Dt.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw fe();const e=this.left.check();if(e!==this.right.check())throw fe();return e+(this.isRed()?0:1)}}Dt.EMPTY=null,Dt.RED=!0,Dt.BLACK=!1;
1513Dt.EMPTY=new class{constructor(){this.size=0}get key(){throw fe()}get value(){throw fe()}get color(){throw fe()}get left(){throw fe()}get right(){throw fe()}copy(e,n,s,i,r){return this}insert(e,n,s){return new Dt(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
1514 * @license
1515 * Copyright 2017 Google LLC
1516 *
1517 * Licensed under the Apache License, Version 2.0 (the "License");
1518 * you may not use this file except in compliance with the License.
1519 * You may obtain a copy of the License at
1520 *
1521 *   http://www.apache.org/licenses/LICENSE-2.0
1522 *
1523 * Unless required by applicable law or agreed to in writing, software
1524 * distributed under the License is distributed on an "AS IS" BASIS,
1525 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1526 * See the License for the specific language governing permissions and
1527 * limitations under the License.
1528 */class Nt{constructor(e){this.comparator=e,this.data=new tt(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,s)=>(e(n),!1))}forEachInRange(e,n){const s=this.data.getIteratorFrom(e[0]);for(;s.hasNext();){const i=s.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let s;for(s=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();s.hasNext();)if(!e(s.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new AI(this.data.getIterator())}getIteratorFrom(e){return new AI(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size<e.size&&(n=e,e=this),e.forEach(s=>{n=n.add(s)}),n}isEqual(e){if(!(e instanceof Nt)||this.size!==e.size)return!1;const n=this.data.getIterator(),s=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,r=s.getNext().key;if(this.comparator(i,r)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new Nt(this.comparator);return n.data=e,n}}class AI{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
1529 * @license
1530 * Copyright 2020 Google LLC
1531 *
1532 * Licensed under the Apache License, Version 2.0 (the "License");
1533 * you may not use this file except in compliance with the License.
1534 * You may obtain a copy of the License at
1535 *
1536 *   http://www.apache.org/licenses/LICENSE-2.0
1537 *
1538 * Unless required by applicable law or agreed to in writing, software
1539 * distributed under the License is distributed on an "AS IS" BASIS,
1540 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1541 * See the License for the specific language governing permissions and
1542 * limitations under the License.
1543 */class Mn{constructor(e){this.fields=e,e.sort(Ct.comparator)}static empty(){return new Mn([])}unionWith(e){let n=new Nt(Ct.comparator);for(const s of this.fields)n=n.add(s);for(const s of e)n=n.add(s);return new Mn(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return Ao(this.fields,e.fields,(n,s)=>n.isEqual(s))}}/**
1544 * @license
1545 * Copyright 2023 Google LLC
1546 *
1547 * Licensed under the Apache License, Version 2.0 (the "License");
1548 * you may not use this file except in compliance with the License.
1549 * You may obtain a copy of the License at
1550 *
1551 *   http://www.apache.org/licenses/LICENSE-2.0
1552 *
1553 * Unless required by applicable law or agreed to in writing, software
1554 * distributed under the License is distributed on an "AS IS" BASIS,
1555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1556 * See the License for the specific language governing permissions and
1557 * limitations under the License.
1558 */class TS extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
1559 * @license
1560 * Copyright 2020 Google LLC
1561 *
1562 * Licensed under the Apache License, Version 2.0 (the "License");
1563 * you may not use this file except in compliance with the License.
1564 * You may obtain a copy of the License at
1565 *
1566 *   http://www.apache.org/licenses/LICENSE-2.0
1567 *
1568 * Unless required by applicable law or agreed to in writing, software
1569 * distributed under the License is distributed on an "AS IS" BASIS,
1570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1571 * See the License for the specific language governing permissions and
1572 * limitations under the License.
1573 */class Ht{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(r){throw typeof DOMException<"u"&&r instanceof DOMException?new TS("Invalid base64 string: "+r):r}}(e);return new Ht(n)}static fromUint8Array(e){const n=function(i){let r="";for(let o=0;o<i.length;++o)r+=String.fromCharCode(i[o]);return r}(e);return new Ht(n)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(n){return btoa(n)}(this.binaryString)}toUint8Array(){return function(n){const s=new Uint8Array(n.length);for(let i=0;i<n.length;i++)s[i]=n.charCodeAt(i);return s}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Pe(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Ht.EMPTY_BYTE_STRING=new Ht("");const YF=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Vi(t){if(He(!!t),typeof t=="string"){let e=0;const n=YF.exec(t);if(He(!!n),n[1]){let i=n[1];i=(i+"000000000").substr(0,9),e=Number(i)}const s=new Date(t);return{seconds:Math.floor(s.getTime()/1e3),nanos:e}}return{seconds:dt(t.seconds),nanos:dt(t.nanos)}}function dt(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function vr(t){return typeof t=="string"?Ht.fromBase64String(t):Ht.fromUint8Array(t)}/**
1574 * @license
1575 * Copyright 2020 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 */function yd(t){var e,n;return((n=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||n===void 0?void 0:n.stringValue)==="server_timestamp"}function Bm(t){const e=t.mapValue.fields.__previous_value__;return yd(e)?Bm(e):e}function ac(t){const e=Vi(t.mapValue.fields.__local_write_time__.timestampValue);return new wt(e.seconds,e.nanos)}/**
1589 * @license
1590 * Copyright 2017 Google LLC
1591 *
1592 * Licensed under the Apache License, Version 2.0 (the "License");
1593 * you may not use this file except in compliance with the License.
1594 * You may obtain a copy of the License at
1595 *
1596 *   http://www.apache.org/licenses/LICENSE-2.0
1597 *
1598 * Unless required by applicable law or agreed to in writing, software
1599 * distributed under the License is distributed on an "AS IS" BASIS,
1600 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1601 * See the License for the specific language governing permissions and
1602 * limitations under the License.
1603 */class QF{constructor(e,n,s,i,r,o,a,c,l){this.databaseId=e,this.appId=n,this.persistenceKey=s,this.host=i,this.ssl=r,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.longPollingOptions=c,this.useFetchStreams=l}}class cc{constructor(e,n){this.projectId=e,this.database=n||"(default)"}static empty(){return new cc("","")}get isDefaultDatabase(){return this.database==="(default)"}isEqual(e){return e instanceof cc&&e.projectId===this.projectId&&e.database===this.database}}/**
1604 * @license
1605 * Copyright 2020 Google LLC
1606 *
1607 * Licensed under the Apache License, Version 2.0 (the "License");
1608 * you may not use this file except in compliance with the License.
1609 * You may obtain a copy of the License at
1610 *
1611 *   http://www.apache.org/licenses/LICENSE-2.0
1612 *
1613 * Unless required by applicable law or agreed to in writing, software
1614 * distributed under the License is distributed on an "AS IS" BASIS,
1615 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1616 * See the License for the specific language governing permissions and
1617 * limitations under the License.
1618 */const hl={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function Tr(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?yd(t)?4:XF(t)?9007199254740991:10:fe()}function Ms(t,e){if(t===e)return!0;const n=Tr(t);if(n!==Tr(e))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return ac(t).isEqual(ac(e));case 3:return function(i,r){if(typeof i.timestampValue=="string"&&typeof r.timestampValue=="string"&&i.timestampValue.length===r.timestampValue.length)return i.timestampValue===r.timestampValue;const o=Vi(i.timestampValue),a=Vi(r.timestampValue);return o.seconds===a.seconds&&o.nanos===a.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(i,r){return vr(i.bytesValue).isEqual(vr(r.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(i,r){return dt(i.geoPointValue.latitude)===dt(r.geoPointValue.latitude)&&dt(i.geoPointValue.longitude)===dt(r.geoPointValue.longitude)}(t,e);case 2:return function(i,r){if("integerValue"in i&&"integerValue"in r)return dt(i.integerValue)===dt(r.integerValue);if("doubleValue"in i&&"doubleValue"in r){const o=dt(i.doubleValue),a=dt(r.doubleValue);return o===a?au(o)===au(a):isNaN(o)&&isNaN(a)}return!1}(t,e);case 9:return Ao(t.arrayValue.values||[],e.arrayValue.values||[],Ms);case 10:return function(i,r){const o=i.mapValue.fields||{},a=r.mapValue.fields||{};if(DI(o)!==DI(a))return!1;for(const c in o)if(o.hasOwnProperty(c)&&(a[c]===void 0||!Ms(o[c],a[c])))return!1;return!0}(t,e);default:return fe()}}function lc(t,e){return(t.values||[]).find(n=>Ms(n,e))!==void 0}function Co(t,e){if(t===e)return 0;const n=Tr(t),s=Tr(e);if(n!==s)return Pe(n,s);switch(n){case 0:case 9007199254740991:return 0;case 1:return Pe(t.booleanValue,e.booleanValue);case 2:return function(r,o){const a=dt(r.integerValue||r.doubleValue),c=dt(o.integerValue||o.doubleValue);return a<c?-1:a>c?1:a===c?0:isNaN(a)?isNaN(c)?0:-1:1}(t,e);case 3:return CI(t.timestampValue,e.timestampValue);case 4:return CI(ac(t),ac(e));case 5:return Pe(t.stringValue,e.stringValue);case 6:return function(r,o){const a=vr(r),c=vr(o);return a.compareTo(c)}(t.bytesValue,e.bytesValue);case 7:return function(r,o){const a=r.split("/"),c=o.split("/");for(let l=0;l<a.length&&l<c.length;l++){const u=Pe(a[l],c[l]);if(u!==0)return u}return Pe(a.length,c.length)}(t.referenceValue,e.referenceValue);case 8:return function(r,o){const a=Pe(dt(r.latitude),dt(o.latitude));return a!==0?a:Pe(dt(r.longitude),dt(o.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(r,o){const a=r.values||[],c=o.values||[];for(let l=0;l<a.length&&l<c.length;++l){const u=Co(a[l],c[l]);if(u)return u}return Pe(a.length,c.length)}(t.arrayValue,e.arrayValue);case 10:return function(r,o){if(r===hl.mapValue&&o===hl.mapValue)return 0;if(r===hl.mapValue)return 1;if(o===hl.mapValue)return-1;const a=r.fields||{},c=Object.keys(a),l=o.fields||{},u=Object.keys(l);c.sort(),u.sort();for(let d=0;d<c.length&&d<u.length;++d){const h=Pe(c[d],u[d]);if(h!==0)return h;const f=Co(a[c[d]],l[u[d]]);if(f!==0)return f}return Pe(c.length,u.length)}(t.mapValue,e.mapValue);default:throw fe()}}function CI(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return Pe(t,e);const n=Vi(t),s=Vi(e),i=Pe(n.seconds,s.seconds);return i!==0?i:Pe(n.nanos,s.nanos)}function Po(t){return ip(t)}function ip(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(n){const s=Vi(n);return`time(${s.seconds},${s.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(n){return vr(n).toBase64()}(t.bytesValue):"referenceValue"in t?function(n){return oe.fromName(n).toString()}(t.referenceValue):"geoPointValue"in t?function(n){return`geo(${n.latitude},${n.longitude})`}(t.geoPointValue):"arrayValue"in t?function(n){let s="[",i=!0;for(const r of n.values||[])i?i=!1:s+=",",s+=ip(r);return s+"]"}(t.arrayValue):"mapValue"in t?function(n){const s=Object.keys(n.fields||{}).sort();let i="{",r=!0;for(const o of s)r?r=!1:i+=",",i+=`${o}:${ip(n.fields[o])}`;return i+"}"}(t.mapValue):fe()}function cu(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function rp(t){return!!t&&"integerValue"in t}function jm(t){return!!t&&"arrayValue"in t}function PI(t){return!!t&&"nullValue"in t}function RI(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Tl(t){return!!t&&"mapValue"in t}function Ra(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){const e={mapValue:{fields:{}}};return Ur(t.mapValue.fields,(n,s)=>e.mapValue.fields[n]=Ra(s)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Ra(t.arrayValue.values[n]);return e}return Object.assign({},t)}function XF(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/**
1619 * @license
1620 * Copyright 2017 Google LLC
1621 *
1622 * Licensed under the Apache License, Version 2.0 (the "License");
1623 * you may not use this file except in compliance with the License.
1624 * You may obtain a copy of the License at
1625 *
1626 *   http://www.apache.org/licenses/LICENSE-2.0
1627 *
1628 * Unless required by applicable law or agreed to in writing, software
1629 * distributed under the License is distributed on an "AS IS" BASIS,
1630 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1631 * See the License for the specific language governing permissions and
1632 * limitations under the License.
1633 */class rn{constructor(e){this.value=e}static empty(){return new rn({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let s=0;s<e.length-1;++s)if(n=(n.mapValue.fields||{})[e.get(s)],!Tl(n))return null;return n=(n.mapValue.fields||{})[e.lastSegment()],n||null}}set(e,n){this.getFieldsMap(e.popLast())[e.lastSegment()]=Ra(n)}setAll(e){let n=Ct.emptyPath(),s={},i=[];e.forEach((o,a)=>{if(!n.isImmediateParentOf(a)){const c=this.getFieldsMap(n);this.applyChanges(c,s,i),s={},i=[],n=a.popLast()}o?s[a.lastSegment()]=Ra(o):i.push(a.lastSegment())});const r=this.getFieldsMap(n);this.applyChanges(r,s,i)}delete(e){const n=this.field(e.popLast());Tl(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return Ms(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let s=0;s<e.length;++s){let i=n.mapValue.fields[e.get(s)];Tl(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},n.mapValue.fields[e.get(s)]=i),n=i}return n.mapValue.fields}applyChanges(e,n,s){Ur(n,(i,r)=>e[i]=r);for(const i of s)delete e[i]}clone(){return new rn(Ra(this.value))}}function bS(t){const e=[];return Ur(t.fields,(n,s)=>{const i=new Ct([n]);if(Tl(s)){const r=bS(s.mapValue).fields;
1633if(r.length===0)e.push(i);else for(const o of r)e.push(i.child(o))}else e.push(i)}),new Mn(e)}/**
1634 * @license
1635 * Copyright 2017 Google LLC
1636 *
1637 * Licensed under the Apache License, Version 2.0 (the "License");
1638 * you may not use this file except in compliance with the License.
1639 * You may obtain a copy of the License at
1640 *
1641 *   http://www.apache.org/licenses/LICENSE-2.0
1642 *
1643 * Unless required by applicable law or agreed to in writing, software
1644 * distributed under the License is distributed on an "AS IS" BASIS,
1645 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1646 * See the License for the specific language governing permissions and
1647 * limitations under the License.
1648 */class Ft{constructor(e,n,s,i,r,o,a){this.key=e,this.documentType=n,this.version=s,this.readTime=i,this.createTime=r,this.data=o,this.documentState=a}static newInvalidDocument(e){return new Ft(e,0,me.min(),me.min(),me.min(),rn.empty(),0)}static newFoundDocument(e,n,s,i){return new Ft(e,1,n,me.min(),s,i,0)}static newNoDocument(e,n){return new Ft(e,2,n,me.min(),me.min(),rn.empty(),0)}static newUnknownDocument(e,n){return new Ft(e,3,n,me.min(),me.min(),rn.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(me.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=rn.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=rn.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 Ft&&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 Ft(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}})`}}/**
1649 * @license
1650 * Copyright 2022 Google LLC
1651 *
1652 * Licensed under the Apache License, Version 2.0 (the "License");
1653 * you may not use this file except in compliance with the License.
1654 * You may obtain a copy of the License at
1655 *
1656 *   http://www.apache.org/licenses/LICENSE-2.0
1657 *
1658 * Unless required by applicable law or agreed to in writing, software
1659 * distributed under the License is distributed on an "AS IS" BASIS,
1660 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1661 * See the License for the specific language governing permissions and
1662 * limitations under the License.
1663 */class Ro{constructor(e,n){this.position=e,this.inclusive=n}}function kI(t,e,n){let s=0;for(let i=0;i<t.position.length;i++){const r=e[i],o=t.position[i];if(r.field.isKeyField()?s=oe.comparator(oe.fromName(o.referenceValue),n.key):s=Co(o,n.data.field(r.field)),r.dir==="desc"&&(s*=-1),s!==0)break}return s}function UI(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!Ms(t.position[n],e.position[n]))return!1;return!0}/**
1664 * @license
1665 * Copyright 2022 Google LLC
1666 *
1667 * Licensed under the Apache License, Version 2.0 (the "License");
1668 * you may not use this file except in compliance with the License.
1669 * You may obtain a copy of the License at
1670 *
1671 *   http://www.apache.org/licenses/LICENSE-2.0
1672 *
1673 * Unless required by applicable law or agreed to in writing, softw
1673are
1674 * distributed under the License is distributed on an "AS IS" BASIS,
1675 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1676 * See the License for the specific language governing permissions and
1677 * limitations under the License.
1678 */class uc{constructor(e,n="asc"){this.field=e,this.dir=n}}function ZF(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}/**
1679 * @license
1680 * Copyright 2022 Google LLC
1681 *
1682 * Licensed under the Apache License, Version 2.0 (the "License");
1683 * you may not use this file except in compliance with the License.
1684 * You may obtain a copy of the License at
1685 *
1686 *   http://www.apache.org/licenses/LICENSE-2.0
1687 *
1688 * Unless required by applicable law or agreed to in writing, software
1689 * distributed under the License is distributed on an "AS IS" BASIS,
1690 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1691 * See the License for the specific language governing permissions and
1692 * limitations under the License.
1693 */class ES{}class ft extends ES{constructor(e,n,s){super(),this.field=e,this.op=n,this.value=s}static create(e,n,s){return e.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(e,n,s):new tV(e,n,s):n==="array-contains"?new iV(e,s):n==="in"?new rV(e,s):n==="not-in"?new oV(e,s):n==="array-contains-any"?new aV(e,s):new ft(e,n,s)}static createKeyFieldInFilter(e,n,s){return n==="in"?new nV(e,s):new sV(e,s)}matches(e){const n=e.data.field(this.field);return this.op==="!="?n!==null&&this.matchesComparison(Co(n,this.value)):n!==null&&Tr(this.value)===Tr(n)&&this.matchesComparison(Co(n,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return fe()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class fs extends ES{constructor(e,n){super(),this.filters=e,this.op=n,this.ae=null}static create(e,n){return new fs(e,n)}matches(e){return SS(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function SS(t){return t.op==="and"}function DS(t){return eV(t)&&SS(t)}function eV(t){for(const e of t.filters)if(e instanceof fs)return!1;return!0}function op(t){if(t instanceof ft)return t.field.canonicalString()+t.op.toString()+Po(t.value);if(DS(t))return t.filters.map(e=>op(e)).join(",");{const e=t.filters.map(n=>op(n)).join(",");return`${t.op}(${e})`}}function AS(t,e){return t instanceof ft?function(s,i){return i instanceof ft&&s.op===i.op&&s.field.isEqual(i.field)&&Ms(s.value,i.value)}(t,e):t instanceof fs?function(s,i){return i instanceof fs&&s.op===i.op&&s.filters.length===i.filters.length?s.filters.reduce((r,o,a)=>r&&AS(o,i.filters[a]),!0):!1}(t,e):void fe()}function CS(t){return t instanceof ft?function(n){return`${n.field.canonicalString()} ${n.op} ${Po(n.value)}`}(t):t instanceof fs?function(n){return n.op.toString()+" {"+n.getFilters().map(CS).join(" ,")+"}"}(t):"Filter"}class tV extends ft{constructor(e,n,s){super(e,n,s),this.key=oe.fromName(s.referenceValue)}matches(e){const n=oe.comparator(e.key,this.key);return this.matchesComparison(n)}}class nV extends ft{constructor(e,n){super(e,"in",n),this.keys=PS("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class sV extends ft{constructor(e,n){super(e,"not-in",n),this.keys=PS("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function PS(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(s=>oe.fromName(s.referenceValue))}class iV extends ft{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return jm(n)&&lc(n.arrayValue,this.value)}}class rV extends ft{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&lc(this.value.arrayValue,n)}}class oV extends ft{constructor(e,n){super(e,"not-in",n)}matches(e){if(lc(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&!lc(this.value.arrayValue,n)}}class aV extends ft{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!jm(n)||!n.arrayValue.values)&&n.arrayValue.values.some(s=>lc(this.value.arrayValue,s))}}/**
1694 * @license
1695 * Copyright 2019 Google LLC
1696 *
1697 * Licensed under the Apache License, Version 2.0 (the "License");
1698 * you may not use this file except in compliance with the License.
1699 * You may obtain a copy of the License at
1700 *
1701 *   http://www.apache.org/licenses/LICENSE-2.0
1702 *
1703 * Unless required by applicable law or agreed to in writing, software
1704 * distributed under the License is distributed on an "AS IS" BASIS,
1705 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1706 * See the License for the specific language governing permissions and
1707 * limitations under the License.
1708 */class cV{constructor(e,n=null,s=[],i=[],r=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=s,this.filters=i,this.limit=r,this.startAt=o,this.endAt=a,this.ue=null}}function NI(t,e=null,n=[],s=[],i=null,r=null,o=null){return new cV(t,e,n,s,i,r,o)}function $m(t){const e=ge(t);if(e.ue===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(s=>op(s)).join(","),n+="|ob:",n+=e.orderBy.map(s=>function(r){return r.field.canonicalString()+r.dir}(s)).join(","),gd(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(s=>Po(s)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(s=>Po(s)).join(",")),e.ue=n}return e.ue}function Hm(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!ZF(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!AS(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!UI(t.startAt,e.startAt)&&UI(t.endAt,e.endAt)}function ap(t){return oe.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}/**
1709 * @license
1710 * Copyright 2017 Google LLC
1711 *
1712 * Licensed under the Apache License, Version 2.0 (the "License");
1713 * you may not use this file except in compliance with the License.
1714 * You may obtain a copy of the License at
1715 *
1716 *   http://www.apache.org/licenses/LICENSE-2.0
1717 *
1718 * Unless required by applicable law or agreed to in writing, software
1719 * distributed under the License is distributed on an "AS IS" BASIS,
1720 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1721 * See the License for the specific language governing permissions and
1722 * limitations under the License.
1723 */class Wi{constructor(e,n=null,s=[],i=[],r=null,o="F",a=null,c=null){this.path=e,this.collectionGroup=n,this.explicitOrderBy=s,this.filters=i,this.limit=r,this.limitType=o,this.startAt=a,this.endAt=c,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function lV(t,e,n,s,i,r,o,a){return new Wi(t,e,n,s,i,r,o,a)}function _d(t){return new Wi(t)}function xI(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function Wm(t){return t.collectionGroup!==null}function fo(t){const e=ge(t);if(e.ce===null){e.ce=[];const n=new Set;for(const r of e.explicitOrderBy)e.ce.push(r),n.add(r.field.canonicalString());const s=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Nt(Ct.comparator);return o.filters.forEach(c=>{c.getFlattenedFilters().forEach(l=>{l.isInequality()&&(a=a.add(l.field))})}),a})(e).forEach(r=>{n.has(r.canonicalString())||r.isKeyField()||e.ce.push(new uc(r,s))}),n.has(Ct.keyField().canonicalString())||e.ce.push(new uc(Ct.keyField(),s))}return e.ce}function ks(t){const e=ge(t);return e.le||(e.le=uV(e,fo(t))),e.le}function uV(t,e){if(t.limitType==="F")return NI(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const r=i.dir==="desc"?"asc":"desc";return new uc(i.field,r)});const n=t.endAt?new Ro(t.endAt.position,t.endAt.inclusive):null,s=t.startAt?new Ro(t.startAt.position,t.startAt.inclusive):null;return NI(t.path,t.collectionGroup,e,t.filters,t.limit,n,s)}}function cp(t,e){const n=t.filters.concat([e]);return new Wi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function lu(t,e,n){return new Wi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Id(t,e){return Hm(ks(t),ks(e))&&t.limitType===e.limitType}function RS(t){return`${$m(ks(t))}|lt:${t.limitType}`}function Qr(t){return`Query(target=${function(n){let s=n.path.canonicalString();return n.collectionGroup!==null&&(s+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(s+=`, filters: [${n.filters.map(i=>CS(i)).join(", ")}]`),gd(n.limit)||(s+=", limit: "+n.limit),n.orderBy.length>0&&(s+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(s+=", startAt: ",s+=n.startAt.inclusive?"b:":"a:",s+=n.startAt.position.map(i=>Po(i)).join(",")),n.endAt&&(s+=", endAt: ",s+=n.endAt.inclusive?"a:":"b:",s+=n.endAt.position.map(i=>Po(i)).join(",")),`Target(${s})`}(ks(t))}; limitType=${t.limitType})`}function wd(t,e){return e.isFoundDocument()&&function(s,i){const r=i.key.path;return s.collectionGroup!==null?i.key.hasCollectionId(s.collectionGroup)&&s.path.isPrefixOf(r):oe.isDocumentKey(s.path)?s.path.isEqual(r):s.path.isImmediateParentOf(r)}(t,e)&&function(s,i){for(const r of fo(s))if(!r.field.isKeyField()&&i.data.field(r.field)===null)return!1;return!0}(t,e)&&function(s,i){for(const r of s.filters)if(!r.matches(i))return!1;return!0}(t,e)&&function(s,i){return!(s.startAt&&!function(o,a,c){const l=kI(o,a,c);return o.inclusive?l<=0:l<0}(s.startAt,fo(s),i)||s.endAt&&!function(o,a,c){const l=kI(o,a,c);return o.inclusive?l>=0:l>0}(s.endAt,fo(s),i))}(t,e)}function dV(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function kS(t){return(e,n)=>{let s=!1;for(const i of fo(t)){const r=hV(i,e,n);if(r!==0)return r;s=s||i.field.isKeyField()}return 0}}function hV(t,e,n){const s=t.field.isKeyField()?oe.comparator(e.key,n.key):function(r,o,a){const c=o.data.field(r),l=a.data.field(r);return c!==null&&l!==null?Co(c,l):fe()}
1723(t.field,e,n);switch(t.dir){case"asc":return s;case"desc":return-1*s;default:return fe()}}/**
1724 * @license
1725 * Copyright 2017 Google LLC
1726 *
1727 * Licensed under the Apache License, Version 2.0 (the "License");
1728 * you may not use this file except in compliance with the License.
1729 * You may obtain a copy of the License at
1730 *
1731 *   http://www.apache.org/licenses/LICENSE-2.0
1732 *
1733 * Unless required by applicable law or agreed to in writing, software
1734 * distributed under the License is distributed on an "AS IS" BASIS,
1735 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1736 * See the License for the specific language governing permissions and
1737 * limitations under the License.
1738 */class $o{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),s=this.inner[n];if(s!==void 0){for(const[i,r]of s)if(this.equalsFn(i,e))return r}}has(e){return this.get(e)!==void 0}set(e,n){const s=this.mapKeyFn(e),i=this.inner[s];if(i===void 0)return this.inner[s]=[[e,n]],void this.innerSize++;for(let r=0;r<i.length;r++)if(this.equalsFn(i[r][0],e))return void(i[r]=[e,n]);i.push([e,n]),this.innerSize++}delete(e){const n=this.mapKeyFn(e),s=this.inner[n];if(s===void 0)return!1;for(let i=0;i<s.length;i++)if(this.equalsFn(s[i][0],e))return s.length===1?delete this.inner[n]:s.splice(i,1),this.innerSize--,!0;return!1}forEach(e){Ur(this.inner,(n,s)=>{for(const[i,r]of s)e(i,r)})}isEmpty(){return vS(this.inner)}size(){return this.innerSize}}/**
1739 * @license
1740 * Copyright 2017 Google LLC
1741 *
1742 * Licensed under the Apache License, Version 2.0 (the "License");
1743 * you may not use this file except in compliance with the License.
1744 * You may obtain a copy of the License at
1745 *
1746 *   http://www.apache.org/licenses/LICENSE-2.0
1747 *
1748 * Unless required by applicable law or agreed to in writing, software
1749 * distributed under the License is distributed on an "AS IS" BASIS,
1750 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1751 * See the License for the specific language governing permissions and
1752 * limitations under the License.
1753 */const fV=new tt(oe.comparator);function ci(){return fV}const US=new tt(oe.comparator);function fa(...t){let e=US;for(const n of t)e=e.insert(n.key,n);return e}function NS(t){let e=US;return t.forEach((n,s)=>e=e.insert(n,s.overlayedDocument)),e}function or(){return ka()}function xS(){return ka()}function ka(){return new $o(t=>t.toString(),(t,e)=>t.isEqual(e))}const pV=new tt(oe.comparator),mV=new Nt(oe.comparator);function Ie(...t){let e=mV;for(const n of t)e=e.add(n);return e}const gV=new Nt(Pe);function yV(){return gV}/**
1754 * @license
1755 * Copyright 2020 Google LLC
1756 *
1757 * Licensed under the Apache License, Version 2.0 (the "License");
1758 * you may not use this file except in compliance with the License.
1759 * You may obtain a copy of the License at
1760 *
1761 *   http://www.apache.org/licenses/LICENSE-2.0
1762 *
1763 * Unless required by applicable law or agreed to in writing, software
1764 * distributed under the License is distributed on an "AS IS" BASIS,
1765 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1766 * See the License for the specific language governing permissions and
1767 * limitations under the License.
1768 */function MS(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:au(e)?"-0":e}}function OS(t){return{integerValue:""+t}}function LS(t,e){return JF(e)?OS(e):MS(t,e)}/**
1769 * @license
1770 * Copyright 2018 Google LLC
1771 *
1772 * Licensed under the Apache License, Version 2.0 (the "License");
1773 * you may not use this file except in compliance with the License.
1774 * You may obtain a copy of the License at
1775 *
1776 *   http://www.apache.org/licenses/LICENSE-2.0
1777 *
1778 * Unless required by applicable law or agreed to in writing, software
1779 * distributed under the License is distributed on an "AS IS" BASIS,
1780 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1781 * See the License for the specific language governing permissions and
1782 * limitations under the License.
1783 */class vd{constructor(){this._=void 0}}function _V(t,e,n){return t instanceof uu?function(i,r){const o={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return r&&yd(r)&&(r=Bm(r)),r&&(o.fields.__previous_value__=r),{mapValue:o}}(n,e):t instanceof dc?VS(t,e):t instanceof hc?qS(t,e):function(i,r){const o=FS(i,r),a=MI(o)+MI(i.Pe);return rp(o)&&rp(i.Pe)?OS(a):MS(i.serializer,a)}(t,e)}function IV(t,e,n){return t instanceof dc?VS(t,e):t instanceof hc?qS(t,e):n}function FS(t,e){return t instanceof fc?function(s){return rp(s)||function(r){return!!r&&"doubleValue"in r}(s)}(e)?e:{integerValue:0}:null}class uu extends vd{}class dc extends vd{constructor(e){super(),this.elements=e}}function VS(t,e){const n=GS(e);for(const s of t.elements)n.some(i=>Ms(i,s))||n.push(s);return{arrayValue:{values:n}}}class hc extends vd{constructor(e){super(),this.elements=e}}function qS(t,e){let n=GS(e);for(const s of t.elements)n=n.filter(i=>!Ms(i,s));return{arrayValue:{values:n}}}
1783class fc extends vd{constructor(e,n){super(),this.serializer=e,this.Pe=n}}function MI(t){return dt(t.integerValue||t.doubleValue)}function GS(t){return jm(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/**
1784 * @license
1785 * Copyright 2017 Google LLC
1786 *
1787 * Licensed under the Apache License, Version 2.0 (the "License");
1788 * you may not use this file except in compliance with the License.
1789 * You may obtain a copy of the License at
1790 *
1791 *   http://www.apache.org/licenses/LICENSE-2.0
1792 *
1793 * Unless required by applicable law or agreed to in writing, software
1794 * distributed under the License is distributed on an "AS IS" BASIS,
1795 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1796 * See the License for the specific language governing permissions and
1797 * limitations under the License.
1798 */class wV{constructor(e,n){this.field=e,this.transform=n}}function vV(t,e){return t.field.isEqual(e.field)&&function(s,i){return s instanceof dc&&i instanceof dc||s instanceof hc&&i instanceof hc?Ao(s.elements,i.elements,Ms):s instanceof fc&&i instanceof fc?Ms(s.Pe,i.Pe):s instanceof uu&&i instanceof uu}(t.transform,e.transform)}class TV{constructor(e,n){this.version=e,this.transformResults=n}}class as{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new as}static exists(e){return new as(void 0,e)}static updateTime(e){return new as(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 bl(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class Td{}function BS(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new Km(t.key,as.none()):new Lc(t.key,t.data,as.none());{const n=t.data,s=rn.empty();let i=new Nt(Ct.comparator);for(let r of e.fields)if(!i.has(r)){let o=n.field(r);o===null&&r.length>1&&(r=r.popLast(),o=n.field(r)),o===null?s.delete(r):s.set(r,o),i=i.add(r)}return new Ki(t.key,s,new Mn(i.toArray()),as.none())}}function bV(t,e,n){t instanceof Lc?function(i,r,o){const a=i.value.clone(),c=LI(i.fieldTransforms,r,o.transformResults);a.setAll(c),r.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(t,e,n):t instanceof Ki?function(i,r,o){if(!bl(i.precondition,r))return void r.convertToUnknownDocument(o.version);const a=LI(i.fieldTransforms,r,o.transformResults),c=r.data;c.setAll(jS(i)),c.setAll(a),r.convertToFoundDocument(o.version,c).setHasCommittedMutations()}(t,e,n):function(i,r,o){r.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function Ua(t,e,n,s){return t instanceof Lc?function(r,o,a,c){if(!bl(r.precondition,o))return a;const l=r.value.clone(),u=FI(r.fieldTransforms,c,o);return l.setAll(u),o.convertToFoundDocument(o.version,l).setHasLocalMutations(),null}(t,e,n,s):t instanceof Ki?function(r,o,a,c){if(!bl(r.precondition,o))return a;const l=FI(r.fieldTransforms,c,o),u=o.data;return u.setAll(jS(r)),u.setAll(l),o.convertToFoundDocument(o.version,u).setHasLocalMutations(),a===null?null:a.unionWith(r.fieldMask.fields).unionWith(r.fieldTransforms.map(d=>d.field))}(t,e,n,s):function(r,o,a){return bl(r.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(t,e,n)}function EV(t,e){let n=null;for(const s of t.fieldTransforms){const i=e.data.field(s.field),r=FS(s.transform,i||null);r!=null&&(n===null&&(n=rn.empty()),n.set(s.field,r))}return n||null}function OI(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(s,i){return s===void 0&&i===void 0||!(!s||!i)&&Ao(s,i,(r,o)=>vV(r,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Lc extends Td{constructor(e,n,s,i=[]){super(),this.key=e,this.value=n,this.precondition=s,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Ki extends Td{constructor(e,n,s,i,r=[]){super(),this.key=e,this.data=n,this.fieldMask=s,this.prec
1798ondition=i,this.fieldTransforms=r,this.type=1}getFieldMask(){return this.fieldMask}}function jS(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const s=t.data.field(n);e.set(n,s)}}),e}function LI(t,e,n){const s=new Map;He(t.length===n.length);for(let i=0;i<n.length;i++){const r=t[i],o=r.transform,a=e.data.field(r.field);s.set(r.field,IV(o,a,n[i]))}return s}function FI(t,e,n){const s=new Map;for(const i of t){const r=i.transform,o=n.data.field(i.field);s.set(i.field,_V(r,o,e))}return s}class Km extends Td{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class SV extends Td{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
1799 * @license
1800 * Copyright 2017 Google LLC
1801 *
1802 * Licensed under the Apache License, Version 2.0 (the "License");
1803 * you may not use this file except in compliance with the License.
1804 * You may obtain a copy of the License at
1805 *
1806 *   http://www.apache.org/licenses/LICENSE-2.0
1807 *
1808 * Unless required by applicable law or agreed to in writing, software
1809 * distributed under the License is distributed on an "AS IS" BASIS,
1810 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1811 * See the License for the specific language governing permissions and
1812 * limitations under the License.
1813 */class DV{constructor(e,n,s,i){this.batchId=e,this.localWriteTime=n,this.baseMutations=s,this.mutations=i}applyToRemoteDocument(e,n){const s=n.mutationResults;for(let i=0;i<this.mutations.length;i++){const r=this.mutations[i];r.key.isEqual(e.key)&&bV(r,e,s[i])}}applyToLocalView(e,n){for(const s of this.baseMutations)s.key.isEqual(e.key)&&(n=Ua(s,e,n,this.localWriteTime));for(const s of this.mutations)s.key.isEqual(e.key)&&(n=Ua(s,e,n,this.localWriteTime));return n}applyToLocalDocumentSet(e,n){const s=xS();return this.mutations.forEach(i=>{const r=e.get(i.key),o=r.overlayedDocument;let a=this.applyToLocalView(o,r.mutatedFields);a=n.has(i.key)?null:a;const c=BS(o,a);c!==null&&s.set(i.key,c),o.isValidDocument()||o.convertToNoDocument(me.min())}),s}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),Ie())}isEqual(e){return this.batchId===e.batchId&&Ao(this.mutations,e.mutations,(n,s)=>OI(n,s))&&Ao(this.baseMutations,e.baseMutations,(n,s)=>OI(n,s))}}class zm{constructor(e,n,s,i){this.batch=e,this.commitVersion=n,this.mutationResults=s,this.docVersions=i}static from(e,n,s){He(e.mutations.length===s.length);let i=function(){return pV}();const r=e.mutations;for(let o=0;o<r.length;o++)i=i.insert(r[o].key,s[o].version);return new zm(e,n,s,i)}}/**
1814 * @license
1815 * Copyright 2022 Google LLC
1816 *
1817 * Licensed under the Apache License, Version 2.0 (the "License");
1818 * you may not use this file except in compliance with the License.
1819 * You may obtain a copy of the License at
1820 *
1821 *   http://www.apache.org/licenses/LICENSE-2.0
1822 *
1823 * Unless required by applicable law or agreed to in writing, software
1824 * distributed under the License is distributed on an "AS IS" BASIS,
1825 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1826 * See the License for the specific language governing permissions and
1827 * limitations under the License.
1828 */class AV{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
1829      largestBatchId: ${this.largestBatchId},
1830      mutation: ${this.mutation.toString()}
1831    }`}}/**
1832 * @license
1833 * Copyright 2017 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 */class CV{constructor(e,n){this.count=e,this.unchangedNames=n}}/**
1847 * @license
1848 * Copyright 2017 Google LLC
1849 *
1850 * Licensed under the Apache License, Version 2.0 (the "License");
1851 * you may not use this file except in compliance with the License.
1852 * You may obtain a copy of the License at
1853 *
1854 *   http://www.apache.org/licenses/LICENSE-2.0
1855 *
1856 * Unless required by applicable law or agreed to in writing, software
1857 * distributed under the License is distributed on an "AS IS" BASIS,
1858 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1859 * See the License for the specific language governing permissions and
1860 * limitations under the License.
1861 */var lt,be;function PV(t){switch(t){default:return fe();case R.CANCELLED:case R.UNKNOWN:case R.DEADLINE_EXCEEDED:case R.RESOURCE_EXHAUSTED:case R.INTERNAL:case R.UNAVAILABLE:case R.UNAUTHENTICATED:return!1;case R.INVALID_ARGUMENT:case R.NOT_FOUND:case R.ALREADY_EXISTS:case R.PERMISSION_DENIED:case R.FAILED_PRECONDITION:case R.ABORTED:case R.OUT_OF_RANGE:case R.UNIMPLEMENTED:case R.DATA_LOSS:return!0}}function $S(t){if(t===void 0)return ai("GRPC error has no .code"),R.UNKNOWN;switch(t){case lt.OK:return R.OK;case lt.CANCELLED:return R.CANCELLED;case lt.UNKNOWN:return R.UNKNOWN;case lt.DEADLINE_EXCEEDED:return R.DEADLINE_EXCEEDED;case lt.RESOURCE_EXHAUSTED:return R.RESOURCE_EXHAUSTED;case lt.INTERNAL:return R.INTERNAL;case lt.UNAVAILABLE:return R.UNAVAILABLE;case lt.UNAUTHENTICATED:return R.UNAUTHENTICATED;case lt.INVALID_ARGUMENT:return R.INVALID_ARGUMENT;case lt.NOT_FOUND:return R.NOT_FOUND;case lt.ALREADY_EXISTS:return R.ALREADY_EXISTS;case lt.PERMISSION_DENIED:return R.PERMISSION_DENIED;case lt.FAILED_PRECONDITION:return R.FAILED_PRECONDITION;case lt.ABORTED:return R.ABORTED;case lt.OUT_OF_RANGE:return R.OUT_OF_RANGE;case lt.UNIMPLEMENTED:return R.UNIMPLEMENTED;case lt.DATA_LOSS:return R.DATA_LOSS;default:return fe()}}(be=lt||(lt={}))[be.OK=0]="OK",be[be.CANCELLED=1]="CANCELLED",be[be.UNKNOWN=2]="UNKNOWN",be[be.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",be[be.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",be[be.NOT_FOUND=5]="NOT_FOUND",be[be.ALREADY_EXISTS=6]="ALREADY_EXISTS",be[be.PERMISSION_DENIED=7]="PERMISSION_DENIED",be[be.UNAUTHENTICATED=16]="UNAUTHENTICATED",be[be.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",be[be.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",be[be.ABORTED=10]="ABORTED",be[be.OUT_OF_RANGE=11]="OUT_OF_RANGE",be[be.UNIMPLEMENTED=12]="UNIMPLEMENTED",be[be.INTERNAL=13]="INTERNAL",be[be.UNAVAILABLE=14]="UNAVAILABLE",be[be.DATA_LOSS=15]="DATA_LOSS";/**
1862 * @license
1863 * Copyright 2023 Google LLC
1864 *
1865 * Licensed under the Apache License, Version 2.0 (the "License");
1866 * you may not use this file except in compliance with the License.
1867 * You may obtain a copy of the License at
1868 *
1869 *   http://www.apache.org/licenses/LICENSE-2.0
1870 *
1871 * Unless required by applicable law or agreed to in writing, software
1872 * distributed under the License is distributed on an "AS IS" BASIS,
1873 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1874 * See the License for the specific language governing permissions and
1875 * limitations under the License.
1876 */function RV(){return new TextEncoder}/**
1877 * @license
1878 * Copyright 2022 Google LLC
1879 *
1880 * Licensed under the Apache License, Version 2.0 (the "License");
1881 * you may not use this file except in compliance with the License.
1882 * You may obtain a copy of the License at
1883 *
1884 *   http://www.apache.org/licenses/LICENSE-2.0
1885 *
1886 * Unless required by applicable law or agreed to in writing, software
1887 * distributed under the License is distributed on an "AS IS" BASIS,
1888 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1889 * See the License for the specific language governing permissions and
1890 * limitations under the License.
1891 */const kV=new ho([4294967295,4294967295],0);function VI(t){const e=RV().encode(t),n=new NF;return n.update(e),new Uint8Array(n.digest())}function qI(t){const e=new DataView(t.buffer),n=e.getUint32(0,!0),s=e.getUint32(4,!0),i=e.getUint32(8,!0),r=e.getUint32(12,!0);return[new ho([n,s],0),new ho([i,r],0)]}class Jm{constructor(e,n,s){if(this.bitmap=e,this.padding=n,this.hashCount=s,n<0||n>=8)throw new pa(`Invalid padding: ${n}`);if(s<0)throw new pa(`Invalid hash count: ${s}`);if(e.length>0&&this.hashCount===0)throw new pa(`Invalid hash count: ${s}`);if(e.length===0&&n!==0)throw new pa(`Invalid padding when bitmap length is 0: ${n}`);this.Ie=8*e.length-n,this.Te=ho.fromNumber(this.Ie)}Ee(e,n,s){let i=e.add(n.multiply(ho.fromNumber(s)));return i.compare(kV)===1&&(i=new ho([i.getBits(0),i.getBits(1)],0)),i.modulo(this.Te).toNumber()}de(e){return(this.bitmap[Math.floor(e/8)]&1<<e%8)!=0}mightContain(e){if(this.Ie===0)return!1;const n=VI(e),[s,i]=qI(n);for(let r=0;r<this.hashCount;r++){const o=this.Ee(s,i,r);if(!this.de(o))return!1}return!0}static create(e,n,s){const i=e%8==0?0:8-e%8,r=new Uint8Array(Math.ceil(e/8)),o=new Jm(r,i,n);
1891return s.forEach(a=>o.insert(a)),o}insert(e){if(this.Ie===0)return;const n=VI(e),[s,i]=qI(n);for(let r=0;r<this.hashCount;r++){const o=this.Ee(s,i,r);this.Ae(o)}}Ae(e){const n=Math.floor(e/8),s=e%8;this.bitmap[n]|=1<<s}}class pa extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
1892 * @license
1893 * Copyright 2017 Google LLC
1894 *
1895 * Licensed under the Apache License, Version 2.0 (the "License");
1896 * you may not use this file except in compliance with the License.
1897 * You may obtain a copy of the License at
1898 *
1899 *   http://www.apache.org/licenses/LICENSE-2.0
1900 *
1901 * Unless required by applicable law or agreed to in writing, software
1902 * distributed under the License is distributed on an "AS IS" BASIS,
1903 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1904 * See the License for the specific language governing permissions and
1905 * limitations under the License.
1906 */class bd{constructor(e,n,s,i,r){this.snapshotVersion=e,this.targetChanges=n,this.targetMismatches=s,this.documentUpdates=i,this.resolvedLimboDocuments=r}static createSynthesizedRemoteEventForCurrentChange(e,n,s){const i=new Map;return i.set(e,Fc.createSynthesizedTargetChangeForCurrentChange(e,n,s)),new bd(me.min(),i,new tt(Pe),ci(),Ie())}}class Fc{constructor(e,n,s,i,r){this.resumeToken=e,this.current=n,this.addedDocuments=s,this.modifiedDocuments=i,this.removedDocuments=r}static createSynthesizedTargetChangeForCurrentChange(e,n,s){return new Fc(s,n,Ie(),Ie(),Ie())}}/**
1907 * @license
1908 * Copyright 2017 Google LLC
1909 *
1910 * Licensed under the Apache License, Version 2.0 (the "License");
1911 * you may not use this file except in compliance with the License.
1912 * You may obtain a copy of the License at
1913 *
1914 *   http://www.apache.org/licenses/LICENSE-2.0
1915 *
1916 * Unless required by applicable law or agreed to in writing, software
1917 * distributed under the License is distributed on an "AS IS" BASIS,
1918 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1919 * See the License for the specific language governing permissions and
1920 * limitations under the License.
1921 */class El{constructor(e,n,s,i){this.Re=e,this.removedTargetIds=n,this.key=s,this.Ve=i}}class HS{constructor(e,n){this.targetId=e,this.me=n}}class WS{constructor(e,n,s=Ht.EMPTY_BYTE_STRING,i=null){this.state=e,this.targetIds=n,this.resumeToken=s,this.cause=i}}class GI{constructor(){this.fe=0,this.ge=jI(),this.pe=Ht.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return this.fe!==0}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}Ce(){let e=Ie(),n=Ie(),s=Ie();return this.ge.forEach((i,r)=>{switch(r){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:s=s.add(i);break;default:fe()}}),new Fc(this.pe,this.ye,e,n,s)}ve(){this.we=!1,this.ge=jI()}Fe(e,n){this.we=!0,this.ge=this.ge.insert(e,n)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,He(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class UV{constructor(e){this.Le=e,this.Be=new Map,this.ke=ci(),this.qe=BI(),this.Qe=new tt(Pe)}Ke(e){for(const n of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(n,e.Ve):this.Ue(n,e.key,e.Ve);for(const n of e.removedTargetIds)this.Ue(n,e.key,e.Ve)}We(e){this.forEachTarget(e,n=>{const s=this.Ge(n);switch(e.state){case 0:this.ze(n)&&s.De(e.resumeToken);break;case 1:s.Oe(),s.Se||s.ve(),s.De(e.resumeToken);break;case 2:s.Oe(),s.Se||this.removeTarget(n);break;case 3:this.ze(n)&&(s.Ne(),s.De(e.resumeToken));break;case 4:this.ze(n)&&(this.je(n),s.De(e.resumeToken));break;default:fe()}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.Be.forEach((s,i)=>{this.ze(i)&&n(i)})}He(e){const n=e.targetId,s=e.me.count,i=this.Je(n);if(i){const r=i.target;if(ap(r))if(s===0){const o=new oe(r.path);this.Ue(n,o,Ft.newNoDocument(o,me.min()))}else He(s===1);else{const o=this.Ye(n);if(o!==s){const a=this.Ze(e),c=a?this.Xe(a,e,o):1;if(c!==0){this.je(n);const l=c===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(n,l)}}}}}Ze(e){const n=e.me.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:s="",padding:i=0},hashCount:r=0}=n;let o,a;try{o=vr(s).toUint8Array()}catch(c){if(c instanceof TS)return Do("Decoding the base64 bloom filter in existence filter failed ("+c.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw c}
1921try{a=new Jm(o,i,r)}catch(c){return Do(c instanceof pa?"BloomFilter error: ":"Applying bloom filter failed: ",c),null}return a.Ie===0?null:a}Xe(e,n,s){return n.me.count===s-this.nt(e,n.targetId)?0:2}nt(e,n){const s=this.Le.getRemoteKeysForTarget(n);let i=0;return s.forEach(r=>{const o=this.Le.tt(),a=`projects/${o.projectId}/databases/${o.database}/documents/${r.path.canonicalString()}`;e.mightContain(a)||(this.Ue(n,r,null),i++)}),i}rt(e){const n=new Map;this.Be.forEach((r,o)=>{const a=this.Je(o);if(a){if(r.current&&ap(a.target)){const c=new oe(a.target.path);this.ke.get(c)!==null||this.it(o,c)||this.Ue(o,c,Ft.newNoDocument(c,e))}r.be&&(n.set(o,r.Ce()),r.ve())}});let s=Ie();this.qe.forEach((r,o)=>{let a=!0;o.forEachWhile(c=>{const l=this.Je(c);return!l||l.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(s=s.add(r))}),this.ke.forEach((r,o)=>o.setReadTime(e));const i=new bd(e,n,this.Qe,this.ke,s);return this.ke=ci(),this.qe=BI(),this.Qe=new tt(Pe),i}$e(e,n){if(!this.ze(e))return;const s=this.it(e,n.key)?2:0;this.Ge(e).Fe(n.key,s),this.ke=this.ke.insert(n.key,n),this.qe=this.qe.insert(n.key,this.st(n.key).add(e))}Ue(e,n,s){if(!this.ze(e))return;const i=this.Ge(e);this.it(e,n)?i.Fe(n,1):i.Me(n),this.qe=this.qe.insert(n,this.st(n).delete(e)),s&&(this.ke=this.ke.insert(n,s))}removeTarget(e){this.Be.delete(e)}Ye(e){const n=this.Ge(e).Ce();return this.Le.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let n=this.Be.get(e);return n||(n=new GI,this.Be.set(e,n)),n}st(e){let n=this.qe.get(e);return n||(n=new Nt(Pe),this.qe=this.qe.insert(e,n)),n}ze(e){const n=this.Je(e)!==null;return n||te("WatchChangeAggregator","Detected inactive target",e),n}Je(e){const n=this.Be.get(e);return n&&n.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new GI),this.Le.getRemoteKeysForTarget(e).forEach(n=>{this.Ue(e,n,null)})}it(e,n){return this.Le.getRemoteKeysForTarget(e).has(n)}}function BI(){return new tt(oe.comparator)}function jI(){return new tt(oe.comparator)}const NV={asc:"ASCENDING",desc:"DESCENDING"},xV={"<":"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"},MV={and:"AND",or:"OR"};class OV{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function lp(t,e){return t.useProto3Json||gd(e)?e:{value:e}}function du(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function KS(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function LV(t,e){return du(t,e.toTimestamp())}function Us(t){return He(!!t),me.fromTimestamp(function(n){const s=Vi(n);return new wt(s.seconds,s.nanos)}(t))}function Ym(t,e){return up(t,e).canonicalString()}function up(t,e){const n=function(i){return new $e(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function zS(t){const e=$e.fromString(t);return He(ZS(e)),e}function dp(t,e){return Ym(t.databaseId,e.path)}function jh(t,e){const n=zS(e);if(n.get(1)!==t.databaseId.projectId)throw new $(R.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new $(R.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new oe(YS(n))}function JS(t,e){return Ym(t.databaseId,e)}function FV(t){const e=zS(t);return e.length===4?$e.emptyPath():YS(e)}function hp(t){return new $e(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function YS(t){return He(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function $I(t,e,n){return{name:dp(t,e),fields:n.value.mapValue.fields}}function VV(t,e){let n;if("targetChange"in e){e.targetChange;const s=function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:fe()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],r=function(l,u){return l.useProto3Json?(He(u===void 0||typeof u=="string"),Ht.fromBase64String(u||"")):(He(u===void 0||u instanceof Buffer||u instanceof Uint8Array),Ht.fromUint8Array(u||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(l){const u=l.code===void 0?R.UNKNOWN:$S(l.code);return new $(u,l.message||"")}(o);n=new WS(s,i,r,a||null)}else if("documentChange"in e){e.documentChange;const s=e.documentChange;s.document,s.document.name,s.document.updateTime;const i=jh(t,s.document.name),r=Us(s.document.updateTime),o=s.document.createTime?Us(s.document.createTime):me.min(),a=new rn({mapValue:{fields:s.document.fields}}),c=Ft.newFoundDocument(i,r,o,a),l=s.targetIds||[],u=s.removedTargetIds||[];n=new El(l,u,c.key,c)}else if("documentDelete"in e){e.documentDelete;const s=e.documentDelete;s.document;const i=jh(t,s.document),r=s.readTime?Us(s.readTime):me.min(),o=Ft.newNoDocument(i,r),a=s.removedTargetIds||[];n=new El([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const s=e.documentRemove;s.document;const i=jh(t,s.document),r=s.removedTargetIds||[];n=new El([],r,i,null)}else{if(!("filter"in e))return fe();{e.filter;const s=e.filter;s.targetId;const{count:i=0,unchangedNames:r}=s,o=new CV(i,r),a=s.targetId;n=new HS(a,o)}}return n}function qV(t,e){let n;if(e instanceof Lc)n={update:$I(t,e.key,e.value)};else if(e instanceof Km)n={delete:dp(t,e.key)};else if(e instanceof Ki)n={update:$I(t,e.key,e.data),updateMask:JV(e.fieldMask)};else{if(!(e instanceof SV))return fe();n={verify:dp(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(s=>function(r,o){const a=o.transform;if(a instanceof uu)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof dc)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof hc)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof fc)return{fieldPath:o.field.canonicalString(),increment:a.Pe};throw fe()}(0,s))),e.precondition.isNone||(n.currentDocument=function(i,r){return r.updateTime!==void 0?{updateTime:LV(i,r.updateTime)}:r.exists!==void 0?{exists:r.exists}:fe()}(t,e.precondition)),n}function GV(t,e){return t&&t.length>0?(He(e!==void 0),t.map(n=>function(i,r){let o=i.updateTime?Us(i.updateTime):Us(r);return o.isEqual(me.min())&&(o=Us(r)),new TV(o,i.transformResults||[])}(n,e))):[]}function BV(t,e){return{documents:[JS(t,e.path)]}}function jV(t,e){const n={structuredQuery:{}},s=e.path;let i;e.collectionGroup!==null?(i=s,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=s.popLast(),n.structuredQuery.from=[{collectionId:s.lastSegment()}]),n.parent=JS(t,i);const r=function(l){if(l.length!==0)return XS(fs.create(l,"and"))}(e.filters);r&&(n.structuredQuery.where=r);const o=function(l){if(l.length!==0)return l.map(u=>function(h){return{field:Xr(h.field),direction:WV(h.dir)}}(u))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=lp(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=function(l){return{before:l.inclusive,values:l.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(l){return{before:!l.inclusive,values:l.position}}(e.endAt)),{_t:n,parent:i}}function $V(t){let e=FV(t.parent);const n=t.structuredQuery,s=n.from?n.from.length:0;let i=null;if(s>0){He(s===1);const u=n.from[0];u.allDescendants?i=u.collectionId:e=e.child(u.collectionId)}let r=[];n.where&&(r=function(d){const h=QS(d);return h instanceof fs&&DS(h)?h.getFilters():[h]}(n.where));let o=[];n.orderBy&&(o=function(d){return d.map(h=>function(m){return new uc(Zr(m.field),function(b){switch(b){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(m.direction))}(h))}(n.orderBy));let a=null;n.limit&&(a=function(d){let h;return h=typeof d=="object"?d.value:d,gd(h)?null:h}(n.limit));let c=null;n.startAt&&(c=function(d){const h=!!d.before,f=d.values||[];return new Ro(f,h)}(n.startAt));let l=null;return n.endAt&&(l=function(d){const h=!d.before,f=d.values||[];return new Ro(f,h)}(n.endAt)),lV(e,i,o,r,a,"F",c,l)}function HV(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return fe()}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function QS(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const s=Zr(n.unaryFilter.field);return ft.create(s,"==",{doubleValue:NaN});case"IS_NULL":const i=Zr(n.unaryFilter.field);return ft.create(i,"==",{nullValue:"NULL_VALUE"});
1921case"IS_NOT_NAN":const r=Zr(n.unaryFilter.field);return ft.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Zr(n.unaryFilter.field);return ft.create(o,"!=",{nullValue:"NULL_VALUE"});default:return fe()}}(t):t.fieldFilter!==void 0?function(n){return ft.create(Zr(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return fe()}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return fs.create(n.compositeFilter.filters.map(s=>QS(s)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return fe()}}(n.compositeFilter.op))}(t):fe()}function WV(t){return NV[t]}function KV(t){return xV[t]}function zV(t){return MV[t]}function Xr(t){return{fieldPath:t.canonicalString()}}function Zr(t){return Ct.fromServerFormat(t.fieldPath)}function XS(t){return t instanceof ft?function(n){if(n.op==="=="){if(RI(n.value))return{unaryFilter:{field:Xr(n.field),op:"IS_NAN"}};if(PI(n.value))return{unaryFilter:{field:Xr(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(RI(n.value))return{unaryFilter:{field:Xr(n.field),op:"IS_NOT_NAN"}};if(PI(n.value))return{unaryFilter:{field:Xr(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Xr(n.field),op:KV(n.op),value:n.value}}}(t):t instanceof fs?function(n){const s=n.getFilters().map(i=>XS(i));return s.length===1?s[0]:{compositeFilter:{op:zV(n.op),filters:s}}}(t):fe()}function JV(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function ZS(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/**
1922 * @license
1923 * Copyright 2017 Google LLC
1924 *
1925 * Licensed under the Apache License, Version 2.0 (the "License");
1926 * you may not use this file except in compliance with the License.
1927 * You may obtain a copy of the License at
1928 *
1929 *   http://www.apache.org/licenses/LICENSE-2.0
1930 *
1931 * Unless required by applicable law or agreed to in writing, software
1932 * distributed under the License is distributed on an "AS IS" BASIS,
1933 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1934 * See the License for the specific language governing permissions and
1935 * limitations under the License.
1936 */class Ri{constructor(e,n,s,i,r=me.min(),o=me.min(),a=Ht.EMPTY_BYTE_STRING,c=null){this.target=e,this.targetId=n,this.purpose=s,this.sequenceNumber=i,this.snapshotVersion=r,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=c}withSequenceNumber(e){return new Ri(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new Ri(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Ri(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Ri(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
1937 * @license
1938 * Copyright 2017 Google LLC
1939 *
1940 * Licensed under the Apache License, Version 2.0 (the "License");
1941 * you may not use this file except in compliance with the License.
1942 * You may obtain a copy of the License at
1943 *
1944 *   http://www.apache.org/licenses/LICENSE-2.0
1945 *
1946 * Unless required by applicable law or agreed to in writing, software
1947 * distributed under the License is distributed on an "AS IS" BASIS,
1948 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1949 * See the License for the specific language governing permissions and
1950 * limitations under the License.
1951 */class YV{constructor(e){this.ut=e}}function QV(t){const e=$V({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?lu(e,e.limit,"L"):e}/**
1952 * @license
1953 * Copyright 2019 Google LLC
1954 *
1955 * Licensed under the Apache License, Version 2.0 (the "License");
1956 * you may not use this file except in compliance with the License.
1957 * You may obtain a copy of the License at
1958 *
1959 *   http://www.apache.org/licenses/LICENSE-2.0
1960 *
1961 * Unless required by applicable law or agreed to in writing, software
1962 * distributed under the License is distributed on an "AS IS" BASIS,
1963 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1964 * See the License for the specific language governing permissions and
1965 * limitations under the License.
1966 */class XV{constructor(){this.on=new ZV}addToCollectionParentIndex(e,n){return this.on.add(n),q.resolve()}getCollectionParents(e,n){return q.resolve(this.on.getEntries(n))}addFieldIndex(e,n){return q.resolve()}deleteFieldIndex(e,n){return q.resolve()}deleteAllFieldIndexes(e){return q.resolve()}createTargetIndexes(e,n){return q.resolve()}getDocumentsMatchingTarget(e,n){return q.resolve(null)}getIndexType(e,n){return q.resolve(0)}getFieldIndexes(e,n){return q.resolve([])}getNextCollectionGroupToUpdate(e){return q.resolve(null)}getMinOffset(e,n){return q.resolve(Fi.min())}getMinOffsetFromCollectionGroup(e,n){return q.resolve(Fi.min())}updateCollectionGroup(e,n,s){return q.resolve()}updateIndexEntries(e,n){return q.resolve()}}class ZV{constructor(){this.index={}}add(e){const n=e.lastSegment(),s=e.popLast(),i=this.index[n]||new Nt($e.comparator),r=!i.has(s);return this.index[n]=i.add(s),r}has(e){const n=e.lastSegment(),s=e.popLast(),i=this.index[n];return i&&i.has(s)}getEntries(e){return(this.index[e]||new Nt($e.comparator)).toArray()}}/**
1967 * @license
1968 * Copyright 2017 Google LLC
1969 *
1970 * Licensed under the Apache License, Version 2.0 (the "License");
1971 * you may not use this file except in compliance with the License.
1972 * You may obtain a copy of the License at
1973 *
1974 *   http://www.apache.org/licenses/LICENSE-2.0
1975 *
1976 * Unless required by applicable law or agreed to in writing, software
1977 * distributed under the License is distributed on an "AS IS" BASIS,
1978 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1979 * See the License for the specific language governing permissions and
1980 * limitations under the License.
1981 */class ko{constructor(e){this.xn=e}next(){return this.xn+=2,this.xn}static On(){return new ko(0)}static Nn(){return new ko(-1)}}/**
1982 * @license
1983 * Copyright 2017 Google LLC
1984 *
1985 * Licensed under the Apache License, Version 2.0 (the "License");
1986 * you may not use this file except in compliance with the License.
1987 * You may obtain a copy of the License at
1988 *
1989 *   http://www.apache.org/licenses/LICENSE-2.0
1990 *
1991 * Unless required by applicable law or agreed to in writing, software
1992 * distributed under the License is distributed on an "AS IS" BASIS,
1993 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1994 * See the License for the specific language governing permissions and
1995 * limitations under the License.
1996 */class e2{constructor(){this.changes=new $o(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,Ft.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const s=this.changes.get(n);return s!==void 0?q.resolve(s):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
1997 * @license
1998 * Copyright 2017 Google LLC
1999 *
2000 * Licensed under the Apache License, Version 2.0 (the "License");
2001 * you may not use this file except in compliance with the License.
2002 * You may obtain a copy of the License at
2003 *
2004 *   http://www.apache.org/licenses/LICENSE-2.0
2005 *
2006 * Unless required by applicable law or agreed to in writing, software
2007 * distributed under the License is distributed on an "AS IS" BASIS,
2008 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2009 * See the License for the specific language governing permissions and
2010 * limitations under the License.
2011 *//**
2012 * @license
2013 * Copyright 2022 Google LLC
2014 *
2015 * Licensed under the Apache License, Version 2.0 (the "License");
2016 * you may not use this file except in compliance with the License.
2017 * You may obtain a copy of the License at
2018 *
2019 *   http://www.apache.org/licenses/LICENSE-2.0
2020 *
2021 * Unless required by applicable law or agreed to in writing, software
2022 * distributed under the License is distributed on an "AS IS" BASIS,
2023 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2024 * See the License for the specific language governing permissions and
2025 * limitations under the License.
2026 */class t2{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/**
2027 * @license
2028 * Copyright 2017 Google LLC
2029 *
2030 * Licensed under the Apache License, Version 2.0 (the "License");
2031 * you may not use this file except in compliance with the License.
2032 * You may obtain a copy of the License at
2033 *
2034 *   http://www.apache.org/licenses/LICENSE-2.0
2035 *
2036 * Unless required by applicable law or agreed to in writing, software
2037 * distributed under the License is distributed on an "AS IS" BASIS,
2038 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2039 * See the License for the specific language governing permissions and
2040 * limitations under the License.
2041 */class n2{constructor(e,n,s,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=s,this.indexManager=i}getDocument(e,n){let s=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(s=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(s!==null&&Ua(s.mutation,i,Mn.empty(),wt.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(s=>this.getLocalViewOfDocuments(e,s,Ie()).next(()=>s))}getLocalViewOfDocuments(e,n,s=Ie()){const i=or();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,s).next(r=>{let o=fa();return r.forEach((a,c)=>{o=o.insert(a,c.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const s=or();return this.populateOverlays(e,s,n).next(()=>this.computeViews(e,n,s,Ie()))}populateOverlays(e,n,s){const i=[];return s.forEach(r=>{n.has(r)||i.push(r)}),this.documentOverlayCache.getOverlays(e,i).next(r=>{r.forEach((o,a)=>{n.set(o,a)})})}computeViews(e,n,s,i){let r=ci();const o=ka(),a=function(){return ka()}();return n.forEach((c,l)=>{const u=s.get(l.key);i.has(l.key)&&(u===void 0||u.mutation instanceof Ki)?r=r.insert(l.key,l):u!==void 0?(o.set(l.key,u.mutation.getFieldMask()),Ua(u.mutation,l,u.mutation.getFieldMask(),wt.now())):o.set(l.key,Mn.empty())}),this.recalculateAndSaveOverlays(e,r).next(c=>(c.forEach((l,u)=>o.set(l,u)),n.forEach((l,u)=>{var d;return a.set(l,new t2(u,(d=o.get(l))!==null&&d!==void 0?d:null))}),a))}recalculateAndSaveOverlays(e,n){const s=ka();let i=new tt((o,a)=>o-a),r=Ie();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const a of o)a.keys().forEach(c=>{const l=n.get(c);if(l===null)return;let u=s.get(c)||Mn.empty();u=a.applyToLocalView(l,u),s.set(c,u);const d=(i.get(a.batchId)||Ie()).add(c);i=i.insert(a.batchId,d)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const c=a.getNext(),l=c.key,u=c.value,d=xS();u.forEach(h=>{if(!r.has(h)){const f=BS(n.get(h),s.get(h));f!==null&&d.set(h,f),r=r.add(h)}}),o.push(this.documentOverlayCache.saveOverlays(e,l,d))}return q.waitFor(o)}).next(()=>s)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(s=>this.recalculateAndSaveOverlays(e,s))}getDocumentsMatchingQuery(e,n,s,i){return function(o){return oe.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):Wm(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,s,i):this.getDocumentsMatchingCollectionQuery(e,n,s,i)}getNextDocuments(e,n,s,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,s,i).next(r=>{const o=i-r.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,s.largestBatchId,i-r.size):q.resolve(or());let a=-1,c=r;return o.next(l=>q.forEach(l,(u,d)=>(a<d.largestBatchId&&(a=d.largestBatchId),r.get(u)?q.resolve():this.remoteDocumentCache.getEntry(e,u).next(h=>{c=c.insert(u,h)}))).next(()=>this.populateOverlays(e,l,r)).next(()=>this.computeViews(e,c,l,Ie())).next(u=>({batchId:a,changes:NS(u)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new oe(n)).next(s=>{let i=fa();
2041return s.isFoundDocument()&&(i=i.insert(s.key,s)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,s,i){const r=n.collectionGroup;let o=fa();return this.indexManager.getCollectionParents(e,r).next(a=>q.forEach(a,c=>{const l=function(d,h){return new Wi(h,null,d.explicitOrderBy.slice(),d.filters.slice(),d.limit,d.limitType,d.startAt,d.endAt)}(n,c.child(r));return this.getDocumentsMatchingCollectionQuery(e,l,s,i).next(u=>{u.forEach((d,h)=>{o=o.insert(d,h)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,s,i){let r;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,s.largestBatchId).next(o=>(r=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,s,r,i))).next(o=>{r.forEach((c,l)=>{const u=l.getKey();o.get(u)===null&&(o=o.insert(u,Ft.newInvalidDocument(u)))});let a=fa();return o.forEach((c,l)=>{const u=r.get(c);u!==void 0&&Ua(u.mutation,l,Mn.empty(),wt.now()),wd(n,l)&&(a=a.insert(c,l))}),a})}}/**
2042 * @license
2043 * Copyright 2020 Google LLC
2044 *
2045 * Licensed under the Apache License, Version 2.0 (the "License");
2046 * you may not use this file except in compliance with the License.
2047 * You may obtain a copy of the License at
2048 *
2049 *   http://www.apache.org/licenses/LICENSE-2.0
2050 *
2051 * Unless required by applicable law or agreed to in writing, software
2052 * distributed under the License is distributed on an "AS IS" BASIS,
2053 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2054 * See the License for the specific language governing permissions and
2055 * limitations under the License.
2056 */class s2{constructor(e){this.serializer=e,this.ur=new Map,this.cr=new Map}getBundleMetadata(e,n){return q.resolve(this.ur.get(n))}saveBundleMetadata(e,n){return this.ur.set(n.id,function(i){return{id:i.id,version:i.version,createTime:Us(i.createTime)}}(n)),q.resolve()}getNamedQuery(e,n){return q.resolve(this.cr.get(n))}saveNamedQuery(e,n){return this.cr.set(n.name,function(i){return{name:i.name,query:QV(i.bundledQuery),readTime:Us(i.readTime)}}(n)),q.resolve()}}/**
2057 * @license
2058 * Copyright 2022 Google LLC
2059 *
2060 * Licensed under the Apache License, Version 2.0 (the "License");
2061 * you may not use this file except in compliance with the License.
2062 * You may obtain a copy of the License at
2063 *
2064 *   http://www.apache.org/licenses/LICENSE-2.0
2065 *
2066 * Unless required by applicable law or agreed to in writing, software
2067 * distributed under the License is distributed on an "AS IS" BASIS,
2068 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2069 * See the License for the specific language governing permissions and
2070 * limitations under the License.
2071 */class i2{constructor(){this.overlays=new tt(oe.comparator),this.lr=new Map}getOverlay(e,n){return q.resolve(this.overlays.get(n))}getOverlays(e,n){const s=or();return q.forEach(n,i=>this.getOverlay(e,i).next(r=>{r!==null&&s.set(i,r)})).next(()=>s)}saveOverlays(e,n,s){return s.forEach((i,r)=>{this.lt(e,n,r)}),q.resolve()}removeOverlaysForBatchId(e,n,s){const i=this.lr.get(s);return i!==void 0&&(i.forEach(r=>this.overlays=this.overlays.remove(r)),this.lr.delete(s)),q.resolve()}getOverlaysForCollection(e,n,s){const i=or(),r=n.length+1,o=new oe(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const c=a.getNext().value,l=c.getKey();if(!n.isPrefixOf(l.path))break;l.path.length===r&&c.largestBatchId>s&&i.set(c.getKey(),c)}return q.resolve(i)}getOverlaysForCollectionGroup(e,n,s,i){let r=new tt((l,u)=>l-u);const o=this.overlays.getIterator();for(;o.hasNext();){const l=o.getNext().value;if(l.getKey().getCollectionGroup()===n&&l.largestBatchId>s){let u=r.get(l.largestBatchId);u===null&&(u=or(),r=r.insert(l.largestBatchId,u)),u.set(l.getKey(),l)}}const a=or(),c=r.getIterator();for(;c.hasNext()&&(c.getNext().value.forEach((l,u)=>a.set(l,u)),!(a.size()>=i)););return q.resolve(a)}lt(e,n,s){const i=this.overlays.get(s.key);if(i!==null){const o=this.lr.get(i.largestBatchId).delete(s.key);this.lr.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(s.key,new AV(n,s));let r=this.lr.get(n);r===void 0&&(r=Ie(),this.lr.set(n,r)),this.lr.set(n,r.add(s.key))}}/**
2072 * @license
2073 * Copyright 2017 Google LLC
2074 *
2075 * Licensed under the Apache License, Version 2.0 (the "License");
2076 * you may not use this file except in compliance with the License.
2077 * You may obtain a copy of the License at
2078 *
2079 *   http://www.apache.org/licenses/LICENSE-2.0
2080 *
2081 * Unless required by applicable law or agreed to in writing, software
2082 * distributed under the License is distributed on an "AS IS" BASIS,
2083 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2084 * See the License for the specific language governing permissions and
2085 * limitations under the License.
2086 */class Qm{constructor(){this.hr=new Nt(Tt.Pr),this.Ir=new Nt(Tt.Tr)}isEmpty(){return this.hr.isEmpty()}addReference(e,n){const s=new Tt(e,n);this.hr=this.hr.add(s),this.Ir=this.Ir.add(s)}Er(e,n){e.forEach(s=>this.addReference(s,n))}removeReference(e,n){this.dr(new Tt(e,n))}Ar(e,n){e.forEach(s=>this.removeReference(s,n))}Rr(e){const n=new oe(new $e([])),s=new Tt(n,e),i=new Tt(n,e+1),r=[];return this.Ir.forEachInRange([s,i],o=>{this.dr(o),r.push(o.key)}),r}Vr(){this.hr.forEach(e=>this.dr(e))}dr(e){this.hr=this.hr.delete(e),this.Ir=this.Ir.delete(e)}mr(e){const n=new oe(new $e([])),s=new Tt(n,e),i=new Tt(n,e+1);let r=Ie();return this.Ir.forEachInRange([s,i],o=>{r=r.add(o.key)}),r}containsKey(e){const n=new Tt(e,0),s=this.hr.firstAfterOrEqual(n);return s!==null&&e.isEqual(s.key)}}class Tt{constructor(e,n){this.key=e,this.gr=n}static Pr(e,n){return oe.comparator(e.key,n.key)||Pe(e.gr,n.gr)}static Tr(e,n){return Pe(e.gr,n.gr)||oe.comparator(e.key,n.key)}}/**
2087 * @license
2088 * Copyright 2017 Google LLC
2089 *
2090 * Licensed under the Apache License, Version 2.0 (the "License");
2091 * you may not use this file except in compliance with the License.
2092 * You may obtain a copy of the License at
2093 *
2094 *   http://www.apache.org/licenses/LICENSE-2.0
2095 *
2096 * Unless required by applicable law or agreed to in writing, software
2097 * distributed under the License is distributed on an "AS IS" BASIS,
2098 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2099 * See the License for the specific language governing permissions and
2100 * limitations under the License.
2101 */class r2{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.pr=1,this.yr=new Nt(Tt.Pr)}checkEmpty(e){return q.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,s,i){const r=this.pr;this.pr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new DV(r,n,s,i);this.mutationQueue.push(o);for(const a of i)this.yr=this.yr.add(new Tt(a.key,r)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return q.resolve(o)}lookupMutationBatch(e,n){return q.resolve(this.wr(n))}getNextMutationBatchAfterBatchId(e,n){const s=n+1,i=this.Sr(s),r=i<0?0:i;return q.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return q.resolve(this.mutationQueue.length===0?-1:this.pr-1)}getAllMutationBatches(e){return q.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const s=new Tt(n,0),i=new Tt(n,Number.POSITIVE_INFINITY),r=[];return this.yr.forEachInRange([s,i],o=>{const a=this.wr(o.gr);r.push(a)}),q.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(e,n){let s=new Nt(Pe);return n.forEach(i=>{const r=new Tt(i,0),o=new Tt(i,Number.POSITIVE_INFINITY);this.yr.forEachInRange([r,o],a=>{s=s.add(a.gr)})}),q.resolve(this.br(s))}getAllMutationBatchesAffectingQuery(e,n){const s=n.path,i=s.length+1;let r=s;oe.isDocumentKey(r)||(r=r.child(""));const o=new Tt(new oe(r),0);let a=new Nt(Pe);return this.yr.forEachWhile(c=>{const l=c.key.path;return!!s.isPrefixOf(l)&&(l.length===i&&(a=a.add(c.gr)),!0)},o),q.resolve(this.br(a))}br(e){const n=[];return e.forEach(s=>{const i=this.wr(s);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){He(this.Dr(n.batchId,"removed")===0),this.mutationQueue.shift();let s=this.yr;return q.forEach(n.mutations,i=>{const r=new Tt(i.key,n.batchId);return s=s.delete(r),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.yr=s})}Fn(e){}containsKey(e,n){const s=new Tt(n,0),i=this.yr.firstAfterOrEqual(s);return q.resolve(n.isEqual(i&&i.key))}
2101performConsistencyCheck(e){return this.mutationQueue.length,q.resolve()}Dr(e,n){return this.Sr(e)}Sr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}wr(e){const n=this.Sr(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/**
2102 * @license
2103 * Copyright 2017 Google LLC
2104 *
2105 * Licensed under the Apache License, Version 2.0 (the "License");
2106 * you may not use this file except in compliance with the License.
2107 * You may obtain a copy of the License at
2108 *
2109 *   http://www.apache.org/licenses/LICENSE-2.0
2110 *
2111 * Unless required by applicable law or agreed to in writing, software
2112 * distributed under the License is distributed on an "AS IS" BASIS,
2113 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2114 * See the License for the specific language governing permissions and
2115 * limitations under the License.
2116 */class o2{constructor(e){this.Cr=e,this.docs=function(){return new tt(oe.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const s=n.key,i=this.docs.get(s),r=i?i.size:0,o=this.Cr(n);return this.docs=this.docs.insert(s,{document:n.mutableCopy(),size:o}),this.size+=o-r,this.indexManager.addToCollectionParentIndex(e,s.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const s=this.docs.get(n);return q.resolve(s?s.document.mutableCopy():Ft.newInvalidDocument(n))}getEntries(e,n){let s=ci();return n.forEach(i=>{const r=this.docs.get(i);s=s.insert(i,r?r.document.mutableCopy():Ft.newInvalidDocument(i))}),q.resolve(s)}getDocumentsMatchingQuery(e,n,s,i){let r=ci();const o=n.path,a=new oe(o.child("")),c=this.docs.getIteratorFrom(a);for(;c.hasNext();){const{key:l,value:{document:u}}=c.getNext();if(!o.isPrefixOf(l.path))break;l.path.length>o.length+1||HF($F(u),s)<=0||(i.has(u.key)||wd(n,u))&&(r=r.insert(u.key,u.mutableCopy()))}return q.resolve(r)}getAllFromCollectionGroup(e,n,s,i){fe()}vr(e,n){return q.forEach(this.docs,s=>n(s))}newChangeBuffer(e){return new a2(this)}getSize(e){return q.resolve(this.size)}}class a2 extends e2{constructor(e){super(),this._r=e}applyChanges(e){const n=[];
2116return this.changes.forEach((s,i)=>{i.isValidDocument()?n.push(this._r.addEntry(e,i)):this._r.removeEntry(s)}),q.waitFor(n)}getFromCache(e,n){return this._r.getEntry(e,n)}getAllFromCache(e,n){return this._r.getEntries(e,n)}}/**
2117 * @license
2118 * Copyright 2017 Google LLC
2119 *
2120 * Licensed under the Apache License, Version 2.0 (the "License");
2121 * you may not use this file except in compliance with the License.
2122 * You may obtain a copy of the License at
2123 *
2124 *   http://www.apache.org/licenses/LICENSE-2.0
2125 *
2126 * Unless required by applicable law or agreed to in writing, software
2127 * distributed under the License is distributed on an "AS IS" BASIS,
2128 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2129 * See the License for the specific language governing permissions and
2130 * limitations under the License.
2131 */class c2{constructor(e){this.persistence=e,this.Fr=new $o(n=>$m(n),Hm),this.lastRemoteSnapshotVersion=me.min(),this.highestTargetId=0,this.Mr=0,this.Or=new Qm,this.targetCount=0,this.Nr=ko.On()}forEachTarget(e,n){return this.Fr.forEach((s,i)=>n(i)),q.resolve()}getLastRemoteSnapshotVersion(e){return q.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return q.resolve(this.Mr)}allocateTargetId(e){return this.highestTargetId=this.Nr.next(),q.resolve(this.highestTargetId)}setTargetsMetadata(e,n,s){return s&&(this.lastRemoteSnapshotVersion=s),n>this.Mr&&(this.Mr=n),q.resolve()}kn(e){this.Fr.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.Nr=new ko(n),this.highestTargetId=n),e.sequenceNumber>this.Mr&&(this.Mr=e.sequenceNumber)}addTargetData(e,n){return this.kn(n),this.targetCount+=1,q.resolve()}updateTargetData(e,n){return this.kn(n),q.resolve()}removeTargetData(e,n){return this.Fr.delete(n.target),this.Or.Rr(n.targetId),this.targetCount-=1,q.resolve()}removeTargets(e,n,s){let i=0;const r=[];return this.Fr.forEach((o,a)=>{a.sequenceNumber<=n&&s.get(a.targetId)===null&&(this.Fr.delete(o),r.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),q.waitFor(r).next(()=>i)}getTargetCount(e){return q.resolve(this.targetCount)}getTargetData(e,n){const s=this.Fr.get(n)||null;return q.resolve(s)}addMatchingKeys(e,n,s){return this.Or.Er(n,s),q.resolve()}removeMatchingKeys(e,n,s){this.Or.Ar(n,s);const i=this.persistence.referenceDelegate,r=[];return i&&n.forEach(o=>{r.push(i.markPotentiallyOrphaned(e,o))}),q.waitFor(r)}removeMatchingKeysForTargetId(e,n){return this.Or.Rr(n),q.resolve()}getMatchingKeysForTargetId(e,n){const s=this.Or.mr(n);return q.resolve(s)}containsKey(e,n){return q.resolve(this.Or.containsKey(n))}}/**
2132 * @license
2133 * Copyright 2017 Google LLC
2134 *
2135 * Licensed under the Apache License, Version 2.0 (the "License");
2136 * you may not use this file except in compliance with the License.
2137 * You may obtain a copy of the License at
2138 *
2139 *   http://www.apache.org/licenses/LICENSE-2.0
2140 *
2141 * Unless required by applicable law or agreed to in writing, software
2142 * distributed under the License is distributed on an "AS IS" BASIS,
2143 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2144 * See the License for the specific language governing permissions and
2145 * limitations under the License.
2146 */class l2{constructor(e,n){this.Lr={},this.overlays={},this.Br=new Gm(0),this.kr=!1,this.kr=!0,this.referenceDelegate=e(this),this.qr=new c2(this),this.indexManager=new XV,this.remoteDocumentCache=function(i){return new o2(i)}(s=>this.referenceDelegate.Qr(s)),this.serializer=new YV(n),this.Kr=new s2(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.kr=!1,Promise.resolve()}get started(){return this.kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new i2,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let s=this.Lr[e.toKey()];return s||(s=new r2(n,this.referenceDelegate),this.Lr[e.toKey()]=s),s}getTargetCache(){return this.qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Kr}runTransaction(e,n,s){te("MemoryPersistence","Starting transaction:",e);const i=new u2(this.Br.next());return this.referenceDelegate.$r(),s(i).next(r=>this.referenceDelegate.Ur(i).next(()=>r)).toPromise().then(r=>(i.raiseOnCommittedEvent(),r))}Wr(e,n){return q.or(Object.values(this.Lr).map(s=>()=>s.containsKey(e,n)))}}class u2 extends KF{constructor(e){super(),this.currentSequenceNumber=e}}class Xm{constructor(e){this.persistence=e,this.Gr=new Qm,this.zr=null}static jr(e){return new Xm(e)}get Hr(){if(this.zr)return this.zr;throw fe()}addReference(e,n,s){return this.Gr.addReference(s,n),this.Hr.delete(s.toString()),q.resolve()}removeReference(e,n,s){return this.Gr.removeReference(s,n),this.Hr.add(s.toString()),q.resolve()}markPotentiallyOrphaned(e,n){return this.Hr.add(n.toString()),q.resolve()}
2146removeTarget(e,n){this.Gr.Rr(n.targetId).forEach(i=>this.Hr.add(i.toString()));const s=this.persistence.getTargetCache();return s.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(r=>this.Hr.add(r.toString()))}).next(()=>s.removeTargetData(e,n))}$r(){this.zr=new Set}Ur(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return q.forEach(this.Hr,s=>{const i=oe.fromPath(s);return this.Jr(e,i).next(r=>{r||n.removeEntry(i,me.min())})}).next(()=>(this.zr=null,n.apply(e)))}updateLimboDocument(e,n){return this.Jr(e,n).next(s=>{s?this.Hr.delete(n.toString()):this.Hr.add(n.toString())})}Qr(e){return 0}Jr(e,n){return q.or([()=>q.resolve(this.Gr.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Wr(e,n)])}}/**
2147 * @license
2148 * Copyright 2017 Google LLC
2149 *
2150 * Licensed under the Apache License, Version 2.0 (the "License");
2151 * you may not use this file except in compliance with the License.
2152 * You may obtain a copy of the License at
2153 *
2154 *   http://www.apache.org/licenses/LICENSE-2.0
2155 *
2156 * Unless required by applicable law or agreed to in writing, software
2157 * distributed under the License is distributed on an "AS IS" BASIS,
2158 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2159 * See the License for the specific language governing permissions and
2160 * limitations under the License.
2161 */class Zm{constructor(e,n,s,i){this.targetId=e,this.fromCache=n,this.ki=s,this.qi=i}static Qi(e,n){let s=Ie(),i=Ie();for(const r of n.docChanges)switch(r.type){case 0:s=s.add(r.doc.key);break;case 1:i=i.add(r.doc.key)}return new Zm(e,n.fromCache,s,i)}}/**
2162 * @license
2163 * Copyright 2023 Google LLC
2164 *
2165 * Licensed under the Apache License, Version 2.0 (the "License");
2166 * you may not use this file except in compliance with the License.
2167 * You may obtain a copy of the License at
2168 *
2169 *   http://www.apache.org/licenses/LICENSE-2.0
2170 *
2171 * Unless required by applicable law or agreed to in writing, software
2172 * distributed under the License is distributed on an "AS IS" BASIS,
2173 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2174 * See the License for the specific language governing permissions and
2175 * limitations under the License.
2176 */class d2{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/**
2177 * @license
2178 * Copyright 2019 Google LLC
2179 *
2180 * Licensed under the Apache License, Version 2.0 (the "License");
2181 * you may not use this file except in compliance with the License.
2182 * You may obtain a copy of the License at
2183 *
2184 *   http://www.apache.org/licenses/LICENSE-2.0
2185 *
2186 * Unless required by applicable law or agreed to in writing, software
2187 * distributed under the License is distributed on an "AS IS" BASIS,
2188 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2189 * See the License for the specific language governing permissions and
2190 * limitations under the License.
2191 */class h2{constructor(){this.Ki=!1,this.$i=!1,this.Ui=100,this.Wi=function(){return tx()?8:zF(xt())>0?6:4}()}initialize(e,n){this.Gi=e,this.indexManager=n,this.Ki=!0}getDocumentsMatchingQuery(e,n,s,i){const r={result:null};return this.zi(e,n).next(o=>{r.result=o}).next(()=>{if(!r.result)return this.ji(e,n,i,s).next(o=>{r.result=o})}).next(()=>{if(r.result)return;const o=new d2;return this.Hi(e,n,o).next(a=>{if(r.result=a,this.$i)return this.Ji(e,n,o,a.size)})}).next(()=>r.result)}Ji(e,n,s,i){return s.documentReadCount<this.Ui?(sa()<=we.DEBUG&&te("QueryEngine","SDK will not create cache indexes for query:",Qr(n),"since it only creates cache indexes for collection contains","more than or equal to",this.Ui,"documents"),q.resolve()):(sa()<=we.DEBUG&&te("QueryEngine","Query:",Qr(n),"scans",s.documentReadCount,"local documents and returns",i,"documents as results."),s.documentReadCount>this.Wi*i?(sa()<=we.DEBUG&&te("QueryEngine","The SDK decides to create cache indexes for query:",Qr(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,ks(n))):q.resolve())}zi(e,n){if(xI(n))return q.resolve(null);let s=ks(n);return this.indexManager.getIndexType(e,s).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=lu(n,null,"F"),s=ks(n)),this.indexManager.getDocumentsMatchingTarget(e,s).next(r=>{const o=Ie(...r);return this.Gi.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,s).next(c=>{const l=this.Yi(n,a);return this.Zi(n,l,o,c.readTime)?this.zi(e,lu(n,null,"F")):this.Xi(e,l,n,c)}))})))}ji(e,n,s,i){return xI(n)||i.isEqual(me.min())?q.resolve(null):this.Gi.getDocuments(e,s).next(r=>{const o=this.Yi(n,r);return this.Zi(n,o,s,i)?q.resolve(null):(sa()<=we.DEBUG&&te("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Qr
2191(n)),this.Xi(e,o,n,jF(i,-1)).next(a=>a))})}Yi(e,n){let s=new Nt(kS(e));return n.forEach((i,r)=>{wd(e,r)&&(s=s.add(r))}),s}Zi(e,n,s,i){if(e.limit===null)return!1;if(s.size!==n.size)return!0;const r=e.limitType==="F"?n.last():n.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(i)>0)}Hi(e,n,s){return sa()<=we.DEBUG&&te("QueryEngine","Using full collection scan to execute query:",Qr(n)),this.Gi.getDocumentsMatchingQuery(e,n,Fi.min(),s)}Xi(e,n,s,i){return this.Gi.getDocumentsMatchingQuery(e,s,i).next(r=>(n.forEach(o=>{r=r.insert(o.key,o)}),r))}}/**
2192 * @license
2193 * Copyright 2020 Google LLC
2194 *
2195 * Licensed under the Apache License, Version 2.0 (the "License");
2196 * you may not use this file except in compliance with the License.
2197 * You may obtain a copy of the License at
2198 *
2199 *   http://www.apache.org/licenses/LICENSE-2.0
2200 *
2201 * Unless required by applicable law or agreed to in writing, software
2202 * distributed under the License is distributed on an "AS IS" BASIS,
2203 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2204 * See the License for the specific language governing permissions and
2205 * limitations under the License.
2206 */class f2{constructor(e,n,s,i){this.persistence=e,this.es=n,this.serializer=i,this.ts=new tt(Pe),this.ns=new $o(r=>$m(r),Hm),this.rs=new Map,this.ss=e.getRemoteDocumentCache(),this.qr=e.getTargetCache(),this.Kr=e.getBundleCache(),this.os(s)}os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new n2(this.ss,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ss.setIndexManager(this.indexManager),this.es.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.ts))}}function p2(t,e,n,s){return new f2(t,e,n,s)}async function e0(t,e){const n=ge(t);return await n.persistence.runTransaction("Handle user change","readonly",s=>{let i;
2206return n.mutationQueue.getAllMutationBatches(s).next(r=>(i=r,n.os(e),n.mutationQueue.getAllMutationBatches(s))).next(r=>{const o=[],a=[];let c=Ie();for(const l of i){o.push(l.batchId);for(const u of l.mutations)c=c.add(u.key)}for(const l of r){a.push(l.batchId);for(const u of l.mutations)c=c.add(u.key)}return n.localDocuments.getDocuments(s,c).next(l=>({_s:l,removedBatchIds:o,addedBatchIds:a}))})})}function m2(t,e){const n=ge(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",s=>{const i=e.batch.keys(),r=n.ss.newChangeBuffer({trackRemovals:!0});return function(a,c,l,u){const d=l.batch,h=d.keys();let f=q.resolve();return h.forEach(m=>{f=f.next(()=>u.getEntry(c,m)).next(v=>{const b=l.docVersions.get(m);He(b!==null),v.version.compareTo(b)<0&&(d.applyToRemoteDocument(v,l),v.isValidDocument()&&(v.setReadTime(l.commitVersion),u.addEntry(v)))})}),f.next(()=>a.mutationQueue.removeMutationBatch(c,d))}(n,s,e,r).next(()=>r.apply(s)).next(()=>n.mutationQueue.performConsistencyCheck(s)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(s,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(s,function(a){let c=Ie();for(let l=0;l<a.mutationResults.length;++l)a.mutationResults[l].transformResults.length>0&&(c=c.add(a.batch.mutations[l].key));return c}(e))).next(()=>n.localDocuments.getDocuments(s,i))})}function t0(t){const e=ge(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.qr.getLastRemoteSnapshotVersion(n))}function g2(t,e){const n=ge(t),s=e.snapshotVersion;let i=n.ts;return n.persistence.runTransaction("Apply remote event","readwrite-primary",r=>{const o=n.ss.newChangeBuffer({trackRemovals:!0});i=n.ts;const a=[];
2206e.targetChanges.forEach((u,d)=>{const h=i.get(d);if(!h)return;a.push(n.qr.removeMatchingKeys(r,u.removedDocuments,d).next(()=>n.qr.addMatchingKeys(r,u.addedDocuments,d)));let f=h.withSequenceNumber(r.currentSequenceNumber);e.targetMismatches.get(d)!==null?f=f.withResumeToken(Ht.EMPTY_BYTE_STRING,me.min()).withLastLimboFreeSnapshotVersion(me.min()):u.resumeToken.approximateByteSize()>0&&(f=f.withResumeToken(u.resumeToken,s)),i=i.insert(d,f),function(v,b,D){return v.resumeToken.approximateByteSize()===0||b.snapshotVersion.toMicroseconds()-v.snapshotVersion.toMicroseconds()>=3e8?!0:D.addedDocuments.size+D.modifiedDocuments.size+D.removedDocuments.size>0}(h,f,u)&&a.push(n.qr.updateTargetData(r,f))});let c=ci(),l=Ie();if(e.documentUpdates.forEach(u=>{e.resolvedLimboDocuments.has(u)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(r,u))}),a.push(y2(r,o,e.documentUpdates).next(u=>{c=u.us,l=u.cs})),!s.isEqual(me.min())){const u=n.qr.getLastRemoteSnapshotVersion(r).next(d=>n.qr.setTargetsMetadata(r,r.currentSequenceNumber,s));a.push(u)}return q.waitFor(a).next(()=>o.apply(r)).next(()=>n.localDocuments.getLocalViewOfDocuments(r,c,l)).next(()=>c)}).then(r=>(n.ts=i,r))}function y2(t,e,n){let s=Ie(),i=Ie();return n.forEach(r=>s=s.add(r)),e.getEntries(t,s).next(r=>{let o=ci();return n.forEach((a,c)=>{const l=r.get(a);c.isFoundDocument()!==l.isFoundDocument()&&(i=i.add(a)),c.isNoDocument()&&c.version.isEqual(me.min())?(e.removeEntry(a,c.readTime),o=o.insert(a,c)):!l.isValidDocument()||c.version.compareTo(l.version)>0||c.version.compareTo(l.version)===0&&l.hasPendingWrites?(e.addEntry(c),o=o.insert(a,c)):te("LocalStore","Ignoring outdated watch update for ",a,". Current version:",l.version," Watch version:",c.version)}),{us:o,cs:i}})}function _2(t,e){const n=ge(t);return n.persistence.runTransaction("Get next mutation batch","readonly",s=>(e===void 0&&(e=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(s,e)))}function I2(t,e){const n=ge(t);return n.persistence.runTransaction("Allocate target","readwrite",s=>{let i;return n.qr.getTargetData(s,e).next(r=>r?(i=r,q.resolve(i)):n.qr.allocateTargetId(s).next(o=>(i=new Ri(e,o,"TargetPurposeListen",s.currentSequenceNumber),n.qr.addTargetData(s,i).next(()=>i))))}).then(s=>{const i=n.ts.get(s.targetId);return(i===null||s.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.ts=n.ts.insert(s.targetId,s),n.ns.set(e,s.targetId)),s})}async function fp(t,e,n){const s=ge(t),i=s.ts.get(e),r=n?"readwrite":"readwrite-primary";try{n||await s.persistence.runTransaction("Release target",r,o=>s.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!Oc(o))throw o;te("LocalStore",`Failed to update sequence numbers for target ${e}: ${o}`)}s.ts=s.ts.remove(e),s.ns.delete(i.target)}function HI(t,e,n){const s=ge(t);let i=me.min(),r=Ie();return s.persistence.runTransaction("Execute query","readwrite",o=>function(c,l,u){const d=ge(c),h=d.ns.get(u);return h!==void 0?q.resolve(d.ts.get(h)):d.qr.getTargetData(l,u)}(s,o,ks(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,s.qr.getMatchingKeysForTargetId(o,a.targetId).next(c=>{r=c})}).next(()=>s.es.getDocumentsMatchingQuery(o,e,n?i:me.min(),n?r:Ie())).next(a=>(w2(s,dV(e),a),{documents:a,ls:r})))}function w2(t,e,n){let s=t.rs.get(e)||me.min();n.forEach((i,r)=>{r.readTime.compareTo(s)>0&&(s=r.readTime)}),t.rs.set(e,s)}class WI{constructor(){this.activeTargetIds=yV()}ds(e){this.activeTargetIds=this.activeTargetIds.add(e)}As(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Es(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class v2{constructor(){this.eo=new WI,this.no={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,s){}addLocalQueryTarget(e){return this.eo.ds(e),this.no[e]||"not-current"}updateQueryState(e,n,s){this.no[e]=n}removeLocalQueryTarget(e){this.eo.As(e)}isLocalQueryTarget(e){return this.eo.activeTargetIds.has(e)}clearQueryState(e){delete this.no[e]}getAllActiveQueryTargets(){return this.eo.activeTargetIds}isActiveQueryTarget(e){return this.eo.activeTargetIds.has(e)}start(){return this.eo=new WI,Promise.resolve()}handleUserChange(e,n,s){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
2207 * @license
2208 * Copyright 2019 Google LLC
2209 *
2210 * Licensed under the Apache License, Version 2.0 (the "License");
2211 * you may not use this file except in compliance with the License.
2212 * You may obtain a copy of the License at
2213 *
2214 *   http://www.apache.org/licenses/LICENSE-2.0
2215 *
2216 * Unless required by applicable law or agreed to in writing, software
2217 * distributed under the License is distributed on an "AS IS" BASIS,
2218 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2219 * See the License for the specific language governing permissions and
2220 * limitations under the License.
2221 */class T2{ro(e){}shutdown(){}}/**
2222 * @license
2223 * Copyright 2019 Google LLC
2224 *
2225 * Licensed under the Apache License, Version 2.0 (the "License");
2226 * you may not use this file except in compliance with the License.
2227 * You may obtain a copy of the License at
2228 *
2229 *   http://www.apache.org/licenses/LICENSE-2.0
2230 *
2231 * Unless required by applicable law or agreed to in writing, software
2232 * distributed under the License is distributed on an "AS IS" BASIS,
2233 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2234 * See the License for the specific language governing permissions and
2235 * limitations under the License.
2236 */class KI{constructor(){this.io=()=>this.so(),this.oo=()=>this._o(),this.ao=[],this.uo()}ro(e){this.ao.push(e)}shutdown(){window.removeEventListener("online",this.io),window.removeEventListener("offline",this.oo)}uo(){window.addEventListener("online",this.io),window.addEventListener("offline",this.oo)}so(){te("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.ao)e(0)}_o(){te("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.ao)e(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
2237 * @license
2238 * Copyright 2023 Google LLC
2239 *
2240 * Licensed under the Apache License, Version 2.0 (the "License");
2241 * you may not use this file except in compliance with the License.
2242 * You may obtain a copy of the License at
2243 *
2244 *   http://www.apache.org/licenses/LICENSE-2.0
2245 *
2246 * Unless required by applicable law or agreed to in writing, software
2247 * distributed under the License is distributed on an "AS IS" BASIS,
2248 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2249 * See the License for the specific language governing permissions and
2250 * limitations under the License.
2251 */let fl=null;function $h(){return fl===null?fl=function(){return 268435456+Math.round(2147483648*Math.random())}():fl++,"0x"+fl.toString(16)}/**
2252 * @license
2253 * Copyright 2020 Google LLC
2254 *
2255 * Licensed under the Apache License, Version 2.0 (the "License");
2256 * you may not use this file except in compliance with the License.
2257 * You may obtain a copy of the License at
2258 *
2259 *   http://www.apache.org/licenses/LICENSE-2.0
2260 *
2261 * Unless required by applicable law or agreed to in writing, software
2262 * distributed under the License is distributed on an "AS IS" BASIS,
2263 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2264 * See the License for the specific language governing permissions and
2265 * limitations under the License.
2266 */const b2={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/**
2267 * @license
2268 * Copyright 2017 Google LLC
2269 *
2270 * Licensed under the Apache License, Version 2.0 (the "License");
2271 * you may not use this file except in compliance with the License.
2272 * You may obtain a copy of the License at
2273 *
2274 *   http://www.apache.org/licenses/LICENSE-2.0
2275 *
2276 * Unless required by applicable law or agreed to in writing, software
2277 * distributed under the License is distributed on an "AS IS" BASIS,
2278 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2279 * See the License for the specific language governing permissions and
2280 * limitations under the License.
2281 */class E2{constructor(e){this.co=e.co,this.lo=e.lo}ho(e){this.Po=e}Io(e){this.To=e}Eo(e){this.Ao=e}onMessage(e){this.Ro=e}close(){this.lo()}send(e){this.co(e)}Vo(){this.Po()}mo(){this.To()}fo(e){this.Ao(e)}po(e){this.Ro(e)}}/**
2282 * @license
2283 * Copyright 2017 Google LLC
2284 *
2285 * Licensed under the Apache License, Version 2.0 (the "License");
2286 * you may not use this file except in compliance with the License.
2287 * You may obtain a copy of the License at
2288 *
2289 *   http://www.apache.org/licenses/LICENSE-2.0
2290 *
2291 * Unless required by applicable law or agreed to in writing, software
2292 * distributed under the License is distributed on an "AS IS" BASIS,
2293 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2294 * See the License for the specific language governing permissions and
2295 * limitations under the License.
2296 */const Mt="WebChannelConnection";class S2 extends class{constructor(n){this.databaseInfo=n,this.databaseId=n.databaseId;const s=n.ssl?"https":"http",i=encodeURIComponent(this.databaseId.projectId),r=encodeURIComponent(this.databaseId.database);this.yo=s+"://"+n.host,this.wo=`projects/${i}/databases/${r}`,this.So=this.databaseId.database==="(default)"?`project_id=${i}`:`project_id=${i}&database_id=${r}`}get bo(){return!1}Do(n,s,i,r,o){const a=$h(),c=this.Co(n,s.toUriEncodedString());te("RestConnection",`Sending RPC '${n}' ${a}:`,c,i);const l={"google-cloud-resource-prefix":this.wo,"x-goog-request-params":this.So};return this.vo(l,r,o),this.Fo(n,c,l,i).then(u=>(te("RestConnection",`Received RPC '${n}' ${a}: `,u),u),u=>{throw Do("RestConnection",`RPC '${n}' ${a} failed with error: `,u,"url: ",c,"request:",i),u})}Mo(n,s,i,r,o,a){return this.Do(n,s,i,r,o)}vo(n,s,i){n["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+jo}(),n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),s&&s.headers.forEach((r,o)=>n[o]=r),i&&i.headers.forEach((r,o)=>n[o]=r)}Co(n,s){const i=b2[n];return`${this.yo}/v1/${s}:${i}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Fo(e,n,s,i){const r=$h();return new Promise((o,a)=>{const c=new UF;c.setWithCredentials(!0),c.listenOnce(PF.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case Bh.NO_ERROR:const u=c.getResponseJson();te(Mt,`XHR for RPC '${e}' ${r} received:`,JSON.stringify(u)),o(u);break;case Bh.TIMEOUT:te(Mt,`RPC '${e}' ${r} timed out`),a(new $(R.DEADLINE_EXCEEDED,"Request time out"));break;case Bh.HTTP_ERROR:const d=c.getStatus();if(te(Mt,`RPC '${e}' ${r} failed with status:`,d,"response text:",c.getResponseText()),d>0){let h=c.getResponseJson();Array.isArray(h)&&(h=h[0]);const f=h==null?void 0:h.error;if(f&&f.status&&f.message){const m=function(b){const D=b.toLowerCase().replace(/_/g,"-");return Object.values(R).indexOf(D)>=0?D:R.UNKNOWN}(f.status);a(new $(m,f.message))}else a(new $(R.UNKNOWN,"Server responded with status "+c.getStatus()))}else a(new $(R.UNAVAILABLE,"Connection failed."));break;default:fe()}}finally{te(Mt,`RPC '${e}' ${r} completed.`)}});const l=JSON.stringify(i);te(Mt,`RPC '${e}' ${r} sending request:`,i),c.send(n,"POST",l,s,15)})}xo(e,n,s){const i=$h(),r=[this.yo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=AF(),a=CF(),c={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(c.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(c.xmlHttpFactory=new kF({})),this.vo(c.initMessageHeaders,n,s),c.encodeInitMessageHeaders=!0;const u=r.join("");te(Mt,`Creating RPC '${e}' stream ${i}: ${u}`,c);const d=o.createWebChannel(u,c);let h=!1,f=!1;const m=new E2({co:b=>{f?te(Mt,`Not sending because RPC '${e}' stream ${i} is closed:`,b):(h||(te(Mt,`Opening RPC '${e}' stream ${i} transport.`),d.open(),h=!0),te(Mt,`RPC '${e}' stream ${i} sending:`,b),d.send(b))},lo:()=>d.close()}),v=(b,D,w)=>{b.listen(D,y=>{try{w(y)}catch(_){setTimeout(()=>{throw _},0)}})};return v(d,ul.EventType.OPEN,()=>{f||(te(Mt,`RPC '${e}' stream ${i} transport opened.`),m.Vo())}),v(d,ul.EventType.CLOSE,()=>{f||(f=!0,te(Mt,`RPC '${e}' stream ${i} transport closed`),m.fo())}
2296),v(d,ul.EventType.ERROR,b=>{f||(f=!0,Do(Mt,`RPC '${e}' stream ${i} transport errored:`,b),m.fo(new $(R.UNAVAILABLE,"The operation could not be completed")))}),v(d,ul.EventType.MESSAGE,b=>{var D;if(!f){const w=b.data[0];He(!!w);const y=w,_=y.error||((D=y[0])===null||D===void 0?void 0:D.error);if(_){te(Mt,`RPC '${e}' stream ${i} received error:`,_);const S=_.status;let P=function(C){const N=lt[C];if(N!==void 0)return $S(N)}(S),x=_.message;P===void 0&&(P=R.INTERNAL,x="Unknown error status: "+S+" with message "+_.message),f=!0,m.fo(new $(P,x)),d.close()}else te(Mt,`RPC '${e}' stream ${i} received:`,w),m.po(w)}}),v(a,RF.STAT_EVENT,b=>{b.stat===EI.PROXY?te(Mt,`RPC '${e}' stream ${i} detected buffering proxy`):b.stat===EI.NOPROXY&&te(Mt,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{m.mo()},0),m}}function Hh(){return typeof document<"u"?document:null}/**
2297 * @license
2298 * Copyright 2020 Google LLC
2299 *
2300 * Licensed under the Apache License, Version 2.0 (the "License");
2301 * you may not use this file except in compliance with the License.
2302 * You may obtain a copy of the License at
2303 *
2304 *   http://www.apache.org/licenses/LICENSE-2.0
2305 *
2306 * Unless required by applicable law or agreed to in writing, software
2307 * distributed under the License is distributed on an "AS IS" BASIS,
2308 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2309 * See the License for the specific language governing permissions and
2310 * limitations under the License.
2311 */function Ed(t){return new OV(t,!0)}/**
2312 * @license
2313 * Copyright 2017 Google LLC
2314 *
2315 * Licensed under the Apache License, Version 2.0 (the "License");
2316 * you may not use this file except in compliance with the License.
2317 * You may obtain a copy of the License at
2318 *
2319 *   http://www.apache.org/licenses/LICENSE-2.0
2320 *
2321 * Unless required by applicable law or agreed to in writing, software
2322 * distributed under the License is distributed on an "AS IS" BASIS,
2323 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2324 * See the License for the specific language governing permissions and
2325 * limitations under the License.
2326 */class n0{constructor(e,n,s=1e3,i=1.5,r=6e4){this.si=e,this.timerId=n,this.Oo=s,this.No=i,this.Lo=r,this.Bo=0,this.ko=null,this.qo=Date.now(),this.reset()}reset(){this.Bo=0}Qo(){this.Bo=this.Lo}Ko(e){this.cancel();const n=Math.floor(this.Bo+this.$o()),s=Math.max(0,Date.now()-this.qo),i=Math.max(0,n-s);i>0&&te("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.Bo} ms, delay with jitter: ${n} ms, last attempt: ${s} ms ago)`),this.ko=this.si.enqueueAfterDelay(this.timerId,i,()=>(this.qo=Date.now(),e())),this.Bo*=this.No,this.Bo<this.Oo&&(this.Bo=this.Oo),this.Bo>this.Lo&&(this.Bo=this.Lo)}Uo(){this.ko!==null&&(this.ko.skipDelay(),this.ko=null)}cancel(){this.ko!==null&&(this.ko.cancel(),this.ko=null)}$o(){return(Math.random()-.5)*this.Bo}}/**
2327 * @license
2328 * Copyright 2017 Google LLC
2329 *
2330 * Licensed under the Apache License, Version 2.0 (the "License");
2331 * you may not use this file except in compliance with the License.
2332 * You may obtain a copy of the License at
2333 *
2334 *   http://www.apache.org/licenses/LICENSE-2.0
2335 *
2336 * Unless required by applicable law or agreed to in writing, software
2337 * distributed under the License is distributed on an "AS IS" BASIS,
2338 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2339 * See the License for the specific language governing permissions and
2340 * limitations under the License.
2341 */class s0{constructor(e,n,s,i,r,o,a,c){this.si=e,this.Wo=s,this.Go=i,this.connection=r,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=c,this.state=0,this.zo=0,this.jo=null,this.Ho=null,this.stream=null,this.Jo=new n0(e,n)}Yo(){return this.state===1||this.state===5||this.Zo()}Zo(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.Xo()}async stop(){this.Yo()&&await this.close(0)}e_(){this.state=0,this.Jo.reset()}t_(){this.Zo()&&this.jo===null&&(this.jo=this.si.enqueueAfterDelay(this.Wo,6e4,()=>this.n_()))}r_(e){this.i_(),this.stream.send(e)}async n_(){if(this.Zo())return this.close(0)}i_(){this.jo&&(this.jo.cancel(),this.jo=null)}s_(){this.Ho&&(this.Ho.cancel(),this.Ho=null)}async close(e,n){this.i_(),this.s_(),this.Jo.cancel(),this.zo++,e!==4?this.Jo.reset():n&&n.code===R.RESOURCE_EXHAUSTED?(ai(n.toString()),ai("Using maximum backoff delay to prevent overloading the backend."),this.Jo.Qo()):n&&n.code===R.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.o_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Eo(n)}o_(){}auth(){this.state=1;const e=this.__(this.zo),n=this.zo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([s,i])=>{this.zo===n&&this.a_(s,i)},s=>{e(()=>{const i=new $(R.UNKNOWN,"Fetching auth token failed: "+s.message);return this.u_(i)})})}a_(e,n){const s=this.__(this.zo);this.stream=this.c_(e,n),this.stream.ho(()=>{s(()=>this.listener.ho())}),this.stream.Io(()=>{s(()=>(this.state=2,this.Ho=this.si.enqueueAfterDelay(this.Go,1e4,()=>(this.Zo()&&(this.state=3),Promise.resolve())),this.listener.Io())
2341)}),this.stream.Eo(i=>{s(()=>this.u_(i))}),this.stream.onMessage(i=>{s(()=>this.onMessage(i))})}Xo(){this.state=5,this.Jo.Ko(async()=>{this.state=0,this.start()})}u_(e){return te("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}__(e){return n=>{this.si.enqueueAndForget(()=>this.zo===e?n():(te("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class D2 extends s0{constructor(e,n,s,i,r,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,s,i,o),this.serializer=r}c_(e,n){return this.connection.xo("Listen",e,n)}onMessage(e){this.Jo.reset();const n=VV(this.serializer,e),s=function(r){if(!("targetChange"in r))return me.min();const o=r.targetChange;return o.targetIds&&o.targetIds.length?me.min():o.readTime?Us(o.readTime):me.min()}(e);return this.listener.l_(n,s)}h_(e){const n={};n.database=hp(this.serializer),n.addTarget=function(r,o){let a;const c=o.target;if(a=ap(c)?{documents:BV(r,c)}:{query:jV(r,c)._t},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=KS(r,o.resumeToken);const l=lp(r,o.expectedCount);l!==null&&(a.expectedCount=l)}else if(o.snapshotVersion.compareTo(me.min())>0){a.readTime=du(r,o.snapshotVersion.toTimestamp());const l=lp(r,o.expectedCount);l!==null&&(a.expectedCount=l)}return a}(this.serializer,e);const s=HV(this.serializer,e);s&&(n.labels=s),this.r_(n)}P_(e){const n={};n.database=hp(this.serializer),n.removeTarget=e,this.r_(n)}}class A2 extends s0{constructor(e,n,s,i,r,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,s,i,o),this.serializer=r,this.I_=!1}get T_(){return this.I_}start(){this.I_=!1,this.lastStreamToken=void 0,super.start()}o_(){this.I_&&this.E_([])}c_(e,n){return this.connection.xo("Write",e,n)}onMessage(e){if(He(!!e.streamToken),this.lastStreamToken=e.streamToken,this.I_){this.Jo.reset();const n=GV(e.writeResults,e.commitTime),s=Us(e.commitTime);return this.listener.d_(s,n)}return He(!e.writeResults||e.writeResults.length===0),this.I_=!0,this.listener.A_()}R_(){const e={};e.database=hp(this.serializer),this.r_(e)}E_(e){const n={streamToken:this.lastStreamToken,writes:e.map(s=>qV(this.serializer,s))};this.r_(n)}}/**
2342 * @license
2343 * Copyright 2017 Google LLC
2344 *
2345 * Licensed under the Apache License, Version 2.0 (the "License");
2346 * you may not use this file except in compliance with the License.
2347 * You may obtain a copy of the License at
2348 *
2349 *   http://www.apache.org/licenses/LICENSE-2.0
2350 *
2351 * Unless required by applicable law or agreed to in writing, software
2352 * distributed under the License is distributed on an "AS IS" BASIS,
2353 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2354 * See the License for the specific language governing permissions and
2355 * limitations under the License.
2356 */class C2 extends class{}{constructor(e,n,s,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=s,this.serializer=i,this.V_=!1}m_(){if(this.V_)throw new $(R.FAILED_PRECONDITION,"The client has already been terminated.")}Do(e,n,s,i){return this.m_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([r,o])=>this.connection.Do(e,up(n,s),i,r,o)).catch(r=>{throw r.name==="FirebaseError"?(r.code===R.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),r):new $(R.UNKNOWN,r.toString())})}Mo(e,n,s,i,r){return this.m_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,a])=>this.connection.Mo(e,up(n,s),i,o,a,r)).catch(o=>{throw o.name==="FirebaseError"?(o.code===R.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new $(R.UNKNOWN,o.toString())})}terminate(){this.V_=!0,this.connection.terminate()}}class P2{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.g_=0,this.p_=null,this.y_=!0}w_(){this.g_===0&&(this.S_("Unknown"),this.p_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.p_=null,this.b_("Backend didn't respond within 10 seconds."),this.S_("Offline"),Promise.resolve())))}D_(e){this.state==="Online"?this.S_("Unknown"):(this.g_++,this.g_>=1&&(this.C_(),this.b_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.S_("Offline")))}set(e){this.C_(),this.g_=0,e==="Online"&&(this.y_=!1),this.S_(e)}S_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}b_(e){const n=`Could not reach Cloud Firestore backend. ${e}
2357This 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.y_?(ai(n),this.y_=!1):te("OnlineStateTracker",n)}C_(){this.p_!==null&&(this.p_.cancel(),this.p_=null)}}/**
2358 * @license
2359 * Copyright 2017 Google LLC
2360 *
2361 * Licensed under the Apache License, Version 2.0 (the "License");
2362 * you may not use this file except in compliance with the License.
2363 * You may obtain a copy of the License at
2364 *
2365 *   http://www.apache.org/licenses/LICENSE-2.0
2366 *
2367 * Unless required by applicable law or agreed to in writing, software
2368 * distributed under the License is distributed on an "AS IS" BASIS,
2369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2370 * See the License for the specific language governing permissions and
2371 * limitations under the License.
2372 */class R2{constructor(e,n,s,i,r){this.localStore=e,this.datastore=n,this.asyncQueue=s,this.remoteSyncer={},this.v_=[],this.F_=new Map,this.M_=new Set,this.x_=[],this.O_=r,this.O_.ro(o=>{s.enqueueAndForget(async()=>{Nr(this)&&(te("RemoteStore","Restarting streams for network reachability change."),await async function(c){const l=ge(c);l.M_.add(4),await Vc(l),l.N_.set("Unknown"),l.M_.delete(4),await Sd(l)}(this))})}),this.N_=new P2(s,i)}}async function Sd(t){if(Nr(t))for(const e of t.x_)await e(!0)}async function Vc(t){for(const e of t.x_)await e(!1)}function i0(t,e){const n=ge(t);n.F_.has(e.targetId)||(n.F_.set(e.targetId,e),sg(n)?ng(n):Ho(n).Zo()&&tg(n,e))}function eg(t,e){const n=ge(t),s=Ho(n);n.F_.delete(e),s.Zo()&&r0(n,e),n.F_.size===0&&(s.Zo()?s.t_():Nr(n)&&n.N_.set("Unknown"))}function tg(t,e){if(t.L_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(me.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}Ho(t).h_(e)}function r0(t,e){t.L_.xe(e),Ho(t).P_(e)}function ng(t){t.L_=new UV({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>t.F_.get(e)||null,tt:()=>t.datastore.serializer.databaseId}),Ho(t).start(),t.N_.w_()}function sg(t){return Nr(t)&&!Ho(t).Yo()&&t.F_.size>0}function Nr(t){return ge(t).M_.size===0}function o0(t){t.L_=void 0}async function k2(t){t.N_.set("Online")}async function U2(t){t.F_.forEach((e,n)=>{tg(t,e)})}async function N2(t,e){o0(t),sg(t)?(t.N_.D_(e),ng(t)):t.N_.set("Unknown")}async function x2(t,e,n){if(t.N_.set("Online"),e instanceof WS&&e.state===2&&e.cause)try{await async function(i,r){const o=r.cause;for(const a of r.targetIds)i.F_.has(a)&&(await i.remoteSyncer.rejectListen(a,o),i.F_.delete(a),i.L_.removeTarget(a))}(t,e)}catch(s){te("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),s),await hu(t,s)}else if(e instanceof El?t.L_.Ke(e):e instanceof HS?t.L_.He(e):t.L_.We(e),!n.isEqual(me.min()))try{const s=await t0(t.localStore);n.compareTo(s)>=0&&await function(r,o){const a=r.L_.rt(o);
2372return a.targetChanges.forEach((c,l)=>{if(c.resumeToken.approximateByteSize()>0){const u=r.F_.get(l);u&&r.F_.set(l,u.withResumeToken(c.resumeToken,o))}}),a.targetMismatches.forEach((c,l)=>{const u=r.F_.get(c);if(!u)return;r.F_.set(c,u.withResumeToken(Ht.EMPTY_BYTE_STRING,u.snapshotVersion)),r0(r,c);const d=new Ri(u.target,c,l,u.sequenceNumber);tg(r,d)}),r.remoteSyncer.applyRemoteEvent(a)}(t,n)}catch(s){te("RemoteStore","Failed to raise snapshot:",s),await hu(t,s)}}async function hu(t,e,n){if(!Oc(e))throw e;t.M_.add(1),await Vc(t),t.N_.set("Offline"),n||(n=()=>t0(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{te("RemoteStore","Retrying IndexedDB access"),await n(),t.M_.delete(1),await Sd(t)})}function a0(t,e){return e().catch(n=>hu(t,n,e))}async function Dd(t){const e=ge(t),n=qi(e);let s=e.v_.length>0?e.v_[e.v_.length-1].batchId:-1;for(;M2(e);)try{const i=await _2(e.localStore,s);if(i===null){e.v_.length===0&&n.t_();break}s=i.batchId,O2(e,i)}catch(i){await hu(e,i)}c0(e)&&l0(e)}function M2(t){return Nr(t)&&t.v_.length<10}function O2(t,e){t.v_.push(e);const n=qi(t);n.Zo()&&n.T_&&n.E_(e.mutations)}function c0(t){return Nr(t)&&!qi(t).Yo()&&t.v_.length>0}function l0(t){qi(t).start()}async function L2(t){qi(t).R_()}async function F2(t){const e=qi(t);for(const n of t.v_)e.E_(n.mutations)}async function V2(t,e,n){const s=t.v_.shift(),i=zm.from(s,e,n);await a0(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await Dd(t)}async function q2(t,e){e&&qi(t).T_&&await async function(s,i){if(function(o){return PV(o)&&o!==R.ABORTED}(i.code)){const r=s.v_.shift();qi(s).e_(),await a0(s,()=>s.remoteSyncer.rejectFailedWrite(r.batchId,i)),await Dd(s)}}(t,e),c0(t)&&l0(t)}async function zI(t,e){const n=ge(t);n.asyncQueue.verifyOperationInProgress(),te("RemoteStore","RemoteStore received new credentials");const s=Nr(n);n.M_.add(3),await Vc(n),s&&n.N_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.M_.delete(3),await Sd(n)}async function G2(t,e){const n=ge(t);e?(n.M_.delete(2),await Sd(n)):e||(n.M_.add(2),await Vc(n),n.N_.set("Unknown"))}function Ho(t){return t.B_||(t.B_=function(n,s,i){const r=ge(n);return r.m_(),new D2(s,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,i)}(t.datastore,t.asyncQueue,{ho:k2.bind(null,t),Io:U2.bind(null,t),Eo:N2.bind(null,t),l_:x2.bind(null,t)}),t.x_.push(async e=>{e?(t.B_.e_(),sg(t)?ng(t):t.N_.set("Unknown")):(await t.B_.stop(),o0(t))})),t.B_}function qi(t){return t.k_||(t.k_=function(n,s,i){const r=ge(n);return r.m_(),new A2(s,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,i)}(t.datastore,t.asyncQueue,{ho:()=>Promise.resolve(),Io:L2.bind(null,t),Eo:q2.bind(null,t),A_:F2.bind(null,t),d_:V2.bind(null,t)}),t.x_.push(async e=>{e?(t.k_.e_(),await Dd(t)):(await t.k_.stop(),t.v_.length>0&&(te("RemoteStore",`Stopping write stream with ${t.v_.length} pending writes`),t.v_=[]))})),t.k_}/**
2373 * @license
2374 * Copyright 2017 Google LLC
2375 *
2376 * Licensed under the Apache License, Version 2.0 (the "License");
2377 * you may not use this file except in compliance with the License.
2378 * You may obtain a copy of the License at
2379 *
2380 *   http://www.apache.org/licenses/LICENSE-2.0
2381 *
2382 * Unless required by applicable law or agreed to in writing, software
2383 * distributed under the License is distributed on an "AS IS" BASIS,
2384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2385 * See the License for the specific language governing permissions and
2386 * limitations under the License.
2387 */class ig{constructor(e,n,s,i,r){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=s,this.op=i,this.removalCallback=r,this.deferred=new Zs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,s,i,r){const o=Date.now()+s,a=new ig(e,n,o,i,r);return a.start(s),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new $(R.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 rg(t,e){if(ai("AsyncQueue",`${e}: ${t}`),Oc(t))return new $(R.UNAVAILABLE,`${e}: ${t}`);throw t}/**
2388 * @license
2389 * Copyright 2017 Google LLC
2390 *
2391 * Licensed under the Apache License, Version 2.0 (the "License");
2392 * you may not use this file except in compliance with the License.
2393 * You may obtain a copy of the License at
2394 *
2395 *   http://www.apache.org/licenses/LICENSE-2.0
2396 *
2397 * Unless required by applicable law or agreed to in writing, software
2398 * distributed under the License is distributed on an "AS IS" BASIS,
2399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2400 * See the License for the specific language governing permissions and
2401 * limitations under the License.
2402 */class po{constructor(e){this.comparator=e?(n,s)=>e(n,s)||oe.comparator(n.key,s.key):(n,s)=>oe.comparator(n.key,s.key),this.keyedMap=fa(),this.sortedSet=new tt(this.comparator)}static emptySet(e){return new po(e.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){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,s)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof po)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),s=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,r=s.getNext().key;if(!i.isEqual(r))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
2403  `+e.join(`  
2404`)+`
2405)`}copy(e,n){const s=new po;return s.comparator=this.comparator,s.keyedMap=e,s.sortedSet=n,s}}/**
2406 * @license
2407 * Copyright 2017 Google LLC
2408 *
2409 * Licensed under the Apache License, Version 2.0 (the "License");
2410 * you may not use this file except in compliance with the License.
2411 * You may obtain a copy of the License at
2412 *
2413 *   http://www.apache.org/licenses/LICENSE-2.0
2414 *
2415 * Unless required by applicable law or agreed to in writing, software
2416 * distributed under the License is distributed on an "AS IS" BASIS,
2417 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2418 * See the License for the specific language governing permissions and
2419 * limitations under the License.
2420 */class JI{constructor(){this.q_=new tt(oe.comparator)}track(e){const n=e.doc.key,s=this.q_.get(n);s?e.type!==0&&s.type===3?this.q_=this.q_.insert(n,e):e.type===3&&s.type!==1?this.q_=this.q_.insert(n,{type:s.type,doc:e.doc}):e.type===2&&s.type===2?this.q_=this.q_.insert(n,{type:2,doc:e.doc}):e.type===2&&s.type===0?this.q_=this.q_.insert(n,{type:0,doc:e.doc}):e.type===1&&s.type===0?this.q_=this.q_.remove(n):e.type===1&&s.type===2?this.q_=this.q_.insert(n,{type:1,doc:s.doc}):e.type===0&&s.type===1?this.q_=this.q_.insert(n,{type:2,doc:e.doc}):fe():this.q_=this.q_.insert(n,e)}Q_(){const e=[];return this.q_.inorderTraversal((n,s)=>{e.push(s)}),e}}class Uo{constructor(e,n,s,i,r,o,a,c,l){this.query=e,this.docs=n,this.oldDocs=s,this.docChanges=i,this.mutatedKeys=r,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=c,this.hasCachedResults=l}static fromInitialDocuments(e,n,s,i,r){const o=[];return n.forEach(a=>{o.push({type:0,doc:a})}),new Uo(e,n,po.emptySet(n),o,s,i,!0,!1,r)}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)&&Id(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,s=e.docChanges;if(n.length!==s.length)return!1;for(let i=0;i<n.length;i++)if(n[i].type!==s[i].type||!n[i].doc.isEqual(s[i].doc))return!1;return!0}}/**
2421 * @license
2422 * Copyright 2017 Google LLC
2423 *
2424 * Licensed under the Apache License, Version 2.0 (the "License");
2425 * you may not use this file except in compliance with the License.
2426 * You may obtain a copy of the License at
2427 *
2428 *   http://www.apache.org/licenses/LICENSE-2.0
2429 *
2430 * Unless required by applicable law or agreed to in writing, softw
2430are
2431 * distributed under the License is distributed on an "AS IS" BASIS,
2432 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2433 * See the License for the specific language governing permissions and
2434 * limitations under the License.
2435 */class B2{constructor(){this.K_=void 0,this.U_=[]}W_(){return this.U_.some(e=>e.G_())}}class j2{constructor(){this.queries=new $o(e=>RS(e),Id),this.onlineState="Unknown",this.z_=new Set}}async function og(t,e){const n=ge(t);let s=3;const i=e.query;let r=n.queries.get(i);r?!r.W_()&&e.G_()&&(s=2):(r=new B2,s=e.G_()?0:1);try{switch(s){case 0:r.K_=await n.onListen(i,!0);break;case 1:r.K_=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(o){const a=rg(o,`Initialization of query '${Qr(e.query)}' failed`);return void e.onError(a)}n.queries.set(i,r),r.U_.push(e),e.j_(n.onlineState),r.K_&&e.H_(r.K_)&&cg(n)}async function ag(t,e){const n=ge(t),s=e.query;let i=3;const r=n.queries.get(s);if(r){const o=r.U_.indexOf(e);o>=0&&(r.U_.splice(o,1),r.U_.length===0?i=e.G_()?0:1:!r.W_()&&e.G_()&&(i=2))}switch(i){case 0:return n.queries.delete(s),n.onUnlisten(s,!0);case 1:return n.queries.delete(s),n.onUnlisten(s,!1);case 2:return n.onLastRemoteStoreUnlisten(s);default:return}}function $2(t,e){const n=ge(t);let s=!1;for(const i of e){const r=i.query,o=n.queries.get(r);if(o){for(const a of o.U_)a.H_(i)&&(s=!0);o.K_=i}}s&&cg(n)}function H2(t,e,n){const s=ge(t),i=s.queries.get(e);if(i)for(const r of i.U_)r.onError(n);s.queries.delete(e)}function cg(t){t.z_.forEach(e=>{e.next()})}var pp,YI;(YI=pp||(pp={})).J_="default",YI.Cache="cache";class lg{constructor(e,n,s){this.query=e,this.Y_=n,this.Z_=!1,this.X_=null,this.onlineState="Unknown",this.options=s||{}}H_(e){if(!this.options.includeMetadataChanges){const s=[];for(const i of e.docChanges)i.type!==3&&s.push(i);e=new Uo(e.query,e.docs,e.oldDocs,s,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Z_?this.ea(e)&&(this.Y_.next(e),n=!0):this.ta(e,this.onlineState)&&(this.na(e),n=!0),this.X_=e,n}onError(e){this.Y_.error(e)}j_(e){this.onlineState=e;let n=!1;return this.X_&&!this.Z_&&this.ta(this.X_,e)&&(this.na(this.X_),n=!0),n}ta(e,n){if(!e.fromCache||!this.G_())return!0;const s=n!=="Offline";return(!this.options.ra||!s)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}ea(e){if(e.docChanges.length>0)return!0;const n=this.X_&&this.X_.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}na(e){e=Uo.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Z_=!0,this.Y_.next(e)}G_(){return this.options.source!==pp.Cache}}/**
2436 * @license
2437 * Copyright 2017 Google LLC
2438 *
2439 * Licensed under the Apache License, Version 2.0 (the "License");
2440 * you may not use this file except in compliance with the License.
2441 * You may obtain a copy of the License at
2442 *
2443 *   http://www.apache.org/licenses/LICENSE-2.0
2444 *
2445 * Unless required by applicable law or agreed to in writing, software
2446 * distributed under the License is distributed on an "AS IS" BASIS,
2447 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2448 * See the License for the specific language governing permissions and
2449 * limitations under the License.
2450 */class u0{constructor(e){this.key=e}}class d0{constructor(e){this.key=e}}class W2{constructor(e,n){this.query=e,this.la=n,this.ha=null,this.hasCachedResults=!1,this.current=!1,this.Pa=Ie(),this.mutatedKeys=Ie(),this.Ia=kS(e),this.Ta=new po(this.Ia)}get Ea(){return this.la}da(e,n){const s=n?n.Aa:new JI,i=n?n.Ta:this.Ta;let r=n?n.mutatedKeys:this.mutatedKeys,o=i,a=!1;const c=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,l=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((u,d)=>{const h=i.get(u),f=wd(this.query,d)?d:null,m=!!h&&this.mutatedKeys.has(h.key),v=!!f&&(f.hasLocalMutations||this.mutatedKeys.has(f.key)&&f.hasCommittedMutations);let b=!1;h&&f?h.data.isEqual(f.data)?m!==v&&(s.track({type:3,doc:f}),b=!0):this.Ra(h,f)||(s.track({type:2,doc:f}),b=!0,(c&&this.Ia(f,c)>0||l&&this.Ia(f,l)<0)&&(a=!0)):!h&&f?(s.track({type:0,doc:f}),b=!0):h&&!f&&(s.track({type:1,doc:h}),b=!0,(c||l)&&(a=!0)),b&&(f?(o=o.add(f),r=v?r.add(u):r.delete(u)):(o=o.delete(u),r=r.delete(u)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const u=this.query.limitType==="F"?o.last():o.first();o=o.delete(u.key),r=r.delete(u.key),s.track({type:1,doc:u})}return{Ta:o,Aa:s,Zi:a,mutatedKeys:r}}Ra(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}
2450applyChanges(e,n,s,i){const r=this.Ta;this.Ta=e.Ta,this.mutatedKeys=e.mutatedKeys;const o=e.Aa.Q_();o.sort((u,d)=>function(f,m){const v=b=>{switch(b){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return fe()}};return v(f)-v(m)}(u.type,d.type)||this.Ia(u.doc,d.doc)),this.Va(s),i=i!=null&&i;const a=n&&!i?this.ma():[],c=this.Pa.size===0&&this.current&&!i?1:0,l=c!==this.ha;return this.ha=c,o.length!==0||l?{snapshot:new Uo(this.query,e.Ta,r,o,e.mutatedKeys,c===0,l,!1,!!s&&s.resumeToken.approximateByteSize()>0),fa:a}:{fa:a}}j_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ta:this.Ta,Aa:new JI,mutatedKeys:this.mutatedKeys,Zi:!1},!1)):{fa:[]}}ga(e){return!this.la.has(e)&&!!this.Ta.has(e)&&!this.Ta.get(e).hasLocalMutations}Va(e){e&&(e.addedDocuments.forEach(n=>this.la=this.la.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.la=this.la.delete(n)),this.current=e.current)}ma(){if(!this.current)return[];const e=this.Pa;this.Pa=Ie(),this.Ta.forEach(s=>{this.ga(s.key)&&(this.Pa=this.Pa.add(s.key))});const n=[];return e.forEach(s=>{this.Pa.has(s)||n.push(new d0(s))}),this.Pa.forEach(s=>{e.has(s)||n.push(new u0(s))}),n}pa(e){this.la=e.ls,this.Pa=Ie();const n=this.da(e.documents);return this.applyChanges(n,!0)}ya(){return Uo.fromInitialDocuments(this.query,this.Ta,this.mutatedKeys,this.ha===0,this.hasCachedResults)}}class K2{constructor(e,n,s){this.query=e,this.targetId=n,this.view=s}}class z2{constructor(e){this.key=e,this.wa=!1}}class J2{constructor(e,n,s,i,r,o){this.localStore=e,this.remoteStore=n,this.eventManager=s,this.sharedClientState=i,this.currentUser=r,this.maxConcurrentLimboResolutions=o,this.Sa={},this.ba=new $o(a=>RS(a),Id),this.Da=new Map,this.Ca=new Set,this.va=new tt(oe.comparator),this.Fa=new Map,this.Ma=new Qm,this.xa={},this.Oa=new Map,this.Na=ko.Nn(),this.onlineState="Unknown",this.La=void 0}get isPrimaryClient(){return this.La===!0}}async function Y2(t,e,n=!0){const s=y0(t);let i;const r=s.ba.get(e);return r?(s.sharedClientState.addLocalQueryTarget(r.targetId),i=r.view.ya()):i=await h0(s,e,n,!0),i}async function Q2(t,e){const n=y0(t);await h0(n,e,!0,!1)}async function h0(t,e,n,s){const i=await I2(t.localStore,ks(e)),r=i.targetId,o=n?t.sharedClientState.addLocalQueryTarget(r):"not-current";let a;return s&&(a=await X2(t,e,r,o==="current",i.resumeToken)),t.isPrimaryClient&&n&&i0(t.remoteStore,i),a}async function X2(t,e,n,s,i){t.Ba=(d,h,f)=>async function(v,b,D,w){let y=b.view.da(D);y.Zi&&(y=await HI(v.localStore,b.query,!1).then(({documents:x})=>b.view.da(x,y)));const _=w&&w.targetChanges.get(b.targetId),S=w&&w.targetMismatches.get(b.targetId)!=null,P=b.view.applyChanges(y,v.isPrimaryClient,_,S);return XI(v,b.targetId,P.fa),P.snapshot}(t,d,h,f);const r=await HI(t.localStore,e,!0),o=new W2(e,r.ls),a=o.da(r.documents),c=Fc.createSynthesizedTargetChangeForCurrentChange(n,s&&t.onlineState!=="Offline",i),l=o.applyChanges(a,t.isPrimaryClient,c);XI(t,n,l.fa);const u=new K2(e,n,o);return t.ba.set(e,u),t.Da.has(n)?t.Da.get(n).push(e):t.Da.set(n,[e]),l.snapshot}async function Z2(t,e,n){const s=ge(t),i=s.ba.get(e),r=s.Da.get(i.targetId);if(r.length>1)return s.Da.set(i.targetId,r.filter(o=>!Id(o,e))),void s.ba.delete(e);s.isPrimaryClient?(s.sharedClientState.removeLocalQueryTarget(i.targetId),s.sharedClientState.isActiveQueryTarget(i.targetId)||await fp(s.localStore,i.targetId,!1).then(()=>{s.sharedClientState.clearQueryState(i.targetId),n&&eg(s.remoteStore,i.targetId),mp(s,i.targetId)}).catch(Mc)):(mp(s,i.targetId),await fp(s.localStore,i.targetId,!0))}async function eq(t,e){const n=ge(t),s=n.ba.get(e),i=n.Da.get(s.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(s.targetId),eg(n.remoteStore,s.targetId))}async function tq(t,e,n){const s=cq(t);try{const i=await function(o,a){const c=ge(o),l=wt.now(),u=a.reduce((f,m)=>f.add(m.key),Ie());let d,h;return c.persistence.runTransaction("Locally write mutations","readwrite",f=>{let m=ci(),v=Ie();return c.ss.getEntries(f,u).next(b=>{m=b,m.forEach((D,w)=>{w.isValidDocument()||(v=v.add(D))})}).next(()=>c.localDocuments.getOverlayedDocuments(f,m)).next(b=>{d=b;const D=[];for(const w of a){const y=EV(w,d.get(w.key).overlayedDocument);y!=null&&D.push(new Ki(w.key,y,bS(y.value.mapValue),as.exists(!0)))}
2450return c.mutationQueue.addMutationBatch(f,l,D,a)}).next(b=>{h=b;const D=b.applyToLocalDocumentSet(d,v);return c.documentOverlayCache.saveOverlays(f,b.batchId,D)})}).then(()=>({batchId:h.batchId,changes:NS(d)}))}(s.localStore,e);s.sharedClientState.addPendingMutation(i.batchId),function(o,a,c){let l=o.xa[o.currentUser.toKey()];l||(l=new tt(Pe)),l=l.insert(a,c),o.xa[o.currentUser.toKey()]=l}(s,i.batchId,n),await qc(s,i.changes),await Dd(s.remoteStore)}catch(i){const r=rg(i,"Failed to persist write");n.reject(r)}}async function f0(t,e){const n=ge(t);try{const s=await g2(n.localStore,e);e.targetChanges.forEach((i,r)=>{const o=n.Fa.get(r);o&&(He(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1),i.addedDocuments.size>0?o.wa=!0:i.modifiedDocuments.size>0?He(o.wa):i.removedDocuments.size>0&&(He(o.wa),o.wa=!1))}),await qc(n,s,e)}catch(s){await Mc(s)}}function QI(t,e,n){const s=ge(t);if(s.isPrimaryClient&&n===0||!s.isPrimaryClient&&n===1){const i=[];s.ba.forEach((r,o)=>{const a=o.view.j_(e);a.snapshot&&i.push(a.snapshot)}),function(o,a){const c=ge(o);c.onlineState=a;let l=!1;c.queries.forEach((u,d)=>{for(const h of d.U_)h.j_(a)&&(l=!0)}),l&&cg(c)}(s.eventManager,e),i.length&&s.Sa.l_(i),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function nq(t,e,n){const s=ge(t);s.sharedClientState.updateQueryState(e,"rejected",n);const i=s.Fa.get(e),r=i&&i.key;if(r){let o=new tt(oe.comparator);o=o.insert(r,Ft.newNoDocument(r,me.min()));const a=Ie().add(r),c=new bd(me.min(),new Map,new tt(Pe),o,a);await f0(s,c),s.va=s.va.remove(r),s.Fa.delete(e),ug(s)}else await fp(s.localStore,e,!1).then(()=>mp(s,e,n)).catch(Mc)}async function sq(t,e){const n=ge(t),s=e.batch.batchId;try{const i=await m2(n.localStore,e);m0(n,s,null),p0(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await qc(n,i)}catch(i){await Mc(i)}}async function iq(t,e,n){const s=ge(t);try{const i=await function(o,a){const c=ge(o);return c.persistence.runTransaction("Reject batch","readwrite-primary",l=>{let u;return c.mutationQueue.lookupMutationBatch(l,a).next(d=>
2450(He(d!==null),u=d.keys(),c.mutationQueue.removeMutationBatch(l,d))).next(()=>c.mutationQueue.performConsistencyCheck(l)).next(()=>c.documentOverlayCache.removeOverlaysForBatchId(l,u,a)).next(()=>c.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,u)).next(()=>c.localDocuments.getDocuments(l,u))})}(s.localStore,e);m0(s,e,n),p0(s,e),s.sharedClientState.updateMutationState(e,"rejected",n),await qc(s,i)}catch(i){await Mc(i)}}function p0(t,e){(t.Oa.get(e)||[]).forEach(n=>{n.resolve()}),t.Oa.delete(e)}function m0(t,e,n){const s=ge(t);let i=s.xa[s.currentUser.toKey()];if(i){const r=i.get(e);r&&(n?r.reject(n):r.resolve(),i=i.remove(e)),s.xa[s.currentUser.toKey()]=i}}function mp(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const s of t.Da.get(e))t.ba.delete(s),n&&t.Sa.ka(s,n);t.Da.delete(e),t.isPrimaryClient&&t.Ma.Rr(e).forEach(s=>{t.Ma.containsKey(s)||g0(t,s)})}function g0(t,e){t.Ca.delete(e.path.canonicalString());const n=t.va.get(e);n!==null&&(eg(t.remoteStore,n),t.va=t.va.remove(e),t.Fa.delete(n),ug(t))}function XI(t,e,n){for(const s of n)s instanceof u0?(t.Ma.addReference(s.key,e),rq(t,s)):s instanceof d0?(te("SyncEngine","Document no longer in limbo: "+s.key),t.Ma.removeReference(s.key,e),t.Ma.containsKey(s.key)||g0(t,s.key)):fe()}function rq(t,e){const n=e.key,s=n.path.canonicalString();t.va.get(n)||t.Ca.has(s)||(te("SyncEngine","New document in limbo: "+n),t.Ca.add(s),ug(t))}function ug(t){for(;t.Ca.size>0&&t.va.size<t.maxConcurrentLimboResolutions;){const e=t.Ca.values().next().value;t.Ca.delete(e);const n=new oe($e.fromString(e)),s=t.Na.next();t.Fa.set(s,new z2(n)),t.va=t.va.insert(n,s),i0(t.remoteStore,new Ri(ks(_d(n.path)),s,"TargetPurposeLimboResolution",Gm.oe))}}async function qc(t,e,n){const s=ge(t),i=[],r=[],o=[];s.ba.isEmpty()||(s.ba.forEach((a,c)=>{o.push(s.Ba(c,e,n).then(l=>{if((l||n)&&s.isPrimaryClient&&s.sharedClientState.updateQueryState(c.targetId,l!=null&&l.fromCache?"not-current":"current"),l){i.push(l);const u=Zm.Qi(c.targetId,l);r.push(u)}}))}),await Promise.all(o),s.Sa.l_(i),await async function(c,l){const u=ge(c);try{await u.persistence.runTransaction("notifyLocalViewChanges","readwrite",d=>q.forEach(l,h=>q.forEach(h.ki,f=>u.persistence.referenceDelegate.addReference(d,h.targetId,f)).next(()=>q.forEach(h.qi,f=>u.persistence.referenceDelegate.removeReference(d,h.targetId,f)))))}catch(d){if(!Oc(d))throw d;te("LocalStore","Failed to update sequence numbers: "+d)}for(const d of l){const h=d.targetId;if(!d.fromCache){const f=u.ts.get(h),m=f.snapshotVersion,v=f.withLastLimboFreeSnapshotVersion(m);u.ts=u.ts.insert(h,v)}}}(s.localStore,r))}async function oq(t,e){const n=ge(t);if(!n.currentUser.isEqual(e)){te("SyncEngine","User change. New user:",e.toKey());const s=await e0(n.localStore,e);n.currentUser=e,function(r,o){r.Oa.forEach(a=>{a.forEach(c=>{c.reject(new $(R.CANCELLED,o))})}),r.Oa.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,s.removedBatchIds,s.addedBatchIds),await qc(n,s._s)}}function aq(t,e){const n=ge(t),s=n.Fa.get(e);if(s&&s.wa)return Ie().add(s.key);{let i=Ie();const r=n.Da.get(e);if(!r)return i;for(const o of r){const a=n.ba.get(o);i=i.unionWith(a.view.Ea)}return i}}function y0(t){const e=ge(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=f0.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=aq.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=nq.bind(null,e),e.Sa.l_=$2.bind(null,e.eventManager),e.Sa.ka=H2.bind(null,e.eventManager),e}function cq(t){const e=ge(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=sq.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=iq.bind(null,e),e}class ZI{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=Ed(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,n){return null}createIndexBackfillerScheduler(e,n){return null}createLocalStore(e){return p2(this.persistence,new h2,e.initialUser,this.serializer)}createPersistence(e){return new l2(Xm.jr,this.serializer)}
2450createSharedClientState(e){return new v2}async terminate(){var e,n;(e=this.gcScheduler)===null||e===void 0||e.stop(),(n=this.indexBackfillerScheduler)===null||n===void 0||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class lq{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=s=>QI(this.syncEngine,s,1),this.remoteStore.remoteSyncer.handleCredentialChange=oq.bind(null,this.syncEngine),await G2(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new j2}()}createDatastore(e){const n=Ed(e.databaseInfo.databaseId),s=function(r){return new S2(r)}(e.databaseInfo);return function(r,o,a,c){return new C2(r,o,a,c)}(e.authCredentials,e.appCheckCredentials,s,n)}createRemoteStore(e){return function(s,i,r,o,a){return new R2(s,i,r,o,a)}(this.localStore,this.datastore,e.asyncQueue,n=>QI(this.syncEngine,n,0),function(){return KI.D()?new KI:new T2}())}createSyncEngine(e,n){return function(i,r,o,a,c,l,u){const d=new J2(i,r,o,a,c,l);return u&&(d.La=!0),d}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e;await async function(s){const i=ge(s);te("RemoteStore","RemoteStore shutting down."),i.M_.add(5),await Vc(i),i.O_.shutdown(),i.N_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate()}}/**
2451 * @license
2452 * Copyright 2020 Google LLC
2453 *
2454 * Licensed under the Apache License, Version 2.0 (the "License");
2455 * you may not use this file except in compliance with the License.
2456 * You may obtain a copy of the License at
2457 *
2458 *   http://www.apache.org/licenses/LICENSE-2.0
2459 *
2460 * Unless required by applicable law or agreed to in writing, software
2461 * distributed under the License is distributed on an "AS IS" BASIS,
2462 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2463 * See the License for the specific language governing permissions and
2464 * limitations under the License.
2465 *//**
2466 * @license
2467 * Copyright 2017 Google LLC
2468 *
2469 * Licensed under the Apache License, Version 2.0 (the "License");
2470 * you may not use this file except in compliance with the License.
2471 * You may obtain a copy of the License at
2472 *
2473 *   http://www.apache.org/licenses/LICENSE-2.0
2474 *
2475 * Unless required by applicable law or agreed to in writing, software
2476 * distributed under the License is distributed on an "AS IS" BASIS,
2477 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2478 * See the License for the specific language governing permissions and
2479 * limitations under the License.
2480 */class dg{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Ka(this.observer.next,e)}error(e){this.observer.error?this.Ka(this.observer.error,e):ai("Uncaught Error in snapshot listener:",e.toString())}$a(){this.muted=!0}Ka(e,n){this.muted||setTimeout(()=>{this.muted||e(n)},0)}}/**
2481 * @license
2482 * Copyright 2017 Google LLC
2483 *
2484 * Licensed under the Apache License, Version 2.0 (the "License");
2485 * you may not use this file except in compliance with the License.
2486 * You may obtain a copy of the License at
2487 *
2488 *   http://www.apache.org/licenses/LICENSE-2.0
2489 *
2490 * Unless required by applicable law or agreed to in writing, software
2491 * distributed under the License is distributed on an "AS IS" BASIS,
2492 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2493 * See the License for the specific language governing permissions and
2494 * limitations under the License.
2495 */class uq{constructor(e,n,s,i){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=s,this.databaseInfo=i,this.user=Ot.UNAUTHENTICATED,this.clientId=wS.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(s,async r=>{te("FirestoreClient","Received user=",r.uid),await this.authCredentialListener(r),this.user=r}),this.appCheckCredentials.start(s,r=>(te("FirestoreClient","Received new app check token=",r),this.appCheckCredentialListener(r,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}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new $(R.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Zs;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(n){const s=rg(n,"Failed to shutdown persistence");e.reject(s)}}),e.promise}}async function Wh(t,e){t.asyncQueue.verifyOperationInProgress(),te("FirestoreClient","Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let s=n.initialUser;t.setCredentialChangeListener(async i=>{s.isEqual(i)||(await e0(e.localStore,i),s=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function ew(t,e){t.asyncQueue.verifyOperationInProgress();const n=await hq(t);te("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(s=>zI(e.remoteStore,s)),t.setAppCheckTokenChangeListener((s,i)=>zI(e.remoteStore,i)),t._onlineComponents=e}function dq(t){return t.name==="FirebaseError"?t.code===R.FAILED_PRECONDITION||t.code===R.UNIMPLEMENT
2495ED:!(typeof DOMException<"u"&&t instanceof DOMException)||t.code===22||t.code===20||t.code===11}async function hq(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){te("FirestoreClient","Using user provided OfflineComponentProvider");try{await Wh(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!dq(n))throw n;Do("Error using user provided cache. Falling back to memory cache: "+n),await Wh(t,new ZI)}}else te("FirestoreClient","Using default OfflineComponentProvider"),await Wh(t,new ZI);return t._offlineComponents}async function _0(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(te("FirestoreClient","Using user provided OnlineComponentProvider"),await ew(t,t._uninitializedComponentsProvider._online)):(te("FirestoreClient","Using default OnlineComponentProvider"),await ew(t,new lq))),t._onlineComponents}function fq(t){return _0(t).then(e=>e.syncEngine)}async function fu(t){const e=await _0(t),n=e.eventManager;return n.onListen=Y2.bind(null,e.syncEngine),n.onUnlisten=Z2.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=Q2.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=eq.bind(null,e.syncEngine),n}function pq(t,e,n={}){const s=new Zs;return t.asyncQueue.enqueueAndForget(async()=>function(r,o,a,c,l){const u=new dg({next:h=>{o.enqueueAndForget(()=>ag(r,d));const f=h.docs.has(a);!f&&h.fromCache?l.reject(new $(R.UNAVAILABLE,"Failed to get document because the client is offline.")):f&&h.fromCache&&c&&c.source==="server"?l.reject(new $(R.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):l.resolve(h)},error:h=>l.reject(h)}),d=new lg(_d(a.path),u,{includeMetadataChanges:!0,ra:!0});return og(r,d)}(await fu(t),t.asyncQueue,e,n,s)),s.promise}function mq(t,e,n={}){const s=new Zs;return t.asyncQueue.enqueueAndForget(async()=>function(r,o,a,c,l){const u=new dg({next:h=>{o.enqueueAndForget(()=>ag(r,d)),h.fromCache&&c.source==="server"?l.reject(new $(R.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(h)},error:h=>l.reject(h)}),d=new lg(a,u,{includeMetadataChanges:!0,ra:!0});return og(r,d)}(await fu(t),t.asyncQueue,e,n,s)),s.promise}/**
2496 * @license
2497 * Copyright 2023 Google LLC
2498 *
2499 * Licensed under the Apache License, Version 2.0 (the "License");
2500 * you may not use this file except in compliance with the License.
2501 * You may obtain a copy of the License at
2502 *
2503 *   http://www.apache.org/licenses/LICENSE-2.0
2504 *
2505 * Unless required by applicable law or agreed to in writing, software
2506 * distributed under the License is distributed on an "AS IS" BASIS,
2507 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2508 * See the License for the specific language governing permissions and
2509 * limitations under the License.
2510 */function I0(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/**
2511 * @license
2512 * Copyright 2020 Google LLC
2513 *
2514 * Licensed under the Apache License, Version 2.0 (the "License");
2515 * you may not use this file except in compliance with the License.
2516 * You may obtain a copy of the License at
2517 *
2518 *   http://www.apache.org/licenses/LICENSE-2.0
2519 *
2520 * Unless required by applicable law or agreed to in writing, software
2521 * distributed under the License is distributed on an "AS IS" BASIS,
2522 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2523 * See the License for the specific language governing permissions and
2524 * limitations under the License.
2525 */const tw=new Map;/**
2526 * @license
2527 * Copyright 2017 Google LLC
2528 *
2529 * Licensed under the Apache License, Version 2.0 (the "License");
2530 * you may not use this file except in compliance with the License.
2531 * You may obtain a copy of the License at
2532 *
2533 *   http://www.apache.org/licenses/LICENSE-2.0
2534 *
2535 * Unless required by applicable law or agreed to in writing, software
2536 * distributed under the License is distributed on an "AS IS" BASIS,
2537 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2538 * See the License for the specific language governing permissions and
2539 * limitations under the License.
2540 */function w0(t,e,n){if(!n)throw new $(R.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function gq(t,e,n,s){if(e===!0&&s===!0)throw new $(R.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function nw(t){if(!oe.isDocumentKey(t))throw new $(R.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function sw(t){if(oe.isDocumentKey(t))throw new $(R.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Ad(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(s){return s.constructor?s.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":fe()}function qn(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new $(R.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Ad(t);throw new $(R.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function yq(t,e){if(e<=0)throw new $(R.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)}/**
2541 * @license
2542 * Copyright 2020 Google LLC
2543 *
2544 * Licensed under the Apache License, Version 2.0 (the "License");
2545 * you may not use this file except in compliance with the License.
2546 * You may obtain a copy of the License at
2547 *
2548 *   http://www.apache.org/licenses/LICENSE-2.0
2549 *
2550 * Unless required by applicable law or agreed to in writing, software
2551 * distributed under the License is distributed on an "AS IS" BASIS,
2552 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2553 * See the License for the specific language governing permissions and
2554 * limitations under the License.
2555 */class iw{constructor(e){var n,s;if(e.host===void 0){if(e.ssl!==void 0)throw new $(R.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(n=e.ssl)===null||n===void 0||n;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new $(R.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}gq("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=I0((s=e.experimentalLongPollingOptions)!==null&&s!==void 0?s:{}),function(r){if(r.timeoutSeconds!==void 0){if(isNaN(r.timeoutSeconds))throw new $(R.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (must not be NaN)`);if(r.timeoutSeconds<5)throw new $(R.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (minimum allowed value is 5)`);if(r.timeoutSeconds>30)throw new $(R.INVALID_ARGUMENT,`invalid long polling timeout: ${r.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(s,i){return s.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Cd{constructor(e,n,s,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=s,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new iw({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new $(R.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!==void 0}_setSettings(e){if(this._settingsFrozen)throw new $(R.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 iw(e),e.credentials!==void 0&&(this._authCredentials=function(s){if(!s)return new xF;switch(s.type){case"firstParty":return new FF(s.sessionIndex||"0",s.iamToken||null,s.authTokenFactory||null);case"provider":return s.client;default:throw new $(R.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||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const s=tw.get(n);s&&(te("ComponentProvider","Removing Datastore"),tw.delete(n),s.terminate())}(this),Promise.resolve()}}function _q(t,e,n,s={}){var i;const r=(t=qn(t,Cd))._getSettings(),o=`${e}:${n}`;if(r.host!=="firestore.googleapis.com"&&r.host!==o&&Do("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),t._setSettings(Object.assign(Object.assign({},r),{host:o,ssl:!1})),s.mockUserToken){let a,c;if(typeof s.mockUserToken=="string")a=s.mockUserToken,c=Ot.MOCK_USER;else{a=Tb(s.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);const l=s.mockUserToken.sub||s.mockUserToken.user_id;if(!l)throw new $(R.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");c=new Ot(l)}t._authCredentials=new MF(new IS(a,c))}}/**
2556 * @license
2557 * Copyright 2020 Google LLC
2558 *
2559 * Licensed under the Apache License, Version 2.0 (the "License");
2560 * you may not use this file except in compliance with the License.
2561 * You may obtain a copy of the License at
2562 *
2563 *   http://www.apache.org/licenses/LICENSE-2.0
2564 *
2565 * Unless required by applicable law or agreed to in writing, software
2566 * distributed under the License is distributed on an "AS IS" BASIS,
2567 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2568 * See the License for the specific language governing permissions and
2569 * limitations under the License.
2570 */class ms{constructor(e,n,s){this.converter=n,this._query=s,this.type="query",this.firestore=e}withConverter(e){return new ms(this.firestore,e,this._query)}}class $t{constructor(e,n,s){this.converter=n,this._key=s,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 Mi(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new $t(this.firestore,e,this._key)}}class Mi extends ms{constructor(e,n,s){super(e,n,_d(s)),this._path=s,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new $t(this.firestore,null,new oe(e))}withConverter(e){return new Mi(this.firestore,e,this._path)}}function gs(t,e,...n){if(t=Ae(t),w0("collection","path",e),t instanceof Cd){const s=$e.fromString(e,...n);return sw(s),new Mi(t,null,s)}{if(!(t instanceof $t||t instanceof Mi))throw new $(R.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child($e.fromString(e,...n));return sw(s),new Mi(t.firestore,null,s)}}function Ve(t,e,...n){if(t=Ae(t),arguments.length===1&&(e=wS.newId()),w0("doc","path",e),t instanceof Cd){const s=$e.fromString(e,...n);return nw(s),new $t(t,null,new oe(s))}{if(!(t instanceof $t||t instanceof Mi))throw new $(R.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child($e.fromString(e,...n));return nw(s),new $t(t.firestore,t instanceof Mi?t.converter:null,new oe(s))}}/**
2571 * @license
2572 * Copyright 2020 Google LLC
2573 *
2574 * Licensed under the Apache License, Version 2.0 (the "License");
2575 * you may not use this file except in compliance with the License.
2576 * You may obtain a copy of the License at
2577 *
2578 *   http://www.apache.org/licenses/LICENSE-2.0
2579 *
2580 * Unless required by applicable law or agreed to in writing, software
2581 * distributed under the License is distributed on an "AS IS" BASIS,
2582 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2583 * See the License for the specific language governing permissions and
2584 * limitations under the License.
2585 */class Iq{constructor(){this.iu=Promise.resolve(),this.su=[],this.ou=!1,this._u=[],this.au=null,this.uu=!1,this.cu=!1,this.lu=[],this.Jo=new n0(this,"async_queue_retry"),this.hu=()=>{const n=Hh();n&&te("AsyncQueue","Visibility state changed to "+n.visibilityState),this.Jo.Uo()};const e=Hh();e&&typeof e.addEventListener=="function"&&e.addEventListener("visibilitychange",this.hu)}get isShuttingDown(){return this.ou}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Pu(),this.Iu(e)}enterRestrictedMode(e){if(!this.ou){this.ou=!0,this.cu=e||!1;const n=Hh();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.hu)}}enqueue(e){if(this.Pu(),this.ou)return new Promise(()=>{});const n=new Zs;return this.Iu(()=>this.ou&&this.cu?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.su.push(e),this.Tu()))}async Tu(){if(this.su.length!==0){try{await this.su[0](),this.su.shift(),this.Jo.reset()}catch(e){if(!Oc(e))throw e;te("AsyncQueue","Operation failed with retryable error: "+e)}this.su.length>0&&this.Jo.Ko(()=>this.Tu())}}Iu(e){const n=this.iu.then(()=>(this.uu=!0,e().catch(s=>{this.au=s,this.uu=!1;const i=function(o){let a=o.message||"";return o.stack&&(a=o.stack.includes(o.message)?o.stack:o.message+`
2586`+o.stack),a}(s);throw ai("INTERNAL UNHANDLED ERROR: ",i),s}).then(s=>(this.uu=!1,s))));return this.iu=n,n}enqueueAfterDelay(e,n,s){this.Pu(),this.lu.indexOf(e)>-1&&(n=0);const i=ig.createAndSchedule(this,e,n,s,r=>this.Eu(r));return this._u.push(i),i}Pu(){this.au&&fe()}verifyOperationInProgress(){}async du(){let e;do e=this.iu,await e;while(e!==this.iu)}Au(e){for(const n of this._u)if(n.timerId===e)return!0;return!1}Ru(e){return this.du().then(()=>{this._u.sort((n,s)=>n.targetTimeMs-s.targetTimeMs);for(const n of this._u)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.du()})}Vu(e){this.lu.push(e)}Eu(e){const n=this._u.indexOf(e);this._u.splice(n,1)}}function rw(t){return function(n,s){if(typeof n!="object"||n===null)return!1;const i=n;for(const r of s)if(r in i&&typeof i[r]=="function")return!0;return!1}(t,["next","error","complete"])}class Gi extends Cd{constructor(e,n,s,i){super(e,n,s,i),this.type="firestore",this._queue=function(){return new Iq}(),this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||T0(this),this._firestoreClient.terminate()}}function v0(t,e){const n=typeof t=="object"?t:qo(),s=typeof t=="string"?t:"(default)",i=ps(n,"firestore").getImmediate({identifier:s});if(!i._initialized){const r=sm("firestore");r&&_q(i,...r)}return i}function Pd(t){return t._firestoreClient||T0(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function T0(t){var e,n,s;const i=t._freezeSettings(),r=function(a,c,l,u){return new QF(a,c,l,u.host,u.ssl,u.experimentalForceLongPolling,u.experimentalAutoDetectLongPolling,I0(u.experimentalLongPollingOptions),u.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._firestoreClient=new uq(t._authCredentials,t._appCheckCredentials,t._queue,r),!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((s=i.localCache)===null||s===void 0)&&s._onlineComponentProvider)&&(t._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}/**
2587 * @license
2588 * Copyright 2020 Google LLC
2589 *
2590 * Licensed under the Apache License, Version 2.0 (the "License");
2591 * you may not use this file except in compliance with the License.
2592 * You may obtain a copy of the License at
2593 *
2594 *   http://www.apache.org/licenses/LICENSE-2.0
2595 *
2596 * Unless required by applicable law or agreed to in writing, software
2597 * distributed under the License is distributed on an "AS IS" BASIS,
2598 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2599 * See the License for the specific language governing permissions and
2600 * limitations under the License.
2601 */class No{constructor(e){this._byteString=e}static fromBase64String(e){try{return new No(Ht.fromBase64String(e))}catch(n){throw new $(R.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new No(Ht.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)}}/**
2602 * @license
2603 * Copyright 2020 Google LLC
2604 *
2605 * Licensed under the Apache License, Version 2.0 (the "License");
2606 * you may not use this file except in compliance with the License.
2607 * You may obtain a copy of the License at
2608 *
2609 *   http://www.apache.org/licenses/LICENSE-2.0
2610 *
2611 * Unless required by applicable law or agreed to in writing, software
2612 * distributed under the License is distributed on an "AS IS" BASIS,
2613 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2614 * See the License for the specific language governing permissions and
2615 * limitations under the License.
2616 */class Rd{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new $(R.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Ct(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
2617 * @license
2618 * Copyright 2020 Google LLC
2619 *
2620 * Licensed under the Apache License, Version 2.0 (the "License");
2621 * you may not use this file except in compliance with the License.
2622 * You may obtain a copy of the License at
2623 *
2624 *   http://www.apache.org/licenses/LICENSE-2.0
2625 *
2626 * Unless required by applicable law or agreed to in writing, software
2627 * distributed under the License is distributed on an "AS IS" BASIS,
2628 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2629 * See the License for the specific language governing permissions and
2630 * limitations under the License.
2631 */class kd{constructor(e){this._methodName=e}}/**
2632 * @license
2633 * Copyright 2017 Google LLC
2634 *
2635 * Licensed under the Apache License, Version 2.0 (the "License");
2636 * you may not use this file except in compliance with the License.
2637 * You may obtain a copy of the License at
2638 *
2639 *   http://www.apache.org/licenses/LICENSE-2.0
2640 *
2641 * Unless required by applicable law or agreed to in writing, software
2642 * distributed under the License is distributed on an "AS IS" BASIS,
2643 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2644 * See the License for the specific language governing permissions and
2645 * limitations under the License.
2646 */class hg{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new $(R.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new $(R.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return Pe(this._lat,e._lat)||Pe(this._long,e._long)}}/**
2647 * @license
2648 * Copyright 2017 Google LLC
2649 *
2650 * Licensed under the Apache License, Version 2.0 (the "License");
2651 * you may not use this file except in compliance with the License.
2652 * You may obtain a copy of the License at
2653 *
2654 *   http://www.apache.org/licenses/LICENSE-2.0
2655 *
2656 * Unless required by applicable law or agreed to in writing, software
2657 * distributed under the License is distributed on an "AS IS" BASIS,
2658 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2659 * See the License for the specific language governing permissions and
2660 * limitations under the License.
2661 */const wq=/^__.*__$/;class vq{constructor(e,n,s){this.data=e,this.fieldMask=n,this.fieldTransforms=s}toMutation(e,n){return this.fieldMask!==null?new Ki(e,this.data,this.fieldMask,n,this.fieldTransforms):new Lc(e,this.data,n,this.fieldTransforms)}}class b0{constructor(e,n,s){this.data=e,this.fieldMask=n,this.fieldTransforms=s}toMutation(e,n){return new Ki(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function E0(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw fe()}}class fg{constructor(e,n,s,i,r,o){this.settings=e,this.databaseId=n,this.serializer
2661=s,this.ignoreUndefinedProperties=i,r===void 0&&this.mu(),this.fieldTransforms=r||[],this.fieldMask=o||[]}get path(){return this.settings.path}get fu(){return this.settings.fu}gu(e){return new fg(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}pu(e){var n;const s=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.gu({path:s,yu:!1});return i.wu(e),i}Su(e){var n;const s=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.gu({path:s,yu:!1});return i.mu(),i}bu(e){return this.gu({path:void 0,yu:!0})}Du(e){return pu(e,this.settings.methodName,this.settings.Cu||!1,this.path,this.settings.vu)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}mu(){if(this.path)for(let e=0;e<this.path.length;e++)this.wu(this.path.get(e))}wu(e){if(e.length===0)throw this.Du("Document fields must not be empty");if(E0(this.fu)&&wq.test(e))throw this.Du('Document fields cannot begin and end with "__"')}}class Tq{constructor(e,n,s){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=s||Ed(e)}Fu(e,n,s,i=!1){return new fg({fu:e,methodName:n,vu:s,path:Ct.emptyPath(),yu:!1,Cu:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Ud(t){const e=t._freezeSettings(),n=Ed(t._databaseId);return new Tq(t._databaseId,!!e.ignoreUndefinedProperties,n)}function bq(t,e,n,s,i,r={}){const o=t.Fu(r.merge||r.mergeFields?2:0,e,n,i);mg("Data must be an object, but it was:",o,s);const a=D0(s,o);let c,l;if(r.merge)c=new Mn(o.fieldMask),l=o.fieldTransforms;else if(r.mergeFields){const u=[];for(const d of r.mergeFields){const h=gp(e,d,n);if(!o.contains(h))throw new $(R.INVALID_ARGUMENT,`Field '${h}' is specified in your field mask but missing from your input data.`);C0(u,h)||u.push(h)}c=new Mn(u),l=o.fieldTransforms.filter(d=>c.covers(d.field))}else c=null,l=o.fieldTransforms;return new vq(new rn(a),c,l)}class Nd extends kd{_toFieldTransform(e){if(e.fu!==2)throw e.fu===1?e.Du(`${this._methodName}() can only appear at the top level of your update data`):e.Du(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Nd}}class pg extends kd{constructor(e,n){super(e),this.xu=n}_toFieldTransform(e){const n=new fc(e.serializer,LS(e.serializer,this.xu));return new wV(e.path,n)}isEqual(e){return e instanceof pg&&this.xu===e.xu}}function Eq(t,e,n,s){const i=t.Fu(1,e,n);mg("Data must be an object, but it was:",i,s);const r=[],o=rn.empty();Ur(s,(c,l)=>{const u=gg(e,c,n);l=Ae(l);const d=i.Su(u);if(l instanceof Nd)r.push(u);else{const h=Gc(l,d);h!=null&&(r.push(u),o.set(u,h))}});const a=new Mn(r);return new b0(o,a,i.fieldTransforms)}function Sq(t,e,n,s,i,r){const o=t.Fu(1,e,n),a=[gp(e,s,n)],c=[i];if(r.length%2!=0)throw new $(R.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let h=0;h<r.length;h+=2)a.push(gp(e,r[h])),c.push(r[h+1]);const l=[],u=rn.empty();for(let h=a.length-1;h>=0;--h)if(!C0(l,a[h])){const f=a[h];let m=c[h];m=Ae(m);const v=o.Su(f);if(m instanceof Nd)l.push(f);else{const b=Gc(m,v);b!=null&&(l.push(f),u.set(f,b))}}const d=new Mn(l);return new b0(u,d,o.fieldTransforms)}function S0(t,e,n,s=!1){return Gc(n,t.Fu(s?4:3,e))}function Gc(t,e){if(A0(t=Ae(t)))return mg("Unsupported field value:",e,t),D0(t,e);if(t instanceof kd)return function(s,i){if(!E0(i.fu))throw i.Du(`${s._methodName}() can only be used with update() and set()`);if(!i.path)throw i.Du(`${s._methodName}() is not currently supported inside arrays`);const r=s._toFieldTransform(i);r&&i.fieldTransforms.push(r)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.yu&&e.fu!==4)throw e.Du("Nested arrays are not supported");return function(s,i){const r=[];let o=0;for(const a of s){let c=Gc(a,i.bu(o));c==null&&(c={nullValue:"NULL_VALUE"}),r.push(c),o++}return{arrayValue:{values:r}}}(t,e)}
2661return function(s,i){if((s=Ae(s))===null)return{nullValue:"NULL_VALUE"};if(typeof s=="number")return LS(i.serializer,s);if(typeof s=="boolean")return{booleanValue:s};if(typeof s=="string")return{stringValue:s};if(s instanceof Date){const r=wt.fromDate(s);return{timestampValue:du(i.serializer,r)}}if(s instanceof wt){const r=new wt(s.seconds,1e3*Math.floor(s.nanoseconds/1e3));return{timestampValue:du(i.serializer,r)}}if(s instanceof hg)return{geoPointValue:{latitude:s.latitude,longitude:s.longitude}};if(s instanceof No)return{bytesValue:KS(i.serializer,s._byteString)};if(s instanceof $t){const r=i.databaseId,o=s.firestore._databaseId;if(!o.isEqual(r))throw i.Du(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${r.projectId}/${r.database}`);return{referenceValue:Ym(s.firestore._databaseId||i.databaseId,s._key.path)}}throw i.Du(`Unsupported field value: ${Ad(s)}`)}(t,e)}function D0(t,e){const n={};return vS(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ur(t,(s,i)=>{const r=Gc(i,e.pu(s));r!=null&&(n[s]=r)}),{mapValue:{fields:n}}}function A0(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof wt||t instanceof hg||t instanceof No||t instanceof $t||t instanceof kd)}function mg(t,e,n){if(!A0(n)||!function(i){return typeof i=="object"&&i!==null&&(Object.getPrototypeOf(i)===Object.prototype||Object.getPrototypeOf(i)===null)}(n)){const s=Ad(n);throw s==="an object"?e.Du(t+" a custom object"):e.Du(t+" "+s)}}function gp(t,e,n){if((e=Ae(e))instanceof Rd)return e._internalPath;if(typeof e=="string")return gg(t,e);throw pu("Field path arguments must be of type string or ",t,!1,void 0,n)}const Dq=new RegExp("[~\\*/\\[\\]]");function gg(t,e,n){if(e.search(Dq)>=0)throw pu(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Rd(...e.split("."))._internalPath}catch{throw pu(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function pu(t,e,n,s,i){const r=s&&!s.isEmpty(),o=i!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(r||o)&&(c+=" (found",r&&(c+=` in field ${s}`),o&&(c+=` in document ${i}`),c+=")"),new $(R.INVALID_ARGUMENT,a+t+c)}function C0(t,e){return t.some(n=>n.isEqual(e))}/**
2662 * @license
2663 * Copyright 2020 Google LLC
2664 *
2665 * Licensed under the Apache License, Version 2.0 (the "License");
2666 * you may not use this file except in compliance with the License.
2667 * You may obtain a copy of the License at
2668 *
2669 *   http://www.apache.org/licenses/LICENSE-2.0
2670 *
2671 * Unless required by applicable law or agreed to in writing, software
2672 * distributed under the License is distributed on an "AS IS" BASIS,
2673 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2674 * See the License for the specific language governing permissions and
2675 * limitations under the License.
2676 */class yg{constructor(e,n,s,i,r){this._firestore=e,this._userDataWriter=n,this._key=s,this._document=i,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new $t(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new Aq(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){const n=this._document.data.field(xd("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class Aq extends yg{data(){return super.data()}}function xd(t,e){return typeof e=="string"?gg(t,e):e instanceof Rd?e._internalPath:e._delegate._internalPath}/**
2677 * @license
2678 * Copyright 2020 Google LLC
2679 *
2680 * Licensed under the Apache License, Version 2.0 (the "License");
2681 * you may not use this file except in compliance with the License.
2682 * You may obtain a copy of the License at
2683 *
2684 *   http://www.apache.org/licenses/LICENSE-2.0
2685 *
2686 * Unless required by applicable law or agreed to in writing, softw
2686are
2687 * distributed under the License is distributed on an "AS IS" BASIS,
2688 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2689 * See the License for the specific language governing permissions and
2690 * limitations under the License.
2691 */function P0(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new $(R.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class _g{}class Bc extends _g{}function Rt(t,e,...n){let s=[];e instanceof _g&&s.push(e),s=s.concat(n),function(r){const o=r.filter(c=>c instanceof Ig).length,a=r.filter(c=>c instanceof Md).length;if(o>1||o>0&&a>0)throw new $(R.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(s);for(const i of s)t=i._apply(t);return t}class Md extends Bc{constructor(e,n,s){super(),this._field=e,this._op=n,this._value=s,this.type="where"}static _create(e,n,s){return new Md(e,n,s)}_apply(e){const n=this._parse(e);return k0(e._query,n),new ms(e.firestore,e.converter,cp(e._query,n))}_parse(e){const n=Ud(e.firestore);return function(r,o,a,c,l,u,d){let h;if(l.isKeyField()){if(u==="array-contains"||u==="array-contains-any")throw new $(R.INVALID_ARGUMENT,`Invalid Query. You can't perform '${u}' queries on documentId().`);if(u==="in"||u==="not-in"){aw(d,u);const f=[];for(const m of d)f.push(ow(c,r,m));h={arrayValue:{values:f}}}else h=ow(c,r,d)}else u!=="in"&&u!=="not-in"&&u!=="array-contains-any"||aw(d,u),h=S0(a,o,d,u==="in"||u==="not-in");return ft.create(l,u,h)}(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function jn(t,e,n){const s=e,i=xd("where",t);return Md._create(i,s,n)}class Ig extends _g{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new Ig(e,n)}_parse(e){const n=this._queryConstraints.map(s=>s._parse(e)).filter(s=>s.getFilters().length>0);return n.length===1?n[0]:fs.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:(function(i,r){let o=i;const a=r.getFlattenedFilters();for(const c of a)k0(o,c),o=cp(o,c)}(e._query,n),new ms(e.firestore,e.converter,cp(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class wg extends Bc{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new wg(e,n)}_apply(e){const n=function(i,r,o){if(i.startAt!==null)throw new $(R.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new $(R.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new uc(r,o)}(e._query,this._field,this._direction);return new ms(e.firestore,e.converter,function(i,r){const o=i.explicitOrderBy.concat([r]);return new Wi(i.path,i.collectionGroup,o,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)}(e._query,n))}}function Jn(t,e="asc"){const n=e,s=xd("orderBy",t);return wg._create(s,n)}class vg extends Bc{constructor(e,n,s){super(),this.type=e,this._limit=n,this._limitType=s}static _create(e,n,s){return new vg(e,n,s)}_apply(e){return new ms(e.firestore,e.converter,lu(e._query,this._limit,this._limitType))}}function Od(t){return yq("limit",t),vg._create("limit",t,"F")}class Tg extends Bc{constructor(e,n,s){super(),this.type=e,this._docOrFields=n,this._inclusive=s}static _create(e,n,s){return new Tg(e,n,s)}_apply(e){const n=R0(e,this.type,this._docOrFields,this._inclusive);return new ms(e.firestore,e.converter,function(i,r){return new Wi(i.path,i.collectionGroup,i.explicitOrderBy.slice(),i.filters.slice(),i.limit,i.limitType,r,i.endAt)}(e._query,n))}}function yp(...t){return Tg._create("startAfter",t,!1)}class bg extends Bc{constructor(e,n,s){super(),this.type=e,this._docOrFields=n,this._inclusive=s}static _create(e,n,s){return new bg(e,n,s)}_apply(e){const n=R0(e,this.type,this._docOrFields,this._inclusive);return new ms(e.firestore,e.converter,function(i,r){return new Wi(i.path,i.collectionGroup,i.explicitOrderBy.slice(),i.filters.slice(),i.limit,i.limitType,i.startAt,r)}(e._query,n))}}function Cq(...t){return bg._create("endBefore",t,!1)}function R0(t,e,n,s){if(n[0]=Ae(n[0]),n[0]instanceof yg)return function(r,o,a,c,l){if(!c)throw new $(R.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${a}().`);const u=[];for(const d of fo(r))if(d.field.isKeyField())u.push(cu(o,c.key));else{const h=c.data.field(d.field);if(yd(h))throw new $(R.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+d.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(h===null){const f=d.field.canonicalString();throw new $(R.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${f}' (used as the orderBy) does not exist.`)}u.push(h)}return new Ro(u,l)}(t._query,t.firestore._databaseId,e,n[0]._document,s);{const i=Ud(t.firestore);return function(o,a,c,l,u,d){const h=o.explicitOrderBy;if(u.length>h.length)throw new $(R.INVALID_ARGUMENT,`Too many arguments provided to ${l}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const f=[];for(let m=0;m<u.length;m++){const v=u[m];
2691if(h[m].field.isKeyField()){if(typeof v!="string")throw new $(R.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${l}(), but got a ${typeof v}`);if(!Wm(o)&&v.indexOf("/")!==-1)throw new $(R.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${l}() must be a plain document ID, but '${v}' contains a slash.`);const b=o.path.child($e.fromString(v));if(!oe.isDocumentKey(b))throw new $(R.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${l}() must result in a valid document path, but '${b}' is not because it contains an odd number of segments.`);const D=new oe(b);f.push(cu(a,D))}else{const b=S0(c,l,v);f.push(b)}}return new Ro(f,d)}(t._query,t.firestore._databaseId,i,e,n,s)}}function ow(t,e,n){if(typeof(n=Ae(n))=="string"){if(n==="")throw new $(R.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Wm(e)&&n.indexOf("/")!==-1)throw new $(R.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const s=e.path.child($e.fromString(n));if(!oe.isDocumentKey(s))throw new $(R.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);return cu(t,new oe(s))}if(n instanceof $t)return cu(t,n._key);throw new $(R.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Ad(n)}.`)}function aw(t,e){if(!Array.isArray(t)||t.length===0)throw new $(R.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function k0(t,e){const n=function(i,r){for(const o of i)for(const a of o.getFlattenedFilters())if(r.indexOf(a.op)>=0)return a.op;return null}(t.filters,function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(n!==null)throw n===e.op?new $(R.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new $(R.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class Pq{convertValue(e,n="none"){switch(Tr(e)){case 0:return null;case 1:return e.booleanValue;case 2:return dt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(vr(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 10:return this.convertObject(e.mapValue,n);default:throw fe()}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const s={};return Ur(e,(i,r)=>{s[i]=this.convertValue(r,n)}),s}convertGeoPoint(e){return new hg(dt(e.latitude),dt(e.longitude))}convertArray(e,n){return(e.values||[]).map(s=>this.convertValue(s,n))}convertServerTimestamp(e,n){switch(n){case"previous":const s=Bm(e);return s==null?null:this.convertValue(s,n);case"estimate":return this.convertTimestamp(ac(e));default:return null}}convertTimestamp(e){const n=Vi(e);return new wt(n.seconds,n.nanos)}convertDocumentKey(e,n){const s=$e.fromString(e);He(ZS(s));const i=new cc(s.get(1),s.get(3)),r=new oe(s.popFirst(5));return i.isEqual(n)||ai(`Document ${r} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),r}}/**
2692 * @license
2693 * Copyright 2020 Google LLC
2694 *
2695 * Licensed under the Apache License, Version 2.0 (the "License");
2696 * you may not use this file except in compliance with the License.
2697 * You may obtain a copy of the License at
2698 *
2699 *   http://www.apache.org/licenses/LICENSE-2.0
2700 *
2701 * Unless required by applicable law or agreed to in writing, softw
2701are
2702 * distributed under the License is distributed on an "AS IS" BASIS,
2703 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2704 * See the License for the specific language governing permissions and
2705 * limitations under the License.
2706 */function Rq(t,e,n){let s;return s=t?t.toFirestore(e):e,s}/**
2707 * @license
2708 * Copyright 2020 Google LLC
2709 *
2710 * Licensed under the Apache License, Version 2.0 (the "License");
2711 * you may not use this file except in compliance with the License.
2712 * You may obtain a copy of the License at
2713 *
2714 *   http://www.apache.org/licenses/LICENSE-2.0
2715 *
2716 * Unless required by applicable law or agreed to in writing, software
2717 * distributed under the License is distributed on an "AS IS" BASIS,
2718 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2719 * See the License for the specific language governing permissions and
2720 * limitations under the License.
2721 */class ma{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class U0 extends yg{constructor(e,n,s,i,r,o){super(e,n,s,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=r}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new Sl(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const s=this._document.data.field(xd("DocumentSnapshot.get",e));if(s!==null)return this._userDataWriter.convertValue(s,n.serverTimestamps)}}}class Sl extends U0{data(e={}){return super.data(e)}}class N0{constructor(e,n,s,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new ma(i.hasPendingWrites,i.fromCache),this.query=s}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(s=>{e.call(n,new Sl(this._firestore,this._userDataWriter,s.key,s,new ma(this._snapshot.mutatedKeys.has(s.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new $(R.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,r){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(a=>{const c=new Sl(i._firestore,i._userDataWriter,a.doc.key,a.doc,new ma(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:c,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>r||a.type!==3).map(a=>{const c=new Sl(i._firestore,i._userDataWriter,a.doc.key,a.doc,new ma(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let l=-1,u=-1;return a.type!==0&&(l=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),u=o.indexOf(a.doc.key)),{type:kq(a.type),doc:c,oldIndex:l,newIndex:u}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}}function kq(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return fe()}}/**
2722 * @license
2723 * Copyright 2020 Google LLC
2724 *
2725 * Licensed under the Apache License, Version 2.0 (the "License");
2726 * you may not use this file except in compliance with the License.
2727 * You may obtain a copy of the License at
2728 *
2729 *   http://www.apache.org/licenses/LICENSE-2.0
2730 *
2731 * Unless required by applicable law or agreed to in writing, software
2732 * distributed under the License is distributed on an "AS IS" BASIS,
2733 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2734 * See the License for the specific language governing permissions and
2735 * limitations under the License.
2736 */function en(t){t=qn(t,$t);const e=qn(t.firestore,Gi);return pq(Pd(e),t._key).then(n=>x0(e,t,n))}class Eg extends Pq{constructor(e){super(),this.firestore=e}convertBytes(e){return new No(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);
2736return new $t(this.firestore,null,n)}}function pi(t){t=qn(t,ms);const e=qn(t.firestore,Gi),n=Pd(e),s=new Eg(e);return P0(t._query),mq(n,t._query).then(i=>new N0(e,s,t,i))}function Uq(t,e,n){t=qn(t,$t);const s=qn(t.firestore,Gi),i=Rq(t.converter,e);return Dg(s,[bq(Ud(s),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,as.none())])}function xr(t,e,n,...s){t=qn(t,$t);const i=qn(t.firestore,Gi),r=Ud(i);let o;return o=typeof(e=Ae(e))=="string"||e instanceof Rd?Sq(r,"updateDoc",t._key,e,n,s):Eq(r,"updateDoc",t._key,e),Dg(i,[o.toMutation(t._key,as.exists(!0))])}function Ld(t){return Dg(qn(t.firestore,Gi),[new Km(t._key,as.none())])}function Sg(t,...e){var n,s,i;t=Ae(t);let r={includeMetadataChanges:!1,source:"default"},o=0;typeof e[o]!="object"||rw(e[o])||(r=e[o],o++);const a={includeMetadataChanges:r.includeMetadataChanges,source:r.source};if(rw(e[o])){const d=e[o];e[o]=(n=d.next)===null||n===void 0?void 0:n.bind(d),e[o+1]=(s=d.error)===null||s===void 0?void 0:s.bind(d),e[o+2]=(i=d.complete)===null||i===void 0?void 0:i.bind(d)}let c,l,u;if(t instanceof $t)l=qn(t.firestore,Gi),u=_d(t._key.path),c={next:d=>{e[o]&&e[o](x0(l,t,d))},error:e[o+1],complete:e[o+2]};else{const d=qn(t,ms);l=qn(d.firestore,Gi),u=d._query;const h=new Eg(l);c={next:f=>{e[o]&&e[o](new N0(l,h,d,f))},error:e[o+1],complete:e[o+2]},P0(t._query)}return function(h,f,m,v){const b=new dg(v),D=new lg(f,b,m);return h.asyncQueue.enqueueAndForget(async()=>og(await fu(h),D)),()=>{b.$a(),h.asyncQueue.enqueueAndForget(async()=>ag(await fu(h),D))}}(Pd(l),u,a,c)}function Dg(t,e){return function(s,i){const r=new Zs;return s.asyncQueue.enqueueAndForget(async()=>tq(await fq(s),i,r)),r.promise}(Pd(t),e)}function x0(t,e,n){const s=n.docs.get(e._key),i=new Eg(t);return new U0(t,i,e._key,s,new ma(n.hasPendingWrites,n.fromCache),e.converter)}function Nq(t){return new pg("increment",t)}(function(e,n=!0){(function(i){jo=i})(Rr),ln(new Zt("firestore",(s,{instanceIdentifier:i,options:r})=>{const o=s.getProvider("app").getImmediate(),a=new Gi(new OF(s.getProvider("auth-internal")),new qF(s.getProvider("app-check-internal")),function(l,u){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new $(R.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new cc(l.options.projectId,u)}(o,i),o);return r=Object.assign({useFetchStreams:n},r),a._setSettings(r),a},"PUBLIC").setMultipleInstances(!0)),kt(SI,"4.6.1",e),kt(SI,"4.6.1","esm2017")})();const cw="[a-fA-F\\d:]",ki=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${cw})|(?<=${cw})(?=\\s|$))`:"",ns="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",ct="[a-fA-F\\d]{1,4}",Fd=`
2737(?:
2738(?:${ct}:){7}(?:${ct}|:)|                                    // 1:2:3:4:5:6:7::  1:2:3:4:5:6:7:8
2739(?:${ct}:){6}(?:${ns}|:${ct}|:)|                             // 1:2:3:4:5:6::    1:2:3:4:5:6::8   1:2:3:4:5:6::8  1:2:3:4:5:6::1.2.3.4
2740(?:${ct}:){5}(?::${ns}|(?::${ct}){1,2}|:)|                   // 1:2:3:4:5::      1:2:3:4:5::7:8   1:2:3:4:5::8    1:2:3:4:5::7:1.2.3.4
2741(?:${ct}:){4}(?:(?::${ct}){0,1}:${ns}|(?::${ct}){1,3}|:)| // 1:2:3:4::        1:2:3:4::6:7:8   1:2:3:4::8      1:2:3:4::6:7:1.2.3.4
2742(?:${ct}:){3}(?:(?::${ct}){0,2}:${ns}|(?::${ct}){1,4}|:)| // 1:2:3::          1:2:3::5:6:7:8   1:2:3::8        1:2:3::5:6:7:1.2.3.4
2743(?:${ct}:){2}(?:(?::${ct}){0,3}:${ns}|(?::${ct}){1,5}|:)| // 1:2::            1:2::4:5:6:7:8   1:2::8          1:2::4:5:6:7:1.2.3.4
2744(?:${ct}:){1}(?:(?::${ct}){0,4}:${ns}|(?::${ct}){1,6}|:)| // 1::              1::3:4:5:6:7:8   1::8            1::3:4:5:6:7:1.2.3.4
2745(?::(?:(?::${ct}){0,5}:${ns}|(?::${ct}){1,7}|:))             // ::2:3:4:5:6:7:8  ::2:3:4:5:6:7:8  ::8             ::1.2.3.4
2746)(?:%[0-9a-zA-Z]{1,})?                                             // %eth0            %1
2747`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),xq=new RegExp(`(?:^${ns}$)|(?:^${Fd}$)`),Mq=new RegExp(`^${ns}$`),Oq=new RegExp(`^${Fd}$`),Ag=t=>t&&t.exact?xq:new RegExp(`(?:${ki(t)}${ns}${ki(t)})|(?:${ki(t)}${Fd}${ki(t)})`,"g");Ag.v4=t=>t&&t.exact?Mq:new RegExp(`${ki(t)}${ns}${ki(t)}`,"g");Ag.v6=t=>t&&t.exact?Oq:new RegExp(`${ki(t)}${Fd}${ki(t)}`,"g");function Lq(t){return Ag.v4({exact:!0}).test(t)}const lw={};typeof lw.homedir>"u"||lw.homedir().replace(/\\/g,"/");
2747class Fq extends Error{constructor(e){super("Could not get the public IP address",e),this.name="IpNotFoundError"}}class M0 extends Error{constructor(){super("Request was cancelled"),this.name="CancelError"}get isCanceled(){return!0}}const Vq={timeout:5e3},qq={v4:["https://ipv4.icanhazip.com/","https://api.ipify.org/"],v6:["https://ipv6.icanhazip.com/","https://api6.ipify.org/"]},Gq=(t,e,n)=>{const s=new XMLHttpRequest;let i;const r=new Promise((o,a)=>{i=a,s.addEventListener("error",a,{once:!0}),s.addEventListener("timeout",a,{once:!0}),s.addEventListener("load",()=>{const c=s.responseText.trim();if(!c||!Lq(c)){a();return}o(c)},{once:!0}),s.open("GET",t),s.timeout=e.timeout,s.send()});return r.cancel=()=>{s.abort(),i(new M0)},r},Bq=(t,e)=>{let n;const s=async function(){const i=[...qq[t],...e.fallbackUrls??[]];let r;for(const o of i)try{return n=Gq(o,e,t),await n}catch(a){if(r=a,a instanceof M0)throw a}throw new Fq({cause:r})}();return s.cancel=()=>{n.cancel()},s};function jq(t){return Bq("v4",{...Vq,...t})}let $n,yt,Cg,zt,Vd,qd,Pg,Rg,br,kg,O0,Ei,Gd;const Ce=()=>$n,T=()=>yt,xe=()=>Cg,ae=()=>zt,ve=()=>Vd,p=()=>Rg,pr=()=>qd,G=()=>Pg,E=()=>br,$q=()=>kg,es=()=>O0,pc=()=>Ei,J=()=>Gd,L0=()=>{Ei=ri(),Ei.calendarWeek=Og(),Ei.calendarMonth=new Date().toLocaleString("default",{month:"long"}),Ei.calendarYear=new Date().getFullYear().toString(),Ei.calendarTerm=Y0()},Mr=async()=>{if(!$n){const{$firebaseApp:t}=We();$n=v0(t),yt=Fs(),yt.setHolidays(),Cg=Rs(),zt=Qe(),br=fi()}},q$=async()=>{$n||Mr(),Pg=fE(),kg=pE(),br.activeDashboard="admin",Ug()},G$=async()=>{$n||Mr(),Pg=fE(),Rg=mE(),Vd=_m(),qd=gm(),O0=uL(),Gd=ym(),br.activeDashboard="administration",L0(),j0(!1)},B$=async()=>{$n||Mr(),qd=gm(),Ei=ri(),kg=pE(),Rg=mE(),Vd=_m(),Gd=ym(),br.activeDashboard="facilitator",L0(),tD()},j$=async()=>{$n||Mr(),Gd=ym(),br=fi(),Vd=_m(),qd=gm(),Ei=ri(),br.activeDashboard="parents",JB()},uw=async t=>{$n||Mr();const e=localStorage.getItem("sessionTimingsVersion")||"0",n=localStorage.getItem("classroomsVersion")||"0",s=localStorage.getItem("subjectsVersion")||"0",i=localStorage.getItem("groupsVersion")||"0",r=localStorage.getItem("facilitatorsVersion")||"0",o=localStorage.getItem("topicsVersion")||"0",a=localStorage.getItem("defaultFacilitatorTopicsVersion")||"0",c=localStorage.getItem("calendarVersion")||"0",l=localStorage.getItem("studentsVersion")||"0",u=localStorage.getItem("feeTariffsVersion")||"0",d=localStorage.getItem("mixedGroupsVersion")||"0",h=localStorage.getItem("mixedGroupsCombinedVersion")||"0",f={appVersion:"1.0.54",calendarVersion:c,classroomsVersion:n,facilitatorsVersion:r,sessionTimingsVersion:e,subjectsVersion:s,groupsVersion:i,studentsVersion:l,topicsVersion:o,defaultTopicsVersion:a,feeTariffsVersion:u,mixedGroupsVersion:d,mixedGroupsCombinedVersion:h,isMobile:window.matchMedia("(max-width: 992px)").matches,ipAddress:await jq()||"IP not available"};yt.preventRefresh=!0;const m=await et("initAppVersions",f,!1,!1);if(yt.isProduction||console.log(m.data),m.data.type==="success"){let v=!1;if((m.data.sessionTimingsVersion!==parseInt(e)||m.data.classroomsVersion!==parseInt(n)||m.data.subjectsVersion!==parseInt(s)||m.data.facilitatorsVersion!==parseInt(r)||m.data.topicsVersion!==parseInt(o)||m.data.mixedGroupsCombinedVersion!==parseInt(h))&&(v=!0),m.data.sessionTimingsVersion!==parseInt(e)&&zt.saveSessionTimings(m.data.sessionTimingsJSON,m.data.sessionTimingsVersion),m.data.classroomsVersion!==parseInt(n)&&zt.saveClassrooms(m.data.classroomsJSON,m.data.classroomsVersion),m.data.subjectsVersion!==parseInt(s)&&zt.saveSubjects(m.data.subjectsJSON,m.data.subjectsVersion),m.data.facilitatorsVersion!==parseInt(r)&&Hq(m.data.facilitatorsVersion),m.data.topicsVersion!==parseInt(o)&&zt.saveTopics(m.data.topicsJSON,m.data.topicsVersion),m.data.defaultTopicsVersion!==parseInt(a)&&zt.saveDefaultTopics(m.data.defaultTopicsJSON,m.data.defaultTopicsVersion),m.data.groupsVersion!==parseInt(i)&&zt.saveGroups(m.data.groupsJSON,m.data.groupsVersion),m.data.mixedGroupsVersion!==parseInt(d)&&zt.saveMixedGroups(m.data.mixedGroupsJSON,m.data.mixedGroupsVersion),m.data.mixedGroupsCombinedVersion!==parseInt(h)&&zt.saveMixedGroupsCombined(m.data.mixedGroupsCombined,m.data.mixedGroupsCombinedVersion),v&&(await yu(c),t!=="guardian"&&t!=="student"&&jc("")),m.data.calendarVersion!==parseInt(c)&&yu(m.data.calendarVersion),T().isParentFacilitator&&m.data.studentsVersion!==parseInt(l)&&_p(m.data.studentsVersion),t==="guardian"||t==="student"){yt.preventRefresh=!1;return}m.data.studentsVersion!==parseInt(l)&&_p(m.data.studentsVersion),m.data.feeTariffsVersion!==parseInt(u)&&zt.saveFeeTariffs(m.data.feeTariffsJSON,m.data.feeTariffsVersion),yt.preventRefresh=!1}},$$=async()=>{await _p("0")};async function _p(t){yt.initRunningTask("Updating students..."),zt.students=null;let e=[];const n=jn("status","==","active"),s=Jn("groupUUID","asc"),i=Jn("name","asc"),r=Rt(gs($n,"Students"),n,s,i);
2747(await pi(r)).forEach(a=>{const c={studentUUID:a.id,name:a.data().name,groupUUID:a.data().groupUUID};e.push(c)}),zt.saveStudents(JSON.stringify(e),t),yt.finishRunningTask("Student list updated","success")}async function Hq(t){yt.initRunningTask("Updating facilitators..."),zt.facilitators=null;let e=[];const n=Jn("facilitatorname","asc"),s=Rt(gs($n,"Facilitators"),n);(await pi(s)).forEach(r=>{const o={facilitatorUUID:r.id,facilitator:r.data().facilitatorname,status:r.data().status};e.push(o)}),zt.saveFacilitators(JSON.stringify(e),t),yt.finishRunningTask("Facilitator list updated","success")}function H$(t){$n||Mr();const e=Rt(gs($n,"Notifications"),jn("status","==","active"),jn("memberUUID","==",Cg.authUser.uid),Jn("date","desc"));return{unsubscribeNotifications:Sg(e,s=>{let i=s.size;yt.notificationsCount=i,s.forEach(r=>{if(r.exists()){if(!yt.notifications.items.some(o=>o.notificationUUID===r.id)){let o=r.data();o.notificationUUID=r.id,o.date=Se(o.date),yt.notifications.items.unshift(o),o.isNew&&(yt.notifications.pendingNotifications=!0),yt.notificationState==="read"&&CG(t,o.action)}r.data().isNew||i--}i>9&&(yt.notificationsCount="9+"),yt.notificationsCount=i.toString()}),yt.notificationState="read"})}}async function W$(t){let e=0,n=10;if(G().initWhatsApp=!1,G().whatsappMessages=[],$n||Mr(),!T().whatsAppInfo){let d=Ve(Ce(),"WhatsApp",t),h=await en(d);if(!h.exists()){T().setAlert("error","WhatsApp number not found");return}let f=h.data();f.whatsappUUID=h.id,T().whatsAppInfo=f}nG();const s=T().whatsAppInfo.received+T().whatsAppInfo.sent;s>0&&(e=s-10,n=s+100);const i=gs(Ce(),`WhatsApp/${T().whatsAppInfo.whatsappUUID}/Messages`),r=Jn("msg_count","desc"),o=jn("msg_count",">=",e),a=jn("msg_count","<=",n),c=Od(100),l=Rt(i,o,a,r,c);return{unsubscribeWhatsAppUpdates:Sg(l,d=>
2747{d.docChanges().forEach(h=>{if(G().initWhatsApp||(G().whatsAppScrolling=!0),h.type==="modified"){const f=G().whatsappMessages.findIndex(v=>v.whatsappUUID===h.doc.id),m=h.doc.data();m.created_At=m.created_At.toDate(),m.whatsappUUID=h.doc.id,G().whatsappMessages[f]=m}else if(h.type==="added"&&!G().whatsappMessages.some(f=>f.whatsappUUID===h.doc.id)){const f=h.doc.data();f.created_At=f.created_At.toDate(),f.whatsappUUID=h.doc.id,G().initWhatsApp&&(G().latestWhatsAppMessage=f),G().initWhatsApp?(G().whatsAppScrolling=!0,G().whatsappMessages.push(f),setTimeout(()=>{G().whatsAppScrolling=!1},500)):G().whatsappMessages.unshift(f)}}),G().initWhatsApp=!0,setTimeout(()=>{G().whatsAppScrolling=!1},500)})}}const Wq=async()=>{const t=gs(Ce(),"Log/Warnings/System"),e=Jn("loggedAt","desc"),n=Rt(t,e);G().warnings=[],(await pi(n)).forEach(i=>{const r=i.data();r.warningUUID=i.id,G().warnings.push(r)}),E().setActiveListItem(G().warnings[0]),G().hasWarnings=!0},K$=async()=>{E().setUILoading(!0);let t=Ve(Ce(),"Log/Warnings/System",E().activeListItem.warningUUID);await Ld(t),t=Ve(Ce(),"Shared","Data"),await xr(t,{systemWarnings:G().sidePaneItems[4].count-1}),G().warnings=G().warnings.filter(e=>e.warningUUID!==E().activeListItem.warningUUID),G().sidePaneItems[4].count--,E().setActiveListItem(G().warnings[0]),E().setUILoading(!1)},vt=async(t,e)=>new Promise(async n=>{E().progress=!0,E().processing=!0;try{const s=Ve(Ce(),t,e);let i=await en(s);E().progress=!1,E().processing=!1,n(i)}catch(s){console.log(s)}}),zi=async(t,e,n)=>new Promise(async s=>{E().progress=!0,E().processing=!0;try{const i=gs(Ce(),t),r=e.map(l=>jn(l.field,l.operator,l.value)),o=(n==null?void 0:n.map(l=>l&&l.field&&l.direction?Jn(l.field,l.direction):null).filter(Boolean))||[],a=Rt(i,...r,...o),c=await pi(a);E().progress=!1,E().processing=!1,s(c)}catch(i){console.log(i)}}),F0=async(t,e,n,s)=>new Promise(async i=>{E().progress=!0,E().processing=!0;try{const r=gs(Ce(),t),o=e.map(u=>jn(u.field,u.operator,u.value)),a=(n==null?void 0:n.map(u=>u&&u.field&&u.direction?Jn(u.field,u.direction):null).filter(Boolean))||[];let c=Rt(r,...o,...a,Od(s));const l=await pi(c);E().progress=!1,E().processing=!1,i(l)}catch(r){console.log(r)}}),z$=async(t,e,n,s,i)=>new Promise(async r=>{E().progress=!0,E().processing=!0;try{const o=gs(Ce(),t),a=e.map(d=>jn(d.field,d.operator,d.value)),c=(n==null?void 0:n.map(d=>d&&d.field&&d.direction?Jn(d.field,d.direction):null).filter(Boolean))||[];let l=Rt(o,...a,...c);l=Rt(l,Od(10)),s&&(i==="next"?l=Rt(l,yp(s)):i==="prev"&&(l=Rt(l,Cq(s))));const u=await pi(l);E().progress=!1,E().processing=!1,r(u)}catch(o){console.log(o)}}),Fe=async(t,e,n)=>new Promise(async s=>{E().progress=!0,E().processing=!0;try{const i=Ve(Ce(),t,e);await xr(i,n),E().progress=!1,E().processing=!1,s("success")}catch(i){console.log(i)}}),Bd=async(t,e,n)=>new Promise(async s=>{E().progress=!0,E().processing=!0;try{const i=Ve(Ce(),t,e);await Uq(i,n),E().progress=!1,E().processing=!1,s("success")}catch(i){console.log(i)}}),Kq=async(t,e)=>new Promise(async n=>{E().progress=!0,E().processing=!0;try{const s=Ve(Ce(),t,e);await Ld(s),E().progress=!1,E().processing=!1,n("success")}catch(s){console.log(s)}}),Or=async(t,e,n,s)=>new Promise(async i=>{E().progress=!0,E().processing=!0;try{const r=Ve(Ce(),t,e);await xr(r,{[n]:Nq(s)}),E().progress=!1,E().processing=!1,i("success")}catch(r){console.log(r)}}),zq=async()=>{G().hasErrors||(G().errors=[],(await zi("Log/Errors/Functions",[],[{field:"loggedAt",direction:"desc"}])).forEach(s=>{const i=s.data();i.errorUUID=s.id,G().errors.push(i)})),E().setActiveListItem(G().errors[0]),G().hasErrors=!0},J$=async()=>{E().setUILoading(!0),await Kq("Log/Errors/Functions",E().activeListItem.errorUUID),await Or("Shared","Data","functionErrors",-1),G().errors=G().errors.filter(t=>t.errorUUID!==E().activeListItem.errorUUID),G().sidePaneItems[3].count--,E().setActiveListItem(G().errors[0]),E().setUILoading(!1)},Ug=async()=>{let t=Ve(Ce(),"Shared","Data"),e=await en(t);if(e.exists()){E().setPagLimit(e.data().paginationLimit),G().setMemberCount(e.data().memberCount),G().sidePaneItems[2].count=e.data().scheduledTasks,G().sidePaneItems[3].count=e.data().functionErrors,G().sidePaneItems[4].count=e.data().systemWarnings,G().sidePaneItems[5].count=e.data().backendEmail
2747s,G().sidePaneItems[6].count=e.data().whatsAppNumbers,G().sidePaneItems[7].count=e.data().feedback,G().sidePaneItems[8].count=e.data().facilitatorsAll;const n={unverified:e.data().unverified,members:e.data().members,users:e.data().users,all:e.data().memberCount,blocked:e.data().blocked};G().memberFilters[0].count=e.data().memberCount,G().memberFilters[1].count=e.data().guardians,G().memberFilters[2].count=e.data().students,G().memberFilters[3].count=e.data().facilitators,G().memberFilters[4].count=e.data().administration,G().memberFilters[5].count=e.data().blocked,G().nodeMailerFilters[0].count=e.data().backendEmails,G().nodeMailerFilters[1].count=e.data().nodemailInquires,G().nodeMailerFilters[2].count=e.data().nodemailAdmissions,G().nodeMailerFilters[3].count=e.data().nodemailStudentFeedback,G().nodeMailerFilters[4].count=e.data().nodemailPayment,G().nodeMailerFilters[5].count=e.data().nodemailWebmail,G().nodeMailerFilters[6].count=e.data().nodemailMembers,G().nodeMailerFilters[7].count=e.data().nodemailContrubution,G().setMembersCount(n),t=Ve(Ce(),"App","Data"),e=await en(t),e.exists()&&(G().setFilesCount(e.data().fileCount),$q().setFileCount(e.data().fileCount));const s=localStorage.getItem("membersFilter");s&&E().setSelectedFilter(JSON.parse(s))}},Jq=async t=>{switch(Ug(),t){case"newMember":E().activeSidePane&&V0("init");break;case"newFunctionError":G().hasErrors=!1,E().activeSidePane==="systemErrors"&&zq();break;case"adminWarning":G().hasWarnings=!1,E().activeSidePane==="warnings"&&Wq();break}},Yq=async()=>{E().clearPagCollection(),E().setPagLastDocRef(null)},Y$=async t=>{const e=Ve(Ce(),"Shared","Data");await xr(e,{paginationLimit:t})},Qq=async t=>{qt("/admin/dash/errors"),E().setActiveSidePane("systemErrors"),G().errors.forEach(e=>{e.errorUUID===t&&E().setActiveListItem(e)})},Xq=async t=>{qt("/admin/dash/warnings"),E().setActiveSidePane("warnings"),G().warnings.forEac
2747h(e=>{e.warningUUID===t&&E().setActiveListItem(e)})},Zq=async t=>{qt("/admin/dash/members"),E().setActiveSidePane("members"),E().pagCollection.forEach(e=>{e.uid===t&&(E().setPagSelectedItem(e),E().setActiveListItem(e))})},eG=t=>{t&&(E().setDisableInputs(!0),E().setTabDetailProgress(!0))},tG=()=>{E().setDisableInputs(!1),E().setTabDetailProgress(!1)},V0=async t=>{eG(!0);let e=Od(E().pagLimit),n,s,i=gs(Ce(),"Members"),r=Jn(E().selectedSort.action);if((E().selectedSort.action==="signinCount"||E().selectedSort.action==="created")&&(r=Jn(E().selectedSort.action,"desc")),t==="prev")E().getPagCollectionStack(t);else{let o=E().pagLastDocRef!==null&&E().pagCollection.length>0;if(o&&(o=E().pagLastDocRef.data().email===E().pagCollection[E().pagCollection.length-1].email),t==="init"?(await Yq(),s=null,n=null,E().selectedFilter.action==="blocked"?s=jn("status","==",E().selectedFilter.action):s=jn("role","==",E().selectedFilter.action),E().setPagTotal(E().selectedFilter.count),E().selectedFilter.action==="all"?n=Rt(i,r,e):n=Rt(i,s,r,e)):o&&(s===null?n=Rt(i,r,yp(E().pagLastDocRef),e):n=Rt(i,s,r,yp(E().pagLastDocRef),e)),t==="init"||o){E().pagCollection=[];let a=await pi(n);a.forEach(c=>{const l=c.data();l.activeListItem=c.data().email,l.uid=c.id,l.created=c.data().created.toDate(),l.lastActivity=c.data().lastActivity.toDate(),l.lastUpdated=c.data().lastUpdated.toDate(),l.appVersion=c.data().appVersion||"1.0.0",E().setPagCollectionItem(l),E().setPagCollectionStackItem(l)}),E().setPagLastDocRef(a.docs[a.docs.length-1])}else E().getPagCollectionStack(t)}E().pagCollection.length>0?(E().setPagSelectedItem(E().pagCollection[0]),E().setActiveListItem(E().pagSelectedItem.activeListItem),E().setPagination(t)):(E().setTabDetailTitle(`no ${E().selectedFilter.action} found`),E().setPagLabel("")),tG()},Q$=async t=>{T().initRunningTask(`changing member status to ${t}`),E().setUILoading(!0);const e={uid:E().pagSelectedItem.uid,token:E().pagSelectedItem.familyToken,role:t},n=await et("updateMemberType",e,!0,!1);n.data.type==="success"?(t==="blocked"?E().pagSelectedItem.status=t:t==="unblock"&&(E().pagSelectedItem.status="verified"),T().finishRunningTask("member status updated","success"),E().setUILoading(!1)):(T().stopRunningTask(),T().setAlert("error",n.data.message))},X$=async()=>{const t=[{field:"status",operator:"==",value:"authPending"}],e=[{field:"facilitatorname",direction:"asc"}];G().dialogFacilitators.facilitators.length===0&&(await zi("Facilitators",t,e)).forEach(s=>{const i=s.data();G().dialogFacilitators.facilitators.push(i)}),G().dialogFacilitators.show=!0},Z$=async(t,e)=>{G().dialogFacilitators.show=!1;let n=`Adding ${E().pagSelectedItem.name} to facilitators is currently unavailable.`;t||(n=`Removing ${E().pagSelectedItem.name} from facilitators is currently unavailable.`),T().setAlert("info",n)},e6=async()=>{const t={uid:E().pagSelectedItem.uid,role:E().pagSelectedItem.role,status:E().pagSelectedItem.status};(await et("deleteMember",t,!0,!1)).data.type==="success"&&(Ug(),V0("init"))},t6=async t=>{T().initRunningTask("Enabling notifications "),E().setUILoading(!0);const e={collection:q0(t),memberRefCollection:t,memberUUID:E().pagSelectedItem.uid},n=await et("addNotificationMember",e,!1,!1);n.data.type==="success"?(T().finishRunningTask("Notifications enabled","success"),E().pagSelectedItem[t]=!0,E().setUILoading(!1)):(T().stopRunningTask(),T().setAlert("error",n.data.message))},n6=async t=>{T().initRunningTask("Disabling notifications "),E().setUILoading(!0);const e={collection:q0(t),memberRefCollection:t,memberUUID:E().pagSelectedItem.uid},n=await et("removeNotificationMember",e,!1,!1);n.data.type==="success"?(T().finishRunningTask("Notifications disabled","success"),E().pagSelectedItem[t]=!1,E().setUILoading(!1)):(T().stopRunningTask(),T().setAlert("error",n.data.message))},q0=t=>{switch(t){case"notificationsFacilitator":return"facilitators";case"notificationsAdministration":return"administration";case"notificationsParents":return"parents";case"notificationsStudents":return"students"}return""},s6=async()=>{const t=Rt(gs(Ce(),"Notifications"),jn("status","==","active"),jn("memberUUID","==",E().pagSelectedItem.uid),Jn("date","asc"));
2747G().dialogNotifications.notifications=[],(await pi(t)).forEach(n=>{const s=n.data();s.notificationUUID=n.id,s.date=Se(s.date),G().dialogNotifications.notifications.push(s)}),G().dialogNotifications.show=!0,G().dialogNotifications.title=`${E().pagSelectedItem.name}'s notifications`},i6=async()=>{G().dialogNotifications.notifications.forEach(async t=>{let e=Ve(Ce(),"Notifications",t.notificationUUID);await xr(e,{isNew:!1}),t.isNew=!1})},r6=async()=>{G().dialogNotifications.notifications.forEach(async t=>{let e=Ve(Ce(),"Notifications",t.notificationUUID);await Ld(e),G().dialogNotifications.notifications.splice(G().dialogNotifications.notifications.indexOf(t),1)})},o6=async()=>{G().dialogMembersLoginHistory.items=[];const t=[],e=[{field:"loginTime",direction:"desc"}];(await F0(`Members/${E().pagSelectedItem.uid}/LoginHistory`,t,e,20)).forEach(s=>{const i=s.data();i.loginTime=Se(i.loginTime),G().dialogMembersLoginHistory.items.push(i)}),G().dialogMembersLoginHistory.show=!0},a6=async()=>{G().whatsappNumbers=[],(await zi("WhatsApp",[{field:"status",operator:"!=",value:"disabled"}],[{field:"name",direction:"asc"}])).forEach(s=>{const i=s.data();i.whatsappUUID=s.id,i.last_received_at&&i.last_received_at!==""&&(i.last_received_at=Se(i.last_received_at)),i.last_sent_at&&i.last_sent_at!==""&&(i.last_sent_at=Se(i.last_sent_at)),i.last_template_sent_At&&i.last_template_sent_At!==""&&(i.last_template_sent_At=Se(i.last_template_sent_At)),G().whatsappNumbers.push(i)}),T().whatsAppInfo=G().whatsappNumbers[0],G().hasWhatsApps=!0},c6=async t=>{t.length<=10&&(t=`91${t}`);const e=`${t}`,n=await vt("WhatsApp",e),s=n.data();s.whatsappUUID=n.id,s.last_received_at&&s.last_received_at!==""&&(s.last_received_at=Se(s.last_received_at)),s.last_sent_at&&s.last_sent_at!==""&&(s.last_sent_at=Se(s.last_sent_at)),s.last_template_sent_At&&s.last_template_sent_At!==""&&(s.last_template_sent_At=Se(s.last_template_sent_At)),T().whatsAppInfo=s,T().dialogWhatsApp.show=!0,setTimeout(()=>{T().whatsAppListening=!0},200)};let Kh=!1;const nG=async()=>{if(T().whatsAppInfo.last_in_Wa_ID!==""&&!Kh){Kh=!0;const t={msg_id:T().whatsAppInfo.last_in_Wa_ID,from:T().whatsAppInfo.whatsappUUID},e=await et("whatsAppMessageRead",t,!1,!1);T().whatsAppInfo.last_in_Wa_ID="",Kh=!1,e.data.type!=="success"?T().setAlert("error",e.data.message):T().whatsAppInfo.last_in_Wa_ID=""}},l6=async()=>{T().initRunningTask("sending message "),E().setUILoading(!0);const t={to:T().whatsAppInfo.whatsappUUID,recipient:T().whatsAppInfo.name,msg_body:G().whatsappMessage.message,msg:G().whatsappMessage.message};let e="sendWhatsAppMessage";T().whatsAppInfo.isSession||(e="initiateWhatsAppMessage");const n=await et(e,t,!1,!1);n.data.type==="success"?(G().whatsappMessage.message="",T().finishRunningTask("message sent","success"),E().setUILoading(!1)):(T().stopRunningTask(),T().setAlert("error",n.data.message))},u6=async()=>{E().setUILoading(!0);const t={to:T().whatsAppInfo.whatsappUUID,name:T().whatsAppInfo.name,createNumber:!1};(await et("onboardWhatsApp",t,!1,!1)).data.type==="success"&&(T().whatsAppInfo.status="Active",T().setAlert("success","WhatsApp number initiated!")),E().setUILoading(!1)};let pl;const sG=new Uint8Array(16);function iG(){if(!pl&&(pl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pl(sG)}const St=[];for(let t=0;t<256;++t)St.push((t+256).toString(16).slice(1));function rG(t,e=0){return St[t[e+0]]+St[t[e+1]]+St[t[e+2]]+St[t[e+3]]+"-"+St[t[e+4]]+St[t[e+5]]+"-"+St[t[e+6]]+St[t[e+7]]+"-"+St[t[e+8]]+St[t[e+9]]+"-"+St[t[e+10]]+St[t[e+11]]+St[t[e+12]]+St[t[e+13]]+St[t[e+14]]+St[t[e+15]]}const oG=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),dw={randomUUID:oG};function Wo(t,e,n){if(dw.randomUUID&&!e&&!t)return dw.randomUUID();t=t||{};const s=t.random||(t.rng||iG)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,rG(s)}const Lr=async t=>{if(p().inquiries=[],t==="all"?p().inquiriesPageStatus="list":p().inquiriesPageStatus="status",!p().hasInquiries){p().allInquiries=[];const e=await vt("Inquiries","Inquiries");e.exists()&&(e.data().initialInquiry!==""&&(p().initialInquiries=JSON.parse(e.data().initialInquiry),Kr(p().initialInquiries,"initialInquiry"),p().inquiryStatuses[0].c
2747ount=p().initialInquiries.length,p().initialInquiries.sort((n,s)=>n.children[0].age.years!==s.children[0].age.years?s.children[0].age.years-n.children[0].age.years:s.children[0].age.months-n.children[0].age.months)),e.data().meeting!==""&&(p().meetingInquiries=JSON.parse(e.data().meeting),Kr(p().meetingInquiries,"meeting"),p().inquiryStatuses[1].count=p().meetingInquiries.length,p().meetingInquiries.sort((n,s)=>{const i=n.meetingDate&&n.meetingStart?new Date(`${n.meetingDate}T${n.meetingStart}`).getTime():1/0,r=s.meetingDate&&s.meetingStart?new Date(`${s.meetingDate}T${s.meetingStart}`).getTime():1/0;return i-r})),e.data().trial!==""&&(p().trialInquiries=JSON.parse(e.data().trial),Kr(p().trialInquiries,"trial"),p().inquiryStatuses[2].count=p().trialInquiries.length,p().trialInquiries.sort((n,s)=>{const i=n.children[0].trialStart?new Date(n.children[0].trialStart).getTime():1/0,r=s.children[0].trialStart?new Date(s.children[0].trialStart).getTime():1/0;return i-r})),e.data().onHold!==""&&(p().onHoldInquiries=JSON.parse(e.data().onHold),Kr(p().onHoldInquiries,"onHold"),p().inquiryStatuses[3].count=p().onHoldInquiries.length,p().onHoldInquiries.sort((n,s)=>n.children[0].age.years!==s.children[0].age.years?s.children[0].age.years-n.children[0].age.years:s.children[0].age.months-n.children[0].age.months)),e.data().notProceeding!==""&&(p().notProceedingInquiries=JSON.parse(e.data().notProceeding),Kr(p().notProceedingInquiries,"notProceeding"),p().inquiryStatuses[4].count=p().notProceedingInquiries.length,p().notProceedingInquiries.sort((n,s)=>n.children[0].age.years!==s.children[0].age.years?s.children[0].age.years-n.children[0].age.years:s.children[0].age.months-n.children[0].age.months)),e.data().admission!==""&&(p().admissionInquiries=JSON.parse(e.data().admission),Kr(p().admissionInquiries,"admission"),p().inquiryStatuses[5].count=p().admissionInquiries.length,p().admissionInquiries.sort((n,s)=>n.children[0].age.years!==s.children[0].age.years?s.children[0].age.years-n.children[0].age.years:s.children[0].age.months-n.children[0].age.months)),p().inquiryStatuses[6].count=p().allInquiries.length),p().hasInquiries=!0,p().allInquiries.sort((n,s)=>n.children[0].age.years!==s.children[0].age.years?s.children[0].age.years-n.children[0].age.years:s.children[0].age.months-n.children[0].age.months)}aG(t)},aG=t=>{switch(t){case"initialInquiry":p().inquiries=p().initialInquiries;break;case"meeting":p().inquiries=p().meetingInquiries;break;case"trial":p().inquiries=p().trialInquiries;break;case"onHold":p().inquiries=p().onHoldInquiries;break;case"notProceeding":p().inquiries=p().notProceedingInquiries;break;case"admission":p().inquiries=p().admissionInquiries;break}},Kr=(t,e)=>{t=t.filter(n=>n!==null),t.forEach(n=>{!n||!n.children||n.children.length===0||(n.children.forEach(s=>{const i=new Date(s.dob);s.age=X0(i),s.trialStart&&(s.trialStart=new Date(s.trialStart)),s.trialEnd&&(s.trialEnd=new Date(s.trialEnd))}),n.status=e,n.submitted=new Date(n.submitted),n.meetingDate&&(n.meetingDate=new Date(n.meetingDate)),p().allInquiries.push(n))})},d6=async()=>{T().initRunningTask(`Moving ${p().selectedInquiry.familyName} to ${p().dialogInquiryStatus.selectedStatus.item}`);const e=(await vt("Inquiries","Inquiries")).data();let n={initialInquiry:"",meeting:"",trial:"",onHold:"",notProceeding:"",admission:""},s=null;const i=a=>{if(e[a]!==""){let l=JSON.parse(e[a]).filter(u=>u.inquiryUUID===p().selectedInquiry.inquiryUUID?(s=u,!1):!0);n[a]=JSON.stringify(l)}};["initialInquiry","meeting","trial","onHold","notProceeding","admission"].forEach(i);let r=p().dialogInquiryStatus.selectedStatus.action;if(n[r]!==""){let a=JSON.parse(n[r]);a.push(s),n[r]=JSON.stringify(a)}await Fe("Inquiries","Inquiries",n);const o={status:p().dialogInquiryStatus.selectedStatus.action,lastEditDate:new Date,lastEditBy:xe().authUser.uid};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,o),p().selectedInquiry.status=p().dialogInquiryStatus.selectedStatus.action,p().selectedInquiry.statusDescription=xg(p().selectedInquiry.status),p().selectedStatus=p().dialogInquiryStatus.selectedStatus,p().hasInquiries=!1,await Lr(p().selectedStatus.action),T().finishRunningTask(`${p().selectedInquiry.familyName} moved to ${p().dialogInquiryStatus.selectedStatus.item}`,"success")},h6=async()=>{T().initRunningTask(`Moving ${p().selectedInquiry.familyName} to admission`);const t=["initialInquiry","meeting","trial","onHold","notProceeding","admission"],n=(await vt("Inquiries","Inquiries")).data();let s=null,i={initialInquiry:"",meeting:"",trial:"",onHold:"",notProceeding:"",admission:""};t.forEach(u=>{const d=n[u];if(!d)return;const f=JSON.parse(d).filter(m=>m.inquiryUUID===p().selectedInquiry.inquiryUUID?(s=m,!1):!0);i[u]=JSON.stringify(f)});
2747const r=(p().selectedInquiry.children||[]).map(u=>{const d={...u};return d.dob&&(ei(d.dob)?d.dob=Se(d.dob):d.dob instanceof Date||(d.dob=new Date(d.dob))),d.trialStart&&(ei(d.trialStart)?d.trialStart=Se(d.trialStart):d.trialStart instanceof Date||(d.trialStart=xo(d.trialStart))),d.trialEnd&&(ei(d.trialEnd)?d.trialEnd=Se(d.trialEnd):d.trialEnd instanceof Date||(d.trialEnd=xo(d.trialEnd))),d.trialEmail=d.trialEmail??!0,d.trialReminder=d.trialReminder??!1,d}),o={...s||{},...p().selectedInquiry,status:"admission",meetingEmail:!0,children:r};let a=[];i.admission&&(a=JSON.parse(i.admission));const c=a.findIndex(u=>u.inquiryUUID===p().selectedInquiry.inquiryUUID);c>-1?a[c]=o:a.push(o),i.admission=JSON.stringify(a),await Fe("Inquiries","Inquiries",i);const l={status:"admission",meetingEmail:!0,children:r,lastEditDate:new Date,lastEditBy:xe().authUser.uid};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,l),p().selectedInquiry.status="admission",p().selectedInquiry.meetingEmail=!0,p().selectedInquiry.children=r,p().selectedInquiry.statusDescription=xg("admission"),p().selectedStatus=p().inquiryStatuses.find(u=>u.action==="admission")||p().selectedStatus,p().hasInquiries=!1,await Lr("admission"),T().finishRunningTask(`${p().selectedInquiry.familyName} moved to admission`,"success")},f6=async()=>{T().initRunningTask("Sending Meetings Email"),p().emailType="";let t=T().dialogEmailPreview.htmlBody.replace("Click here",'<a href="https://goo.gl/maps/r9SHkgKSUoYSLhWm7" target="_blank" aria-label="Google Maps" noreferrer >Click here</a>');t=t.replace(p().meetingsData.formattedMeetingDate,`<strong>${p().meetingsData.formattedMeetingDate}</strong>`);const e={htmlBody:t,subject:T().dialogEmailPreview.subject,email:T().dialogEmailPreview.email,cc:T().emailCC,sender:T().mailerAccountAdmissions,attachments:[],sendEmail:!0,eventName:`Meeting with ${p().selectedInquiry.familyDescription}`,eventDescription:`Meeting with ${p().selectedInquiry.familyDescription}`,eventDate:p().meetingsData.date,eventStartTime:p().meetingsData.startTime,eventEndTime:p().meetingsData.endTime,calendarAccounts:["calendar_admissions","calendar_nandita"],attendees:"Shivani, Nandita and the family"},n=await et("meetingsEmail",e,!1,!1);if(n.data.type==="success"){const s={meetingPOC:p().meetingsData.meetingPOC,meetingDate:p().meetingsData.date,meetingStart:p().meetingsData.startTime,meetingEnd:p().meetingsData.endTime,meetingEmail:!0,lastEditDate:new Date,lastEditBy:xe().authUser.uid,meetingEventIDs:n.data.eventIDs};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,s),await G0(p().selectedInquiry.inquiryUUID,p().meetingsData.date,p().meetingsData.startTime,p().meetingsData.endTime,p().selectedStatus.action),p().emailType="",p().selectedInquiry.meetingPOC=p().meetingsData.meetingPOC,p().selectedInquiry.meetingDate=p().meetingsData.date.toLocaleDateString(),p().selectedInquiry.meetingEmail=!0,T().finishRunningTask("Success! Meetings email sent","success")}else T().stopRunningTask(),T().setAlert("error",n.data.message)},p6=async()=>{p().emailType="",T().initRunningTask("Sending Trialing Email");const e={htmlBody:T().dialogEmailPreview.htmlBody.replace(p().trialData.formattedTrialStart,`<strong>${p().trialData.formattedTrialStart}</strong>`),subject:T().dialogEmailPreview.subject,email:T().dialogEmailPreview.email,cc:T().emailCC,sender:T().mailerAccountAdmissions,attachments:[p().curriculumForm],inquiryUUID:p().selectedInquiry.inquiryUUID,studentName:p().trialData.trialChild.firstName,groupName:p().trialData.trialGroup.groupName,trialPeriod:H0(p().trialData.trialStart,p().trialData.trialEnd),trialStart:p().trialData.trialStart,trialEnd:p().trialData.trialEnd,calendarAccounts:["calendar_admissions","calendar_nandita"],sendEmail:!0,facilitatorNotifications:!0},n=await et("studentTrial",e,!1,!1);if(n.data.type==="success"){const s=JSON.parse(JSON.stringify(p().selectedInquiry.children));s.forEach(r=>{ei(r.dob)?r.dob=Se(r.dob):r.dob=new Date(r.dob),r.trialStart&&(r.trialStart=gu(r.trialStart)),r.trialEnd&&(r.trialEnd=gu(r.trialEnd)),r.firstName===p().trialData.trialChild.firstName&&(r.trialStart=p().trialData.tri
2747alStart,r.trialEnd=p().trialData.trialEnd,r.trialEmail=!0,r.trialGroupName=p().trialData.trialGroup.groupName,r.trialGroupUUID=p().trialData.trialGroup.groupUUID,r.trialReminder=!1)});const i={lastEditDate:new Date,lastEditBy:xe().authUser.uid,children:s,formsCurriculum:!0,trialEventIDs:n.data.eventIDs};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,i),await B0(p().selectedInquiry.inquiryUUID,p().trialData.trialStart,p().trialData.trialEnd,p().selectedStatus.action,p().trialData.trialChild),s.forEach(r=>{r.trialStart&&(r.trialStart=r.trialStart.toLocaleDateString()),r.trialEnd&&(r.trialEnd=r.trialEnd.toLocaleDateString()),r.firstName===p().trialData.trialChild.firstName&&(r.trialStart=p().trialData.trialStart.toLocaleDateString(),r.trialEnd=p().trialData.trialEnd.toLocaleDateString(),r.trialEmail=!0,r.trialReminder=!1)}),p().selectedInquiry.children=s,T().finishRunningTask("Success! Trialing email sent","success")}else T().stopRunningTask(),T().setAlert("error",n.data.message)},m6=async(t=!0)=>{p().emailType="";const e=!!p().selectedInquiry.familyToken;let n="Creating account and sending admission email";t?e&&(n="Sending admission email"):n="Creating account and completing admission",T().initRunningTask(n);let s=T().dialogEmailPreview.htmlBody.replace("Financials:","<strong>Financials:</strong>");s=s.replace("Family Profile:","<strong>Family Profile:</strong>");let i=[];p().selectedInquiry.guardians.forEach(a=>{i.push(a.email.toLowerCase())});const r={htmlBody:s,subject:T().dialogEmailPreview.subject,cc:T().emailCC,sender:T().mailerAccountAdmissions,recipients:i,attachments:[],guardians:[],familyDescription:p().selectedInquiry.familyDescription,familyName:p().selectedInquiry.familyName,inquiryUUID:p().selectedInquiry.inquiryUUID,sendEmail:t};p().selectedInquiry.familyToken?r.familyToken=p().selectedInquiry.familyToken:p().selectedInquiry.guardians.forEach(a=>{let c=a.prefix?a.prefix:"+91",l=`${c}${a.mobile}`.replace(/[\s+]/g,"");const u={address:a.address,dob:Se(a.dob),firstName:a.firstName,middleName:a.middleName,gender:a.gender,lastName:a.lastName,email:a.email,mobile:a.mobile,prefix:c,whatsApp:l,nationality:a.nationality,occupation:a.occupation,jobDescription:a.jobDescription,workPlace:a.workPlace,maritalStatus:p().selectedInquiry.maritalStatus};r.guardians.push(u)}),p().selectedInquiry.children.forEach(a=>{if(a.firstName===p().admissionData.admissionChild.firstName){let c=`${a.firstName} ${a.lastName}`;a.middleName&&(c=`${a.firstName} ${a.middleName} ${a.lastName}`);let l={firstName:a.firstName,middleName:a.middleName,lastName:a.lastName,name:c,dob:a.dob,gender:a.gender,nationality:a.nationality,groupUUID:p().admissionData.admissionGroupUUID,groupName:p().admissionData.admissionGroupName,admissionTerm:p().admissionData.admissionTerm,monthlyFee:p().admissionData.monthlyFee,feeTariffUUID:p().admissionData.feeTariffUUID,depositFee:p().admissionData.depositFee,admissionFee:p().admissionData.admissionFee,contribiutionType:p().admissionData.contribiutionType,contribiutionFee:p().admissionData.contribiutionFee,previousSchools:p().admissionData.admissionChild.previousSchools,paymentPending:!0};r.child=l}});const o=await et("onboardFamily",r,!1,!1);if(o.data.type==="success"){const a=JSON.parse(JSON.stringify(p().selectedInquiry.children));a.forEach(u=>{ei(u.dob)?u.dob=Se(u.dob):u.dob=new Date(u.dob),u.trialStart&&(u.trialStart=xo(u.trialStart)),u.trialEnd&&(u.trialEnd=xo(u.trialEnd)),u.firstName===p().admissionData.admissionChild.firstName&&(u.admissionTerm=p().admissionData.admissionTerm,u.depositFee=p().admissionData.depositFee,u.admissionFee=p().admissionData.admissionFee,u.monthlyFee=p().admissionData.monthlyFee,u.admissionEmail=!0,u.groupUUID=p().admissionData.admissionGroupUUID,u.groupName=p().admissionData.admissionGroupName,u.paymentPending=!0)});const c={familyToken:o.data.familyToken,lastEditDate:new Date,lastEditBy:xe().authUser.uid,children:a};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,c),p().selectedInquiry.familyToken=o.data.familyToken,a.forEach(u=>{u.trialStart instanceof Date&&(u.trialStart=u.trialStart.toLocaleDateString()),u.trialEnd instanceof Date&&(u.trialEnd=u.trialEnd.toLocaleDateString())}),p().selectedInquiry.children=a;let l="Success! Family record created and admission completed";t?(l="Success! Family record created and admission email sent",e&&(l="Admission email sent")):e&&(l="Admission completed"),T().finishRunningTask(l,"success")}else T().stopRunningTask(),T().setAlert("error",o.data.message)},g6=async t=>{T().initRunningTask("Creating payment receipt and sending email");const e={inquiryUUID:p().selectedInquiry.inquiryUUID,studentName:t.firstName,sendEmail:!0},n=await et("admissionPaymentEmail",e,!1,!1);if(n.data.type==="success"){const s=JSON.parse(JSON.stringify(p().selectedInquiry.children));
2747s.forEach(r=>{ei(r.dob)?r.dob=Se(r.dob):r.dob=new Date(r.dob),r.trialStart&&(r.trialStart=xo(r.trialStart)),r.trialEnd&&(r.trialEnd=xo(r.trialEnd)),r.firstName===t.firstName&&(r.paymentPending=!1)});const i={lastEditDate:new Date,lastEditBy:xe().authUser.uid,children:s};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,i),s.forEach(r=>{r.trialStart instanceof Date&&(r.trialStart=r.trialStart.toLocaleDateString()),r.trialEnd instanceof Date&&(r.trialEnd=r.trialEnd.toLocaleDateString())}),p().selectedInquiry.children=s,T().finishRunningTask("Payment receipt generated and email sent","success")}else T().stopRunningTask(),T().setAlert("error",n.data.message)},y6=async()=>{T().initRunningTask("Enrolling Student");const t=await vt("Families",p().selectedInquiry.familyToken);console.log(t.data());const n=t.data().children.find(d=>d.firstName===p().studentToEnroll.firstName);console.log("child",n);const s=n.feeTariffUUID;let i="";p().selectedInquiry.guardians.forEach(d=>{i===""?i=d.firstName:i=i+", "+d.firstName});const r=[];p().selectedInquiry.guardians.forEach(d=>{r.push(d.email.toLowerCase())});const o=[];p().selectedInquiry.guardians.forEach(d=>{o.push({mobile:d.mobile,name:d.firstName})});const a=new Date;let c=p().selectedInquiry.familyDescription;c.includes(p().studentToEnroll.firstName)||(c=Ng(p().selectedInquiry,p().studentToEnroll));const l={htmlBody:T().dialogEmailPreview.htmlBody,subject:T().dialogEmailPreview.subject,cc:T().emailCC,sender:T().mailerAccountAdmissions,recipients:r,attachments:[],sendEmail:!0,familyToken:p().selectedInquiry.familyToken,familyDescription:c,guardianCount:p().selectedInquiry.guardians.length,guardianNames:i,guardianEmails:r,guardianMobiles:o,inquiryUUID:p().selectedInquiry.inquiryUUID,student:{firstName:p().studentToEnroll.firstName,middleName:p().studentToEnroll.middleName,lastName:p().studentToEnroll.lastName,dob:p().studentToEnroll.dob,gender:p().studentToEnroll.gender,nationality:p().studentToEnroll.nationality,groupName:p().studentToEnroll.groupName,groupUUID:p().studentToEnroll.groupUUID,admissionTerm:p().studentToEnroll.admissionTerm,admissionFee:p().studentToEnroll.admissionFee,depositFee:p().studentToEnroll.depositFee,feeTariffUUID:s,admissionYear:a.getFullYear(),admissionMonth:a.toLocaleString("default",{month:"long"}),previousSchools:p().studentToEnroll.previousSchools}};console.log("enrollStudent data",l);const u=await et("enrollStudentAdmission",l,!1,!1);if(u.data.type==="success"){const d=JSON.parse(JSON.stringify(p().selectedInquiry.children));d.forEach(f=>{ei(f.dob)?f.dob=Se(f.dob):f.dob=new Date(f.dob),f.trialStart&&(f.trialStart=gu(f.trialStart)),f.trialEnd&&(f.trialEnd=gu(f.trialEnd)),f.firstName===p().studentToEnroll.firstName&&(f.studentUUID=u.data.studentUUID,f.enrolled=!0)});let h={lastEditDate:new Date,lastEditBy:xe().authUser.uid,children:d};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,h),d.forEach(f=>{f.trialStart instanceof Date&&(f.trialStart=f.trialStart.toLocaleDateString()),f.trialEnd instanceof Date&&(f.trialEnd=f.trialEnd.toLocaleDateString())}),p().selectedInquiry.children=d,T().finishRunningTask("Success! Student enrolled","success")}else T().stopRunningTask(),T().setAlert("error",u.data.message)},_6=async()=>{T().initRunningTask("Updating Inquiry Notes");let t={lastEditDate:new Date,lastEditBy:xe().authUser.uid};switch(p().inquiryData.editNote){case"nextSteps":t.nextSteps=p().inquiryData.notes,t.nextStepsEdited=new Date,t.nextStepsEditedBy=xe().authUser.dis
2747playName;break;case"meetingNote":t.meetingNote=p().inquiryData.notes,t.meetingNoteEdited=new Date,t.meetingNoteEditedBy=xe().authUser.displayName;break;case"trialNote":t.trialNote=p().inquiryData.notes,t.trialNoteEdited=new Date,t.trialNoteEditedBy=xe().authUser.displayName;break}switch(await Fe("Inquiries",p().selectedInquiry.inquiryUUID,t),p().inquiryData.editNote){case"nextSteps":p().selectedInquiry.nextSteps=p().inquiryData.notes,p().selectedInquiry.nextStepsEdited=mo(new Date().toString()),p().selectedInquiry.nextStepsEditedBy=xe().authUser.displayName;break;case"meetingNote":p().selectedInquiry.meetingNote=p().inquiryData.notes,p().selectedInquiry.meetingNoteEdited=mo(new Date().toString()),p().selectedInquiry.meetingNoteEditedBy=xe().authUser.displayName;break;case"trialNote":p().selectedInquiry.trialNote=p().inquiryData.notes,p().selectedInquiry.trialNoteEdited=mo(new Date().toString()),p().selectedInquiry.trialNoteEditedBy=xe().authUser.displayName;break}T().finishRunningTask("Success! Inquiry Note updated","success")},I6=async t=>{await Fe("Inquiries",p().selectedInquiry.inquiryUUID,{tentativeAdmissionTerm:t}),p().selectedInquiry.tentativeAdmissionTerm=t},w6=async()=>{T().initRunningTask("Tagging Inquiry");const t=!p().selectedInquiry.potential;p().inquiries.forEach((s,i)=>{s.inquiryUUID===p().selectedInquiry.inquiryUUID&&(s.potential=t)});let e={[p().selectedStatus.action]:JSON.stringify(p().inquiries)};await Fe("Inquiries","Inquiries",e);let n={potential:t,lastEditDate:new Date,lastEditBy:xe().authUser.uid};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,n),p().hasInquiries=!1,await Lr(p().selectedStatus.action),setTimeout(()=>{p().selectedInquiry.potential=t,T().finishRunningTask("Success! Inquiry tagged","success")},1e3)},v6=async t=>{T().initRunningTask(`uploading ${t.name}`);const n={fileURL:await $B(`Inquiries/${p().selectedInquiry.familyName}`,t.name,t),fileName:t.name,fileExtension:t.name.split(".").pop(),uploadedBy:xe().authUser.uid,uploadedOn:new Date},s=p().selectedInquiry.files||[];s.push(n);const i={lastEditDate:new Date,lastEditBy:xe().authUser.uid,files:s};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,i),p().selectedInquiry.files=s,T().finishRunningTask("Success! File uploaded","success")},T6=async(t,e,n)=>{T().initRunningTask("Updating meetings date");let s={meetingDate:t,meetingStart:e,meetingEnd:n,lastEditDate:new Date,lastEditBy:xe().authUser.uid};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,s),await G0(p().selectedInquiry.inquiryUUID,t,e,n,p().selectedStatus.action),p().selectedInquiry.meetingDate=t.toLocaleDateString(),T().finishRunningTask("Success! Inquiry Note updated","success")},G0=async(t,e,n,s,i)=>{let a=(await vt("Inquiries","Inquiries")).data()[i];a=JSON.parse(a),a.forEach(l=>{l.inquiryUUID===t&&(l.meetingDate=e,l.meetingStart=n,l.meetingEnd=s)}),a=JSON.stringify(a);let c={[i]:a};await Fe("Inquiries","Inquiries",c),p().hasInquiries=!1,await Lr(p().selectedStatus.action)},b6=async(t,e,n)=>{T().initRunningTask("Updating meetings date"),p().selectedInquiry.children.forEach(i=>{i.firstName===n.firstName&&(i.trialStart=t,i.trialEnd=e)});let s={children:p().selectedInquiry.children,lastEditDate:new Date,lastEditBy:xe().authUser.uid};await Fe("Inquiries",p().selectedInquiry.inquiryUUID,s),await B0(p().selectedInquiry.inquiryUUID,t,e,p().selectedStatus.action,n),p().selectedInquiry.children.forEach(i=>{i.firstName===n.firstName&&(i.trialStart=t.toLocaleDateString(),i.trialEnd=e.toLocaleDateString())}),T().finishRunningTask("Success! Inquiry Note updated","success")},B0=async(t,e,n,s,i)=>{let a=(await vt("Inquiries","Inquiries")).data()[s];a=JSON.parse(a),a.forEach(l=>{l.inquiryUUID===t&&l.children.forEach(u=>{u.name===i.firstName&&(u.trialStart=e,u.trialEnd=n)})}),a=JSON.stringify(a);let c={[s]:a};await Fe("Inquiries","Inquiries",c),p().hasInquiries=!1,await Lr(p().selectedStatus.action)},E6=async()=>{p().selectedInquiry.archived=!0,Fe("Inquiries",p().selectedInquiry.inquiryUUID,{archived:!0,lastEditDate:new Date,lastEditBy:xe().authUser.uid}),p().inquiries=p().inquiries.filter(s=>s.inquiryUUID!==p().selectedInquiry.inquiryUUID),p().admissionInquiries=p().admissionInquiries.filter(s=>s.inquiryUUID!==p().selectedInquiry.inquiryUUID);const t=await vt("Inquiries","Inquiries");let n=JSON.parse(t.data().admission).filter(s=>s.inquiryUUID!==p().selectedInquiry.inquiryUUID);p().inquiryStatuses[5].count--,Fe("Inquiries","Inquiries",{admission:JSON.stringify(n)}),Or("App","Data","inquiriesCount",-1),E().sidePaneItems[0].count--},cG=[{item:"Pre-Admission",count:0,action:"inquiries",notification:!1},{item:"Families",count:0,action:"families",notification:!1},{item:"Students",count:0,action:"students",notification:!1},{item:"Reminders",count:0,action:"reminders",notification:!1},{item:"Meetings",count:0,action:"meetings",notification:!1},{item:"Events",count:0,action:"events",notification:!1},{item:"Payments",count:0,action:"payments",notification:!1},{item:"Accounting",count:0,action:"accounting",notification:!1},{item:"Archive",count:0,action:"archive",notification:!1}],lG=[{item:"Reminders",count:0,action:"reminders",notification:!1},{item:"Meetings",count:0,action:"meetings",notification:!1},{item:"Events",count:0,action:"events",notification:!1},{item:"Payments",count:0,action:"payments",notification:!1},{item:"Accounting",count:0,action:"accounting",notification:!1},{item:"Archive",count:0,action:"archive",notification:!1}],j0=async t=>{t||(E().navTitle="Administration Dashboard",E().activeSidePane="inquiries",E().activeMainPage="Pre-Admission",E().sidePaneItems=cG,E().sidePaneItemsMobile=lG);let e=Ve(Ce(),"App","Data"),n=await en(e);n.exists()&&(E().sidePaneItems[0].count=n.data().inquiriesCount,E().sidePaneItems[1].count=n.data().families,E().sidePaneItems[2].count=n.data().students,E().sidePaneItems[3].count=n.data().reminders,E().sidePaneItems[4].count=n.data().meetings,E().sidePaneItems[5].count=n.data().events);const s=localStorage.getItem("selectedInquiryStatus");s?p().selectedStatus=JSON.parse(s):p().selectedStatus=p().inquiryStatuses[0],E().activeSidePane==="inquiries"&&!E().isMobile&&Lr(p().selectedStatus.action)},$0=async t=>{switch(j0(!0),t){case"newInquiry":p().hasInquiries=!1,E().activeSidePane==="inquiries"&&Lr(p().selectedStatus.action);break;case"feePayment":ve().hasYearlyFees=!1,E().activeSidePane==="accounting"&&PG();break}},S6=async()=>
2747{if(ae().families.length===0){const t=await vt("App","Families");t.exists()&&(ae().families=JSON.parse(t.data().families),ae().setGroupFamilies(ae().selectedGroup.groupUUID,!1))}},uG=async t=>{let e=Ve(Ce(),"Inquiries",t),n=await en(e);if(n.exists()){let s=n.data();if(s.inquiryUUID=n.id,s.statusDescription=xg(s.status),E().navDetailTitle=s.familyName,s.submitted=s.submitted.toDate().toLocaleDateString(),s.meetingDate&&(s.meetingDate=s.meetingDate.toDate().toLocaleDateString()),s.meetingNoteEdited&&(s.meetingNoteEdited=mo(s.meetingNoteEdited.toDate().toString())),s.trialNoteEdited&&(s.trialNoteEdited=mo(s.trialNoteEdited.toDate().toString())),s.nextStepsEdited&&(s.nextStepsEdited=mo(s.nextStepsEdited.toDate().toString())),s.children.forEach(i=>{i.trialStart&&typeof i.trialStart.toDate=="function"&&(i.trialStart=i.trialStart.toDate().toLocaleDateString()),i.trialEnd&&typeof i.trialEnd.toDate=="function"&&(i.trialEnd=i.trialEnd.toDate().toLocaleDateString()),typeof i.dob.toDate=="function"?i.dob=i.dob.toDate():i.dob instanceof Date||(i.dob=new Date(i.dob))}),s.tentativeAdmissionTerm||(s.tentativeAdmissionTerm="Select Term"),p().selectedInquiry=s,gG(s.guardians,s.children),p().selectedInfo=s,p().selectedFamilyMember=p().selectedFamilyMembers[0],s.familyToken){e=Ve(Ce(),"Families",s.familyToken);let i=await en(e);if(i.exists()){let r=i.data();r.familyToken=i.id,pr().selectedFamily=r}}}E().activeSidePane!=="inquiries"&&(E().activeSidePane="inquiries"),E().fDetailPage=!0,qt("/administration/dash/inquiries")},D6=async()=>{p().dialogRemoveStudent.show=!1,T().initRunningTask(`Terminate Enrollment of ${p().studentToRemove.name}`);const t={student:p().studentToRemove,familyToken:p().selectedFamily.familyToken,familyDescription:p().selectedFamily.familyDescription,familyName:p().selectedFamily.familyName,terminationNotes:p().dialogRemoveStudent.terminationNotes},e=await et("terminateEnrollment",t,!1,!1);e.data.type==="success"?T().finishRunningTask("Success! Students enrollment terminated","success"):(T().stopRunningTask(),T().setAlert("error",e.data.message))},A6=async(t,e)=>{if(console.log(p().selectedFamily.inquiryUUID),p().selectedFamily.inquiryUUID){let n=Ve(Ce(),"Inquiries",p().selectedFamily.inquiryUUID),s=await en(n);if(s.exists()){const i=s.data();i.inquiryUUID=s.id,p().selectedInquiry=i}}es().clearApplyFromChild(),p().dialogEnrollStudent.title=e,p().dialogEnrollStudent.trial=t,p().dialogEnrollStudent.show=!0},C6=async()=>{p().dialogEnrollStudent.show=!1;const t={...es().applyFormChild};delete t.editMode;const e=Ng(p().selectedInquiry,t);console.log(e)},P6=async()=>{p().dialogEnrollStudent.show=!1;const t={...es().applyFormChild};delete t.editMode;const e=Ng(p().selectedFamily,t);let n=p().selectedFamily.guardians[0].firstName,s=[p().selectedFamily.guardians[0].email],i=[{mobile:p().selectedFamily.guardians[0].mobile,name:p().selectedFamily.guardians[0].firstName}];p().selectedFamily.guardians.length>1&&(n+=`, ${p().selectedFamily.guardians[1].firstName}`,s.push(p().selectedFamily.guardians[1].email),i.push({mobile:p().selectedFamily.guardians[1].mobile,name:p().selectedFamily.guardians[1].firstName}));const r=Q0(),o=new Date,a={familyToken:p().selectedFamily.familyToken,guardianCount:p().selectedFamily.guardians.length,guardianNames:n,guardianEmails:s,guardianMobiles:i,familyDescription:e,student:{firstName:es().applyFormChild.firstName,middleName:es().applyFormChild.middleName,lastName:es().applyFormChild.lastName,dob:es().applyFormChild.dob,gender:es().applyFormChild.gender,nationality:es().applyFormChild.nationality,groupName:p().dialogEnrollStudent.group.groupName,groupUUID:p().dialogEnrollStudent.group.groupUUID,admissionTerm:r.name,admissionFee:p().dialogEnrollStudent.admissionFee,depositFee:p().dialogEnrollStudent.depositFee,feeTariffUUID:p().dialogEnrollStudent.feeTariffUUID,admissionYear:o.getFullYear(),admissionMonth:o.toLocaleString("default",{month:"long"})},updateStatus:!1};T().initRunningTask(`Processing admission for ${es().applyFormChild.firstName}`);const c=await et("enrollStudent",a,!1,!1);c.data.type==="success"?T().finishRunningTask(`Success! Admission of ${es().applyFormChild.firstName} completed.`,"success"):(T().stopRunningTask(),T().setAlert("error",c.data.message))},dG=async t=>{let e=Ve(Ce(),"Families",t),n=await en(e);n.exists()&&(p().selectedFamily=n.data())},R6=async t=>{let e=Ve(Ce(),"Students",t),n=await en(e);if(n.exists()){const s=await yG(n);ve().selectedStudent=s}},k6=async t=>{T().isProfileAdmin=!0,xe().memberToken=t,J().forms[0].path="",await AD("administration"),E().profilePage=!0},U6=async()=>{const t=await vt("App","FamiliesNotEnrolled");t.exists()&&(ve().archiveFamilies=JSON.parse(t.data().families))},N6=t=>t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,""),x6=(t,e)=>(Number(t)+Number(e)).toString(),M6=(t,e)=>(Number(t)-Number(e)).toString(),O6=()=>new Date().getFullYear().toString(),L6=()=>{const t=new Date,e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0");return`${e}_${n}`},hG=()=>{const t={weekday:"long"};return new Date().toLocaleDateString("en-US",t)},mu=t=>{const e=new Date;let n=e.getFullYear()-t.getFullYear();const s=e.getMonth()-t.getMonth();return(s<0||s===0&&e.getDate()<t.getDate())&&n--,n},hw=t=>{const e=new Date(t),n=new Date;let s=n.getFullYear()-e.getFullYear();const i=n.getMonth()-e.getMonth();return(i<0||i===0&&n.getDate()<e.getDate())&&s--,s},ei=t=>!!(t&&typeof t=="object"&&typeof t.seconds=="number"&&typeof t.nanoseconds=="number"&&t.seconds>=0&&t.nanoseconds>=0),gu=t=>{const[e,n,s]=t.split("/").map(Number);return new Date(s,e-1,n)},xo=t=>{const[e,n,s]=t.split("/").map(Number),i=new Date(s,n-1,e);return i.setHours(12),i},mo=t=>t.split(" ").slice(0,5).join(" "),Se=t=>{const e=t.seconds*1e3+t.nanoseconds/1e6;return new Date(e)};let Dl;const F6=(t,e,n)=>{if(e)return Dl=s=>{s.target===e.value||s.composedPath().includes(e.value)||s.target===t.value||s.composedPath().includes(t.value)||typeof n=="function"&&n()},window.addEventListener("click",Dl),Dl},V6=()=>{try{window.removeEventListener("click",Dl)}catch(t){console.log(t)}},q6=t=>{const n=t*1e3,i=new Date(n).getDay();
2747return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][i]},H0=(t,e)=>{const n=["January","February","March","April","May","June","July","August","September","October","November","December"],s=t.getDate(),i=e.getDate(),r=n[t.getMonth()],o=n[e.getMonth()],a=t.getFullYear(),c=e.getFullYear();return t>e?"Error: Start date must be before end date":r===o&&a===c?`${s}-${i} ${r}, ${a}`:a===c?`${s} ${r} - ${i} ${o}, ${a}`:`${s} ${r}, ${a} - ${i} ${o}, ${c}`},G6=(t,e,n)=>{const s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=["January","February","March","April","May","June","July","August","September","October","November","December"],r=t.getDate(),o=i[t.getMonth()],a=t.getFullYear(),c=s[t.getDay()],l=r%10===1&&r!==11?"st":r%10===2&&r!==12?"nd":r%10===3&&r!==13?"rd":"th";return`${r}${l} ${o}, ${a} (${c}) from ${e} till ${n}`},B6=(t,e)=>Number(t).toLocaleString(),fw=t=>{let e=t.toString().split("").reverse().join(""),n="";for(let s=0;s<e.length;s++)s===3&&(n+=","),(s-3)%2===0&&s>3&&(n+=","),n+=e[s];return n.split("").reverse().join("")+".00"},j6=t=>{let e=t.replace(/\D/g,"");return e.length===10&&e[0]!=="0"&&(e="91"+e),e.length!==12||e.substring(0,2)!=="91"?"invalid":"+"+e},$6=async()=>{let t="";T().dialogEmailPreview.email.forEach(i=>{t+=i+","}),T().initRunningTask(`Sending email to ${t}...`);const n={sender:T().getEmailSenderAccount(),recipient:T().dialogEmailPreview.email,cc:"",subject:T().dialogEmailPreview.subject,htmlBody:T().dialogEmailPreview.htmlBody,attachments:[],emailType:"Webmail",emailTrigger:"User",triggeredBy:T().authUser.uid},s=await et("webmail",n,!1,!1);s.data.type==="success"?T().finishRunningTask(`Email sent to ${t}`,"success"):(T().stopRunningTask(),T().setAlert("error",s.data.message))},H6=t=>/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/.test(t),W6=(t,e)=>{const n=t.replace(/[^\d]/g,""),s=n.match(/^[0-9]+$/),i=n.length===e;return s&&i},K6=t=>{let n=t.name.match(/\.[0-9a-z]+$/i);return n?n[0].slice(1):""},z6=t=>{const e=new Date,n=new Date(t);return n.getFullYear()===e.getFullYear()&&n.getMonth()===e.getMonth()&&n.getDate()===e.getDate()},W0=t=>["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][t.getDay()],J6=t=>t.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),K0=(t,e,n="")=>{let s=[];for(let i in e){const r=n?`${n}.${i}`:i;e[i]instanceof Date||r==="profileVersion"||(typeof e[i]=="object"&&e[i]!==null?t[i]&&typeof t[i]=="object"?s=s.concat(K0(t[i],e[i],r)):s.push({item:r,valueBefore:t[i]||"undefined",valueAfter:e[i]||"undefined"}):e[i]!==t[i]&&s.push({item:r,valueBefore:t[i]||"undefined",valueAfter:e[i]||"undefined"}))}return s},Y6=()=>/iP(ad|od|hone)/i.test(navigator.platform)&&/WebKit/i.test(navigator.userAgent)&&!/(CriOS|FxiOS|OPiOS|mercury)/i.test(navigator.userAgent),Q6=t=>{const e=["January","February","March","April","May","June","July","August","September","October","November","December"],n=t.getDate(),s=t.getMonth(),i=t.getFullYear();return`${e[s]} ${n}${fG(n)}, ${i}`};function fG(t){if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}const pG=(t,e,n,s)=>{const i=e.toISOString().split("T")[0],r=new Date(`${i}T${n}:00`),o=new Date(`${i}T${s}:00`);return`https://www.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(t)}&dates=${r.toISOString().replace(/-|:|\.\d\d\d/g,"")}/${o.toISOString().replace(/-|:|\.\d\d\d/g,"")}`},X6=(t,e,n,s)=>{const i=e.toISOString().split("T")[0],r=new Date(`${i}T${n}:00`).toISOString().replace(/-|:|\.\d\d\d/g,""),o=new Date(`${i}T${s}:00`).toISOString().replace(/-|:|\.\d\d\d/g,""),a=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`UID:${r}@example.com`,"SEQUENCE:0","STATUS:CONFIRMED",`DTSTAMP:${r}`,`DTSTART:${r}`,`DTEND:${o}`,`SUMMARY:${t}`,"END:VEVENT","END:VCALENDAR"].join(`
2748`),c=new Blob([a],{type:"text/calendar;charset=utf-8;"}),l=document.createElement("a");l.href=URL.createObjectURL(c),l.download="event.ics",l.click()},Ng=(t,e)=>{let n="(";t.guardians.forEach((i,r)=>{r===0?n+=i.firstName+", ":n+=i.firstName+")"});let s=!1;
2748return t.children.forEach(i=>{(i.studentUUID||i.admissionEmail)&&(s?n=i.firstName+", "+n:n=i.firstName+" "+n,s=!0)}),s?n=e.firstName+", "+n:n=e.firstName+" "+n,n},xg=t=>{switch(t){case"initialInquiry":return"Initial Inquiry";case"meeting":return"Meeting";case"trial":return"Trial";case"onHold":return"On Hold";case"notProceeding":return"Not Proceeding";case"admission":return"Admission";case"enrolled":return"Enrolled"}return"Unknown"},mG=t=>t<5?0:1,z0=t=>t<5?ve().feePaymentSessions[0].months:ve().feePaymentSessions[1].months,pw=t=>t<3?0:t<5?1:t<8?2:3,J0=t=>t<3?ve().feePaymentTerms[0].months:t<5?ve().feePaymentTerms[1].months:t<9?ve().feePaymentTerms[2].months:ve().feePaymentTerms[3].months,Mg=()=>{const t=new Date,e=t.getFullYear(),n=t.getMonth();let s=e;n<5&&(s=e-1);const i=(s+1)%100;return`${s}-${i}`},gG=(t,e)=>{p().selectedFamilyMembers=[];let n=[];t.forEach((s,i)=>{let r=0;ei(s.dob)?r=mu(Se(s.dob)):r=hw(s.dob),s.age=r,n.push({name:s.firstName,type:"guardian",index:i,data:s})}),e.forEach((s,i)=>{let r=0;ei(s.dob)?r=mu(Se(s.dob)):r=hw(s.dob),s.age=r,n.push({name:s.firstName,type:"student",index:i,data:s})}),p().selectedFamilyMembers=n},Ip=t=>{const e=new Date(t),n=e.getDay();(n===0||n===6)&&e.setDate(e.getDate()+(n===0?1:2));const s=new Date(e.setDate(e.getDate()-e.getDay()+1)),i=new Date(s.getFullYear(),0,1),r=Math.ceil(((s.getTime()-i.getTime())/864e5+i.getDay()+1)/7),o=String(r).padStart(2,"0");return{week:`${s.getFullYear()}_${o}`,monday:s}},Og=()=>Ip(new Date).week,Z6=()=>{const t=Q0(),e=parseInt(t.action.split("_")[0],10);let n,s;t.item===1?(n=new Date(e,5,1),s=new Date(e,8,0)):t.item===2?(n=new Date(e,8,1),s=new Date(e,11,31)):(n=new Date(e+1,0,1),s=new Date(e+1,3,30));const i={},r=Ip(n).monday;for(;r<=s;){const o=Ip(r);i[o.week]=o.monday.toISOString(),r.setDate(r.getDate()+7)}return{weeks:Object.keys(i),weekToMonday:i}},Y0=()=>{const e=new Date().getMonth();return e>=0&&e<=4?"Term 3":e>=5&&e<=8?"Term 1":"Term 2"},yG=async t=>new Promise(async e=>{var l,u;const n=t.data();n.uuid=t.id,n.studentUUID=t.id,n.age=mu(Se(n.dob)),n.dob=Se(n.dob).toLocaleDateString();const s=await _G(n.feeTariffUUID);n.feeTariffAmount=s;let i=0,r=0,o=0;const a=s,c=a*12;if(n.paymentSettings){if(n.paymentSettings=JSON.parse(n.paymentSettings),n.paymentSettings.lastPaymentAmount=n.paymentSettings.paymentAmount,n.paymentSettings.paymentType===""&&(n.paymentSettings.paymentType="monthly fee"),n.paymentSettings.paymentOption===""&&(n.paymentSettings.paymentOption="Indian Bank Transfer"),n.paymentSettings.studentsFee!==c&&(n.paymentSettings.studentsFee=c),n.paymentSettings.paymentAmount===0)n.paymentSettings.paymentAmount=a;else{const d=new Date().getMonth(),h=ve().feePaymentMonths[d].text;switch(n.paymentSettings.paymentType){case"yearly fee":n.paymentSettings.paymentAmount=c;break;case"monthly fee":n.paymentSettings.paymentAmount=a;break;case"session fee":const f=z0(h);n.paymentSettings.paymentAmount=a*f;break;case"term fee":const m=J0(d);n.paymentSettings.paymentAmount=a*m;break}}if(n.paymentSettings.receivedFrom===""){const d=p();d&&(d.selectedFamily||await dG(n.familyToken),(u=(l=d.selectedFamily)==null?void 0:l.guardians)!=null&&u[0]&&(n.paymentSettings.receivedFrom=d.selectedFamily.guardians[0].firstName))}n.paymentSettings.paymentDate===""?n.paymentSettings.paymentDate=new Date:n.paymentSettings.paymentDate=new Date(n.paymentSettings.paymentDate),i=Number(n.paymentSettings.yearPaymentTotal),o=Number(n.paymentSettings.studentsFee),o<a&&(o=a),r=o-i,n.paymentSettings.academicYear!==Mg()&&(console.log("not same year"),i=0,r=o)}else o=c;n.totalFeePaid=i,n.totalFeePending=r,n.totalFee=o,e(n)}),_G=async t=>{const e=ae().feeTariffs.find(n=>n.tariffUUID===t);if(!e){const n=await vt("FeeTariffs",t);return Number(n.data().amount)?Number(n.data().amount):0}return e.amount?e.amount:0},e9=t=>{const e=ae().feeTariffs.find(n=>n.tariffUUID===t);return e!=null&&e.amount?e.amount:0},Q0=()=>{const t=new Date;let e=t.getFullYear();const n=[{term:1,startMonth:6,endMonth:8,nameSuffix:"Term 01",description:"June-August"},{term:2,startMonth:9,endMonth:12,nameSuffix:"Term 02",description:"September-December"},{term:3,startMonth:1,endMonth:4,nameSuffix:"Term 03",description:"January-April"}],s=t.getMonth()+1;let i=n.find(a=>s>=a.startMonth&&s<=a.endMonth);i||(i=n[2]),i.term===3&&(e=e-1);const r=i.term===3?e+1:e;return{item:i.term,name:`${e}-${(e+1).toString().slice(-2)} ${i.nameSuffix}`,description:`${i.description} ${r}`,action:`${e}_${(e+1).toString().slice(-2)}_${String(i.term).padStart(2,"0")}`}}
2748,X0=t=>{const e=t,n=new Date;let s=n.getFullYear()-e.getFullYear(),i=n.getMonth()-e.getMonth();return(i<0||i===0&&n.getDate()<e.getDate())&&(s--,i=(12+i)%12),n.getDate()<e.getDate()&&i--,i===-1&&(i=11),{years:s,months:i}},t9=t=>{switch(t){case 0:return"bg-orange-300";case 1:return"bg-orange-300";case 2:return"bg-yellow-300";case 3:return"bg-lime-300";case 4:return"bg-green-300";case 5:return"bg-red-300";case 6:return"bg-amber-300";case 7:return"bg-emerald-300";case 8:return"bg-teal-300";case 9:return"bg-cyan-300";case 10:return"bg-sky-300";case 11:return"bg-blue-300";case 12:return"bg-indigo-300";case 13:return"bg-violet-300";case 14:return"bg-purple-300";case 15:return"bg-fuchsia-300";case 16:return"bg-pink-300";case 17:return"bg-rose-300";case 18:return"bg-rose-300"}},Bi=t=>{const n=Qe().subjects.find(s=>s.subjectUUID===t);return n?n.color:0},jd=t=>{const n=Qe().subjects.find(s=>s.subjectUUID===t);return n?n.name:"Subject"},IG=t=>{const n=Qe().sessionTimings.find(s=>s.timingUUID===t);return n?n.timing:"Timing"},Z0=t=>{let e="Classroom";const s=Qe().classrooms.find(i=>i.classroomUUID===t);return s&&(e=s.name),e},Lg=t=>{const n=Qe().facilitators.find(s=>s.facilitatorUUID===t);return n?n.facilitator:"Facilitator"},n9=t=>{const e=ae().students.find(n=>n.studentUUID===t);return e?e.name:"Student"},Fg=(t,e,n)=>{t.topicUUID=e;const s=wG(t.facilitatorUUID,e);if(s){if(!t.isMixedGroup)t.topic=s.topic;else{const i=t.mixedGroupCombined.mixedGroups.find(r=>r.mixedGroupUUID===t.mixedGroupUUID);if(!i)return;i.topic=s.topic}if(n&&s.subtopicsCounter>0){const r=JSON.parse(s.subtopics).find(o=>o.subtopicUUID===n);if(!r)console.log(t);else if(!t.isMixedGroup)t.subtopic=r.subtopic||"",t.subtopicUUID=n;else{const o=t.mixedGroupCombined.mixedGroups.find(a=>a.mixedGroupUUID===t.mixedGroupUUID);if(!o)return;o.subtopic=r.subtopic||"",o.subtopicUUID=n}}}},wG=(t,e)=>{try{return JSON.parse(localStorage.getItem("topics")).filter(r=>r.facilitatorUUID===t)[0].topics.find(r=>r.topicUUID===e)}catch{return null}},vG=t=>{if(t.setHours(0,0,0,0),t.getDay()===0||t.getDay()===6)return!0;for(let e of T().holidays){const n=new Date(e.startDate),s=new Date(e.endDate);if(n.setHours(0,0,0,0),s.setHours(0,0,0,0),t>=n&&t<=s)return!0}return!1},Vg=(t,e)=>{!t.mixedGroupCombined&&t.mainMixedGroupUUID&&eD(t),t.mixedGroupCombined&&t.mixedGroupCombined.mixedGroups.forEach(n=>{n.students.forEach(s=>{if(s.studentUUID===e){t.classroomUUID=n.classroomUUID,t.classroom=n.classroom,t.subjectUUID=n.subjectUUID,t.facilitatorUUID=n.facilitatorUUID,t.subject=n.subject,t.facilitator=n.facilitator;const i=Bi(t.subjectUUID);t.color=i,t.subjectColor=i}})})},eD=t=>{ae().mixedGroupsCombined.forEach(e=>{e.mainMixedGroupUUID===t.mainMixedGroupUUID&&(t.mixedGroupCombined=e)})},s9=(t,e)=>{let[n,s]=t.split("_").map(Number);return s+=e,s>52?(n+=1,s=1):s<1&&(n-=1,s=52),`${n}_${s.toString().padStart(2,"0")}`},i9=t=>t?t.replace(/(\b[a-z])/g,function(e,n){return n===0?e:e.toUpperCase()}):"",TG=[{item:"Lessons",count:0,action:"lessons",notification:!1},{item:"Groups",count:0,action:"groups",notification:!1},{item:"Students",count:0,action:"students",notification:!1},{item:"Assignments",count:0,action:"assignments",notification:!1},{item:"Resources",count:0,action:"resources",notification:!1},{item:"Absences",count:0,action:"absences",notification:!1},{item:"Feedback",count:0,action:"feedback",notification:!1},{item:"Notes",count:0,action:"notes",notification:!1},{item:"Mixed Groups",count:0,action:"mixedGroups",notification:!1}],bG=[{item:"Students",count:0,action:"students",notification:!1},{item:"Assignments",count:0,action:"assignments",notification:!1},{item:"Resources",count:0,action:"resources",notification:!1},{item:"Absences",count:0,action:"absences",notification:!1},{item:"Feedback",count:0,action:"feedback",notification:!1},{item:"Notes",count:0,action:"notes",notification:!1},{item:"Mixed Groups",count:0,action:"mixedGroups",notification:!1}],tD=async()=>{if(E().navTitle="Facilitator Dashboard",E().activeSidePane="lessons",E().activeMainPage="Lessons",E().sidePaneItems=TG,E().sidePaneItemsMobile=bG,T().isParentFacilitator&&(ae().loadParentFacilitator(),SG()),E().sidePaneItems[1].count=ae().groups.length,E().sidePaneItems[2].count=ae().students.length,T().isFacilitatorAdmin||E().sidePaneItems.pop(),!pr().hasTrials){let t=Ve(Ce(),"Inquiries","Inquiries"),e=await en(t);if(e.exists()){const n=JSON.parse(e.data().trial);
2748if(n.length>0){n.forEach(i=>{i.files=[],i.children.forEach(r=>{r.trialDate="Not Scheduled"})}),pr().trialFamilies=n;const s={item:"Trials",count:n.length,action:"trials",notification:!1};E().sidePaneItems.splice(3,0,s),E().sidePaneItemsMobile.splice(3,0,s),pr().hasTrials=!0}}}},EG=async t=>{tD()},r9=async(t,e)=>{const n=new Date,s={weekday:"long"};let i=n.toLocaleDateString("en-US",s);(i==="Saturday"||i==="Sunday")&&(i="Monday"),pc().setSelectedGroupSessions(t),pc().setSelectedGroupSessionsDay(i),E().fDetailPage=!0,T().facilitatorDashGroupUUID=t,T().facilitatorDashGroupName=e,E().navDetailTitle=e,qt("/facilitators/dash/groupDays")},o9=async(t,e)=>{E().fDetailPage=!E().fDetailPage,T().selectedStudent.studentUUID=t.uuid,T().selectedStudent.groupUUID=e.groupUUID,E().navDetailTitle=t.name,ve().setSelectedStudentLessons(e.groupName,t.uuid),E().activeDashboard==="facilitator"?qt("/facilitators/dash/students"):E().activeDashboard==="administration"&&qt("/administration/dash/students")},a9=async()=>{pr().trialFamiliesData||(await zi("Inquiries",[{field:"status",operator:"==",value:"trial"}],[{field:"submitted",direction:"desc"}])).forEach(s=>{const i=s.data();i.inquiryUUID=s.id,i.submitted=Se(i.submitted),pr().trialFamilies.forEach(r=>{r.inquiryUUID===i.inquiryUUID&&(i.files&&(r.files=i.files),r.children.forEach(o=>{i.children.forEach(a=>{const c=new Date(o.dob);if(o.age=X0(c),o.name===a.firstName&&a.trialStart){const l=H0(Se(a.trialStart),Se(a.trialEnd));o.trialDate=l,r.trialStart=Se(a.trialStart)}})}))}),pr().trialFamilies.sort((r,o)=>{const a=new Date(r.trialStart),c=new Date(o.trialStart);return a.getTime()-c.getTime()})})};let mw=!1,Na,Y,Al,Xe,mc;function nD(){if(mw)return;const{$firebaseApp:t}=We();mc=v0(t),Y=ri(),Al=fi(),Xe=Fs(),Y.calendarWeek=Og(),Y.calendarMonth=new Date().toLocaleString("default",{month:"long"}),Y.calendarYear=new Date().getFullYear().toString(),Y.calendarTerm=Y0(),Na=hG(),Y.selectedDayTitle=Na;const e=localStorage.getItem("calendarWeek");!e||e!==Y.calendarWeek?sD():(Y.calendarGroupStudents=JSON.parse(localStorage.getItem("calendarGroupStudents")),Y.calendarMixedGroupStudents=JSON.parse(localStorage.getItem("calendarMixedGroupStudents"))),mw=!0}function SG(){nD();const t=Ve(mc,"Calendar/Sessions/Weeks",Y.calendarWeek),e=Sg(t,n=>{n.exists()?(Y.setCalendar(n.data()),Y.useLocalCalendar=!1):e(),Xe.isProduction&&DG()});return{unsubscribeCalendar:e}}function DG(){Y.groupSessions.forEach(t=>{const e=Y.calendarGroupLessons.find(n=>n.groupUUID===t.groupUUID);e&&t.days.forEach(n=>{const s=n.day,i=e.days.find(r=>r.day===s);i&&(n.date=i.date,n.sessions.forEach(r=>{if(r.day=s,r.groupUUID=t.groupUUID,r.mainMixedGroupUUID!==""){r.isMixedGroup=!0;return}const o=i.sessions.find(a=>a.lessonUUID===r.lessonUUID);o&&(r.lessonDetails=o.lessonDetails||{fComments:0,fResources:0,fAssignments:0},r.lessonDetailUUID=o.lessonDetailUUID,o.topicUUID&&Fg(r,o.topicUUID,o.subtopicUUID),o.facilitatorUUID!==r.facilitatorUUID&&(r.facilitatorUUID=o.facilitatorUUID,r.facilitator=Lg(o.facilitatorUUID)),o.subjectUUID!==r.subjectUUID&&(r.subjectUUID=o.subjectUUID,r.subject=jd(o.subjectUUID),r.subjectColor=Bi(o.subjectUUID)))}))})}),jc("")}const jc=async t=>{Y.clearFacilitatorSessions(),t===""&&(t=Xe.facilitatorAuthUUID);let e=0,n=!1;if(Y.groupSessions.forEach(s=>{let i=s.groupName;const r=s.groupUUID;let o=!1;s.days.forEach((a,c)=>{const l=a.day,u=a.date;a.sessions.forEach(d=>{if(o=!0,d.mainMixedGroupUUID!==""){d.facilitatorUUID="",d.facilitator="Facilitator",d.subjectUUID="",d.subject="Subject",d.subjectColor=0;let h=null;const f=ae().mixedGroupsCombined.find(b=>b.mainMixedGroupUUID===d.mainMixedGroupUUID);if(!f){console.log("no mixed group combined");return}const m=JSON.parse(JSON.stringify(f));m.timingUUID=d.timingUUID,m.timing=d.timing,d.mixedGroupCombined=m,d.mixedGroupName=m.mixedGroupName;let v=Y.calendarMixedGroupStudents.find(b=>b.mainMixedGroupUUID===d.mainMixedGroupUUID);if(v||(console.log("no remote mixed group students"),v=n4(f)),Y.useLocalCalendar||(h=Y.calendarMixedGroupsLessons.find(b=>b.mainMixedGroupUUID===d.mainMixedGroupUUID&&b.day===l&&b.timingUUID===d.timingUUID)),f){d.classroom="Classroom";const b=f.facilitatorInfos.find(D=>D.facilitatorUUID===t);if(b){const D=f.mixedGroups.find(_=>_.facilitatorUUID===t);let w=v.mixedGroups.find(_=>_.mixedGroupUUID===D.mixedGroupUUID);if(w?d.students=w.students:(console.log("no group students"),D.students.length>0&&(d.students=D.students)),d.facilitatorUUID=D.facilitatorUUID,d.facilitator=D.facilitator,d.subjectUUID=D.subjectUUID,d.subject=D.subject,d.subjectColor=Bi(D.subjectUUID),h){const _=h.mixedGroups.find(S=>S.mixedGroupUUID===D.mixedGroupUUID);
2748_&&(d.lessonDetails=_.lessonDetails,d.lessonDetailUUID=_.lessonDetailUUID,D.subjectUUID=_.subjectUUID,_.topicUUID&&(d.facilitatorUUID=t,d.topicUUID=_.topicUUID,d.subtopicUUID=_.subtopicUUID||""))}Y.facilitatorSessions[c].sessions.find(_=>_.mainMixedGroupUUID===D.mainMixedGroupUUID&&_.timing===d.timing)?o=!1:(D.classroomUUID&&D.classroomUUID!==""&&(d.classroomUUID=D.classroomUUID,d.classroom=Z0(d.classroomUUID)),d.mainMixedGroupUUID=D.mainMixedGroupUUID,d.mixedGroupUUID=D.mixedGroupUUID,d.subjectUUID=D.subjectUUID,d.subjectColor=Bi(D.subjectUUID),d.facilitatorUUID=t,i=b.groupsCombined,d.topicUUID&&d.topicUUID!==""&&Fg(d,d.topicUUID,d.subtopicUUID)),n=!0}}}else{d.isMixedGroup=!1;const h=Y.calendarGroupStudents.find(f=>f.groupUUID===r);h&&(d.students=h.students)}if(d.facilitatorUUID===t&&o){let h=d.topic||"",f=d.subtopic||"",m=d.topicUUID||"",v=d.subtopicUUID||"";if(d.isMixedGroup){const D=d.mixedGroupCombined.mixedGroups.find(w=>w.mixedGroupUUID===d.mixedGroupUUID);if(!D)return;h=D.topic||"",f=D.subtopic||"",m=D.topicUUID||"",v=D.subtopicUUID||""}const b={mainMixedGroupUUID:d.mainMixedGroupUUID||"",mixedGroupUUID:d.mixedGroupUUID||"",isMixedGroup:d.isMixedGroup,mixedGroupName:d.mixedGroupName||"",groupName:i,groupUUID:r,facilitatorUUID:t,facilitator:d.facilitator,day:l,classroom:d.classroom,classroomUUID:d.classroomUUID,subject:d.subject,subjectColor:d.subjectColor,subjectUUID:d.subjectUUID,students:d.students,timing:d.timing,timingUUID:d.timingUUID,lessonUUID:d.lessonUUID||"",lessonDetailUUID:d.lessonDetailUUID||"",lessonDetails:d.lessonDetails||{fComments:0,fResources:0,fAssignments:0},topic:h,topicUUID:m,subtopicUUID:v,subtopic:f};Y.facilitatorSessions[c].sessions.push(b),Y.facilitatorSessions[c].date=u,e++}})})}),Na==="Saturday"||Na==="Sunday")Y.facilitatorSessionsDay=Y.facilitatorSessions[0];else if(Y.facilitatorSessions.forEach(s=>{if(s.day===Na){Y.facilitatorSessionsDay=s;return}}),n)for(let s=0;s<Y.facilitatorSessions.length;s++)Y.facilitatorSessions[s].sessions.sort((r,o)=>{const a=gw(r.timing),c=gw(o.timing);return a.start<c.start?-1:a.start>c.start?1:0});Al&&Al.sidePaneItems[0]&&(Al.sidePaneItems[0].count=e),Y&&Y.selectedGroupSessions.days&&Y.selectedGroupSessions.days.length>0&&Y.setSelectedGroupSessions(Y.selectedGroupSessions.groupUUID)};function gw(t){const[e,n]=t.split(" - ").map(s=>{const[i,r]=s.split(":").map(Number);return i*60+r});return{start:e,end:n}}const sD=async()=>{console.log("updating calendar week local store...");let t;t=Qe();const e=Ve(mc,"Calendar/Sessions/GroupStudentWeeks",Y.calendarWeek);let n=await en(e);const s=JSON.parse(n.data().groupStudents);s&&(s.forEach(a=>{const c=Y.groupSessions.find(u=>u.groupUUID===a.groupUUID);a.groupName=c.groupName;const l=[];a.students.forEach(u=>{const d=t.students.find(h=>h.studentUUID===u);d&&l.push({studentUUID:u,student:d.name})}),a.students=l}),Y.calendarGroupStudents=s,localStorage.setItem("calendarGroupStudents",JSON.stringify(s)));const i=Ve(mc,"Calendar/Sessions/MixedGroupStudentWeeks",Y.calendarWeek);let r=await en(i);const o=JSON.parse(r.data().mixedGroupsCombinedStudents);o&&(o.forEach(a=>{a.mixedGroups.forEach(c=>{c.students.forEach(l=>{const u=t.students.find(h=>h.studentUUID===l.studentUUID),d=Y.groupSessions.find(h=>h.groupUUID===l.groupUUID);!u||!d||(l.groupName=d.groupName,l.student=u.name)})})}),Y.calendarMixedGroupStudents=o,localStorage.setItem("calendarMixedGroupStudents",JSON.stringify(o))),localStorage.setItem("calendarWeek",Y.calendarWeek)},c9=async()=>{const t=K0(Y.editLesson,Xe.dialogEditCalendar.lesson);if(t.length>0){const e=await vt("Calendar/Sessions/Groups",Y.selectedGroupSessions.groupUUID),n=JSON.parse(e.data()[Xe.dialogEditCalendar.day]);let s=n.findIndex(u=>u.lessonUUID===Y.editLesson.lessonUUID),i={...n[s],...Xe.dialogEditCalendar.lesson};const r=Y.groupSessions.findIndex(u=>u.groupUUID===Y.selectedGroupSessions.groupUUID),o=Y.groupSessions[r].days.findIndex(u=>u.day===Xe.dialogEditCalendar.day),a=Y.groupSessions[r].days[o].sessions.findIndex(u=>u.lessonUUID===Xe.dialogEditCalendar.lesson.lessonUUID),c=JSON.parse(JSON.stringify(i));Y.groupSessions[r].days[o].sessions[a]=c,delete i.mixedGroupCombined,delete i.mixedGroupName,delete i.isMixedGroup,delete i.mixedGroupSubject,delete i.subject,delete i.classroom,delete i.timing,delete i.color,delete i.subjectColor,delete i.facilitator,delete i.topic,delete i.subtopic,delete i.topicUUID,delete i.subtopicUUID,delete i.lessonDetail
2748s,delete i.day,delete i.groupName,delete i.groupUUID,delete i.mixedGroupSubjectUUID;const l={groupUUID:Y.selectedGroupSessions.groupUUID,groupName:Y.selectedGroupSessions.groupName,groupDay:Xe.dialogEditCalendar.day,localLesson:i,changes:t};console.log(l),Y.calendarChangedLessons.push(l)}Xe.dialogEditCalendar.show=!1,Xe.dialogEditCalendar.editColor=0,Xe.dialogEditCalendar.lesson=null,Xe.dialogEditCalendar.editClassroom="",Xe.dialogEditCalendar.editSubject=""},l9=async()=>{if(Y.calendarChangedLessons.length===0)return;Xe.initRunningTask("Updating calendar");const t=await vt("Calendar/Sessions/Groups",Y.selectedGroupSessions.groupUUID),e=Y.getCalendarGroupDays(Y.selectedGroupSessions.groupUUID);e.forEach(i=>{delete i.date}),e.forEach(i=>{i.sessions=JSON.parse(t.data()[i.day])}),console.log("calendarChangedLessons"),console.log(Y.calendarChangedLessons),console.log("groupDays"),console.log(e);for await(const i of Y.calendarChangedLessons){const r=e.find(d=>d.day===i.groupDay),o=r.sessions;let a=o.findIndex(d=>d.lessonUUID===i.localLesson.lessonUUID),c={...r[a],...i.localLesson};delete c.mixedGroupCombined,delete c.mixedGroupName,delete c.isMixedGroup,delete c.mixedGroupSubject,delete c.subject,delete c.classroom,delete c.timing,delete c.color,delete c.subjectColor,delete c.facilitator,delete c.topic,delete c.subtopic,delete c.topicUUID,delete c.subtopicUUID,delete c.lessonDetails,delete c.day,delete c.groupName,delete c.groupUUID,delete c.mixedGroupSubjectUUID,delete c.students,o[a]=c;const l={changes:i.changes,groupUUID:i.groupUUID,groupName:i.groupName,day:i.groupDay,createdAt:new Date,createdBy:xe().authUser.uid,createdByName:xe().authUser.dis
2748playName,year:Y.calendarYear,term:Y.calendarTerm},u=Wo();await Bd("Calendar/Sessions/Changes",u,l)}let n={updatedAt:new Date,updatedBy:xe().authUser.uid,updatedByName:xe().authUser.displayName};e.forEach(i=>{n[i.day]=JSON.stringify(i.sessions)}),await Fe("Calendar/Sessions/Groups",Y.selectedGroupSessions.groupUUID,n),await Or("App","AppVersions","calendarVersion",1);const s=localStorage.getItem("calendarVersion");yu(s||"0"),Y.calendarChangedLessons=[],Xe.finishRunningTask("Success! Calendar updated","success")},u9=async()=>{Y.calendarChangedLessons=[];const t=localStorage.getItem("calendar")||"[]";Y.groupSessions=JSON.parse(t),jc(""),Y.setSelectedGroupSessions(Y.selectedGroupSessions.groupUUID)},yu=async t=>{nD(),Xe.initRunningTask("Updating Calendar..."),Y.calendarWeek=Og(),sD(),Y.groupSessions=[];const e=jn("status","==","active"),n=Rt(gs(mc,"Calendar/Sessions/Groups"),e);(await pi(n)).forEach(i=>{const r=AG(i.data());r.forEach((a,c)=>{a.sessions.forEach(l=>{let u=Lg(l.facilitatorUUID),d=jd(l.subjectUUID),h=IG(l.timingUUID),f="Classroom";l.classroomUUID&&(f=Z0(l.classroomUUID)),l.subjectColor=Bi(l.subjectUUID),l.facilitator=u,l.subject=d,l.timing=h,l.classroom=f,l.mainMixedGroupUUID!==""&&(eD(l),l.isMixedGroup=!0),l.facilitator===""&&(l.facilitator="Facilitator")})});const o={groupName:i.data().groupName,groupUUID:i.id,days:r};Y.groupSessions.push(o)}),ae().saveCalendar(JSON.stringify(Y.groupSessions),t),jc(""),Xe.finishRunningTask("Calendar updated","success")};function AG(t){return[{day:"Monday",sessions:JSON.parse(t.Monday)},{day:"Tuesday",sessions:JSON.parse(t.Tuesday)},{day:"Wednesday",sessions:JSON.parse(t.Wednesday)},{day:"Thursday",sessions:JSON.parse(t.Thursday)},{day:"Friday",sessions:JSON.parse(t.Friday)}]}const d9=async()=>{Xe.initRunningTask("Updating Calendar week...");const t={calendarWeek:Y.calendarWeek},e=await et("generateCalendarWeekManually",t,!0,!1);e.data.type==="success"?Xe.finishRunningTask("Calendar week updated","success"):Xe.setAlert("error",e.data.message)},h9=async()=>{var e,n;Xe.initRunningTask("Rebuilding calendar week...");const t=await et("rebuildCalendarWeek",{},!0,!1);if(((e=t==null?void 0:t.data)==null?void 0:e.type)==="success"){const s=localStorage.getItem("calendarVersion")||"0";await yu(s),Xe.finishRunningTask("Calendar week rebuilt","success")}else Xe.setAlert("error",((n=t==null?void 0:t.data)==null?void 0:n.message)||"Rebuild failed")},CG=async(t,e)=>{switch(t){case"Admin":Jq(e);break;case"Facilitator":EG();break;case"Administration":$0(e);break}},f9=async()=>{const t=T().selectedNotification.action,e=T().selectedNotification.actionItem;switch(t){case"newInquiry":uG(e);break;case"feePayment":E().activeDashboard==="Administration"&&$0(t);break;case"familyAdded":break;case"calendarEvent":window.open(e,"_blank");break;case"newFunctionError":Qq(e);break;case"adminWarning":Xq(e);break;case"newMember":Zq(e);break}const n=Ve(Ce(),"Notifications",T().selectedNotification.notificationUUID);await xr(n,{isNew:!1})},p9=async()=>{T().notifications.show=!1,T().notifications.items.forEach(async t=>{if(!t.isNew){const e=Ve(Ce(),"Notifications",t.notificationUUID);await Ld(e),T().notifications.items=T().notifications.items.filter(n=>n.notificationUUID!==t.notificationUUID)}})},m9=async()=>{T().notifications.items.forEach(async t=>{const e=Ve(Ce(),"Notifications",t.notificationUUID);await xr(e,{isNew:!1}),t.isNew=!1})},PG=async()=>{const t=`Total_${Mg()}`,e=`Total_${new Date().getFullYear()}`;let n=Ve(Ce(),"FeePayments",t),s=await en(n);if(s.exists()){const i=JSON.parse(s.data().fYearTotal);i.forEach(r=>{r.amount=fw(r.amount)}),ve().yearTotals=i}if(n=Ve(Ce(),"FeePayments",e),s=await en(n),s.exists()){const i=JSON.parse(s.data().yearTotal);i.forEach(r=>{r.amount=fw(r.amount)}),ve().fYearTotals=i}ve().hasYearlyFees=!0};/**
2749 * @license
2750 * Copyright 2017 Google LLC
2751 *
2752 * Licensed under the Apache License, Version 2.0 (the "License");
2753 * you may not use this file except in compliance with the License.
2754 * You may obtain a copy of the License at
2755 *
2756 *   http://www.apache.org/licenses/LICENSE-2.0
2757 *
2758 * Unless required by applicable law or agreed to in writing, softw
2758are
2759 * distributed under the License is distributed on an "AS IS" BASIS,
2760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2761 * See the License for the specific language governing permissions and
2762 * limitations under the License.
2763 */const iD="firebasestorage.googleapis.com",rD="storageBucket",RG=2*60*1e3,kG=10*60*1e3,UG=1e3;/**
2764 * @license
2765 * Copyright 2017 Google LLC
2766 *
2767 * Licensed under the Apache License, Version 2.0 (the "License");
2768 * you may not use this file except in compliance with the License.
2769 * You may obtain a copy of the License at
2770 *
2771 *   http://www.apache.org/licenses/LICENSE-2.0
2772 *
2773 * Unless required by applicable law or agreed to in writing, software
2774 * distributed under the License is distributed on an "AS IS" BASIS,
2775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2776 * See the License for the specific language governing permissions and
2777 * limitations under the License.
2778 */class nt extends Hn{constructor(e,n,s=0){super(zh(e),`Firebase Storage: ${n} (${zh(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,nt.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return zh(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
2779${this.customData.serverResponse}`:this.message=this._baseMessage}}var Je;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Je||(Je={}));function zh(t){return"storage/"+t}function qg(){const t="An unknown error occurred, please check the error payload for server response.";return new nt(Je.UNKNOWN,t)}function NG(t){return new nt(Je.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function xG(t){return new nt(Je.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function MG(){const t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new nt(Je.UNAUTHENTICATED,t)}function OG(){return new nt(Je.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function LG(t){return new nt(Je.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function oD(){return new nt(Je.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function aD(){return new nt(Je.CANCELED,"User canceled the upload/download.")}function FG(t){return new nt(Je.INVALID_URL,"Invalid URL '"+t+"'.")}function VG(t){return new nt(Je.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function qG(){return new nt(Je.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+rD+"' property when initializing the app?")}function cD(){return new nt(Je.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function GG(){return new nt(Je.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function BG(){return new nt(Je.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function jG(t){return new nt(Je.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function wp(t){return new nt(Je.INVALID_ARGUMENT,t)}function lD(){return new nt(Je.APP_DELETED,"The Firebase app was deleted.")}function $G(t){return new nt(Je.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function xa(t,e){return new nt(Je.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function ia(t){throw new nt(Je.INTERNAL_ERROR,"Internal error: "+t)}/**
2780 * @license
2781 * Copyright 2017 Google LLC
2782 *
2783 * Licensed under the Apache License, Version 2.0 (the "License");
2784 * you may not use this file except in compliance with the License.
2785 * You may obtain a copy of the License at
2786 *
2787 *   http://www.apache.org/licenses/LICENSE-2.0
2788 *
2789 * Unless required by applicable law or agreed to in writing, software
2790 * distributed under the License is distributed on an "AS IS" BASIS,
2791 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2792 * See the License for the specific language governing permissions and
2793 * limitations under the License.
2794 */class On{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let s;try{s=On.makeFromUrl(e,n)}catch{return new On(e,"")}if(s.path==="")return s;throw VG(e)}static makeFromUrl(e,n){let s=null;const i="([A-Za-z0-9.\\-_]+)";function r(_){_.path.charAt(_.path.length-1)==="/"&&(_.path_=_.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+i+o,"i"),c={bucket:1,path:3};function l(_){_.path_=decodeURIComponent(_.path)}const u="v[A-Za-z0-9_]+",d=n.replace(/[.]/g,"\\."),h="(/([^?#]*).*)?$",f=new RegExp(`^https?://${d}/${u}/b/${i}/o${h}`,"i"),m={bucket:1,path:3},v=n===iD?"(?:storage.googleapis.com|storage.cloud.google.com)":n,b="([^?#]*)",D=new RegExp(`^https?://${v}/${i}/${b}`,"i"),y=[{regex:a,indices:c,postModify:r},{regex:f,indices:m,postModify:l},{regex:D,indices:{bucket:1,path:2},postModify:l}];for(let _=0;_<y.length;_++){const S=y[_],P=S.regex.exec(e);if(P){const x=P[S.indices.bucket];let M=P[S.indices.path];M||(M=""),s=new On(x,M),S.postModify(s);break}}if(s==null)throw FG(e);return s}}class HG{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}/**
2795 * @license
2796 * Copyright 2017 Google LLC
2797 *
2798 * Licensed under the Apache License, Version 2.0 (the "License");
2799 * you may not use this file except in compliance with the License.
2800 * You may obtain a copy of the License at
2801 *
2802 *   http://www.apache.org/licenses/LICENSE-2.0
2803 *
2804 * Unless required by applicable law or agreed to in writing, software
2805 * distributed under the License is distributed on an "AS IS" BASIS,
2806 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2807 * See the License for the specific language governing permissions and
2808 * limitations under the License.
2809 */function WG(t,e,n){let s=1,i=null,r=null,o=!1,a=0;function c(){return a===2}let l=!1;function u(...b){l||(l=!0,e.apply(null,b))}function d(b){i=setTimeout(()=>{i=null,t(f,c())},b)}function h(){r&&clearTimeout(r)}function f(b,...D){if(l){h();return}if(b){h(),u.call(null,b,...D);return}if(c()||o){h(),u.call(null,b,...D);return}s<64&&(s*=2);let y;a===1?(a=2,y=0):y=(s+Math.random())*1e3,d(y)}let m=!1;function v(b){m||(m=!0,h(),!l&&(i!==null?(b||(a=2),clearTimeout(i),d(0)):b||(a=1)))}return d(0),r=setTimeout(()=>{o=!0,v(!0)},n),v}function KG(t){t(!1)}/**
2810 * @license
2811 * Copyright 2017 Google LLC
2812 *
2813 * Licensed under the Apache License, Version 2.0 (the "License");
2814 * you may not use this file except in compliance with the License.
2815 * You may obtain a copy of the License at
2816 *
2817 *   http://www.apache.org/licenses/LICENSE-2.0
2818 *
2819 * Unless required by applicable law or agreed to in writing, software
2820 * distributed under the License is distributed on an "AS IS" BASIS,
2821 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2822 * See the License for the specific language governing permissions and
2823 * limitations under the License.
2824 */function zG(t){return t!==void 0}function JG(t){return typeof t=="function"}function YG(t){return typeof t=="object"&&!Array.isArray(t)}function $d(t){return typeof t=="string"||t instanceof String}function yw(t){return Gg()&&t instanceof Blob}function Gg(){return typeof Blob<"u"}function _w(t,e,n,s){if(s<e)throw wp(`Invalid value for '${t}'. Expected ${e} or greater.`);if(s>n)throw wp(`Invalid value for '${t}'. Expected ${n} or less.`)}/**
2825 * @license
2826 * Copyright 2017 Google LLC
2827 *
2828 * Licensed under the Apache License, Version 2.0 (the "License");
2829 * you may not use this file except in compliance with the License.
2830 * You may obtain a copy of the License at
2831 *
2832 *   http://www.apache.org/licenses/LICENSE-2.0
2833 *
2834 * Unless required by applicable law or agreed to in writing, software
2835 * distributed under the License is distributed on an "AS IS" BASIS,
2836 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2837 * See the License for the specific language governing permissions and
2838 * limitations under the License.
2839 */function Ko(t,e,n){let s=e;return n==null&&(s=`https://${e}`),`${n}://${s}/v0${t}`}function uD(t){const e=encodeURIComponent;let n="?";for(const s in t)if(t.hasOwnProperty(s)){const i=e(s)+"="+e(t[s]);n=n+i+"&"}return n=n.slice(0,-1),n}/**
2840 * @license
2841 * Copyright 2017 Google LLC
2842 *
2843 * Licensed under the Apache License, Version 2.0 (the "License");
2844 * you may not use this file except in compliance with the License.
2845 * You may obtain a copy of the License at
2846 *
2847 *   http://www.apache.org/licenses/LICENSE-2.0
2848 *
2849 * Unless required by applicable law or agreed to in writing, software
2850 * distributed under the License is distributed on an "AS IS" BASIS,
2851 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2852 * See the License for the specific language governing permissions and
2853 * limitations under the License.
2854 */var mr;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(mr||(mr={}));/**
2855 * @license
2856 * Copyright 2022 Google LLC
2857 *
2858 * Licensed under the Apache License, Version 2.0 (the "License");
2859 * you may not use this file except in compliance with the License.
2860 * You may obtain a copy of the License at
2861 *
2862 *   http://www.apache.org/licenses/LICENSE-2.0
2863 *
2864 * Unless required by applicable law or agreed to in writing, software
2865 * distributed under the License is distributed on an "AS IS" BASIS,
2866 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2867 * See the License for the specific language governing permissions and
2868 * limitations under the License.
2869 */function dD(t,e){const n=t>=500&&t<600,i=[408,429].indexOf(t)!==-1,r=e.indexOf(t)!==-1;return n||i||r}/**
2870 * @license
2871 * Copyright 2017 Google LLC
2872 *
2873 * Licensed under the Apache License, Version 2.0 (the "License");
2874 * you may not use this file except in compliance with the License.
2875 * You may obtain a copy of the License at
2876 *
2877 *   http://www.apache.org/licenses/LICENSE-2.0
2878 *
2879 * Unless required by applicable law or agreed to in writing, software
2880 * distributed under the License is distributed on an "AS IS" BASIS,
2881 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2882 * See the License for the specific language governing permissions and
2883 * limitations under the License.
2884 */class QG{constructor(e,n,s,i,r,o,a,c,l,u,d,h=!0){this.url_=e,this.method_=n,this.headers_=s,this.body_=i,this.successCodes_=r,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=c,this.timeout_=l,this.progressCallback_=u,this.connectionFactory_=d,this.retry=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((f,m)=>{this.resolve_=f,this.reject_=m,this.start_()})}start_(){const e=(s,i)=>{if(i){s(!1,new ml(!1,null,!0));return}const r=this.connectionFactory_();this.pendingConnection_=r;const o=a=>{const c=a.loaded,l=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(c,l)};this.progressCallback_!==null&&r.addUploadProgressListener(o),r.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&r.removeUploadProgressListener(o),this.pendingConnection_=null;const a=r.getErrorCode()===mr.NO_ERROR,c=r.getStatus();if(!a||dD(c,this.additionalRetryCodes_)&&this.retry){const u=r.getErrorCode()===mr.ABORT;s(!1,new ml(!1,null,u));return}const l=this.successCodes_.indexOf(c)!==-1;s(!0,new ml(l,r))})},n=(s,i)=>{const r=this.resolve_,o=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const c=this.callback_(a,a.getResponse());zG(c)?r(c):r()}catch(c){o(c)}else if(a!==null){const c=qg();c.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,c)):o(c)}else if(i.canceled){const c=this.appDelete_?lD():aD();o(c)}else{const c=oD();o(c)}};this.canceled_?n(!1,new ml(!1,null,!0)):this.backoffId_=WG(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&KG(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class ml{constructor(e,n,s){this.wasSuccessCode=e,this.connection=n,this.canceled=!!s}}
2884function XG(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function ZG(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function eB(t,e){e&&(t["X-Firebase-GMPID"]=e)}function tB(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function nB(t,e,n,s,i,r,o=!0){const a=uD(t.urlParams),c=t.url+a,l=Object.assign({},t.headers);return eB(l,e),XG(l,n),ZG(l,r),tB(l,s),new QG(c,t.method,l,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i,o)}/**
2885 * @license
2886 * Copyright 2017 Google LLC
2887 *
2888 * Licensed under the Apache License, Version 2.0 (the "License");
2889 * you may not use this file except in compliance with the License.
2890 * You may obtain a copy of the License at
2891 *
2892 *   http://www.apache.org/licenses/LICENSE-2.0
2893 *
2894 * Unless required by applicable law or agreed to in writing, software
2895 * distributed under the License is distributed on an "AS IS" BASIS,
2896 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2897 * See the License for the specific language governing permissions and
2898 * limitations under the License.
2899 */function sB(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function iB(...t){const e=sB();if(e!==void 0){const n=new e;for(let s=0;s<t.length;s++)n.append(t[s]);return n.getBlob()}else{if(Gg())return new Blob(t);throw new nt(Je.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function rB(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}/**
2900 * @license
2901 * Copyright 2021 Google LLC
2902 *
2903 * Licensed under the Apache License, Version 2.0 (the "License");
2904 * you may not use this file except in compliance with the License.
2905 * You may obtain a copy of the License at
2906 *
2907 *   http://www.apache.org/licenses/LICENSE-2.0
2908 *
2909 * Unless required by applicable law or agreed to in writing, software
2910 * distributed under the License is distributed on an "AS IS" BASIS,
2911 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2912 * See the License for the specific language governing permissions and
2913 * limitations under the License.
2914 */function oB(t){if(typeof atob>"u")throw jG("base-64");return atob(t)}/**
2915 * @license
2916 * Copyright 2017 Google LLC
2917 *
2918 * Licensed under the Apache License, Version 2.0 (the "License");
2919 * you may not use this file except in compliance with the License.
2920 * You may obtain a copy of the License at
2921 *
2922 *   http://www.apache.org/licenses/LICENSE-2.0
2923 *
2924 * Unless required by applicable law or agreed to in writing, software
2925 * distributed under the License is distributed on an "AS IS" BASIS,
2926 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2927 * See the License for the specific language governing permissions and
2928 * limitations under the License.
2929 */const Cs={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class Jh{constructor(e,n){this.data=e,this.contentType=n||null}}function aB(t,e){switch(t){case Cs.RAW:return new Jh(hD(e));case Cs.BASE64:case Cs.BASE64URL:return new Jh(fD(t,e));case Cs.DATA_URL:return new Jh(lB(e),uB(e))}throw qg()}function hD(t){const e=[];for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);if(s<=127)e.push(s);else if(s<=2047)e.push(192|s>>6,128|s&63);else if((s&64512)===55296)if(!(n<t.length-1&&(t.charCodeAt(n+1)&64512)===56320))e.push(239,191,189);else{const r=s,o=t.charCodeAt(++n);s=65536|(r&1023)<<10|o&1023,e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63)}else(s&64512)===56320?e.push(239,191,189):e.push(224|s>>12,128|s>>6&63,128|s&63)}return new Uint8Array(e)}function cB(t){let e;try{e=decodeURIComponent(t)}catch{throw xa(Cs.DATA_URL,"Malformed data URL.")}return hD(e)}function fD(t,e){switch(t){case Cs.BASE64:{const i=e.indexOf("-")!==-1,r=e.indexOf("_")!==-1;if(i||r)throw xa(t,"Invalid character '"+(i?"-":"_")+"' found: is it base64url encoded?");break}case Cs.BASE64URL:{const i=e.indexOf("+")!==-1,r=e.indexOf("/")!==-1;if(i||r)throw xa(t,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=oB(e)}
2929catch(i){throw i.message.includes("polyfill")?i:xa(t,"Invalid character found")}const s=new Uint8Array(n.length);for(let i=0;i<n.length;i++)s[i]=n.charCodeAt(i);return s}class pD{constructor(e){this.base64=!1,this.contentType=null;const n=e.match(/^data:([^,]+)?,/);if(n===null)throw xa(Cs.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const s=n[1]||null;s!=null&&(this.base64=dB(s,";base64"),this.contentType=this.base64?s.substring(0,s.length-7):s),this.rest=e.substring(e.indexOf(",")+1)}}function lB(t){const e=new pD(t);return e.base64?fD(Cs.BASE64,e.rest):cB(e.rest)}function uB(t){return new pD(t).contentType}function dB(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}/**
2930 * @license
2931 * Copyright 2017 Google LLC
2932 *
2933 * Licensed under the Apache License, Version 2.0 (the "License");
2934 * you may not use this file except in compliance with the License.
2935 * You may obtain a copy of the License at
2936 *
2937 *   http://www.apache.org/licenses/LICENSE-2.0
2938 *
2939 * Unless required by applicable law or agreed to in writing, software
2940 * distributed under the License is distributed on an "AS IS" BASIS,
2941 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2942 * See the License for the specific language governing permissions and
2943 * limitations under the License.
2944 */class Si{constructor(e,n){let s=0,i="";yw(e)?(this.data_=e,s=e.size,i=e.type):e instanceof ArrayBuffer?(n?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),s=this.data_.length):e instanceof Uint8Array&&(n?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),s=e.length),this.size_=s,this.type_=i}size(){return this.size_}type(){return this.type_}slice(e,n){if(yw(this.data_)){const s=this.data_,i=rB(s,e,n);return i===null?null:new Si(i)}else{const s=new Uint8Array(this.data_.buffer,e,n-e);return new Si(s,!0)}}static getBlob(...e){if(Gg()){const n=e.map(s=>s instanceof Si?s.data_:s);return new Si(iB.apply(null,n))}else{const n=e.map(o=>$d(o)?aB(Cs.RAW,o).data:o.data_);let s=0;n.forEach(o=>{s+=o.byteLength});const i=new Uint8Array(s);let r=0;return n.forEach(o=>{for(let a=0;a<o.length;a++)i[r++]=o[a]}),new Si(i,!0)}}uploadData(){return this.data_}}/**
2945 * @license
2946 * Copyright 2017 Google LLC
2947 *
2948 * Licensed under the Apache License, Version 2.0 (the "License");
2949 * you may not use this file except in compliance with the License.
2950 * You may obtain a copy of the License at
2951 *
2952 *   http://www.apache.org/licenses/LICENSE-2.0
2953 *
2954 * Unless required by applicable law or agreed to in writing, software
2955 * distributed under the License is distributed on an "AS IS" BASIS,
2956 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2957 * See the License for the specific language governing permissions and
2958 * limitations under the License.
2959 */function mD(t){let e;try{e=JSON.parse(t)}catch{return null}return YG(e)?e:null}/**
2960 * @license
2961 * Copyright 2017 Google LLC
2962 *
2963 * Licensed under the Apache License, Version 2.0 (the "License");
2964 * you may not use this file except in compliance with the License.
2965 * You may obtain a copy of the License at
2966 *
2967 *   http://www.apache.org/licenses/LICENSE-2.0
2968 *
2969 * Unless required by applicable law or agreed to in writing, software
2970 * distributed under the License is distributed on an "AS IS" BASIS,
2971 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2972 * See the License for the specific language governing permissions and
2973 * limitations under the License.
2974 */function hB(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function fB(t,e){const n=e.split("/").filter(s=>s.length>0).join("/");return t.length===0?n:t+"/"+n}function gD(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/**
2975 * @license
2976 * Copyright 2017 Google LLC
2977 *
2978 * Licensed under the Apache License, Version 2.0 (the "License");
2979 * you may not use this file except in compliance with the License.
2980 * You may obtain a copy of the License at
2981 *
2982 *   http://www.apache.org/licenses/LICENSE-2.0
2983 *
2984 * Unless required by applicable law or agreed to in writing, softw
2984are
2985 * distributed under the License is distributed on an "AS IS" BASIS,
2986 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2987 * See the License for the specific language governing permissions and
2988 * limitations under the License.
2989 */function pB(t,e){return e}class Wt{constructor(e,n,s,i){this.server=e,this.local=n||e,this.writable=!!s,this.xform=i||pB}}let gl=null;function mB(t){return!$d(t)||t.length<2?t:gD(t)}function yD(){if(gl)return gl;const t=[];t.push(new Wt("bucket")),t.push(new Wt("generation")),t.push(new Wt("metageneration")),t.push(new Wt("name","fullPath",!0));function e(r,o){return mB(o)}const n=new Wt("name");n.xform=e,t.push(n);function s(r,o){return o!==void 0?Number(o):o}const i=new Wt("size");return i.xform=s,t.push(i),t.push(new Wt("timeCreated")),t.push(new Wt("updated")),t.push(new Wt("md5Hash",null,!0)),t.push(new Wt("cacheControl",null,!0)),t.push(new Wt("contentDisposition",null,!0)),t.push(new Wt("contentEncoding",null,!0)),t.push(new Wt("contentLanguage",null,!0)),t.push(new Wt("contentType",null,!0)),t.push(new Wt("metadata","customMetadata",!0)),gl=t,gl}function gB(t,e){function n(){const s=t.bucket,i=t.fullPath,r=new On(s,i);return e._makeStorageReference(r)}Object.defineProperty(t,"ref",{get:n})}function yB(t,e,n){const s={};s.type="file";const i=n.length;for(let r=0;r<i;r++){const o=n[r];s[o.local]=o.xform(s,e[o.server])}return gB(s,t),s}function _D(t,e,n){const s=mD(e);return s===null?null:yB(t,s,n)}function _B(t,e,n,s){const i=mD(e);if(i===null||!$d(i.downloadTokens))return null;const r=i.downloadTokens;if(r.length===0)return null;const o=encodeURIComponent;return r.split(",").map(l=>{const u=t.bucket,d=t.fullPath,h="/b/"+o(u)+"/o/"+o(d),f=Ko(h,n,s),m=uD({alt:"media",token:l});return f+m})[0]}function ID(t,e){const n={},s=e.length;for(let i=0;i<s;i++){const r=e[i];r.writable&&(n[r.server]=t[r.local])}return JSON.stringify(n)}class Fr{constructor(e,n,s,i){this.url=e,this.method=n,this.handler=s,this.timeout=i,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
2990 * @license
2991 * Copyright 2017 Google LLC
2992 *
2993 * Licensed under the Apache License, Version 2.0 (the "License");
2994 * you may not use this file except in compliance with the License.
2995 * You may obtain a copy of the License at
2996 *
2997 *   http://www.apache.org/licenses/LICENSE-2.0
2998 *
2999 * Unless required by applicable law or agreed to in writing, software
3000 * distributed under the License is distributed on an "AS IS" BASIS,
3001 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3002 * See the License for the specific language governing permissions and
3003 * limitations under the License.
3004 */function ti(t){if(!t)throw qg()}function Bg(t,e){function n(s,i){const r=_D(t,i,e);return ti(r!==null),r}return n}function IB(t,e){function n(s,i){const r=_D(t,i,e);return ti(r!==null),_B(r,i,t.host,t._protocol)}return n}function $c(t){function e(n,s){let i;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?i=OG():i=MG():n.getStatus()===402?i=xG(t.bucket):n.getStatus()===403?i=LG(t.path):i=s,i.status=n.getStatus(),i.serverResponse=s.serverResponse,i}return e}function jg(t){const e=$c(t);function n(s,i){let r=e(s,i);return s.getStatus()===404&&(r=NG(t.path)),r.serverResponse=i.serverResponse,r}return n}function wB(t,e,n){const s=e.fullServerUrl(),i=Ko(s,t.host,t._protocol),r="GET",o=t.maxOperationRetryTime,a=new Fr(i,r,Bg(t,n),o);return a.errorHandler=jg(e),a}function vB(t,e,n){const s=e.fullServerUrl(),i=Ko(s,t.host,t._protocol),r="GET",o=t.maxOperationRetryTime,a=new Fr(i,r,IB(t,n),o);return a.errorHandler=jg(e),a}function TB(t,e){const n=e.fullServerUrl(),s=Ko(n,t.host,t._protocol),i="DELETE",r=t.maxOperationRetryTime;function o(c,l){}const a=new Fr(s,i,o,r);return a.successCodes=[200,204],a.errorHandler=jg(e),a}function bB(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function wD(t,e,n){const s=Object.assign({},n);return s.fullPath=t.path,s.size=e.size(),s.contentType||(s.contentType=bB(null,e)),s}function EB(t,e,n,s,i){const r=e.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"};function a(){let y="";for(let _=0;_<2;_++)y=y+Math.random().toString().slice(2);return y}const c=a();o["Content-Type"]="multipart/related; boundary="+c;const l=wD(e,s,i),u=ID(l,n),d="--"+c+`\r
3005Content-Type: application/json; charset=utf-8\r
3006\r
3007`+u+`\r
3008--`+c+`\r
3009Content-Type: `+l.contentType+`\r
3010\r
3011`,h=`\r
3012--`+c+"--",f=Si.getBlob(d,s,h);if(f===null)throw cD();const m={name:l.fullPath},v=Ko(r,t.host,t._protocol),b="POST",D=t.maxUploadRetryTime,w=new Fr(v,b,Bg(t,n),D);
3012return w.urlParams=m,w.headers=o,w.body=f.uploadData(),w.errorHandler=$c(e),w}class _u{constructor(e,n,s,i){this.current=e,this.total=n,this.finalized=!!s,this.metadata=i||null}}function $g(t,e){let n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch{ti(!1)}return ti(!!n&&(e||["active"]).indexOf(n)!==-1),n}function SB(t,e,n,s,i){const r=e.bucketOnlyServerUrl(),o=wD(e,s,i),a={name:o.fullPath},c=Ko(r,t.host,t._protocol),l="POST",u={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":o.contentType,"Content-Type":"application/json; charset=utf-8"},d=ID(o,n),h=t.maxUploadRetryTime;function f(v){$g(v);let b;try{b=v.getResponseHeader("X-Goog-Upload-URL")}catch{ti(!1)}return ti($d(b)),b}const m=new Fr(c,l,f,h);return m.urlParams=a,m.headers=u,m.body=d,m.errorHandler=$c(e),m}function DB(t,e,n,s){const i={"X-Goog-Upload-Command":"query"};function r(l){const u=$g(l,["active","final"]);let d=null;try{d=l.getResponseHeader("X-Goog-Upload-Size-Received")}catch{ti(!1)}d||ti(!1);const h=Number(d);return ti(!isNaN(h)),new _u(h,s.size(),u==="final")}const o="POST",a=t.maxUploadRetryTime,c=new Fr(n,o,r,a);return c.headers=i,c.errorHandler=$c(e),c}const Iw=256*1024;function AB(t,e,n,s,i,r,o,a){const c=new _u(0,0);if(o?(c.current=o.current,c.total=o.total):(c.current=0,c.total=s.size()),s.size()!==c.total)throw GG();const l=c.total-c.current;let u=l;i>0&&(u=Math.min(u,i));const d=c.current,h=d+u;let f="";u===0?f="finalize":l===u?f="upload, finalize":f="upload";const m={"X-Goog-Upload-Command":f,"X-Goog-Upload-Offset":`${c.current}`},v=s.slice(d,h);if(v===null)throw cD();function b(_,S){const P=$g(_,["active","final"]),x=c.current+u,M=s.size();let C;return P==="final"?C=Bg(e,r)(_,S):C=null,new _u(x,M,P==="final",C)}const D="POST",w=e.maxUploadRetryTime,y=new Fr(n,D,b,w);return y.headers=m,y.body=v.uploadData(),y.progressCallback=a||null,y.errorHandler=$c(t),y}const sn={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function Yh(t){switch(t){case"running":case"pausing":case"canceling":return sn.RUNNING;case"paused":return sn.PAUSED;case"success":return sn.SUCCESS;case"canceled":return sn.CANCELED;case"error":return sn.ERROR;default:return sn.ERROR}}/**
3013 * @license
3014 * Copyright 2017 Google LLC
3015 *
3016 * Licensed under the Apache License, Version 2.0 (the "License");
3017 * you may not use this file except in compliance with the License.
3018 * You may obtain a copy of the License at
3019 *
3020 *   http://www.apache.org/licenses/LICENSE-2.0
3021 *
3022 * Unless required by applicable law or agreed to in writing, software
3023 * distributed under the License is distributed on an "AS IS" BASIS,
3024 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3025 * See the License for the specific language governing permissions and
3026 * limitations under the License.
3027 */class CB{constructor(e,n,s){if(JG(e)||n!=null||s!=null)this.next=e,this.error=n??void 0,this.complete=s??void 0;else{const r=e;this.next=r.next,this.error=r.error,this.complete=r.complete}}}/**
3028 * @license
3029 * Copyright 2017 Google LLC
3030 *
3031 * Licensed under the Apache License, Version 2.0 (the "License");
3032 * you may not use this file except in compliance with the License.
3033 * You may obtain a copy of the License at
3034 *
3035 *   http://www.apache.org/licenses/LICENSE-2.0
3036 *
3037 * Unless required by applicable law or agreed to in writing, software
3038 * distributed under the License is distributed on an "AS IS" BASIS,
3039 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3040 * See the License for the specific language governing permissions and
3041 * limitations under the License.
3042 */function zr(t){return(...e)=>{Promise.resolve().then(()=>t(...e))}}class PB{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=mr.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=mr.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=mr.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,n,s,i){if(this.sent_)throw ia("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(n,e,!0),i!==void 0)for(const r in i)i.hasOwnProperty(r)&&this.xhr_.setRequestHeader(r,i[r].toString());return s!==void 0?this.xhr_.send(s):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw ia("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw ia("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw ia("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw ia("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class RB extends PB{initXhr(){this.xhr_.responseType="text"}}function nr(){return new RB}/**
3043 * @license
3044 * Copyright 2017 Google LLC
3045 *
3046 * Licensed under the Apache License, Version 2.0 (the "License");
3047 * you may not use this file except in compliance with the License.
3048 * You may obtain a copy of the License at
3049 *
3050 *   http://www.apache.org/licenses/LICENSE-2.0
3051 *
3052 * Unless required by applicable law or agreed to in writing, software
3053 * distributed under the License is distributed on an "AS IS" BASIS,
3054 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3055 * See the License for the specific language governing permissions and
3056 * limitations under the License.
3057 */class kB{constructor(e,n,s=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=n,this._metadata=s,this._mappings=yD(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=i=>{if(this._request=void 0,this._chunkMultiplier=1,i._codeEquals(Je.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const r=this.isExponentialBackoffExpired();if(dD(i.status,[]))if(r)i=oD();else{this.sleepTime=Math.max(this.sleepTime*2,UG),this._needToFetchStatus=!0,this.completeTransitions_();return}this._error=i,this._transition("error")}},this._metadataErrorHandler=i=>{this._request=void 0,i._codeEquals(Je.CANCELED)?this.completeTransitions_():(this._error=i,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((i,r)=>{this._resolve=i,this._reject=r,this._start()}),this._promise.then(null,()=>{})}isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}_makeProgressCallback(){const e=this._transferred;return n=>this._updateProgress(e+n)}_shouldDoResumable(e){return e.size()>256*1024}_start(){this._state==="running"&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([n,s])=>{switch(this._state){case"running":e(n,s);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused");break}})}_createResumable(){this._resolveToken((e,n)=>{const s=SB(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),i=this._ref.storage._makeRequest(s,nr,e,n);this._request=i,i.getPromise().then(r=>{this._request=void 0,this._uploadUrl=r,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const e=this._uploadUrl;this._resolveToken((n,s)=>{const i=DB(this._ref.storage,this._ref._location,e,this._blob),r=this._ref.storage._makeRequest(i,nr,n,s);this._request=r,r.getPromise().then(o=>{o=o,this._request=void 0,this._updateProgress(o.current),this._needToFetchStatus=!1,o.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const e=Iw*this._chunkMultiplier,n=new _u(this._transferred,this._blob.size()),s=this._uploadUrl;this._resolveToken((i,r)=>{let o;try{o=AB(this._ref._location,this._ref.storage,s,this._blob,e,this._mappings,n,this._makeProgressCallback())}catch(c){this._error=c,this._transition("error");return}const a=this._ref.storage._makeRequest(o,nr,i,r,!1);this._request=a,a.getPromise().then(c=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(c.current),c.finalized?(this._metadata=c.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){Iw*this._chunkMultiplier*2<32*1024*1024&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,n)=>{const s=wB(this._ref.storage,this._ref._location,this._mappings),i=this._ref.storage._makeRequest(s,nr,e,n);this._request=i,i.getPromise().then(r=>{this._request=void 0,this._metadata=r,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,n)=>{const s=EB(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),i=this._ref.storage._makeRequest
3057(s,nr,e,n);this._request=i,i.getPromise().then(r=>{this._request=void 0,this._metadata=r,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){const n=this._transferred;this._transferred=e,this._transferred!==n&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,this._request!==void 0?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const n=this._state==="paused";this._state=e,n&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=aD(),this._state=e,this._notifyObservers();break;case"error":this._state=e,this._notifyObservers();break;case"success":this._state=e,this._notifyObservers();break}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}}get snapshot(){const e=Yh(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,n,s,i){const r=new CB(n||void 0,s||void 0,i||void 0);return this._addObserver(r),()=>{this._removeObserver(r)}}then(e,n){return this._promise.then(e,n)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){const n=this._observers.indexOf(e);n!==-1&&this._observers.splice(n,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(n=>{this._notifyObserver(n)})}_finishPromise(){if(this._resolve!==void 0){let e=!0;switch(Yh(this._state)){case sn.SUCCESS:zr(this._resolve.bind(null,this.snapshot))();break;case sn.CANCELED:case sn.ERROR:const n=this._reject;zr(n.bind(null,this._error))();break;default:e=!1;break}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(Yh(this._state)){case sn.RUNNING:case sn.PAUSED:e.next&&zr(e.next.bind(e,this.snapshot))();break;case sn.SUCCESS:e.complete&&zr(e.complete.bind(e))();break;case sn.CANCELED:case sn.ERROR:e.error&&zr(e.error.bind(e,this._error))();break;default:e.error&&zr(e.error.bind(e,this._error))()}}resume(){const e=this._state==="paused"||this._state==="pausing";return e&&this._transition("running"),e}pause(){const e=this._state==="running";return e&&this._transition("pausing"),e}cancel(){const e=this._state==="running"||this._state==="pausing";return e&&this._transition("canceling"),e}}/**
3058 * @license
3059 * Copyright 2019 Google LLC
3060 *
3061 * Licensed under the Apache License, Version 2.0 (the "License");
3062 * you may not use this file except in compliance with the License.
3063 * You may obtain a copy of the License at
3064 *
3065 *   http://www.apache.org/licenses/LICENSE-2.0
3066 *
3067 * Unless required by applicable law or agreed to in writing, software
3068 * distributed under the License is distributed on an "AS IS" BASIS,
3069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3070 * See the License for the specific language governing permissions and
3071 * limitations under the License.
3072 */class Er{constructor(e,n){this._service=e,n instanceof On?this._location=n:this._location=On.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new Er(e,n)}get root(){const e=new On(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return gD(this._location.path)}get storage(){return this._service}get parent(){const e=hB(this._location.path);if(e===null)return null;const n=new On(this._location.bucket,e);return new Er(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw $G(e)}}function UB(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new kB(t,new Si(e),n)}function NB(t){t._throwIfRoot("getDownloadURL");const e=vB(t.storage,t._location,yD());return t.storage.makeRequestWithTokens(e,nr).then(n=>{if(n===null)throw BG();return n})}function xB(t){t._throwIfRoot("deleteObject");const e=TB(t.storage,t._location);return t.storage.makeRequestWithTokens(e,nr)}function MB(t,e){const n=fB(t._location.path,e),s=new On(t._location.bucket,n);return new Er(t.storage,s)}/**
3073 * @license
3074 * Copyright 2017 Google LLC
3075 *
3076 * Licensed under the Apache License, Version 2.0 (the "License");
3077 * you may not use this file except in compliance with the License.
3078 * You may obtain a copy of the License at
3079 *
3080 *   http://www.apache.org/licenses/LICENSE-2.0
3081 *
3082 * Unless required by applicable law or agreed to in writing, software
3083 * distributed under the License is distributed on an "AS IS" BASIS,
3084 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3085 * See the License for the specific language governing permissions and
3086 * limitations under the License.
3087 */function OB(t){return/^[A-Za-z]+:\/\//.test(t)}function LB(t,e){return new Er(t,e)}function vD(t,e){if(t instanceof Hg){const n=t;if(n._bucket==null)throw qG();const s=new Er(n,n._bucket);return e!=null?vD(s,e):s}else return e!==void 0?MB(t,e):t}function FB(t,e){if(e&&OB(e)){if(t instanceof Hg)return LB(t,e);throw wp("To use ref(service, url), the first argument must be a Storage instance.")}else return vD(t,e)}function ww(t,e){const n=e==null?void 0:e[rD];return n==null?null:On.makeFromBucketSpec(n,t)}function VB(t,e,n,s={}){t.host=`${e}:${n}`,t._protocol="http";const{mockUserToken:i}=s;i&&(t._overrideAuthToken=typeof i=="string"?i:Tb(i,t.app.options.projectId))}class Hg{constructor(e,n,s,i,r){this.app=e,this._authProvider=n,this._appCheckProvider=s,this._url=i,this._firebaseVersion=r,this._bucket=null,this._host=iD,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=RG,this._maxUploadRetryTime=kG,this._requests=new Set,i!=null?this._bucket=On.makeFromBucketSpec(i,this._host):this._bucket=ww(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=On.makeFromBucketSpec(this._url,e):this._bucket=ww(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){_w("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){_w("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Er(this,e)}_makeRequest(e,n,s,i,r=!0){if(this._deleted)return new HG(lD());{const o=nB(e,this._appId,s,i,n,this._firebaseVersion,r);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[s,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,s,i).getPromise()}}const vw="@firebase/storage",Tw="0.12.4";/**
3088 * @license
3089 * Copyright 2020 Google LLC
3090 *
3091 * Licensed under the Apache License, Version 2.0 (the "License");
3092 * you may not use this file except in compliance with the License.
3093 * You may obtain a copy of the License at
3094 *
3095 *   http://www.apache.org/licenses/LICENSE-2.0
3096 *
3097 * Unless required by applicable law or agreed to in writing, software
3098 * distributed under the License is distributed on an "AS IS" BASIS,
3099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3100 * See the License for the specific language governing permissions and
3101 * limitations under the License.
3102 */const TD="storage";function bD(t,e,n){return t=Ae(t),UB(t,e,n)}function Wg(t){return t=Ae(t),NB(t)}function bw(t){return t=Ae(t),xB(t)}function gc(t,e){return t=Ae(t),FB(t,e)}function qB(t=qo(),e){t=Ae(t);const s=ps(t,TD).getImmediate({identifier:e}),i=sm("storage");return i&&GB(s,...i),s}function GB(t,e,n,s={}){VB(t,e,n,s)}function BB(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),s=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal");return new Hg(n,s,i,e,Rr)}function jB(){ln(new Zt(TD,BB,"PUBLIC").setMultipleInstances(!0)),kt(vw,Tw,""),kt(vw,Tw,"esm2017")}jB();let Sr=null;function Kg(){if(!Sr){const{$firebaseApp:t}=We();Sr=qB(t)}}const g9=async(t,e,n)=>new Promise(async(s,i)=>{Kg(),E().setShowProgressBar(!0);const r=gc(Sr,`${t}/${e.name}`),o=bD(r,e),a=await HB(e.name),c=await WB(e.name);o.on("state_changed",l=>{const u=ED(l.bytesTransferred/l.totalBytes*100);switch(E().setProgressText(`${u}%`),E().setProgressStyle(`width: ${u}%`),E().setProgressCount(u),l.state){case"paused":console.log("Upload is paused");break}},l=>{console.log(l),i(l),E().setShowProgressBar(!1)},()=>{c!=="pdf"&&E().setProgressLabel("generating thumbnail..."),Wg(o.snapshot.ref).then(async l=>{if(c==="pdf")s(`${l}@@@noThumbNail`);else{await DD(700);const u=await SD(`${t}/thumbnails/${a}_200x200.webp`);s(`${l}@@@${u}`),E().setShowProgressBar(!1)}})})}),$B=async(t,e,n,s)=>new Promise(async(i,r)=>{Kg(),E().setShowProgressBar(!0);const o=gc(Sr,`${t}/${e}`),a=bD(o,n);a.on("state_changed",c=>{const l=ED(c.bytesTransferred/c.totalBytes*100);switch(E().setProgressText(`${l}%`),E().setProgressStyle(`width: ${l}%`),E().setProgressCount(l),c.state){case"paused":console.log("Upload is paused");break}},c=>{console.log(c),r(c),E().setShowProgressBar(!1)},()=>{Wg(a.snapshot.ref).then(async c=>{i(c),E().setShowProgressBar(!1)})})}),y9=async(t,e,n)=>new Promise(async(s,i)=>{Kg();let r=gc(Sr,`${t}/${e}.${n}`);const o=a=>["jpg","jpeg","png","gif","webp","tiff","bmp"].includes(a.toLowerCase());bw(r).then(()=>
3102{if(o(n))r=gc(Sr,`${t}/thumbnails/${e}_200x200.webp`),bw(r).then(()=>{s("success")});else{s("success");return}}).catch(a=>{i(a)})});function ED(t){return t|0}function SD(t){return new Promise(e=>{const n=gc(Sr,t);Wg(n).then(async s=>{e(s)}).catch(async s=>{await DD(400),e(SD(t))})})}function DD(t){return new Promise(e=>{setTimeout(()=>{e("done")},t)})}function HB(t){return new Promise(e=>{const n=t.split(".");e(n[0])})}function WB(t){return new Promise(e=>{const n=t.split(".");e(n[1])})}const _9=async()=>{const t=Fs(),e=Rs(),n=fi(),s={email:e.memberData.email},i=await et("initSignin",s,!0,!1);i.data.type==="success"?(t.signinState=i.data.mode,(i.data.mode==="facilitator_signup"||i.data.mode==="facilitator_signup_password")&&(e.memberData.facilitatorUUID=i.data.facilitatorUUID,e.memberData.facilitatorAuthOld=i.data.facilitatorAuthOld,e.memberData.name=i.data.facilitatorName,e.registerState="connect")):t.setAlert("error",i.data.message),n.disableInputs=!1},I9=async()=>{const t=Fs(),e=fi();t.setAlert("info","Facilitator sign-up is currently unavailable. Please contact TLC for assistance."),e.disableInputs=!1},w9=async()=>{const t=Rs();t.registerState="verifying";const n={whatsApp:t.connectAccountData.whatsApp.replace(/\s/g,""),prefix:t.connectAccountData.prefix},s=await et("initConnectAccount",n,!0,!1);if(s.data.type==="success"&&(s.data.data.email=s.data.data.email.toLowerCase()),s.data.type!=="success"){Fs().setAlert("error",s.data.message),t.registerState="init";return}if(s.data.type==="success"){t.registerState="connect",t.connectAccountData=s.data.data,t.registerProgressMessage="Connecting you to your account...";return}},KB=async t=>{const e=Rs();e.memberData.email=e.connectAccountData.email,e.registerState="account_setup",e.registerProgressMessage="Please wait, we are initiating your account...";const n={familyToken:e.connectAccountData.familyToken,email:e.connectAccountData.email,password:e.memberData.password,authType:t,whatsApp:e.connectAccountData.whatsApp,prefix:e.connectAccountData.prefix,memberType:e.connectAccountData.memberType,docRef:e.connectAccountData.docRef};if((await et("registerMember",n,!0,!1)).data.type==="success"){const i=Fs();fi().setUILoading(!1),i.preventRefresh=!1,t==="emailpw"?await oA():(e.setMemberToken(e.connectAccountData.familyToken),e.setAuthLogin(!0),e.setMemberRole(e.connectAccountData.memberType),e.connectAccountData.memberType==="guardian"?qt("/parents/dash"):e.connectAccountData.memberType==="student"?qt("/students/dash"):qt("/parents/dash"))}},v9=async()=>{const t=Rs(),e={email:t.memberData.email};(await et("requestResetPassword",e,!0,!0)).data.type==="success"&&t.setResetState("success")},T9=async()=>{const t=Rs(),e={password:t.memberData.password,oobCode:t.memberData.oobCode},n=await et("resetPassword",e,!0,!0);n.data.type==="success"&&(t.setEmail(n.data.email),t.setPassword(t.memberData.password),await oA())},zB=[{item:"Home",count:0,action:"home",notification:!1},{item:"Payments",count:0,action:"payments",notification:!1},{item:"Feedback",count:0,action:"feedback",notification:!1}],JB=async()=>{E().sidePaneItems=zB,E().navTitle="Parents Dashboard",E().activeSidePane="home",E().activeMainPage="Home",await AD("parents"),t4(),s4()},b9=async t=>{if(!t.groupFeedback){const n=await vt("FeedbackGroups",t.groupFeedbackUUID);n.exists()&&(t.groupFeedback=n.data().coveredCurriculum)}let e=`${t.facilitatorName}`;(ve().selectedStudent.groupName==="Tanni"||ve().selectedStudent.groupName==="Paani"||ve().selectedStudent.groupName==="Jaul")&&(e=`${t.facilitatorName} - ${t.subjectName}`),T().dialogStudentFeedback.title=e,T().dialogStudentFeedback.feedback=t.feedback,T().dialogStudentFeedback.groupFeedback=t.groupFeedback,T().dialogStudentFeedback.color=t.color,T().dialogStudentFeedback.show=!0},AD=async t=>{let e;J().documentsPending=0,J().formsPending=0,J().profileDocuments=[];const n=await vt("Families",xe().memberToken);if(n.exists()){e=n.data(),e.familyUUID=n.id,e.status==="admission"&&(J().isAdmission=!0),e.latestMessage&&e4(e.latestMessage),e.profileVersion&&(J().profileVersion=e.profileVersion),e.guardians.forEach(i=>
3102{i.dob=Se(i.dob),i.identityProof&&i.identityProof.forEach(r=>{r.uploaded_At&&(r.uploaded_At=Se(r.uploaded_At)),r.expiryDate&&(r.expiryDate=Se(r.expiryDate)),r.fileURL===""&&J().documentsPending++,Iu(r),r.personName=i.name,J().profileDocuments.push(r)})}),e.children.forEach(i=>{i.status!=="unenrolled"&&(i.dob=Se(i.dob),(i.groupName==="Jaul"||i.groupName==="Tanni"||i.groupName==="Paani")&&(J().isTLCPlus=!0),i.identityProof&&i.identityProof.forEach(r=>{r.uploaded_At&&(r.uploaded_At=Se(r.uploaded_At)),r.expiryDate&&(r.expiryDate=Se(r.expiryDate)),r.fileURL===""&&J().documentsPending++,Iu(r),r.personName=i.name,J().profileDocuments.push(r)}))}),e.forms?e.forms.forEach(i=>{i.uploaded_At&&(i.uploaded_At=Se(i.uploaded_At))}):J().formsPending=1,YB(e),J().setProfileData(e),J().profileCompleted=J().isProfileCompleted(),!J().profileCompleted&&!T().isProfileAdmin&&(E().activeMainPage="Profile",E().activeSidePane="profile");const s=localStorage.getItem("currentStep");s&&(J().currentStep=parseInt(s)),J().profileCompleted||J().showModalCompleteProfile("Please complete your profile"),J().orgProfileData=JSON.parse(JSON.stringify(J().profileData)),J().isAdmission||ZB()}t==="parents"&&(E().navTitle="Parents Dashboard")},YB=t=>{t.guardians.forEach((n,s)=>{const i=localStorage.getItem(`parentsData${n.firstName}`);if(i){J().profileUpdated=!0;const r=JSON.parse(i);r.dob=new Date(r.dob),r.identityProof.forEach(o=>{o.uploaded_At&&(o.uploaded_At=new Date(o.uploaded_At)),o.expiryDate&&(o.expiryDate=new Date(o.expiryDate)),o.fileURL===""&&J().documentsPending++,Iu(o)}),n.identityProof=r.identityProof,t.guardians[s]=r}else(!n.medicalInfo||!n.identityProof||!n.parentsQuestionsOne||!n.parentsQuestionsTwo)&&QB(n)}),t.children.forEach((n,s)=>{const i=localStorage.getItem(`childData${n.firstName}`);if(i){J().profileUpdated=!0;const r=JSON.parse(i);r.dob=new Date(r.dob),r.identityProof.forEach(o=>{o.uploaded_At&&(o.uploaded_At=new Date(o.uploaded_At)),o.expiryDate&&(o.expiryDate=new Date(o.expiryDate)),o.fileURL===""&&J().documentsPending++,Iu(o)}),t.children[s]=r}else(!n.medicalInfo||!n.identityProof||!n.questions)&&XB(n)});const e=localStorage.getItem("emergencyInfos");e?(J().emergencyInfos=JSON.parse(e),J().profileUpdated=!0):t.emergencyInfos&&(J().emergencyInfos=t.emergencyInfos),t.forms&&t.forms.forEach(n=>{let s=J().forms.find(i=>i.fileName===n.fileName);s.path=n.fileURL,J().formsPending--}),t.guardians.forEach(n=>{if(n.maritalStatus!=="Married"){t.legalGuardianDocuments||(t.legalGuardianDocuments=[]);const s={name:"Legal Guardian Ship",fileName:"legalGuardianDocument",downloadUrl:"",fileURL:"",formType:"legalGuardianDocument"};t.legalGuardianDocuments.length===0?t.legalGuardianDocuments.push(s):t.legalGuardianDocuments.unshift(s)}}),J().currentStep=parseInt(localStorage.getItem("currentStep"))||1},QB=t=>{if(t.medicalInfo||(t.medicalInfo={fAllergies:"Please select",allergies:"",fVacinations:"Please select",vacinations:"",bloodGroup:"Select Blood Group"}),t.parentsQuestionsOne||(t.parentsQuestionsOne=[...J().parentsQuestionsOne]),t.parentsQuestionsTwo||(t.parentsQuestionsTwo=[...J().parentsQuestionsTwo]),!t.identityProof){const e=[],n={fileName:"",fileURL:"",identityProofType:"ID Proof",identityProofSelection:"Please select",identityOptions:J().validDocuments};if(e.push(n),J().documentsPending++,t.nationality!=="Indian"){const s={fileName:"",fileURL:"",identityProofType:"Visa Proof",identityProofSelection:"Please select",identityOptions:J().validVisa};e.push(s),J().documentsPending++}t.identityProof=e}},XB=t=>{if(t.medicalInfo||(t.medicalInfo={fAllergies:"Please select",allergies:"",fVacinations:"Please select",vacinations:"",bloodGroup:"Select Blood Group"}),t.questions||(t.questions=[...J().studentQuestions]),!t.identityProof){const e=[],n={fileName:"",fileURL:"",identityProofType:"ID Proof",identityProofSelection:"Please select",identityOptions:J().validDocuments};if(e.push(n),J().documentsPending++,t.nationality!=="Indian"){const s={fileName:"",fileURL:"",identityProofType:"Visa Proof",identityProofSelection:"Please select",identityOptions:J().validVisa};
3102e.push(s),J().documentsPending++}t.identityProof=e}},Iu=t=>{if(t.hasExpiryDate){const e=new Date(t.expiryDate);new Date>e&&J().documentsExpired++}},ZB=async()=>{J().profileData.children.forEach(e=>{e.status!=="unenrolled"&&J().studentLessons.push({student:e.firstName,studentUUID:e.studentUUID,groupName:e.groupName,todaysLessons:[]})});const t=W0(new Date);t==="Saturday"||t==="Sunday"||J().profileData.children.forEach(e=>{if(e.status==="unenrolled")return;const s=pc().groupSessions.filter(r=>r.groupName===e.groupName)[0].days.filter(r=>r.day===t),i=J().studentLessons.find(r=>r.student===e.firstName);i.todaysLessons=s[0].sessions,i.todaysLessons.forEach(r=>{r.isMixedGroup&&(r.mixedGroupSubjectUUID&&(r.mainMixedGroupUUID=r.mixedGroupSubjectUUID,delete r.mixedGroupSubjectUUID),Vg(r,e.studentUUID))})})},E9=async()=>{if(J().familyFeedbacks.length===0)for await(const t of J().profileData.children){if(t.status==="unenrolled")continue;const e=[],n=[{field:"createdAt",direction:"desc"}];(await zi(`Students/${t.studentUUID}/FeedbackCombined`,e,n)).forEach(i=>{const r=i.data();r.createdAt=Se(r.createdAt),r.studentName=t.name,J().familyFeedbacks.push(r)})}},e4=async t=>{const e=await vt("Messages",t);if(e.exists()){const n=e.data();n.messageUUID=e.id,n.createdAt=Se(n.createdAt),J().latestMessage=n}},S9=async()=>{const e=(await vt("WhatsAppGroups","a70cd9c1-8f38-449c-91a2-aedac2f765c4")).data();T().dialogMeetings.meetingData.participants=e.members,T().dialogMeetings.meetingData.participants.forEac
3102h(n=>{n.status="pending",n.groupUUID===ae().groups[0].groupUUID&&T().dialogMeetings.meetingData.filteredParticipants.push(n)}),T().dialogMeetings.show=!0},D9=async()=>{T().dialogMeetings.meetingData=ve().selectedMeeting,CD(ve().selectedMeeting.participants),T().dialogMeetings.selectedGroup=ae().groups[0],T().dialogMeetings.meetingData.filteredParticipants=[],T().dialogMeetings.meetingData.participants.forEach(t=>{t.groupUUID===T().dialogMeetings.selectedGroup.groupUUID&&T().dialogMeetings.meetingData.filteredParticipants.push(t)}),T().dialogMeetings.status=ve().selectedMeeting.status,T().dialogMeetings.show=!0},CD=t=>{T().dialogMeetings.attendance.pending=0,T().dialogMeetings.attendance.accepted=0,T().dialogMeetings.attendance.declined=0,t.forEach(e=>{switch(e.status){case"sent":T().dialogMeetings.attendance.pending++;break;case"accepted":T().dialogMeetings.attendance.accepted++;break;case"rejected":T().dialogMeetings.attendance.declined++;break}})},t4=async()=>{ve().meetings=[],(await F0("MeetingsCollection",[{field:"type",operator:"==",value:"parents_meeting"},{field:"status",operator:"==",value:"sent"}],[],1)).forEach(n=>{const s=n.data();s.meetingCollectionUUID=n.id,s.date=s.date.toDate();let i="pending";const r=J().profileData.guardians.findIndex(d=>d.parentUUID===xe().authUser.uid),o=J().profileData.guardians[r].firstName,a=JSON.parse(J().profileData.groupUUIDs),c=s.participants.findIndex(d=>d.name===o);a.findIndex(d=>d===s.participants[c].groupUUID)!==-1&&(i=s.participants[c].status);const u=pG(s.title,s.date,s.startTime,s.endTime);J().upcomingMeeting={meetingCollectionUUID:s.meetingCollectionUUID,title:s.title,date:s.date,status:s.status,description:s.description,startTime:s.startTime,endTime:s.endTime,meetingStatus:i,calendarLink:u}})},A9=async(t,e)=>{ve().meetings=[],(await zi("MeetingsCollection",[{field:"type",operator:"==",value:t},{field:"status",operator:"==",value:e}],[{field:"date",direction:"desc"}])).forEach(r=>{const o=r.data();o.meetingCollectionUUID=r.id,o.date=o.date.toDate(),ve().meetings.push(o)})},C9=async()=>{const t=Wo();T().dialogMeetings.meetingData.status="pending",T().dialogMeetings.meetingData.type="parents_meeting",delete T().dialogMeetings.meetingData.filteredParticipants,await Bd("MeetingsCollection",t,T().dialogMeetings.meetingData),await Or("App","Data","meetings",1),ve().meetings.push(T().dialogMeetings.meetingData),T().dialogMeetings.show=!1},P9=async()=>{for await(const t of T().dialogMeetings.meetingData.participants){const e=Wo(),n={to:t.number,data:{name:t.name,date:T().dialogMeetings.meetingData.date,topic:T().dialogMeetings.meetingData.description},whatsAppTemplate:"parent_meetings",meetingCollectionUUID:T().dialogMeetings.meetingData.meetingCollectionUUID,status:"pending",createdAt:new Date,createdBy:xe().authUser.uid};await new Promise(s=>setTimeout(s,2e3)),await Bd("Meetings",e,n),console.log("sent to: "+t.name)}await Fe("MeetingsCollection",T().dialogMeetings.meetingData.meetingCollectionUUID,{status:"sent"}),T().dialogMeetings.status="sent",T().dialogMeetings.show=!1},R9=async()=>{const t=[{field:"meetingCollectionUUID",operator:"==",value:ve().selectedMeeting.meetingCollectionUUID}];(await zi("Meetings",t,[])).forEach(n=>{const s=n.data(),i=T().dialogMeetings.meetingData.participants.findIndex(r=>r.number===s.to);i!==-1&&(T().dialogMeetings.meetingData.participants[i].status=s.status)}),await Fe("MeetingsCollection",ve().selectedMeeting.meetingCollectionUUID,{participants:T().dialogMeetings.meetingData.participants}),CD(T().dialogMeetings.meetingData.participants)},k9=async t=>{const n=(await vt("MeetingsCollection",J().upcomingMeeting.meetingCollectionUUID)).data(),s=J().profileData.guardians.findIndex(c=>c.parentUUID===xe().authUser.uid),i=J().profileData.guardians[s].firstName,r=JSON.parse(J().profileData.groupUUIDs),o=n.participants.findIndex(c=>c.name===i);r.findIndex(c=>c===n.participants[o].groupUUID)!==-1&&(n.participants[o].status=t,await Fe("MeetingsCollection",J().upcomingMeeting.meetingCollectionUUID,{participants:n.participants}))},U9=async()=>{await Fe("MeetingsCollection",T().dialogMeetings.meetingData.meetingCollectionUUID,{status:"archived"}),T().dialogMeetings.status="archived",T().dialogMeetings.show=!1},N9=async()=>{const e={mainMixedGroupUUID:Wo(),mixedGroupName:"",mixedGroups:[]};ae().selectedMixedGroupCombined=e,ae().selectedMixedGroup=null,ae().setMixedGroupCombinedStudents(),E().isEdit=!0},x9=async(t,e,n)=>{const s=Wo(),i={mainMixedGroupUUID:ae().selectedMixedGroupCombined.mainMixedGroupUUID,mixedGroupUUID:s,facilitatorUUID:t.facilitatorUUID,facilitator:t.facilitator,subject:e.name,subjectUUID:e.subjectUUID,classroom:n.name,classroomUUID:n.classroomUUID,students:[]};ae().mixedGroups.push(i),ae().selectedMixedGroupCombined.mixedGroups.push(i),ae().selectedMixedGroup=ae().mixedGroups[ae().mi
3102xedGroups.length-1]},M9=async(t,e,n)=>{ae().selectedMixedGroup.facilitatorUUID=t.facilitatorUUID,ae().selectedMixedGroup.facilitator=t.facilitator,ae().selectedMixedGroup.subject=e.name,ae().selectedMixedGroup.subjectUUID=e.subjectUUID,ae().selectedMixedGroup.classroom=n.name,ae().selectedMixedGroup.classroomUUID=n.classroomUUID},O9=async t=>{t.students.forEach(e=>{ae().mixedGroupStudents.forEach(n=>{n.groupUUID===e.groupUUID&&n.students.push({studentUUID:e.studentUUID,name:e.student,groupUUID:e.groupUUID})})}),ae().selectedMixedGroupCombined.mixedGroups=ae().selectedMixedGroupCombined.mixedGroups.filter(e=>e.mixedGroupUUID!==t.mixedGroupUUID),ae().selectedMixedGroup=ae().selectedMixedGroupCombined.mixedGroups[0]},L9=async()=>{const t=JSON.parse(JSON.stringify(ae().mixedGroupsCombined));if(!t.find(n=>n.mainMixedGroupUUID===ae().selectedMixedGroupCombined.mainMixedGroupUUID)){const n=JSON.parse(JSON.stringify(ae().selectedMixedGroupCombined));t.push(n)}t.forEach(n=>{const s=[],i=[];n.mixedGroups.forEach(r=>{delete r.combinedGroupStudents,i.push({classroom:r.classroom||"Classroom",classroomUUID:r.classroomUUID||""});const o={facilitatorUUID:r.facilitatorUUID,facilitator:r.facilitator,groups:[],groupsCombined:""};r.students.forEach(c=>{o.groups.find(u=>u.groupUUID===c.groupUUID)||o.groups.push({groupUUID:c.groupUUID,groupName:c.group})});let a="";o.groups.forEach(c=>{a+=c.groupName+" - "}),a.endsWith(" - ")&&(a=a.slice(0,-3)),o.groupsCombined=a,s.push(o)}),n.facilitatorInfos=s,n.classrooms=i}),await Fe("App","MixedGroupsCombined",{mixedGroupsCombined:t,editedAt:new Date,editedBy:T().authUser.uid,editedByName:T().authUser.dis
3102playName}),await Or("App","AppVersions","mixedGroupsCombinedVersion",1),localStorage.setItem("mixedGroupsCombined",JSON.stringify(t)),ae().mixedGroupsCombined=t,ae().initMixedGroupsPage(),E().isEdit=!1},F9=async(t,e)=>{let n=!1;if(ae().selectedMixedGroupCombined.mixedGroups.forEach(i=>{if(i.students.filter(r=>r.studentUUID===t.uuid).length>0){T().setAlert("error",`${t.name} already in mixed group (${i.facilitator} - ${i.subject})`),n=!0;return}}),n)return;const s={studentUUID:t.studentUUID,student:t.name,groupUUID:e.groupUUID,group:e.groupName};ae().selectedMixedGroup.students.push(s),ae().mixedGroupStudents.forEach(i=>{i.groupUUID===s.groupUUID&&(i.students=i.students.filter(r=>r.studentUUID!==s.studentUUID))})},V9=async t=>{ae().selectedMixedGroup.students=ae().selectedMixedGroup.students.filter(e=>e.studentUUID!==t.studentUUID),ae().mixedGroupStudents.forEach(e=>{e.groupUUID===t.groupUUID&&e.students.push({studentUUID:t.studentUUID,name:t.student,groupUUID:t.groupUUID})})},q9=async()=>{let t=!1;if(pc().groupSessions.forEach(e=>{e.days.forEach(n=>{n.sessions.forEach(s=>{s.mainMixedGroupUUID===ae().selectedMixedGroupCombined.mainMixedGroupUUID&&(t=!0,T().setAlert("error",`${ae().selectedMixedGroupCombined.mixedGroupName} is still in use: ${e.groupName} on ${n.day}, ${s.timing}`))})})}),!t){ae().mixedGroupsCombined=ae().mixedGroupsCombined.filter(n=>n.mainMixedGroupUUID!==ae().selectedMixedGroupCombined.mainMixedGroupUUID);const e=JSON.parse(JSON.stringify(ae().mixedGroupsCombined));await Fe("App","MixedGroupsCombined",{mixedGroupsCombined:e,editedAt:new Date,editedBy:T().authUser.uid,editedByName:T().authUser.dis
3102playName}),await Or("App","AppVersions","mixedGroupsCombinedVersion",1),localStorage.setItem("mixedGroupsCombined",JSON.stringify(e)),ae().selectedMixedGroupCombined=null,E().isEdit=!1}},n4=t=>{const e={mainMixedGroupUUID:t.mainMixedGroupUUID,mixedGroups:[]};return t.mixedGroups.forEach(n=>{const s={mixedGroupUUID:n.mixedGroupUUID,students:n.students};e.mixedGroups.push(s)}),e},G9=async()=>{ve().selectedEvent&&(T().dialogEvents.eventData=ve().selectedEvent,T().dialogEvents.status=ve().selectedEvent.status),T().dialogEvents.show=!0},s4=async()=>{if(J().upcomingEvents.length>0)return;const t=[],e=J().profileData.groupUUIDs,n=Array.isArray(e)?e:(()=>{try{const s=JSON.parse(e||"[]");return Array.isArray(s)?s:[]}catch{return[]}})();T().fieldTrips.forEach(s=>{s.groups.forEach(i=>{n.findIndex(o=>o===i)!==-1&&t.push(s)})});for await(const s of t){const r=(await vt("Events",s.eventUUID)).data();r.eventUUID=s.eventUUID,r.status!=="archived"&&r.participants.forEach(o=>{J().profileData.children.forEach(a=>{a.studentUUID===o.studentUUID&&J().upcomingEvents.findIndex(l=>l.eventUUID===r.eventUUID)===-1&&(r.studentName=a.firstName,r.startDate=r.startDate.toDate(),r.endDate=r.endDate.toDate(),J().upcomingEvents.push(r))})})}},B9=async(t,e)=>{ve().events=[],(await zi("Events",[{field:"type",operator:"==",value:t},{field:"status",operator:"==",value:e}],[{field:"startDate",direction:"desc"}])).forEach(r=>{const o=r.data();o.eventUUID=r.id,o.startDate=o.startDate.toDate(),o.endDate=o.endDate.toDate(),ve().events.push(o)})},j9=async()=>{if(T().dialogEvents.eventData.eventUUID)await Fe("Events",T().dialogEvents.eventData.eventUUID,T().dialogEvents.eventData);else{const t=Wo();T().dialogEvents.eventData.status="pending",T().dialogEvents.eventData.type="field_trips",T().dialogEvents.eventData.createdAt=new Date,T().dialogEvents.eventData.createdBy=xe().authUser.uid,await Bd("Events",t,T().dialogEvents.eventData),await Or("App","Data","events",1),ve().events.push(T().dialogEvents.eventData)}T().dialogEvents.show=!1},$9=async()=>{await Fe("Events",T().dialogEvents.eventData.eventUUID,{status:"archived"}),ve().events.forEach(t=>{t.eventUUID===T().dialogEvents.eventData.eventUUID&&(t.status="archived")}),T().dialogEvents.show=!1};function zg(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(t);i<s.length;i++)e.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(t,s[i])&&(n[s[i]]=t[s[i]]);return n}function PD(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const i4=PD,RD=new ji("auth","Firebase",PD());/**
3103 * @license
3104 * Copyright 2020 Google LLC
3105 *
3106 * Licensed under the Apache License, Version 2.0 (the "License");
3107 * you may not use this file except in compliance with the License.
3108 * You may obtain a copy of the License at
3109 *
3110 *   http://www.apache.org/licenses/LICENSE-2.0
3111 *
3112 * Unless required by applicable law or agreed to in writing, software
3113 * distributed under the License is distributed on an "AS IS" BASIS,
3114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3115 * See the License for the specific language governing permissions and
3116 * limitations under the License.
3117 */const wu=new Ac("@firebase/auth");function r4(t,...e){wu.logLevel<=we.WARN&&wu.warn(`Auth (${Rr}): ${t}`,...e)}function Cl(t,...e){wu.logLevel<=we.ERROR&&wu.error(`Auth (${Rr}): ${t}`,...e)}/**
3118 * @license
3119 * Copyright 2020 Google LLC
3120 *
3121 * Licensed under the Apache License, Version 2.0 (the "License");
3122 * you may not use this file except in compliance with the License.
3123 * You may obtain a copy of the License at
3124 *
3125 *   http://www.apache.org/licenses/LICENSE-2.0
3126 *
3127 * Unless required by applicable law or agreed to in writing, software
3128 * distributed under the License is distributed on an "AS IS" BASIS,
3129 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3130 * See the License for the specific language governing permissions and
3131 * limitations under the License.
3132 */function Yn(t,...e){throw Yg(t,...e)}function cs(t,...e){return Yg(t,...e)}function Jg(t,e,n){const s=Object.assign(Object.assign({}
3132,i4()),{[e]:n});return new ji("auth","Firebase",s).create(e,{appName:t.name})}function Oi(t){return Jg(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function o4(t,e,n){const s=n;if(!(e instanceof s))throw s.name!==e.constructor.name&&Yn(t,"argument-error"),Jg(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Yg(t,...e){if(typeof t!="string"){const n=e[0],s=[...e.slice(1)];return s[0]&&(s[0].appName=t.name),t._errorFactory.create(n,...s)}return RD.create(t,...e)}function le(t,e,...n){if(!t)throw Yg(e,...n)}function zs(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Cl(e),new Error(e)}function li(t,e){t||zs(e)}/**
3133 * @license
3134 * Copyright 2020 Google LLC
3135 *
3136 * Licensed under the Apache License, Version 2.0 (the "License");
3137 * you may not use this file except in compliance with the License.
3138 * You may obtain a copy of the License at
3139 *
3140 *   http://www.apache.org/licenses/LICENSE-2.0
3141 *
3142 * Unless required by applicable law or agreed to in writing, software
3143 * distributed under the License is distributed on an "AS IS" BASIS,
3144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3145 * See the License for the specific language governing permissions and
3146 * limitations under the License.
3147 */function vp(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function a4(){return Ew()==="http:"||Ew()==="https:"}function Ew(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/**
3148 * @license
3149 * Copyright 2020 Google LLC
3150 *
3151 * Licensed under the Apache License, Version 2.0 (the "License");
3152 * you may not use this file except in compliance with the License.
3153 * You may obtain a copy of the License at
3154 *
3155 *   http://www.apache.org/licenses/LICENSE-2.0
3156 *
3157 * Unless required by applicable law or agreed to in writing, software
3158 * distributed under the License is distributed on an "AS IS" BASIS,
3159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3160 * See the License for the specific language governing permissions and
3161 * limitations under the License.
3162 */function c4(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(a4()||bb()||"connection"in navigator)?navigator.onLine:!0}function l4(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/**
3163 * @license
3164 * Copyright 2020 Google LLC
3165 *
3166 * Licensed under the Apache License, Version 2.0 (the "License");
3167 * you may not use this file except in compliance with the License.
3168 * You may obtain a copy of the License at
3169 *
3170 *   http://www.apache.org/licenses/LICENSE-2.0
3171 *
3172 * Unless required by applicable law or agreed to in writing, software
3173 * distributed under the License is distributed on an "AS IS" BASIS,
3174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3175 * See the License for the specific language governing permissions and
3176 * limitations under the License.
3177 */class Hc{constructor(e,n){this.shortDelay=e,this.longDelay=n,li(n>e,"Short delay should be less than long delay!"),this.isMobile=QN()||ZN()}get(){return c4()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
3178 * @license
3179 * Copyright 2020 Google LLC
3180 *
3181 * Licensed under the Apache License, Version 2.0 (the "License");
3182 * you may not use this file except in compliance with the License.
3183 * You may obtain a copy of the License at
3184 *
3185 *   http://www.apache.org/licenses/LICENSE-2.0
3186 *
3187 * Unless required by applicable law or agreed to in writing, software
3188 * distributed under the License is distributed on an "AS IS" BASIS,
3189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3190 * See the License for the specific language governing permissions and
3191 * limitations under the License.
3192 */function Qg(t,e){li(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/**
3193 * @license
3194 * Copyright 2020 Google LLC
3195 *
3196 * Licensed under the Apache License, Version 2.0 (the "License");
3197 * you may not use this file except in compliance with the License.
3198 * You may obtain a copy of the License at
3199 *
3200 *   http://www.apache.org/licenses/LICENSE-2.0
3201 *
3202 * Unless required by applicable law or agreed to in writing, software
3203 * distributed under the License is distributed on an "AS IS" BASIS,
3204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3205 * See the License for the specific language governing permissions and
3206 * limitations under the License.
3207 */class kD{static initialize(e,n,s){this.fetchImpl=e,n&&(this.headersImpl=n),s&&(this.responseImpl=s)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;zs("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;zs("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;zs("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
3208 * @license
3209 * Copyright 2020 Google LLC
3210 *
3211 * Licensed under the Apache License, Version 2.0 (the "License");
3212 * you may not use this file except in compliance with the License.
3213 * You may obtain a copy of the License at
3214 *
3215 *   http://www.apache.org/licenses/LICENSE-2.0
3216 *
3217 * Unless required by applicable law or agreed to in writing, software
3218 * distributed under the License is distributed on an "AS IS" BASIS,
3219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3220 * See the License for the specific language governing permissions and
3221 * limitations under the License.
3222 */const u4={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-rec
3222aptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
3223 * @license
3224 * Copyright 2020 Google LLC
3225 *
3226 * Licensed under the Apache License, Version 2.0 (the "License");
3227 * you may not use this file except in compliance with the License.
3228 * You may obtain a copy of the License at
3229 *
3230 *   http://www.apache.org/licenses/LICENSE-2.0
3231 *
3232 * Unless required by applicable law or agreed to in writing, software
3233 * distributed under the License is distributed on an "AS IS" BASIS,
3234 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3235 * See the License for the specific language governing permissions and
3236 * limitations under the License.
3237 */const d4=new Hc(3e4,6e4);function Vr(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Ji(t,e,n,s,i={}){return UD(t,i,async()=>{let r={},o={};s&&(e==="GET"?o=s:r={body:JSON.stringify(s)});const a=Dc(Object.assign({key:t.config.apiKey},o)).slice(1),c=await t._getAdditionalHeaders();return c["Content-Type"]="application/json",t.languageCode&&(c["X-Firebase-Locale"]=t.languageCode),kD.fetch()(ND(t,t.config.apiHost,n,a),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},r))})}async function UD(t,e,n){t._canInitEmulator=!1;const s=Object.assign(Object.assign({},u4),e);try{const i=new f4(t),r=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await r.json();if("needConfirmation"in o)throw yl(t,"account-exists-with-different-credential",o);if(r.ok&&!("errorMessage"in o))return o;{const a=r.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw yl(t,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw yl(t,"email-already-in-use",o);if(c==="USER_DISABLED")throw yl(t,"user-disabled",o);const u=s[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw Jg(t,u,l);Yn(t,u)}}catch(i){if(i instanceof Hn)throw i;Yn(t,"network-request-failed",{message:String(i)})}}async function Hd(t,e,n,s,i={}){const r=await Ji(t,e,n,s,i);return"mfaPendingCredential"in r&&Yn(t,"multi-factor-auth-required",{_serverResponse:r}),r}function ND(t,e,n,s){const i=`${e}${n}?${s}`;return t.config.emulator?Qg(t.config,i):`${t.config.apiScheme}://${i}`}function h4(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class f4{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,s)=>{this.timer=setTimeout(()=>s(cs(this.auth,"network-request-failed")),d4.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function yl(t,e,n){const s={appName:t.name};n.email&&(s.email=n.email),n.phoneNumber&&(s.phoneNumber=n.phoneNumber);const i=cs(t,e,s);return i.customData._tokenResponse=n,i}function Sw(t){return t!==void 0&&t.enterprise!==void 0}class p4{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return h4
3237(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function m4(t,e){return Ji(t,"GET","/v2/recaptchaConfig",Vr(t,e))}/**
3238 * @license
3239 * Copyright 2020 Google LLC
3240 *
3241 * Licensed under the Apache License, Version 2.0 (the "License");
3242 * you may not use this file except in compliance with the License.
3243 * You may obtain a copy of the License at
3244 *
3245 *   http://www.apache.org/licenses/LICENSE-2.0
3246 *
3247 * Unless required by applicable law or agreed to in writing, software
3248 * distributed under the License is distributed on an "AS IS" BASIS,
3249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3250 * See the License for the specific language governing permissions and
3251 * limitations under the License.
3252 */async function g4(t,e){return Ji(t,"POST","/v1/accounts:delete",e)}async function xD(t,e){return Ji(t,"POST","/v1/accounts:lookup",e)}/**
3253 * @license
3254 * Copyright 2020 Google LLC
3255 *
3256 * Licensed under the Apache License, Version 2.0 (the "License");
3257 * you may not use this file except in compliance with the License.
3258 * You may obtain a copy of the License at
3259 *
3260 *   http://www.apache.org/licenses/LICENSE-2.0
3261 *
3262 * Unless required by applicable law or agreed to in writing, software
3263 * distributed under the License is distributed on an "AS IS" BASIS,
3264 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3265 * See the License for the specific language governing permissions and
3266 * limitations under the License.
3267 */function Ma(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function y4(t,e=!1){const n=Ae(t),s=await n.getIdToken(e),i=Xg(s);le(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const r=typeof i.firebase=="object"?i.firebase:void 0,o=r==null?void 0:r.sign_in_provider;return{claims:i,token:s,authTime:Ma(Qh(i.auth_time)),issuedAtTime:Ma(Qh(i.iat)),expirationTime:Ma(Qh(i.exp)),signInProvider:o||null,signInSecondFactor:(r==null?void 0:r.sign_in_second_factor)||null}}function Qh(t){return Number(t)*1e3}function Xg(t){const[e,n,s]=t.split(".");if(e===void 0||n===void 0||s===void 0)return Cl("JWT malformed, contained fewer than 3 sections"),null;try{const i=yb(n);return i?JSON.parse(i):(Cl("Failed to decode base64 JWT payload"),null)}catch(i){return Cl("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function Dw(t){const e=Xg(t);return le(e,"internal-error"),le(typeof e.exp<"u","internal-error"),le(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
3268 * @license
3269 * Copyright 2020 Google LLC
3270 *
3271 * Licensed under the Apache License, Version 2.0 (the "License");
3272 * you may not use this file except in compliance with the License.
3273 * You may obtain a copy of the License at
3274 *
3275 *   http://www.apache.org/licenses/LICENSE-2.0
3276 *
3277 * Unless required by applicable law or agreed to in writing, software
3278 * distributed under the License is distributed on an "AS IS" BASIS,
3279 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3280 * See the License for the specific language governing permissions and
3281 * limitations under the License.
3282 */async function yc(t,e,n=!1){if(n)return e;try{return await e}catch(s){throw s instanceof Hn&&_4(s)&&t.auth.currentUser===t&&await t.auth.signOut(),s}}function _4({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/**
3283 * @license
3284 * Copyright 2020 Google LLC
3285 *
3286 * Licensed under the Apache License, Version 2.0 (the "License");
3287 * you may not use this file except in compliance with the License.
3288 * You may obtain a copy of the License at
3289 *
3290 *   http://www.apache.org/licenses/LICENSE-2.0
3291 *
3292 * Unless required by applicable law or agreed to in writing, software
3293 * distributed under the License is distributed on an "AS IS" BASIS,
3294 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3295 * See the License for the specific language governing permissions and
3296 * limitations under the License.
3297 */class I4{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const s=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),s}else{this.errorBackoff=3e4;const i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
3298 * @license
3299 * Copyright 2020 Google LLC
3300 *
3301 * Licensed under the Apache License, Version 2.0 (the "License");
3302 * you may not use this file except in compliance with the License.
3303 * You may obtain a copy of the License at
3304 *
3305 *   http://www.apache.org/licenses/LICENSE-2.0
3306 *
3307 * Unless required by applicable law or agreed to in writing, software
3308 * distributed under the License is distributed on an "AS IS" BASIS,
3309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3310 * See the License for the specific language governing permissions and
3311 * limitations under the License.
3312 */class Tp{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ma(this.lastLoginAt),this.creationTime=Ma(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
3313 * @license
3314 * Copyright 2019 Google LLC
3315 *
3316 * Licensed under the Apache License, Version 2.0 (the "License");
3317 * you may not use this file except in compliance with the License.
3318 * You may obtain a copy of the License at
3319 *
3320 *   http://www.apache.org/licenses/LICENSE-2.0
3321 *
3322 * Unless required by applicable law or agreed to in writing, software
3323 * distributed under the License is distributed on an "AS IS" BASIS,
3324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3325 * See the License for the specific language governing permissions and
3326 * limitations under the License.
3327 */async function vu(t){var e;const n=t.auth,s=await t.getIdToken(),i=await yc(t,xD(n,{idToken:s}));le(i==null?void 0:i.users.length,n,"internal-error");const r=i.users[0];t._notifyReloadListener(r);const o=!((e=r.providerUserInfo)===null||e===void 0)&&e.length?MD(r.providerUserInfo):[],a=v4(t.providerData,o),c=t.isAnonymous,l=!(t.email&&r.passwordHash)&&!(a!=null&&a.length),u=c?l:!1,d={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new Tp(r.createdAt,r.lastLoginAt),isAnonymous:u};Object.assign(t,d)}async function w4(t){const e=Ae(t);await vu(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function v4(t,e){return[...t.filter(s=>!e.some(i=>i.providerId===s.providerId)),...e]}function MD(t){return t.map(e=>{var{providerId:n}=e,s=zg(e,["providerId"]);return{providerId:n,uid:s.rawId||"",displayName:s.displayName||null,email:s.email||null,phoneNumber:s.phoneNumber||null,photoURL:s.photoUrl||null}})}/**
3328 * @license
3329 * Copyright 2020 Google LLC
3330 *
3331 * Licensed under the Apache License, Version 2.0 (the "License");
3332 * you may not use this file except in compliance with the License.
3333 * You may obtain a copy of the License at
3334 *
3335 *   http://www.apache.org/licenses/LICENSE-2.0
3336 *
3337 * Unless required by applicable law or agreed to in writing, software
3338 * distributed under the License is distributed on an "AS IS" BASIS,
3339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3340 * See the License for the specific language governing permissions and
3341 * limitations under the License.
3342 */async function T4(t,e){const n=await UD(t,{},async()=>{const s=Dc({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:r}=t.config,o=ND(t,i,"/v1/token",`key=${r}`),a=await t._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",kD.fetch()(o,{method:"POST",headers:a,body:s})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function b4(t,e){return Ji(t,"POST","/v2/accounts:revokeToken",Vr(t,e))}/**
3343 * @license
3344 * Copyright 2020 Google LLC
3345 *
3346 * Licensed under the Apache License, Version 2.0 (the "License");
3347 * you may not use this file except in compliance with the License.
3348 * You may obtain a copy of the License at
3349 *
3350 *   http://www.apache.org/licenses/LICENSE-2.0
3351 *
3352 * Unless required by applicable law or agreed to in writing, software
3353 * distributed under the License is distributed on an "AS IS" BASIS,
3354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3355 * See the License for the specific language governing permissions and
3356 * limitations under the License.
3357 */class go{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){le(e.idToken,"internal-error"),le(typeof e.idToken<"u","internal-error"),le(typeof e.refreshToken<"u","internal-error");
3357const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):Dw(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){le(e.length!==0,"internal-error");const n=Dw(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(le(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:s,refreshToken:i,expiresIn:r}=await T4(e,n);this.updateTokensAndExpiration(s,i,Number(r))}updateTokensAndExpiration(e,n,s){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+s*1e3}static fromJSON(e,n){const{refreshToken:s,accessToken:i,expirationTime:r}=n,o=new go;return s&&(le(typeof s=="string","internal-error",{appName:e}),o.refreshToken=s),i&&(le(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),r&&(le(typeof r=="number","internal-error",{appName:e}),o.expirationTime=r),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new go,this.toJSON())}_performRefresh(){return zs("not implemented")}}/**
3358 * @license
3359 * Copyright 2020 Google LLC
3360 *
3361 * Licensed under the Apache License, Version 2.0 (the "License");
3362 * you may not use this file except in compliance with the License.
3363 * You may obtain a copy of the License at
3364 *
3365 *   http://www.apache.org/licenses/LICENSE-2.0
3366 *
3367 * Unless required by applicable law or agreed to in writing, software
3368 * distributed under the License is distributed on an "AS IS" BASIS,
3369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3370 * See the License for the specific language governing permissions and
3371 * limitations under the License.
3372 */function _i(t,e){le(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Js{constructor(e){var{uid:n,auth:s,stsTokenManager:i}=e,r=zg(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new I4(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=s,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=r.displayName||null,this.email=r.email||null,this.emailVerified=r.emailVerified||!1,this.phoneNumber=r.phoneNumber||null,this.photoURL=r.photoURL||null,this.isAnonymous=r.isAnonymous||!1,this.tenantId=r.tenantId||null,this.providerData=r.providerData?[...r.providerData]:[],this.metadata=new Tp(r.createdAt||void 0,r.lastLoginAt||void 0)}async getIdToken(e){const n=await yc(this,this.stsTokenManager.getToken(this.auth,e));return le(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return y4(this,e)}reload(){return w4(this)}_assign(e){this!==e&&(le(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Js(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){le(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let s=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),s=!0),n&&await vu(this),await this.auth._persistUserIfCurrent(this),s&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ss(this.auth.app))return Promise.reject(Oi(this.auth));const e=await this.getIdToken();return await yc(this,g4(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
3372nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var s,i,r,o,a,c,l,u;const d=(s=n.displayName)!==null&&s!==void 0?s:void 0,h=(i=n.email)!==null&&i!==void 0?i:void 0,f=(r=n.phoneNumber)!==null&&r!==void 0?r:void 0,m=(o=n.photoURL)!==null&&o!==void 0?o:void 0,v=(a=n.tenantId)!==null&&a!==void 0?a:void 0,b=(c=n._redirectEventId)!==null&&c!==void 0?c:void 0,D=(l=n.createdAt)!==null&&l!==void 0?l:void 0,w=(u=n.lastLoginAt)!==null&&u!==void 0?u:void 0,{uid:y,emailVerified:_,isAnonymous:S,providerData:P,stsTokenManager:x}=n;le(y&&x,e,"internal-error");const M=go.fromJSON(this.name,x);le(typeof y=="string",e,"internal-error"),_i(d,e.name),_i(h,e.name),le(typeof _=="boolean",e,"internal-error"),le(typeof S=="boolean",e,"internal-error"),_i(f,e.name),_i(m,e.name),_i(v,e.name),_i(b,e.name),_i(D,e.name),_i(w,e.name);const C=new Js({uid:y,auth:e,email:h,emailVerified:_,displayName:d,isAnonymous:S,photoURL:m,phoneNumber:f,tenantId:v,stsTokenManager:M,createdAt:D,lastLoginAt:w});return P&&Array.isArray(P)&&(C.providerData=P.map(N=>Object.assign({},N))),b&&(C._redirectEventId=b),C}static async _fromIdTokenResponse(e,n,s=!1){const i=new go;i.updateFromServerResponse(n);const r=new Js({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:s});return await vu(r),r}static async _fromGetAccountInfoResponse(e,n,s){const i=n.users[0];le(i.localId!==void 0,"internal-error");const r=i.providerUserInfo!==void 0?MD(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(r!=null&&r.length),a=new go;a.updateFromIdToken(s);const c=new Js({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),l={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:r,metadata:new Tp(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(r!=null&&r.length)};return Object.assign(c,l),c}}/**
3373 * @license
3374 * Copyright 2020 Google LLC
3375 *
3376 * Licensed under the Apache License, Version 2.0 (the "License");
3377 * you may not use this file except in compliance with the License.
3378 * You may obtain a copy of the License at
3379 *
3380 *   http://www.apache.org/licenses/LICENSE-2.0
3381 *
3382 * Unless required by applicable law or agreed to in writing, software
3383 * distributed under the License is distributed on an "AS IS" BASIS,
3384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3385 * See the License for the specific language governing permissions and
3386 * limitations under the License.
3387 */const Aw=new Map;function Ys(t){li(t instanceof Function,"Expected a class definition");let e=Aw.get(t);return e?(li(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Aw.set(t,e),e)}/**
3388 * @license
3389 * Copyright 2019 Google LLC
3390 *
3391 * Licensed under the Apache License, Version 2.0 (the "License");
3392 * you may not use this file except in compliance with the License.
3393 * You may obtain a copy of the License at
3394 *
3395 *   http://www.apache.org/licenses/LICENSE-2.0
3396 *
3397 * Unless required by applicable law or agreed to in writing, software
3398 * distributed under the License is distributed on an "AS IS" BASIS,
3399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3400 * See the License for the specific language governing permissions and
3401 * limitations under the License.
3402 */class OD{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}OD.type="NONE";const Cw=OD;/**
3403 * @license
3404 * Copyright 2019 Google LLC
3405 *
3406 * Licensed under the Apache License, Version 2.0 (the "License");
3407 * you may not use this file except in compliance with the License.
3408 * You may obtain a copy of the License at
3409 *
3410 *   http://www.apache.org/licenses/LICENSE-2.0
3411 *
3412 * Unless required by applicable law or agreed to in writing, software
3413 * distributed under the License is distributed on an "AS IS" BASIS,
3414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3415 * See the License for the specific language governing permissions and
3416 * limitations under the License.
3417 */function Pl(t,e,n){return`firebase:${t}:${e}:${n}`}class yo{constructor(e,n,s){this.persistence=e,this.auth=n,this.userKey=s;const{config:i,name:r}=this.auth;this.fullUserKey=Pl(this.userKey,i.apiKey,r),this.fullPersistenceKey=Pl("persistence",i.apiKey,r),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?Js._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,s="authUser"){if(!n.length)return new yo(Ys(Cw),e,s);const i=(await Promise.all(n.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let r=i[0]||Ys(Cw);const o=Pl(s,e.config.apiKey,e.name);let a=null;for(const l of n)try{const u=await l._get(o);if(u){const d=Js._fromJSON(e,u);l!==r&&(a=d),r=l;break}}catch{}const c=i.filter(l=>l._shouldAllowMigration);return!r._shouldAllowMigration||!c.length?new yo(r,e,s):(r=c[0],a&&await r._set(o,a.toJSON()),await Promise.all(n.map(async l=>{if(l!==r)try{await l._remove(o)}catch{}})),new yo(r,e,s))}}/**
3418 * @license
3419 * Copyright 2020 Google LLC
3420 *
3421 * Licensed under the Apache License, Version 2.0 (the "License");
3422 * you may not use this file except in compliance with the License.
3423 * You may obtain a copy of the License at
3424 *
3425 *   http://www.apache.org/licenses/LICENSE-2.0
3426 *
3427 * Unless required by applicable law or agreed to in writing, software
3428 * distributed under the License is distributed on an "AS IS" BASIS,
3429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3430 * See the License for the specific language governing permissions and
3431 * limitations under the License.
3432 */function Pw(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(VD(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(LD(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(GD(e))return"Blackberry";if(BD(e))return"Webos";if(Zg(e))return"Safari";if((e.includes("chrome/")||FD(e))&&!e.includes("edge/"))return"Chrome";if(qD(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,s=t.match(n);if((s==null?void 0:s.length)===2)return s[1]}return"Other"}function LD(t=xt()){return/firefox\//i.test(t)}function Zg(t=xt()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function FD(t=xt()){return/crios\//i.test(t)}function VD(t=xt()){return/iemobile/i.test(t)}function qD(t=xt()){return/android/i.test(t)}function GD(t=xt()){return/blackberry/i.test(t)}function BD(t=xt()){return/webos/i.test(t)}function Wd(t=xt()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function E4(t=xt()){var e;return Wd(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function S4(){return ex()&&document.documentMode===10}function jD(t=xt()){return Wd(t)||qD(t)||BD(t)||GD(t)||/windows phone/i.test(t)||VD(t)}function D4(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
3433 * @license
3434 * Copyright 2020 Google LLC
3435 *
3436 * Licensed under the Apache License, Version 2.0 (the "License");
3437 * you may not use this file except in compliance with the License.
3438 * You may obtain a copy of the License at
3439 *
3440 *   http://www.apache.org/licenses/LICENSE-2.0
3441 *
3442 * Unless required by applicable law or agreed to in writing, software
3443 * distributed under the License is distributed on an "AS IS" BASIS,
3444 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3445 * See the License for the specific language governing permissions and
3446 * limitations under the License.
3447 */function $D(t,e=[]){let n;switch(t){case"Browser":n=Pw(xt());break;case"Worker":n=`${Pw(xt())}-${t}`;break;default:n=t}const s=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Rr}/${s}`}/**
3448 * @license
3449 * Copyright 2022 Google LLC
3450 *
3451 * Licensed under the Apache License, Version 2.0 (the "License");
3452 * you may not use this file except in compliance with the License.
3453 * You may obtain a copy of the License at
3454 *
3455 *   http://www.apache.org/licenses/LICENSE-2.0
3456 *
3457 * Unless required by applicable law or agreed to in writing, software
3458 * distributed under the License is distributed on an "AS IS" BASIS,
3459 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3460 * See the License for the specific language governing permissions and
3461 * limitations under the License.
3462 */class A4{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const s=r=>new Promise((o,a)=>{try{const c=e(r);o(c)}catch(c){a(c)}});s.onAbort=n,this.queue.push(s);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const s of this.queue)await s(e),s.onAbort&&n.push(s.onAbort)}catch(s){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:s==null?void 0:s.message})}}}/**
3463 * @license
3464 * Copyright 2023 Google LLC
3465 *
3466 * Licensed under the Apache License, Version 2.0 (the "License");
3467 * you may not use this file except in compliance with the License.
3468 * You may obtain a copy of the License at
3469 *
3470 *   http://www.apache.org/licenses/LICENSE-2.0
3471 *
3472 * Unless required by applicable law or agreed to in writing, software
3473 * distributed under the License is distributed on an "AS IS" BASIS,
3474 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3475 * See the License for the specific language governing permissions and
3476 * limitations under the License.
3477 */async function C4(t,e={}){return Ji(t,"GET","/v2/passwordPolicy",Vr(t,e))}/**
3478 * @license
3479 * Copyright 2023 Google LLC
3480 *
3481 * Licensed under the Apache License, Version 2.0 (the "License");
3482 * you may not use this file except in compliance with the License.
3483 * You may obtain a copy of the License at
3484 *
3485 *   http://www.apache.org/licenses/LICENSE-2.0
3486 *
3487 * Unless required by applicable law or agreed to in writing, software
3488 * distributed under the License is distributed on an "AS IS" BASIS,
3489 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3490 * See the License for the specific language governing permissions and
3491 * limitations under the License.
3492 */const P4=6;class R4{constructor(e){var n,s,i,r;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=o.minPasswordLength)!==null&&n!==void 0?n:P4,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(s=e.allowedNonAlphanumericCharacters)===null||s===void 0?void 0:s.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(r=e.forceUpgradeOnSignin)!==null&&r!==void 0?r:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,s,i,r,o,a;const c={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,c),this.validatePasswordCharacterOptions(e,c),c.isValid&&
3492(c.isValid=(n=c.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),c.isValid&&(c.isValid=(s=c.meetsMaxPasswordLength)!==null&&s!==void 0?s:!0),c.isValid&&(c.isValid=(i=c.containsLowercaseLetter)!==null&&i!==void 0?i:!0),c.isValid&&(c.isValid=(r=c.containsUppercaseLetter)!==null&&r!==void 0?r:!0),c.isValid&&(c.isValid=(o=c.containsNumericCharacter)!==null&&o!==void 0?o:!0),c.isValid&&(c.isValid=(a=c.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),c}validatePasswordLengthOptions(e,n){const s=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;s&&(n.meetsMinPasswordLength=e.length>=s),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let s;for(let i=0;i<e.length;i++)s=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(n,s>="a"&&s<="z",s>="A"&&s<="Z",s>="0"&&s<="9",this.allowedNonAlphanumericCharacters.includes(s))}updatePasswordCharacterOptionsStatuses(e,n,s,i,r){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=s)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=r))}}/**
3493 * @license
3494 * Copyright 2020 Google LLC
3495 *
3496 * Licensed under the Apache License, Version 2.0 (the "License");
3497 * you may not use this file except in compliance with the License.
3498 * You may obtain a copy of the License at
3499 *
3500 *   http://www.apache.org/licenses/LICENSE-2.0
3501 *
3502 * Unless required by applicable law or agreed to in writing, software
3503 * distributed under the License is distributed on an "AS IS" BASIS,
3504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3505 * See the License for the specific language governing permissions and
3506 * limitations under the License.
3507 */class k4{constructor(e,n,s,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=s,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Rw(this),this.idTokenSubscription=new Rw(this),this.beforeStateQueue=new A4(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=RD,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Ys(n)),this._initializationPromise=this.queue(async()=>{var s,i;if(!this._deleted&&(this.persistenceManager=await yo.create(this,e),!this._deleted)){if(!((s=this._popupRedirectResolver)===null||s===void 0)&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await xD(this,{idToken:e}),s=await Js._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(s)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(Ss(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const s=await this.assertedPersistence.getCurrentUser();let i=s,r=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i==null?void 0:i._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===a)&&(c!=null&&c.user)&&(i=c.user,r=!0)}if(!i)return this.directlySetCurrentUser(null);
3507if(!i._redirectEventId){if(r)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=s,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return le(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await vu(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=l4()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Ss(this.app))return Promise.reject(Oi(this));const n=e?Ae(e):null;return n&&le(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&le(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ss(this.app)?Promise.reject(Oi(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ss(this.app)?Promise.reject(Oi(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Ys(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await C4(this),n=new R4(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new ji("auth","Firebase",e())}onAuthStateChanged(e,n,s){return this.registerStateListener(this.authStateSubscription,e,n,s)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,s){return this.registerStateListener(this.idTokenSubscription,e,n,s)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const s=this.onAuthStateChanged(()=>{s(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),s={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(s.tenantId=this.tenantId),await b4(this,s)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const s=await this.getOrInitRedirectPersistenceManager(n);return e===null?s.removeCurrentUser():s.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Ys(e)||this._popupRedirectResolver;le(n,this,"argument-error"),this.redirectPersistenceManager=await yo.create(this,[Ys(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,s;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((s=this.redirectUser)===null||s===void 0?void 0:s._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const s=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==s&&(this.lastNotifiedUid=s,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,s,i){if(this._deleted)return()=>{};const r=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(le(a,this,"internal-error"),a.then(()=>{o||r(this.currentUser)}),typeof n=="function"){const c=e.addObserver(n,s,i);return()=>{o=!0,c()}}else{const c=e.addObserver(n);return()=>{o=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return le(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=$D(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const s=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());s&&(n["X-Firebase-Client"]=s);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var e;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&r4(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function qr(t){return Ae(t)}class Rw{constructor(e){this.auth=e,this.observer=null,this.addObserver=ax(n=>this.observer=n)}get next(){return le(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
3508 * @license
3509 * Copyright 2020 Google LLC
3510 *
3511 * Licensed under the Apache License, Version 2.0 (the "License");
3512 * you may not use this file except in compliance with the License.
3513 * You may obtain a copy of the License at
3514 *
3515 *   http://www.apache.org/licenses/LICENSE-2.0
3516 *
3517 * Unless required by applicable law or agreed to in writing, software
3518 * distributed under the License is distributed on an "AS IS" BASIS,
3519 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3520 * See the License for the specific language governing permissions and
3521 * limitations under the License.
3522 */let Kd={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function U4(t){Kd=t}function HD(t){return Kd.loadJS(t)}function N4(){return Kd.recaptchaEnterpriseScript}function x4(){return Kd.gapiScript}function M4(t){return`__${t}${Math.floor(Math.random()*1e6)}`}const O4="recaptcha-enterprise",L4="NO_RECAPTCHA";class F4{constructor(e){this.type=O4,this.auth=qr(e)}async verify(e="verify",n=!1){async function s(r){if(!n){if(r.tenantId==null&&r._agentRecaptchaConfig!=null)return r._agentRecaptchaConfig.siteKey;if(r.tenantId!=null&&r._tenantRecaptchaConfigs[r.tenantId]!==void 0)return r._tenantRecaptchaConfigs[r.tenantId].siteKey}return new Promise(async(o,a)=>{m4(r,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const l=new p4(c);return r.tenantId==null?r._agentRecaptchaConfig=l:r._tenantRecaptchaConfigs[r.tenantId]=l,o(l.siteKey)}}).catch(c=>{a(c)})})}function i(r,o,a){const c=window.grecaptcha;Sw(c)?c.enterprise.ready(()=>{c.enterprise.execute(r,{action:e}).then(l=>{o(l)}).catch(()=>{o(L4)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((r,o)=>{s(this.auth).then(a=>{if(!n&&Sw(window.grecaptcha))i(a,r,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let c=N4();c.length!==0&&(c+=a),HD(c).then(()=>{i(a,r,o)}).catch(l=>{o(l)})}}).catch(a=>{o(a)})})}}async function kw(t,e,n,s=!1){const i=new F4(t);let r;try{r=await i.verify(n)}catch{r=await i.verify(n,!0)}const o=Object.assign({},e);return s?Object.assign(o,{captchaResp:r}):Object.assign(o,{captchaResponse:r}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function Uw(t,e,n,s){var i;if(!((i=t._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const r=await kw(t,e,n,n==="getOobCode");return s(t,r)}else return s(t,e).catch(async r=>{if(r.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await kw(t,e,n,n==="getOobCode");return s(t,o)}else return Promise.reject(r)})}/**
3523 * @license
3524 * Copyright 2020 Google LLC
3525 *
3526 * Licensed under the Apache License, Version 2.0 (the "License");
3527 * you may not use this file except in compliance with the License.
3528 * You may obtain a copy of the License at
3529 *
3530 *   http://www.apache.org/licenses/LICENSE-2.0
3531 *
3532 * Unless required by applicable law or agreed to in writing, software
3533 * distributed under the License is distributed on an "AS IS" BASIS,
3534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3535 * See the License for the specific language governing permissions and
3536 * limitations under the License.
3537 */function V4(t,e){const n=ps(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),r=n.getOptions();if(za(r,e??{}))return i;Yn(i,"already-initialized")}return n.initialize({options:e})}function q4(t,e){const n=(e==null?void 0:e.persistence)||[],s=(Array.isArray(n)?n:[n]).map(Ys);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(s,e==null?void 0:e.popupRedirectResolver)}function G4(t,e,n){const s=qr(t);le(s._canInitEmulator,s,"emulator-config-failed"),le(/^https?:\/\//.test(e),s,"invalid-emulator-scheme");const i=!1,r=WD(e),{host:o,port:a}=B4(e),c=a===null?"":`:${a}`;s.config.emulator={url:`${r}//${o}${c}/`},s.settings.appVerificationDisabledForTesting=!0,s.emulatorConfig=Object.freeze({host:o,port:a,protocol:r.replace(":",""),options:Object.freeze({disableWarnings:i})}),j4()}function WD(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function B4(t){const e=WD(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const s=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(s);if(i){const r=i[1];return{host:r,port:Nw(s.substr(r.length+1))}}else{const[r,o]=s.split(":");return{host:r,port:Nw(o)}}}function Nw(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function j4(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/**
3538 * @license
3539 * Copyright 2020 Google LLC
3540 *
3541 * Licensed under the Apache License, Version 2.0 (the "License");
3542 * you may not use this file except in compliance with the License.
3543 * You may obtain a copy of the License at
3544 *
3545 *   http://www.apache.org/licenses/LICENSE-2.0
3546 *
3547 * Unless required by applicable law or agreed to in writing, software
3548 * distributed under the License is distributed on an "AS IS" BASIS,
3549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3550 * See the License for the specific language governing permissions and
3551 * limitations under the License.
3552 */class ey{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return zs("not implemented")}_getIdTokenResponse(e){return zs("not implemented")}_linkToIdToken(e,n){return zs("not implemented")}_getReauthenticationResolver(e){return zs("not implemented")}}async function $4(t,e){return Ji(t,"POST","/v1/accounts:signUp",e)}/**
3553 * @license
3554 * Copyright 2020 Google LLC
3555 *
3556 * Licensed under the Apache License, Version 2.0 (the "License");
3557 * you may not use this file except in compliance with the License.
3558 * You may obtain a copy of the License at
3559 *
3560 *   http://www.apache.org/licenses/LICENSE-2.0
3561 *
3562 * Unless required by applicable law or agreed to in writing, software
3563 * distributed under the License is distributed on an "AS IS" BASIS,
3564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3565 * See the License for the specific language governing permissions and
3566 * limitations under the License.
3567 */async function H4(t,e){return Hd(t,"POST","/v1/accounts:signInWithPassword",Vr(t,e))}/**
3568 * @license
3569 * Copyright 2020 Google LLC
3570 *
3571 * Licensed under the Apache License, Version 2.0 (the "License");
3572 * you may not use this file except in compliance with the License.
3573 * You may obtain a copy of the License at
3574 *
3575 *   http://www.apache.org/licenses/LICENSE-2.0
3576 *
3577 * Unless required by applicable law or agreed to in writing, software
3578 * distributed under the License is distributed on an "AS IS" BASIS,
3579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3580 * See the License for the specific language governing permissions and
3581 * limitations under the License.
3582 */async function W4(t,e){return Hd(t,"POST","/v1/accounts:signInWithEmailLink",Vr(t,e))}async function K4(t,e){return Hd(t,"POST","/v1/accounts:signInWithEmailLink",Vr(t,e))}/**
3583 * @license
3584 * Copyright 2020 Google LLC
3585 *
3586 * Licensed under the Apache License, Version 2.0 (the "License");
3587 * you may not use this file except in compliance with the License.
3588 * You may obtain a copy of the License at
3589 *
3590 *   http://www.apache.org/licenses/LICENSE-2.0
3591 *
3592 * Unless required by applicable law or agreed to in writing, software
3593 * distributed under the License is distributed on an "AS IS" BASIS,
3594 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3595 * See the License for the specific language governing permissions and
3596 * limitations under the License.
3597 */class _c extends ey{constructor(e,n,s,i=null){super("password",s),this._email=e,this._password=n,this._tenantId=i}static _fromEmailAndPassword(e,n){return new _c(e,n,"password")}static _fromEmailAndCode(e,n,s=null){return new _c(e,n,"emailLink",s)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Uw(e,n,"signInWithPassword",H4);case"emailLink":return W4(e,{email:this._email,oobCode:this._password});default:Yn(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const s={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Uw(e,s,"signUpPassword",$4);case"emailLink":return K4(e,{idToken:n,email:this._email,oobCode:this._password});default:Yn(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
3598 * @license
3599 * Copyright 2020 Google LLC
3600 *
3601 * Licensed under the Apache License, Version 2.0 (the "License");
3602 * you may not use this file except in compliance with the License.
3603 * You may obtain a copy of the License at
3604 *
3605 *   http://www.apache.org/licenses/LICENSE-2.0
3606 *
3607 * Unless required by applicable law or agreed to in writing, software
3608 * distributed under the License is distributed on an "AS IS" BASIS,
3609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3610 * See the License for the specific language governing permissions and
3611 * limitations under the License.
3612 */async function _o(t,e){return Hd(t,"POST","/v1/accounts:signInWithIdp",Vr(t,e))}/**
3613 * @license
3614 * Copyright 2020 Google LLC
3615 *
3616 * Licensed under the Apache License, Version 2.0 (the "License");
3617 * you may not use this file except in compliance with the License.
3618 * You may obtain a copy of the License at
3619 *
3620 *   http://www.apache.org/licenses/LICENSE-2.0
3621 *
3622 * Unless required by applicable law or agreed to in writing, software
3623 * distributed under the License is distributed on an "AS IS" BASIS,
3624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3625 * See the License for the specific language governing permissions and
3626 * limitations under the License.
3627 */const z4="http://localhost";class Dr extends ey{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new Dr(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):Yn("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
3627once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:s,signInMethod:i}=n,r=zg(n,["providerId","signInMethod"]);if(!s||!i)return null;const o=new Dr(s,i);return o.idToken=r.idToken||void 0,o.accessToken=r.accessToken||void 0,o.secret=r.secret,o.nonce=r.nonce,o.pendingToken=r.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return _o(e,n)}_linkToIdToken(e,n){const s=this.buildRequest();return s.idToken=n,_o(e,s)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,_o(e,n)}buildRequest(){const e={requestUri:z4,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=Dc(n)}return e}}/**
3628 * @license
3629 * Copyright 2020 Google LLC
3630 *
3631 * Licensed under the Apache License, Version 2.0 (the "License");
3632 * you may not use this file except in compliance with the License.
3633 * You may obtain a copy of the License at
3634 *
3635 *   http://www.apache.org/licenses/LICENSE-2.0
3636 *
3637 * Unless required by applicable law or agreed to in writing, software
3638 * distributed under the License is distributed on an "AS IS" BASIS,
3639 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3640 * See the License for the specific language governing permissions and
3641 * limitations under the License.
3642 */function J4(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function Y4(t){const e=ca(la(t)).link,n=e?ca(la(e)).deep_link_id:null,s=ca(la(t)).deep_link_id;return(s?ca(la(s)).link:null)||s||n||e||t}class ty{constructor(e){var n,s,i,r,o,a;const c=ca(la(e)),l=(n=c.apiKey)!==null&&n!==void 0?n:null,u=(s=c.oobCode)!==null&&s!==void 0?s:null,d=J4((i=c.mode)!==null&&i!==void 0?i:null);le(l&&u&&d,"argument-error"),this.apiKey=l,this.operation=d,this.code=u,this.continueUrl=(r=c.continueUrl)!==null&&r!==void 0?r:null,this.languageCode=(o=c.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=c.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const n=Y4(e);try{return new ty(n)}catch{return null}}}/**
3643 * @license
3644 * Copyright 2020 Google LLC
3645 *
3646 * Licensed under the Apache License, Version 2.0 (the "License");
3647 * you may not use this file except in compliance with the License.
3648 * You may obtain a copy of the License at
3649 *
3650 *   http://www.apache.org/licenses/LICENSE-2.0
3651 *
3652 * Unless required by applicable law or agreed to in writing, software
3653 * distributed under the License is distributed on an "AS IS" BASIS,
3654 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3655 * See the License for the specific language governing permissions and
3656 * limitations under the License.
3657 */class zo{constructor(){this.providerId=zo.PROVIDER_ID}static credential(e,n){return _c._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const s=ty.parseLink(n);return le(s,"argument-error"),_c._fromEmailAndCode(e,s.code,s.tenantId)}}zo.PROVIDER_ID="password";zo.EMAIL_PASSWORD_SIGN_IN_METHOD="password";zo.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
3658 * @license
3659 * Copyright 2020 Google LLC
3660 *
3661 * Licensed under the Apache License, Version 2.0 (the "License");
3662 * you may not use this file except in compliance with the License.
3663 * You may obtain a copy of the License at
3664 *
3665 *   http://www.apache.org/licenses/LICENSE-2.0
3666 *
3667 * Unless required by applicable law or agreed to in writing, software
3668 * distributed under the License is distributed on an "AS IS" BASIS,
3669 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3670 * See the License for the specific language governing permissions and
3671 * limitations under the License.
3672 */class ny{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
3673 * @license
3674 * Copyright 2019 Google LLC
3675 *
3676 * Licensed under the Apache License, Version 2.0 (the "License");
3677 * you may not use this file except in compliance with the License.
3678 * You may obtain a copy of the License at
3679 *
3680 *   http://www.apache.org/licenses/LICENSE-2.0
3681 *
3682 * Unless required by applicable law or agreed to in writing, software
3683 * distributed under the License is distributed on an "AS IS" BASIS,
3684 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3685 * See the License for the specific language governing permissions and
3686 * limitations under the License.
3687 */class Wc extends ny{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
3688 * @license
3689 * Copyright 2020 Google LLC
3690 *
3691 * Licensed under the Apache License, Version 2.0 (the "License");
3692 * you may not use this file except in compliance with the License.
3693 * You may obtain a copy of the License at
3694 *
3695 *   http://www.apache.org/licenses/LICENSE-2.0
3696 *
3697 * Unless required by applicable law or agreed to in writing, software
3698 * distributed under the License is distributed on an "AS IS" BASIS,
3699 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3700 * See the License for the specific language governing permissions and
3701 * limitations under the License.
3702 */class Di extends Wc{constructor(){super("facebook.com")}static credential(e){return Dr._fromParams({providerId:Di.PROVIDER_ID,signInMethod:Di.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Di.credentialFromTaggedObject(e)}static credentialFromError(e){return Di.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Di.credential(e.oauthAccessToken)}catch{return null}}}Di.FACEBOOK_SIGN_IN_METHOD="facebook.com";Di.PROVIDER_ID="facebook.com";/**
3703 * @license
3704 * Copyright 2020 Google LLC
3705 *
3706 * Licensed under the Apache License, Version 2.0 (the "License");
3707 * you may not use this file except in compliance with the License.
3708 * You may obtain a copy of the License at
3709 *
3710 *   http://www.apache.org/licenses/LICENSE-2.0
3711 *
3712 * Unless required by applicable law or agreed to in writing, software
3713 * distributed under the License is distributed on an "AS IS" BASIS,
3714 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3715 * See the License for the specific language governing permissions and
3716 * limitations under the License.
3717 */class Ws extends Wc{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return Dr._fromParams({providerId:Ws.PROVIDER_ID,signInMethod:Ws.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Ws.credentialFromTaggedObject(e)}static credentialFromError(e){return Ws.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:s}=e;if(!n&&!s)return null;try{return Ws.credential(n,s)}catch{return null}}}Ws.GOOGLE_SIGN_IN_METHOD="google.com";Ws.PROVIDER_ID="google.com";/**
3718 * @license
3719 * Copyright 2020 Google LLC
3720 *
3721 * Licensed under the Apache License, Version 2.0 (the "License");
3722 * you may not use this file except in compliance with the License.
3723 * You may obtain a copy of the License at
3724 *
3725 *   http://www.apache.org/licenses/LICENSE-2.0
3726 *
3727 * Unless required by applicable law or agreed to in writing, software
3728 * distributed under the License is distributed on an "AS IS" BASIS,
3729 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3730 * See the License for the specific language governing permissions and
3731 * limitations under the License.
3732 */class Ai extends Wc{constructor(){super("github.com")}static credential(e){return Dr._fromParams({providerId:Ai.PROVIDER_ID,signInMethod:Ai.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ai.credentialFromTaggedObject(e)}static credentialFromError(e){return Ai.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Ai.credential(e.oauthAccessToken)}catch{return null}}}Ai.GITHUB_SIGN_IN_METHOD="github.com";Ai.PROVIDER_ID="github.com";/**
3733 * @license
3734 * Copyright 2020 Google LLC
3735 *
3736 * Licensed under the Apache License, Version 2.0 (the "License");
3737 * you may not use this file except in compliance with the License.
3738 * You may obtain a copy of the License at
3739 *
3740 *   http://www.apache.org/licenses/LICENSE-2.0
3741 *
3742 * Unless required by applicable law or agreed to in writing, software
3743 * distributed under the License is distributed on an "AS IS" BASIS,
3744 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3745 * See the License for the specific language governing permissions and
3746 * limitations under the License.
3747 */class Ci extends Wc{constructor(){super("twitter.com")}static credential(e,n){return Dr._fromParams({providerId:Ci.PROVIDER_ID,signInMethod:Ci.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Ci.credentialFromTaggedObject(e)}static credentialFromError(e){return Ci.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:s}=e;if(!n||!s)return null;try{return Ci.credential(n,s)}catch{return null}}}Ci.TWITTER_SIGN_IN_METHOD="twitter.com";Ci.PROVIDER_ID="twitter.com";/**
3748 * @license
3749 * Copyright 2020 Google LLC
3750 *
3751 * Licensed under the Apache License, Version 2.0 (the "License");
3752 * you may not use this file except in compliance with the License.
3753 * You may obtain a copy of the License at
3754 *
3755 *   http://www.apache.org/licenses/LICENSE-2.0
3756 *
3757 * Unless required by applicable law or agreed to in writing, software
3758 * distributed under the License is distributed on an "AS IS" BASIS,
3759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3760 * See the License for the specific language governing permissions and
3761 * limitations under the License.
3762 */class Mo{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,s,i=!1){const r=await Js._fromIdTokenResponse(e,s,i),o=xw(s);return new Mo({user:r,providerId:o,_tokenResponse:s,operationType:n})}static async _forOperation(e,n,s){await e._updateTokensIfNecessary(s,!0);const i=xw(s);return new Mo({user:e,providerId:i,_tokenResponse:s,operationType:n})}}function xw(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/**
3763 * @license
3764 * Copyright 2020 Google LLC
3765 *
3766 * Licensed under the Apache License, Version 2.0 (the "License");
3767 * you may not use this file except in compliance with the License.
3768 * You may obtain a copy of the License at
3769 *
3770 *   http://www.apache.org/licenses/LICENSE-2.0
3771 *
3772 * Unless required by applicable law or agreed to in writing, software
3773 * distributed under the License is distributed on an "AS IS" BASIS,
3774 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3775 * See the License for the specific language governing permissions and
3776 * limitations under the License.
3777 */class Tu extends Hn{constructor(e,n,s,i){var r;super(n.code,n.message),this.operationType=s,this.user=i,Object.setPrototypeOf(this,Tu.prototype),this.customData={appName:e.name,tenantId:(r=e.tenantId)!==null&&r!==void 0?r:void 0,_serverResponse:n.customData._serverResponse,operationType:s}}static _fromErrorAndOperation(e,n,s,i){return new Tu(e,n,s,i)}}function KD(t,e,n,s){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(r=>{throw r.code==="auth/multi-factor-auth-required"?Tu._fromErrorAndOperation(t,r,e,s):r})}async function Q4(t,e,n=!1){const s=await yc(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Mo._forOperation(t,"link",s)}/**
3778 * @license
3779 * Copyright 2019 Google LLC
3780 *
3781 * Licensed under the Apache License, Version 2.0 (the "License");
3782 * you may not use this file except in compliance with the License.
3783 * You may obtain a copy of the License at
3784 *
3785 *   http://www.apache.org/licenses/LICENSE-2.0
3786 *
3787 * Unless required by applicable law or agreed to in writing, software
3788 * distributed under the License is distributed on an "AS IS" BASIS,
3789 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3790 * See the License for the specific language governing permissions and
3791 * limitations under the License.
3792 */async function X4(t,e,n=!1){const{auth:s}=t;if(Ss(s.app))return Promise.reject(Oi(s));const i="reauthenticate";try{const r=await yc(t,KD(s,i,e,t),n);le(r.idToken,s,"internal-error");const o=Xg(r.idToken);le(o,s,"internal-error");const{sub:a}=o;return le(t.uid===a,s,"user-mismatch"),Mo._forOperation(t,i,r)}catch(r){throw(r==null?void 0:r.code)==="auth/user-not-found"&&Yn(s,"user-mismatch"),r}}/**
3793 * @license
3794 * Copyright 2020 Google LLC
3795 *
3796 * Licensed under the Apache License, Version 2.0 (the "License");
3797 * you may not use this file except in compliance with the License.
3798 * You may obtain a copy of the License at
3799 *
3800 *   http://www.apache.org/licenses/LICENSE-2.0
3801 *
3802 * Unless required by applicable law or agreed to in writing, software
3803 * distributed under the License is distributed on an "AS IS" BASIS,
3804 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3805 * See the License for the specific language governing permissions and
3806 * limitations under the License.
3807 */async function zD(t,e,n=!1){if(Ss(t.app))return Promise.reject(Oi(t));const s="signIn",i=await KD(t,s,e),r=await Mo._fromIdTokenResponse(t,s,i);return n||await t._updateCurrentUser(r.user),r}async function Z4(t,e){return zD(qr(t),e)}/**
3808 * @license
3809 * Copyright 2020 Google LLC
3810 *
3811 * Licensed under the Apache License, Version 2.0 (the "License");
3812 * you may not use this file except in compliance with the License.
3813 * You may obtain a copy of the License at
3814 *
3815 *   http://www.apache.org/licenses/LICENSE-2.0
3816 *
3817 * Unless required by applicable law or agreed to in writing, software
3818 * distributed under the License is distributed on an "AS IS" BASIS,
3819 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3820 * See the License for the specific language governing permissions and
3821 * limitations under the License.
3822 */async function ej(t){const e=qr(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function tj(t,e,n){return Ss(t.app)?Promise.reject(Oi(t)):Z4(Ae(t),zo.credential(e,n)).catch(async s=>{throw s.code==="auth/password-does-not-meet-requirements"&&ej(t),s})}/**
3823 * @license
3824 * Copyright 2020 Google LLC
3825 *
3826 * Licensed under the Apache License, Version 2.0 (the "License");
3827 * you may not use this file except in compliance with the License.
3828 * You may obtain a copy of the License at
3829 *
3830 *   http://www.apache.org/licenses/LICENSE-2.0
3831 *
3832 * Unless required by applicable law or agreed to in writing, software
3833 * distributed under the License is distributed on an "AS IS" BASIS,
3834 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3835 * See the License for the specific language governing permissions and
3836 * limitations under the License.
3837 */function JD(t,e){return Ae(t).setPersistence(e)}function nj(t,e,n,s){return Ae(t).onIdTokenChanged(e,n,s)}function sj(t,e,n){return Ae(t).beforeAuthStateChanged(e,n)}function ij(t,e,n,s){return Ae(t).onAuthStateChanged(e,n,s)}function rj(t){return Ae(t).signOut()}const bu="__sak";/**
3838 * @license
3839 * Copyright 2019 Google LLC
3840 *
3841 * Licensed under the Apache License, Version 2.0 (the "License");
3842 * you may not use this file except in compliance with the License.
3843 * You may obtain a copy of the License at
3844 *
3845 *   http://www.apache.org/licenses/LICENSE-2.0
3846 *
3847 * Unless required by applicable law or agreed to in writing, software
3848 * distributed under the License is distributed on an "AS IS" BASIS,
3849 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3850 * See the License for the specific language governing permissions and
3851 * limitations under the License.
3852 */class YD{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(bu,"1"),this.storage.removeItem(bu),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
3853 * @license
3854 * Copyright 2020 Google LLC
3855 *
3856 * Licensed under the Apache License, Version 2.0 (the "License");
3857 * you may not use this file except in compliance with the License.
3858 * You may obtain a copy of the License at
3859 *
3860 *   http://www.apache.org/licenses/LICENSE-2.0
3861 *
3862 * Unless required by applicable law or agreed to in writing, software
3863 * distributed under the License is distributed on an "AS IS" BASIS,
3864 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3865 * See the License for the specific language governing permissions and
3866 * limitations under the License.
3867 */function oj(){const t=xt();return Zg(t)||Wd(t)}const aj=1e3,cj=10;class QD extends YD{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=oj()&&D4(),this.fallbackToPolling=jD(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const s=this.storage.getItem(n),i=this.localCache[n];s!==i&&e(n,i,s)}}
3867onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const s=e.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(s);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(s,e.newValue):this.storage.removeItem(s);else if(this.localCache[s]===e.newValue&&!n)return}const i=()=>{const o=this.storage.getItem(s);!n&&this.localCache[s]===o||this.notifyListeners(s,o)},r=this.storage.getItem(s);S4()&&r!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,cj):i()}notifyListeners(e,n){this.localCache[e]=n;const s=this.listeners[e];if(s)for(const i of Array.from(s))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,s)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:s}),!0)})},aj)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
3867ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}QD.type="LOCAL";const lj=QD;/**
3868 * @license
3869 * Copyright 2020 Google LLC
3870 *
3871 * Licensed under the Apache License, Version 2.0 (the "License");
3872 * you may not use this file except in compliance with the License.
3873 * You may obtain a copy of the License at
3874 *
3875 *   http://www.apache.org/licenses/LICENSE-2.0
3876 *
3877 * Unless required by applicable law or agreed to in writing, software
3878 * distributed under the License is distributed on an "AS IS" BASIS,
3879 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3880 * See the License for the specific language governing permissions and
3881 * limitations under the License.
3882 */class XD extends YD{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}XD.type="SESSION";const zd=XD;/**
3883 * @license
3884 * Copyright 2019 Google LLC
3885 *
3886 * Licensed under the Apache License, Version 2.0 (the "License");
3887 * you may not use this file except in compliance with the License.
3888 * You may obtain a copy of the License at
3889 *
3890 *   http://www.apache.org/licenses/LICENSE-2.0
3891 *
3892 * Unless required by applicable law or agreed to in writing, software
3893 * distributed under the License is distributed on an "AS IS" BASIS,
3894 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3895 * See the License for the specific language governing permissions and
3896 * limitations under the License.
3897 */function uj(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
3898 * @license
3899 * Copyright 2019 Google LLC
3900 *
3901 * Licensed under the Apache License, Version 2.0 (the "License");
3902 * you may not use this file except in compliance with the License.
3903 * You may obtain a copy of the License at
3904 *
3905 *   http://www.apache.org/licenses/LICENSE-2.0
3906 *
3907 * Unless required by applicable law or agreed to in writing, software
3908 * distributed under the License is distributed on an "AS IS" BASIS,
3909 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3910 * See the License for the specific language governing permissions and
3911 * limitations under the License.
3912 */class Jd{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const s=new Jd(e);return this.receivers.push(s),s}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:s,eventType:i,data:r}=n.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:s,eventType:i});const a=Array.from(o).map(async l=>l(n.origin,r)),c=await uj(a);n.ports[0].postMessage({status:"done",eventId:s,eventType:i,response:c})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Jd.receivers=[];/**
3913 * @license
3914 * Copyright 2020 Google LLC
3915 *
3916 * Licensed under the Apache License, Version 2.0 (the "License");
3917 * you may not use this file except in compliance with the License.
3918 * You may obtain a copy of the License at
3919 *
3920 *   http://www.apache.org/licenses/LICENSE-2.0
3921 *
3922 * Unless required by applicable law or agreed to in writing, software
3923 * distributed under the License is distributed on an "AS IS" BASIS,
3924 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3925 * See the License for the specific language governing permissions and
3926 * limitations under the License.
3927 */function sy(t="",e=10){let n="";for(let s=0;s<e;s++)n+=Math.floor(Math.random()*10);return t+n}/**
3928 * @license
3929 * Copyright 2019 Google LLC
3930 *
3931 * Licensed under the Apache License, Version 2.0 (the "License");
3932 * you may not use this file except in compliance with the License.
3933 * You may obtain a copy of the License at
3934 *
3935 *   http://www.apache.org/licenses/LICENSE-2.0
3936 *
3937 * Unless required by applicable law or agreed to in writing, software
3938 * distributed under the License is distributed on an "AS IS" BASIS,
3939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3940 * See the License for the specific language governing permissions and
3941 * limitations under the License.
3942 */class dj{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,s=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let r,o;return new Promise((a,c)=>{const l=sy("",20);i.port1.start();const u=setTimeout(()=>{c(new Error("unsupported_event"))},s);o={messageChannel:i,onMessage(d){const h=d;if(h.data.eventId===l)switch(h.data.status){case"ack":clearTimeout(u),r=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(r),a(h.data.response);break;default:clearTimeout(u),clearTimeout(r),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:n},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
3943 * @license
3944 * Copyright 2020 Google LLC
3945 *
3946 * Licensed under the Apache License, Version 2.0 (the "License");
3947 * you may not use this file except in compliance with the License.
3948 * You may obtain a copy of the License at
3949 *
3950 *   http://www.apache.org/licenses/LICENSE-2.0
3951 *
3952 * Unless required by applicable law or agreed to in writing, software
3953 * distributed under the License is distributed on an "AS IS" BASIS,
3954 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3955 * See the License for the specific language governing permissions and
3956 * limitations under the License.
3957 */function Ns(){return window}function hj(t){Ns().location.href=t}/**
3958 * @license
3959 * Copyright 2020 Google LLC.
3960 *
3961 * Licensed under the Apache License, Version 2.0 (the "License");
3962 * you may not use this file except in compliance with the License.
3963 * You may obtain a copy of the License at
3964 *
3965 *   http://www.apache.org/licenses/LICENSE-2.0
3966 *
3967 * Unless required by applicable law or agreed to in writing, software
3968 * distributed under the License is distributed on an "AS IS" BASIS,
3969 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3970 * See the License for the specific language governing permissions and
3971 * limitations under the License.
3972 */function ZD(){return typeof Ns().WorkerGlobalScope<"u"&&typeof Ns().importScripts=="function"}async function fj(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function pj(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function mj(){return ZD()?self:null}/**
3973 * @license
3974 * Copyright 2019 Google LLC
3975 *
3976 * Licensed under the Apache License, Version 2.0 (the "License");
3977 * you may not use this file except in compliance with the License.
3978 * You may obtain a copy of the License at
3979 *
3980 *   http://www.apache.org/licenses/LICENSE-2.0
3981 *
3982 * Unless required by applicable law or agreed to in writing, software
3983 * distributed under the License is distributed on an "AS IS" BASIS,
3984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3985 * See the License for the specific language governing permissions and
3986 * limitations under the License.
3987 */const eA="firebaseLocalStorageDb",gj=1,Eu="firebaseLocalStorage",tA="fbase_key";class Kc{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function Yd(t,e){return t.transaction([Eu],e?"readwrite":"readonly").objectStore(Eu)}function yj(){const t=indexedDB.deleteDatabase(eA);
3987return new Kc(t).toPromise()}function bp(){const t=indexedDB.open(eA,gj);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const s=t.result;try{s.createObjectStore(Eu,{keyPath:tA})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const s=t.result;s.objectStoreNames.contains(Eu)?e(s):(s.close(),await yj(),e(await bp()))})})}async function Mw(t,e,n){const s=Yd(t,!0).put({[tA]:e,value:n});return new Kc(s).toPromise()}async function _j(t,e){const n=Yd(t,!1).get(e),s=await new Kc(n).toPromise();return s===void 0?null:s.value}function Ow(t,e){const n=Yd(t,!0).delete(e);return new Kc(n).toPromise()}const Ij=800,wj=3;class nA{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await bp(),this.db)}async _withRetries(e){let n=0;for(;;)try{const s=await this._openDb();return await e(s)}catch(s){if(n++>wj)throw s;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return ZD()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Jd._getInstance(mj()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)}
3987)),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await fj(),!this.activeServiceWorker)return;this.sender=new dj(this.activeServiceWorker);const s=await this.sender._send("ping",{},800);s&&!((e=s[0])===null||e===void 0)&&e.fulfilled&&!((n=s[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||pj()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await bp();return await Mw(e,bu,"1"),await Ow(e,bu),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(s=>Mw(s,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(s=>_j(s,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>Ow(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const r=Yd(i,!1).getAll();return new Kc(r).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],s=new Set;if(e.length!==0)for(const{fbase_key:i,value:r}of e)s.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(r)&&(this.notifyListeners(i,r),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!s.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;const s=this.listeners[e];if(s)for(const i of Array.from(s))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Ij)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
3987ject.keys(this.listeners).length===0&&this.stopPolling()}}nA.type="LOCAL";const vj=nA;new Hc(3e4,6e4);/**
3988 * @license
3989 * Copyright 2021 Google LLC
3990 *
3991 * Licensed under the Apache License, Version 2.0 (the "License");
3992 * you may not use this file except in compliance with the License.
3993 * You may obtain a copy of the License at
3994 *
3995 *   http://www.apache.org/licenses/LICENSE-2.0
3996 *
3997 * Unless required by applicable law or agreed to in writing, software
3998 * distributed under the License is distributed on an "AS IS" BASIS,
3999 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4000 * See the License for the specific language governing permissions and
4001 * limitations under the License.
4002 */function sA(t,e){return e?Ys(e):(le(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/**
4003 * @license
4004 * Copyright 2019 Google LLC
4005 *
4006 * Licensed under the Apache License, Version 2.0 (the "License");
4007 * you may not use this file except in compliance with the License.
4008 * You may obtain a copy of the License at
4009 *
4010 *   http://www.apache.org/licenses/LICENSE-2.0
4011 *
4012 * Unless required by applicable law or agreed to in writing, software
4013 * distributed under the License is distributed on an "AS IS" BASIS,
4014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4015 * See the License for the specific language governing permissions and
4016 * limitations under the License.
4017 */class iy extends ey{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return _o(e,this._buildIdpRequest())}_linkToIdToken(e,n){return _o(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return _o(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function Tj(t){return zD(t.auth,new iy(t),t.bypassAuthState)}function bj(t){const{auth:e,user:n}=t;return le(n,e,"internal-error"),X4(n,new iy(t),t.bypassAuthState)}async function Ej(t){const{auth:e,user:n}=t;return le(n,e,"internal-error"),Q4(n,new iy(t),t.bypassAuthState)}/**
4018 * @license
4019 * Copyright 2020 Google LLC
4020 *
4021 * Licensed under the Apache License, Version 2.0 (the "License");
4022 * you may not use this file except in compliance with the License.
4023 * You may obtain a copy of the License at
4024 *
4025 *   http://www.apache.org/licenses/LICENSE-2.0
4026 *
4027 * Unless required by applicable law or agreed to in writing, software
4028 * distributed under the License is distributed on an "AS IS" BASIS,
4029 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4030 * See the License for the specific language governing permissions and
4031 * limitations under the License.
4032 */class iA{constructor(e,n,s,i,r=!1){this.auth=e,this.resolver=s,this.user=i,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(s){this.reject(s)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:s,postBody:i,tenantId:r,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:n,sessionId:s,tenantId:r||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Tj;case"linkViaPopup":case"linkViaRedirect":return Ej;case"reauthViaPopup":case"reauthViaRedirect":return bj;default:Yn(this.auth,"internal-error")}}resolve(e){li(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){li(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
4033 * @license
4034 * Copyright 2020 Google LLC
4035 *
4036 * Licensed under the Apache License, Version 2.0 (the "License");
4037 * you may not use this file except in compliance with the License.
4038 * You may obtain a copy of the License at
4039 *
4040 *   http://www.apache.org/licenses/LICENSE-2.0
4041 *
4042 * Unless required by applicable law or agreed to in writing, software
4043 * distributed under the License is distributed on an "AS IS" BASIS,
4044 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4045 * See the License for the specific language governing permissions and
4046 * limitations under the License.
4047 */const Sj=new Hc(2e3,1e4);async function Dj(t,e,n){if(Ss(t.app))return Promise.reject(cs(t,"operation-not-supported-in-this-environment"));const s=qr(t);o4(t,e,ny);const i=sA(s,n);return new ar(s,"signInViaPopup",e,i).executeNotNull()}class ar extends iA{constructor(e,n,s,i,r){super(e,n,i,r),this.provider=s,this.authWindow=null,this.pollId=null,ar.currentPopupAction&&ar.currentPopupAction.cancel(),ar.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return le(e,this.auth,"internal-error"),e}async onExecution(){li(this.filter.length===1,"Popup operations only handle one event");const e=sy();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(cs(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(cs(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,ar.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,s;if(!((s=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||s===void 0)&&s.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(cs(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Sj.get())};e()}}ar.currentPopupAction=null;/**
4048 * @license
4049 * Copyright 2020 Google LLC
4050 *
4051 * Licensed under the Apache License, Version 2.0 (the "License");
4052 * you may not use this file except in compliance with the License.
4053 * You may obtain a copy of the License at
4054 *
4055 *   http://www.apache.org/licenses/LICENSE-2.0
4056 *
4057 * Unless required by applicable law or agreed to in writing, software
4058 * distributed under the License is distributed on an "AS IS" BASIS,
4059 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4060 * See the License for the specific language governing permissions and
4061 * limitations under the License.
4062 */const Aj="pendingRedirect",Rl=new Map;class Cj extends iA{constructor(e,n,s=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,s),this.eventId=null}async execute(){let e=Rl.get(this.auth._key());if(!e){try{const s=await Pj(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(s)}catch(n){e=()=>Promise.reject(n)}Rl.set(this.auth._key(),e)}return this.bypassAuthState||Rl.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function Pj(t,e){const n=Uj(e),s=kj(t);if(!await s._isAvailable())return!1;const i=await s._get(n)==="true";return await s._remove(n),i}function Rj(t,e){Rl.set(t._key(),e)}function kj(t){return Ys(t._redirectPersistence)}function Uj(t){return Pl(Aj,t.config.apiKey,t.name)}async function Nj(t,e,n=!1){if(Ss(t.app))return Promise.reject(Oi(t));const s=qr(t),i=sA(s,e),o=await new Cj(s,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await s._persistUserIfCurrent(o.user),await s._setRedirectUser(null,e)),o}/**
4063 * @license
4064 * Copyright 2020 Google LLC
4065 *
4066 * Licensed under the Apache License, Version 2.0 (the "License");
4067 * you may not use this file except in compliance with the License.
4068 * You may obtain a copy of the License at
4069 *
4070 *   http://www.apache.org/licenses/LICENSE-2.0
4071 *
4072 * Unless required by applicable law or agreed to in writing, software
4073 * distributed under the License is distributed on an "AS IS" BASIS,
4074 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4075 * See the License for the specific language governing permissions and
4076 * limitations under the License.
4077 */const xj=10*60*1e3;class Mj{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(s=>{this.isEventForConsumer(e,s)&&(n=!0,this.sendToConsumer(e,s),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Oj(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var s;if(e.error&&!rA(e)){const i=((s=e.error.code)===null||s===void 0?void 0:s.split("auth/")[1])||"internal-error";n.onError(cs(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const s=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&s}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=xj&&this.cachedEventUids.clear(),this.cachedEventUids.has(Lw(e))}saveEventToCache(e){this.cachedEventUids.add(Lw(e)),this.lastProcessedEventTime=Date.now()}}function Lw(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function rA({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Oj(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return rA(t);default:return!1}}/**
4078 * @license
4079 * Copyright 2020 Google LLC
4080 *
4081 * Licensed under the Apache License, Version 2.0 (the "License");
4082 * you may not use this file except in compliance with the License.
4083 * You may obtain a copy of the License at
4084 *
4085 *   http://www.apache.org/licenses/LICENSE-2.0
4086 *
4087 * Unless required by applicable law or agreed to in writing, software
4088 * distributed under the License is distributed on an "AS IS" BASIS,
4089 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4090 * See the License for the specific language governing permissions and
4091 * limitations under the License.
4092 */async function Lj(t,e={}){return Ji(t,"GET","/v1/projects",e)}/**
4093 * @license
4094 * Copyright 2020 Google LLC
4095 *
4096 * Licensed under the Apache License, Version 2.0 (the "License");
4097 * you may not use this file except in compliance with the License.
4098 * You may obtain a copy of the License at
4099 *
4100 *   http://www.apache.org/licenses/LICENSE-2.0
4101 *
4102 * Unless required by applicable law or agreed to in writing, software
4103 * distributed under the License is distributed on an "AS IS" BASIS,
4104 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4105 * See the License for the specific language governing permissions and
4106 * limitations under the License.
4107 */const Fj=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Vj=/^https?/;async function qj(t){if(t.config.emulator)return;const{authorizedDomains:e}=await Lj(t);for(const n of e)try{if(Gj(n))return}catch{}Yn(t,"unauthorized-domain")}function Gj(t){const e=vp(),{protocol:n,hostname:s}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&s===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===s}if(!Vj.test(n))return!1;if(Fj.test(t))return s===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(s)}/**
4108 * @license
4109 * Copyright 2020 Google LLC.
4110 *
4111 * Licensed under the Apache License, Version 2.0 (the "License");
4112 * you may not use this file except in compliance with the License.
4113 * You may obtain a copy of the License at
4114 *
4115 *   http://www.apache.org/licenses/LICENSE-2.0
4116 *
4117 * Unless required by applicable law or agreed to in writing, software
4118 * distributed under the License is distributed on an "AS IS" BASIS,
4119 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4120 * See the License for the specific language governing permissions and
4121 * limitations under the License.
4122 */const Bj=new Hc(3e4,6e4);function Fw(){const t=Ns().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function jj(t){return new Promise((e,n)=>{var s,i,r;function o(){Fw(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Fw(),n(cs(t,"network-request-failed"))},timeout:Bj.get()})}if(!((i=(s=Ns().gapi)===null||s===void 0?void 0:s.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((r=Ns().gapi)===null||r===void 0)&&r.load)o();else{const a=M4("iframefcb");return Ns()[a]=()=>{gapi.load?o():n(cs(t,"network-request-failed"))},HD(`${x4()}?onload=${a}`).catch(c=>n(c))}}).catch(e=>{throw kl=null,e})}let kl=null;function $j(t){return kl=kl||jj(t),kl}/**
4123 * @license
4124 * Copyright 2020 Google LLC.
4125 *
4126 * Licensed under the Apache License, Version 2.0 (the "License");
4127 * you may not use this file except in compliance with the License.
4128 * You may obtain a copy of the License at
4129 *
4130 *   http://www.apache.org/licenses/LICENSE-2.0
4131 *
4132 * Unless required by applicable law or agreed to in writing, software
4133 * distributed under the License is distributed on an "AS IS" BASIS,
4134 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4135 * See the License for the specific language governing permissions and
4136 * limitations under the License.
4137 */const Hj=new Hc(5e3,15e3),Wj="__/auth/iframe",Kj="emulator/auth/iframe",zj={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Jj=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Yj(t){const e=t.config;le(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Qg(e,Kj):`https://${t.config.authDomain}/${Wj}`,s={apiKey:e.apiKey,appName:t.name,v:Rr},i=Jj.get(t.config.apiHost);i&&(s.eid=i);const r=t._getFrameworks();return r.length&&(s.fw=r.join(",")),`${n}?${Dc(s).slice(1)}`}async function Qj(t){const e=await $j(t),n=Ns().gapi;return le(n,t,"internal-error"),e.open({where:document.body,url:Yj(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:zj,dontclear:!0},s=>new Promise(async(i,r)=>{await s.restyle({setHideOnLeave:!1});const o=cs(t,"network-request-failed"),a=Ns().setTimeout(()=>{r(o)},Hj.get());function c(){Ns().clearTimeout(a),i(s)}s.ping(c).then(c,()=>{r(o)})}))}/**
4138 * @license
4139 * Copyright 2020 Google LLC.
4140 *
4141 * Licensed under the Apache License, Version 2.0 (the "License");
4142 * you may not use this file except in compliance with the License.
4143 * You may obtain a copy of the License at
4144 *
4145 *   http://www.apache.org/licenses/LICENSE-2.0
4146 *
4147 * Unless required by applicable law or agreed to in writing, software
4148 * distributed under the License is distributed on an "AS IS" BASIS,
4149 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4150 * See the License for the specific language governing permissions and
4151 * limitations under the License.
4152 */const Xj={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Zj=500,e$=600,t$="_blank",n$="http://localhost";class Vw{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function s$(t,e,n,s=Zj,i=e$){const r=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-s)/2,0).toString();let a="";const c=Object.assign(Object.assign({},Xj),{width:s.toString(),height:i.toString(),top:r,left:o}),l=xt().toLowerCase();n&&(a=FD(l)?t$:n),LD(l)&&(e=e||n$,c.scrollbars="yes");const u=Object.entries(c).reduce((h,[f,m])=>`${h}${f}=${m},`,"");if(E4(l)&&a!=="_self")return i$(e||"",a),new Vw(null);const d=window.open(e||"",a,u);le(d,t,"popup-blocked");try{d.focus()}catch{}return new Vw(d)}function i$(t,e){const n=document.createElement("a");n.href=t,n.target=e;const s=document.createEvent("MouseEvent");
4152s.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(s)}/**
4153 * @license
4154 * Copyright 2021 Google LLC
4155 *
4156 * Licensed under the Apache License, Version 2.0 (the "License");
4157 * you may not use this file except in compliance with the License.
4158 * You may obtain a copy of the License at
4159 *
4160 *   http://www.apache.org/licenses/LICENSE-2.0
4161 *
4162 * Unless required by applicable law or agreed to in writing, software
4163 * distributed under the License is distributed on an "AS IS" BASIS,
4164 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4165 * See the License for the specific language governing permissions and
4166 * limitations under the License.
4167 */const r$="__/auth/handler",o$="emulator/auth/handler",a$=encodeURIComponent("fac");async function qw(t,e,n,s,i,r){le(t.config.authDomain,t,"auth-domain-config-required"),le(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:s,v:Rr,eventId:i};if(e instanceof ny){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",ox(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,d]of Object.entries({}))o[u]=d}if(e instanceof Wc){const u=e.getScopes().filter(d=>d!=="");u.length>0&&(o.scopes=u.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const u of Object.keys(a))a[u]===void 0&&delete a[u];const c=await t._getAppCheckToken(),l=c?`#${a$}=${encodeURIComponent(c)}`:"";return`${c$(t)}?${Dc(a).slice(1)}${l}`}function c$({config:t}){return t.emulator?Qg(t,o$):`https://${t.authDomain}/${r$}`}/**
4168 * @license
4169 * Copyright 2020 Google LLC
4170 *
4171 * Licensed under the Apache License, Version 2.0 (the "License");
4172 * you may not use this file except in compliance with the License.
4173 * You may obtain a copy of the License at
4174 *
4175 *   http://www.apache.org/licenses/LICENSE-2.0
4176 *
4177 * Unless required by applicable law or agreed to in writing, software
4178 * distributed under the License is distributed on an "AS IS" BASIS,
4179 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4180 * See the License for the specific language governing permissions and
4181 * limitations under the License.
4182 */const Xh="webStorageSupport";class l${constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=zd,this._completeRedirectFn=Nj,this._overrideRedirectResult=Rj}async _openPopup(e,n,s,i){var r;li((r=this.eventManagers[e._key()])===null||r===void 0?void 0:r.manager,"_initialize() not called before _openPopup()");const o=await qw(e,n,s,vp(),i);return s$(e,o,sy())}async _openRedirect(e,n,s,i){await this._originValidation(e);const r=await qw(e,n,s,vp(),i);return hj(r),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:r}=this.eventManagers[n];return i?Promise.resolve(i):(li(r,"If manager is not set, promise should be"),r)}const s=this.initAndGetManager(e);return this.eventManagers[n]={promise:s},s.catch(()=>{delete this.eventManagers[n]}),s}async initAndGetManager(e){const n=await Qj(e),s=new Mj(e);return n.register("authEvent",i=>(le(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:s.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:s},this.iframes[e._key()]=n,s}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(Xh,{type:Xh},i=>{var r;const o=(r=i==null?void 0:i[0])===null||r===void 0?void 0:r[Xh];o!==void 0&&n(!!o),Yn(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=qj(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return jD()||Zg()||Wd()}}const u$=l$;var Gw="@firebase/auth",Bw="1.7.2";/**
4183 * @license
4184 * Copyright 2020 Google LLC
4185 *
4186 * Licensed under the Apache License, Version 2.0 (the "License");
4187 * you may not use this file except in compliance with the License.
4188 * You may obtain a copy of the License at
4189 *
4190 *   http://www.apache.org/licenses/LICENSE-2.0
4191 *
4192 * Unless required by applicable law or agreed to in writing, softw
4192are
4193 * distributed under the License is distributed on an "AS IS" BASIS,
4194 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4195 * See the License for the specific language governing permissions and
4196 * limitations under the License.
4197 */class d${constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(s=>{e((s==null?void 0:s.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){le(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
4198 * @license
4199 * Copyright 2020 Google LLC
4200 *
4201 * Licensed under the Apache License, Version 2.0 (the "License");
4202 * you may not use this file except in compliance with the License.
4203 * You may obtain a copy of the License at
4204 *
4205 *   http://www.apache.org/licenses/LICENSE-2.0
4206 *
4207 * Unless required by applicable law or agreed to in writing, software
4208 * distributed under the License is distributed on an "AS IS" BASIS,
4209 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4210 * See the License for the specific language governing permissions and
4211 * limitations under the License.
4212 */function h$(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function f$(t){ln(new Zt("auth",(e,{options:n})=>{const s=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),r=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=s.options;le(o&&!o.includes(":"),"invalid-api-key",{appName:s.name});const c={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:$D(t)},l=new k4(s,i,r,c);return q4(l,n),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,s)=>{e.getProvider("auth-internal").initialize()})),ln(new Zt("auth-internal",e=>{const n=qr(e.getProvider("auth").getImmediate());return(s=>new d$(s))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),kt(Gw,Bw,h$(t)),kt(Gw,Bw,"esm2017")}/**
4213 * @license
4214 * Copyright 2021 Google LLC
4215 *
4216 * Licensed under the Apache License, Version 2.0 (the "License");
4217 * you may not use this file except in compliance with the License.
4218 * You may obtain a copy of the License at
4219 *
4220 *   http://www.apache.org/licenses/LICENSE-2.0
4221 *
4222 * Unless required by applicable law or agreed to in writing, software
4223 * distributed under the License is distributed on an "AS IS" BASIS,
4224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4225 * See the License for the specific language governing permissions and
4226 * limitations under the License.
4227 */const p$=5*60,m$=vb("authIdTokenMaxAge")||p$;let jw=null;const g$=t=>async e=>{const n=e&&await e.getIdTokenResult(),s=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(s&&s>m$)return;const i=n==null?void 0:n.token;jw!==i&&(jw=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function y$(t=qo()){const e=ps(t,"auth");if(e.isInitialized())return e.getImmediate();const n=V4(t,{popupRedirectResolver:u$,persistence:[vj,lj,zd]}),s=vb("authTokenSyncURL");if(s&&typeof isSecureContext=="boolean"&&isSecureContext){const r=new URL(s,location.origin);if(location.origin===r.origin){const o=g$(r.toString());sj(n,o,()=>o(n.currentUser)),nj(n,a=>o(a))}}const i=Ib("auth");return i&&G4(n,`http://${i}`),n}function _$(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}
4227U4({loadJS(t){return new Promise((e,n)=>{const s=document.createElement("script");s.setAttribute("src",t),s.onload=e,s.onerror=i=>{const r=cs("internal-error");r.customData=i,n(r)},s.type="text/javascript",s.charset="UTF-8",_$().appendChild(s)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});f$("Browser");let ut,Ue,Li,Ar;function Qd(){ut=Fs(),Ue=Rs(),Ar=fi(),Li=y$()}const oA=async()=>{Qd(),Ar.setUILoading(!0),Ue.memberData.persist||await JD(Li,zd).catch(t=>{console.log(t.code,t.message)}),await tj(Li,Ue.memberData.email,Ue.memberData.password).catch(t=>{ut.setAlert("error","Sign in failed. Please check email and password")}).finally(()=>{Ue.setPassword(""),Ue.memberData.repeatPassword="",Ar.setUILoading(!1),ut.preventRefresh&&(ut.preventRefresh=!1),ry("/")})},H9=async()=>{const t=new Ws;Qd(),Li.useDeviceLanguage(),Ue.memberData.persist||await JD(Li,zd).catch(e=>{console.log(e.code,e.message)}),await Dj(Li,t).then(async e=>{}).catch(e=>{console.log(e.code,e.message),Ar.setAlert("error",e.message)}).finally(()=>{Ue.connectAccountData.email===""&&Ar.setDisableInputs(!1),ry("/")})},ga=async t=>{Qd(),await rj(Li),Ar.setDisableInputs(!1),ut.signinState="email",t&&qt("/signin")},ry=async t=>{Qd(),t!=="/"&&(ut.refeshRoute=t),ij(Li,async e=>{if(e){ut.isLoggingIn=!0;const n=await I$(e);if(Ue.memberRole==="blocked"){ut.setAlert("error","Your account has been temporarily disabled."),ga(!0);return}if(Ue.setAuthUser(e,e.emailVerified===!0),Ue.setAuthLogin(Ue.authVerified),typeof n>"u"&&Ue.setAuthLogin(!1),Ue.authLogin){if(ut.isProduction&&setTimeout(()=>{uw(n)},500),uw(n),Ue.memberRole==="admin"){qt("/admin/dash/members");return}if(Ue.memberRole==="admission"||Ue.memberRole==="administration"){qt("/administration/dash");return}if(Ue.memberRole==="facilitator"){qt("/facilitators/dash");return}if(Ue.memberRole==="guardian"){qt("/parents/dash");return}qt(ut.authUserPath);return}else ut.isLoggingIn=!1,Ue.connectAccountData.email!==""?Ue.connectAccountData.email.toLowerCase()===e.email?Ue.registerState==="connect"&&KB("google"):(ga(!1),ut.setAlert("error",`Please sign in with ${Ue.connectAccountData.email}`),Ar.setUILoading(!1)):ut.signinState==="facilitator_signup"?Ue.memberData.email===e.email?Ue.registerState==="connect"&&v$(e,Ue.memberData.whatsapp):(ut.setAlert("error",`Please sign in with ${Ue.memberData.email}.`),ga(!0)):(w$(e),ut.setAlert("error","This email is not registered with us."),ga(!0))}else console.log("no user"),Ue.clearMember()})};async function I$(t){return new Promise(async e=>{const n=await t.getIdTokenResult(!0),{role:s,token:i,extra:r,facilitatorToken:o}=n.claims||null;s!=="member"&&(Ue.setMemberRole(s),Ue.setMemberToken(i)),s==="facilitator"&&(ut.facilitatorAuthUUID=i),s==="facilitator"&&r&&r==="admin"&&(ut.isFacilitatorAdmin=!0),s==="admin"&&(ut.isSystemAdmin=!0),s==="guardian"&&r&&r==="pf"&&(ut.isParentFacilitator=!0,ut.facilitatorAuthUUID=o),e(s)})}async function w$(t){const e={email:t.email,name:t.displayName,photoURL:t.photoURL};await et("logUnregisterdSignin",e,!0,!1)}async function v$(t,e){Fs().setAlert("info","Facilitator sign-up is currently unavailable. Please contact TLC for assistance."),ga(!0)}const T$={__name:"app",setup(t){const e=fi(),n=Fs(),{darkMode:s,refeshRoute:i,preventRefresh:r}=N_(n),{isOnline:o,isSlowInternet:a}=N_(e);return KT({title:_t("Experiential Learning | The Learning Centre | Goa")}),Ou(async()=>{const l=ju();if(window.addEventListener("beforeunload",u=>{r.value&&(u.preventDefault(),u.returnValue="")}),ry(l.path),window.addEventListener("online",()=>{o.value=!0}),window.addEventListener("offline",()=>{o.value=!1}),"connection"in navigator){const u=navigator.connection||navigator.mozConnection||navigator.webkitConnection;a.value=u.effectiveType==="2g",u.addEventListener("change",()=>{a.value=u.effectiveType==="2g"})}}),(l,u)=>{const d=B1,h=$1,f=J1;return ss(),uT("div",{class:ku({dark:st(s)})},[rt(f,null,{default:Lp(()=>[rt(d),rt(h)]),_:1})],2)}}},b$={class:"overflow-hidden"},E$=di({__name:"error",props:{error:Object},setup(t){const e=()=>qT({redirect:"/"});return(n,s)=>(ss(),uT("body",b$,[Ta("div",{class:"text-center py-48 px-4 lg:py-20 pb-32 md:py-32 flex flex-col items-center justify-center"},[s[0]||(s[0]=YC('<div class="grid place-content-center"><img src="https://i.ibb.co/ncJJqTq/undraw-page-not-found-su7k-2-1-1-1.png" alt="404 animation"></div><h1 class="lg:text-5xl md:text-4xl text-2xl font-bold text-gray-800 py-4 md:py-8"> Looks like you&#39;re lost </h1><p class="text-base text-gray-600 py-2"> Sorry! We could not find you the page you are looking for. Please check URL in <br class="md:block hidden"> address bar and try again. </p>',3)),Ta("div",{class:"my-4 md:my-8 w-full"},[Ta("button",{class:"text-center text-base font-medium text-white p-4 md:w-auto w-full bg-indigo-700 border rounded-md hover:bg-indigo-800",onClick:e}," Get back to Homepage ")])])]))}}),$w={__name:"nuxt-root",setup(t){const e=()=>null,n=We(),s=n.deferHydration();if(n.isHydrating){const a=n.hooks.hookOnce("app:error",s);Ls().beforeEach(a)}const i=!1;ur(Ec,ju()),n.hooks.callHookWith(a=>a.map(c=>c()),"vue:setup");const r=$u();Fv((a,c,l)=>{if(n.hooks.callHook("vue:error",a,c,l).catch(u=>console.error("[nuxt] Error in `vue:error` hook",u)),ik(a)&&(a.fatal||a.unhandled))return n.runWithContext(()=>eo(a)),!1});const o=!1;return(a,c)=>(ss(),Ti(jp,{onResolve:st(s)},{default:Lp(()=>[st(r)?(ss(),Ti(st(E$),{key:0,error:st(r)},null,8,["error"])):st(o)?(ss(),Ti(st(e),{key:1,context:st(o)},null,8,["context"])):st(i)?(ss(),Ti(yC(st(i)),{key:2})):(ss(),Ti(st(T$),{key:3}))]),_:1},8,["onResolve"]))}};let Hw;{let t;Hw=async function(){var o,a;if(t)return t;const s=!!((o=window.__NUXT__)!=null&&o.serverRendered||((a=document.getElementById("__NUXT_DATA__"))==null?void 0:a.dataset.ssr)==="true")?FP($w):LP($w),i=$R({vueApp:s});async function r(c){await i.callHook("app:error",c),i.payload.error=i.payload.error||Hu(c)}s.config.errorHandler=r;try{await WR(i,G1)}catch(c){r(c)}try{await i.hooks.callHook("app:created",s),await i.hooks.callHook("app:beforeMount",s),s.mount(Xk),await i.hooks.callHook("app:mounted",s),await ui()}catch(c){r(c)}return s.config.errorHandler===r&&(s.config.errorHandler=void 0),s},t=Hw().catch(e=>{throw console.error("Error while mounting app:",e),e})}export{Ce as $,T as A,Wo as B,Bd as C,et as D,di as E,Yt as F,Rs as G,YC as H,Se as I,pE as J,V6 as K,F6 as L,Ze as M,Dp as N,X$ as O,Z$ as P,o6 as Q,v9 as R,Q$ as S,e6 as T,t6 as U,n6 as V,s6 as W,i6 as X,r6 as Y,V0 as Z,gs as _,Ta as a,gG as a$,Jn as a0,jn as a1,Rt as a2,pi as a3,Ve as a4,xr as a5,Ld as a6,K$ as a7,Wq as a8,Fs as a9,PG as aA,Mg as aB,dG as aC,R6 as aD,A9 as aE,S9 as aF,D9 as aG,P9 as aH,R9 as aI,U9 as aJ,C9 as aK,G9 as aL,$9 as aM,j9 as aN,B9 as aO,U6 as aP,ye as aQ,nG as aR,Lv as aS,l6 as aT,u6 as aU,W$ as aV,pr as aW,vt as aX,p as aY,mu as aZ,yG as a_,a6 as aa,z$ as ab,Kq as ac,hC as ad,C$ as ae,xn as af,Qe as ag,mE as ah,_m as ai,gm as aj,fw as ak,uL as al,C6 as am,P6 as an,S$ as ao,P$ as ap,D6 as aq,Ui as ar,Lr as as,k$ as at,uG as au,aG as av,$$ as aw,U$ as ax,c6 as ay,S6 as az,rt as b,ve as b$,qt as b0,v6 as b1,xo as b2,T6 as b3,b6 as b4,_6 as b5,m6 as b6,p6 as b7,f6 as b8,B6 as b9,L9 as bA,q9 as bB,M9 as bC,x9 as bD,O9 as bE,o9 as bF,Uq as bG,pc as bH,$B as bI,$q as bJ,Bi as bK,IG as bL,Lg as bM,Vg as bN,$6 as bO,y6 as bP,ga as bQ,J as bR,ym as bS,Q6 as bT,k9 as bU,X6 as bV,J6 as bW,E9 as bX,ui as bY,Q0 as bZ,b9 as b_,H0 as ba,G6 as bb,d6 as bc,H6 as bd,W6 as be,O$ as bf,w9 as bg,KB as bh,H9 as bi,Ls as bj,ae as bk,DG as bl,ri as bm,t9 as bn,i9 as bo,c9 as bp,jd as bq,r9 as br,IT as b
4227s,jc as bt,s9 as bu,R$ as bv,a9 as bw,N9 as bx,V9 as by,F9 as bz,uT as c,A6 as c$,e9 as c0,mG as c1,pw as c2,J0 as c3,z0 as c4,O6 as c5,x6 as c6,M6 as c7,I6 as c8,oA as c9,M$ as cA,Fn as cB,D$ as cC,Kp as cD,Gu as cE,tR as cF,x$ as cG,Bu as cH,We as cI,Pr as cJ,_f as cK,Wp as cL,n9 as cM,Yq as cN,Y$ as cO,Xn as cP,H$ as cQ,q$ as cR,Y6 as cS,PT as cT,Sg as cU,v0 as cV,f9 as cW,p9 as cX,m9 as cY,h9 as cZ,k6 as c_,_9 as ca,I9 as cb,T9 as cc,N$ as cd,eG as ce,Od as cf,y9 as cg,yp as ch,N6 as ci,wt as cj,g9 as ck,j6 as cl,Z6 as cm,L6 as cn,Og as co,q6 as cp,uw as cq,F0 as cr,K0 as cs,K6 as ct,z6 as cu,ei as cv,gu as cw,db as cx,k_ as cy,Lu as cz,st as d,w6 as d0,h6 as d1,g6 as d2,E6 as d3,G$ as d4,l9 as d5,u9 as d6,d9 as d7,SG as d8,B$ as d9,j$ as da,hT as e,J$ as f,fE as g,Ou as h,zq as i,Ti as j,QC as k,KT as l,_t as m,ku as n,ss as o,G as p,zi as q,A$ as r,N_ as s,IA as t,fi as u,E as v,Lp as w,xe as x,Fe as y,Or as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.