1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Cu1VLvme.js","./BbMNnUSj.js","./D6peDvsS.js","./BQVmlsji.js","./bhduW_P2.js","./CKklybzv.js","./Dp_kbMeE.js","./BuT-0jPG.js","./CbPho2Ur.js"])))=>i.map(i=>d[i]); 2import{$ as e,$n as t,$t as n,A as r,An as i,At as a,B as o,Bn as s,Bt as c,C as l,Cn as u,Ct as d,D as f,Dn as p,Dt as m,E as ee,En as h,Et as te,F as ne,Fn as g,G as _,Gt as re,H as ie,Ht as v,I as ae,In as y,J as oe,Jn as se,Jt as b,K as ce,Kt as le,L as ue,Lt as de,M as fe,Mn as pe,Mt as me,N as he,O as ge,On as _e,Ot as ve,P as ye,Pt as be,Q as xe,Qn as Se,Qt as Ce,R as we,Rt as Te,S as Ee,St as x,T as De,Tn as S,Tt as C,U as Oe,Ut as ke,V as Ae,Vn as je,Vt as Me,W as Ne,Wn as Pe,Wt as Fe,X as Ie,Xn as Le,Xt as Re,Y as ze,Yn as Be,Yt as Ve,Z as He,Zn as Ue,_ as We,_t as Ge,an as Ke,at as qe,b as w,bn as Je,c as Ye,cn as Xe,cr as Ze,d as Qe,dr as $e,dt as et,er as tt,et as nt,fn as T,ft as rt,gn as it,gt as at,hn as ot,ht as st,i as ct,ir as E,it as lt,j as ut,k as dt,kt as ft,ln as pt,lr as mt,lt as ht,m as gt,mn as _t,mt as vt,nn as yt,nr as bt,nt as xt,on as St,or as Ct,ot as wt,p as Tt,pn as D,pt as Et,q as O,qn as Dt,qt as k,rn as Ot,rr as kt,rt as At,s as jt,sr as Mt,st as Nt,tn as Pt,tr as A,tt as Ft,u as It,un as Lt,ur as Rt,ut as zt,v as Bt,vn as Vt,w as Ht,wt as Ut,x as Wt,xn as Gt,xt as Kt,yn as qt,yt as Jt,z as Yt}from"./BbMNnUSj.js";import{$ as Xt,A as Zt,B as Qt,C as $t,D as en,E as tn,F as nn,H as rn,I as an,K as on,L as sn,M as cn,N as ln,O as un,P as dn,Q as fn,R as pn,S as mn,T as hn,V as gn,X as _n,Y as vn,Z as yn,_ as bn,at as xn,b as Sn,c as Cn,ct as wn,d as Tn,et as En,f as Dn,g as On,h as kn,it as An,j as jn,k as Mn,m as Nn,nt as Pn,o as Fn,ot as In,p as Ln,q as Rn,rt as zn,s as Bn,st as Vn,t as Hn,tt as Un,u as Wn,v as Gn,w as Kn,x as qn,y as Jn,z as Yn}from"./D6peDvsS.js";import{a as Xn,i as Zn,n as Qn,o as $n,r as er,t as tr}from"./BQVmlsji.js";import{n as nr,r as rr,t as ir}from"./CbPho2Ur.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),`global`in globalThis||(globalThis.global=globalThis);function ar(e,t){return t&&typeof e==`function`&&(e.key=t),e}var or=/\\/g,sr=/</g,cr=/"/g,lr=/%\w+(?:\.\w+)?/g,ur=`%separator`;function dr(e,t,n=!1){let r;if(t===`s`||t===`pageTitle`)r=e.pageTitle;else if(t.includes(`.`)){let n=t.indexOf(`.`);r=e[t.substring(0,n)]?.[t.substring(n+1)]}else r=e[t];if(r!==void 0)return n?(r||``).replace(or,`\\\\`).replace(sr,`\\u003C`).replace(cr,`\\"`):r||``}function fr(e,t,n,r=!1){if(typeof e!=`string`||!e.includes(`%`))return e;let i=e;try{i=decodeURI(e)}catch{}let a=i.match(lr);if(!a)return e;let o=e.includes(ur);return e=e.replace(lr,e=>{if(e===ur||!a.includes(e))return e;let n=dr(t,e.slice(1),r);return n===void 0?e:n}).trim(),o&&(e=e.split(ur).map(e=>e.trim()).filter(e=>e!==``).join(n?` ${n} `:` `)),e}var pr=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w,mr=e=>e.includes(`:key`)?e:e.split(`:`).join(`:key:`),hr=ar({key:`aliasSorting`,hooks:{"tags:resolve":e=>{let t=!1;for(let n of e.tags){let r=n.tagPriority;if(!r)continue;let i=String(r);if(i.startsWith(`before:`)){let r=mr(i.slice(7)),a=e.tagMap.get(r);a&&(typeof a.tagPriority==`number`&&(n.tagPriority=a.tagPriority),n._p=a._p-1,t=!0)}else if(i.startsWith(`after:`)){let r=mr(i.slice(6)),a=e.tagMap.get(r);a&&(typeof a.tagPriority==`number`&&(n.tagPriority=a.tagPriority),n._p=a._p+1,t=!0)}}t&&(e.tags=e.tags.sort(pr))}}}),gr=ar({key:`deprecations`,hooks:{"entries:normalize":({tags:e})=>{for(let t of e)t.props.children&&(t.innerHTML=t.props.children,delete t.props.children),t.props.hid&&(t.key=t.props.hid,delete t.props.hid),t.props.vmid&&(t.key=t.props.vmid,delete t.props.vmid),`body`
2in t.props&&(t.props.body&&(t.tagPosition=`bodyClose`),delete t.props.body),t.props.renderPriority!=null&&(t.tagPriority=t.props.renderPriority,delete t.props.renderPriority)}}});function _r(e){return typeof e?.then==`function`}var vr=256;function yr(e,t){if(t===e.length)return;if(t===vr){let n=Array(e.length),r=!1;for(;t<e.length;t++){let i=xr(e[t]);n[t]=i,r||=_r(i)}return r?n:void 0}let n=xr(e[t]);if(_r(n)){let r=Array(e.length);r[t]=n;for(let n=t+1;n<e.length;n++)r[n]=xr(e[n]);return r}let r=yr(e,t+1);return r&&(r[t]=n),r}function br(e,t,n){if(n===t.length)return;if(n===vr){let r=Array(t.length),i=!1;for(;n<t.length;n++){let a=xr(e[t[n]]);r[n]=a,i||=_r(a)}return i?r:void 0}let r=xr(e[t[n]]);if(_r(r)){let i=Array(t.length);i[n]=r;for(let r=n+1;r<t.length;r++)i[r]=xr(e[t[r]]);return i}let i=br(e,t,n+1);return i&&(i[n]=r),i}function xr(e){if(typeof e==`function`)return e;if(_r(e))return Promise.resolve(e).then(xr);if(Array.isArray(e)){let t=yr(e,0);return t?Promise.all(t):e}if(e?.constructor===Object){let t=Object.keys(e),n=br(e,t,0);if(n)return Promise.all(n).then(e=>Object.fromEntries(t.map((t,n)=>[t,e[n]])))}return e}var Sr=ar(e=>{let t=new WeakMap;return{key:`promises`,hooks:{"entries:resolve":n=>{for(let r=n.entries.length-1;r>=0;r--){let i=n.entries[r],a=i.input;if(t.get(i)===a){n.entries.splice(r,1);continue}let o=xr(a);if(!_r(o)){t.delete(i);continue}t.set(i,a),n.entries.splice(r,1),Promise.resolve(o).then(n=>{t.get(i)===a&&(t.delete(i),i.input=n,delete i._tags,e.invalidate?.())},()=>{t.get(i)===a&&t.delete(i)})}}}}},`promises`),Cr={meta:`content`,link:`href`,htmlAttrs:`lang`},wr=[`innerHTML`,`textContent`];function Tr(e,t,n,r=!1){return typeof e==`string`&&e.includes(`%`)?fr(e,t,n,r):e}var Er=ar(e=>({key:`template-params`,hooks:{"tags:resolve":({tagMap:t,tags:n})=>{let r=t.get(`templateParams`)?.props||{},i=r.separator||`|`;delete r.separator,r.pageTitle=Tr(r.pageTitle||e._title||``,r,i);for(let e of n){if(e.processTemplateParams===!1)continue;let t=Cr[e.tag];if(t&&typeof e.props[t]==`string`)e.props[t]=Tr(e.props[t],r,i);else if(e.processTemplateParams||e.tag===`titleTemplate`||e.tag===`title`)for(let t of wr)typeof e[t]==`string`&&(e[t]=Tr(e[t],r,i,e.tag===`script`&&typeof e.props.type==`string`&&e.props.type.endsWith(`json`)))}e._templateParams=r,e._separator=i},"tags:afterResolve":({tagMap:t})=>{let n=t.get(`title`);n?.textContent&&n.processTemplateParams!==!1&&(n.textContent=Tr(n.textContent,e._templateParams,e._separator))}}}),`template-params`);function Dr(e,t){if(typeof t==`function`&&t.key&&e.plugins.has(t.key))return;let n=typeof t==`function`?t(e):t,r=n.key||String(e.plugins.size+1);if(!e.plugins.get(r)){e.plugins.set(r,n);for(let t in n.hooks||{})e.hooks?.hook(t,n.hooks[t])}}function Or(e,t={}){let n=!t.document,r=new Map,i={_entryCount:1,_h:0,plugins:new Map,resolvedOptions:t,ssr:n,entries:r,hooks:void 0,render:()=>e(i),use:e=>Dr(i,e),push(e,t){let a=t?._index??i._entryCount++,o=t?{...t}:{};delete o.head,delete o.onRendered,delete o._index;let s={_i:a,input:e,options:o};return r.set(a,s),{_i:a,dispose(){r.delete(a)},patch(e){n?(s.input=e,delete s._tags):s._pending=e,r.has(a)||r.set(a,s)}}}};return t.init?.forEach(e=>e&&i.push(e)),i}var kr=$e({docsBase:mt,reporters:Rt}),Ar=$e({docsBase:mt,reporters:Rt}),jr=()=>location.protocol+`//`+location.host;function Mr(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Ne(n,``)}return Ne(n,e)+r+i}function Nr(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=Mr(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){let{history:e}=window;e.state&&e.replaceState(O({},e.state,{scroll:Wt()}),``)}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),{pauseListeners:c,listen:l,destroy:d}}function Pr(e,t,n,r=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:null}}function Fr(e){let{history:t,location:n}=window,r={value:Mr(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:jr()+e+r;
vendor: 4,662 bytes, line 2
2try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,O({},t.state,Pr(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=O({},i.value,t.state,{forward:e,scroll:Wt()});a(o.current,o,!0),a(e,O({},Pr(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function Ir(e){e=ae(e);let t=Fr(e),n=Nr(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=O({location:``,base:e,go:r,createHref:Ee.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var Lr={type:0,value:``},Rr=/[a-zA-Z0-9_]/;function zr(e){if(!e)return[[]];if(e===`/`)return[[Lr]];if(!ze(e))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;)switch(c=e[s++],n){case 0:c===`\\`?(r=n,n=4):c===`/`?(l&&d(),o()):c===`:`?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:c===`(`?n=2:Rr.test(c)?f():(d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--);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!==`+`&&s--,u=``;break;default:t(`Unknown state`)}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var Br=`[^/]+?`,Vr={sensitive:!1,strict:!1,start:!0,end:!0},Hr=/[.+*?^${}()[\]/\\]/g;function Ur(e,t){let n=O({},Vr,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=40+(n.sensitive?.25:0);if(o.type===0)r||(i+=`/`),i+=o.value.replace(Hr,`\\$&`),s+=40;else if(o.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||Br;if(u!==Br){s+=10;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=20,c&&(s+=-8),n&&(s+=-20),u===`.*`&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===0)n+=e.value;else if(e.type===1){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(Ie(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=Ie(c)?c.join(`/`):c;if(!l)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function Wr(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function Gr(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Wr(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(Kr(r))return 1;if(Kr(i))return-1}return i.length-r.length}function Kr(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var qr={strict:!1,end:!0,sensitive:!1};function Jr(e,t,n){let r=Ur(zr(e.path),n),i=O(r,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function Yr(t,n){let r=[],i=new Map;n=e(qr,n);function a(e){return i.get(e)}function o(t,r,i){let a=!i,c=Zr(t);c.aliasOf=i&&i.record;let u=e(n,t),d=[c];if(`alias`in t){let e=typeof t.alias==`string`?[t.alias]:t.alias;for(let t of e)d.push(Zr(O({},c,{components:i?i.record.components:c.components,path:t,aliasOf:i?i.record:c})))}let f,p;for(let e of d){let{path:n}=e;if(r&&!ze(n)){let t=r.record.path,i=t[t.length-1]===`/`?``:`/`;e.path=r.record.path+(n&&i+n)}if(f=Jr(e,r,u),i?i.alias.push(f):(p||=f,p!==f&&p.alias.push(f),a&&t.name&&!$r(f)&&s(t.name)),ri(f)&&l(f),c.children){let e=c.
vendor: 9,679 bytes, line 2
2children;for(let t=0;t<e.length;t++)o(e[t],f,i&&i.children[t])}i||=f}return p?()=>{s(p)}:nt}function s(e){if(fe(e)){let t=i.get(e);t&&(i.delete(e),r.splice(r.indexOf(t),1),t.children.forEach(s),t.alias.forEach(s))}else{let t=r.indexOf(e);t>-1&&(r.splice(t,1),e.record.name&&i.delete(e.record.name),e.children.forEach(s),e.alias.forEach(s))}}function c(){return r}function l(e){let t=ti(e,r);r.splice(t,0,e),e.record.name&&!$r(e)&&i.set(e.record.name,e)}function u(e,t){let n,a={},o,s;if(`name`in e&&e.name){if(n=i.get(e.name),!n)throw oe(1,{location:e});s=n.record.name,a=O(Xr(t.params,n.keys.filter(e=>!e.optional).concat(n.parent?n.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&Xr(e.params,n.keys.map(e=>e.name))),o=n.stringify(a)}else if(e.path!=null)o=e.path,n=r.find(e=>e.re.test(o)),n&&(a=n.parse(o),s=n.record.name,n.keys.forEach(e=>{e.optional&&!a[e.name]&&delete a[e.name]}));else{if(n=t.name?i.get(t.name):r.find(e=>e.re.test(t.path)),!n)throw oe(1,{location:e,currentLocation:t});s=n.record.name,a=O({},t.params,e.params),o=n.stringify(a)}let c=[],l=n;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:ei(c)}}t.forEach(e=>o(e));function d(){r.length=0,i.clear()}return{addRoute:o,resolve:u,removeRoute:s,clearRoutes:d,getRoutes:c,getRecordMatcher:a}}function Xr(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Zr(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Qr(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Qr(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function $r(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ei(e){return e.reduce((e,t)=>O(e,t.meta),{})}function ti(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;Gr(e,t[i])<0?r=i:n=i+1}let i=ni(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function ni(e){let t=e;for(;t=t.parent;)if(ri(t)&&Gr(e,t)===0)return t}function ri({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function ii(e){let t=S(xt),n=S(Ft),r=T(()=>{let n=E(e.to);return t.resolve(n)}),i=T(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(ne.bind(null,i));if(o>-1)return o;let s=li(e[t-2]);return t>1&&li(i)===s&&a[a.length-1].path!==s?a.findIndex(ne.bind(null,e[t-2])):o}),a=T(()=>i.value>-1&&ci(n.params,r.value.params)),o=T(()=>i.value>-1&&i.value===n.matched.length-1&&ye(n.params,r.value.params));function s(n={}){if(si(n)){let n=t[E(e.replace)?`replace`:`push`](E(e.to)).catch(nt);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:T(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function ai(e){return e.length===1?e[0]:e}var oi=Gt({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`},viewTransition:Boolean},useLink:ii,setup(e,{slots:t}){let n=Se(ii(e)),{options:r}=S(xt),i=T(()=>({[ui(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[ui(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&ai(t.default(n));return e.custom?r:u(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function si(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(e.button===void 0||e.button===0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function ci(e,t){for(let n in t){let r=t[n],i=e[n];if(Ie(r)){if(!Ie(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}else if(r!==i)return!1}return!0}function li(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var ui=(e,t,n)=>e??t??n,di=Gt({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:n,slots:r}){let i=S(At),a=T(()=>e.route||i.value),o=S(qe,0),s=T(()=>{let e=E(o),{matched:t}=a.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),c=T(()=>a.value.matched[s.value]);y(qe,T(()=>s.value+1)),y(xe,c),y(At,a);let l=t();return je(()=>[l.value,c.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!ne(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let t=a.value,i=e.name,o=c.value,s=o&&o.components[i];if(!s)return fi(r.default,{Component:s,route:t});let d=o.props[i],f=d?d===!0?t.params:typeof d==`function`?d(t):d:null,p=u(s,O({},f,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[i]=null)},ref:l}));return fi(r.default,{Component:p,route:t})||p}}});function fi(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var pi=di;function mi(e){let t=Yr(e.routes,e),n=e.parseQuery||we,i=e.stringifyQuery||ie,a=e.history,s=_(),c=_(),u=_(),d=A(w),p=A(0),m=w;ut&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let h=ce.bind(null,e=>``+e),te=ce.bind(null,De),ne=ce.bind(null,l);function g(e,n){let r,i;fe(e)?(r=t.getRecordMatcher(e),i=n):i=e;let a=t.addRoute(i,r);return p.value++,()=>{a(),p.value++}}function re(e){let n=t.getRecordMatcher(e);n&&(t.removeRoute(n),p.value++)}function v(){t.clearRoutes(),p.value++}function ae(){return t.getRoutes().map(e=>e.record)}function y(e){return!!t.getRecordMatcher(e)}function se(e,r){if(p.value,typeof e==`string`){r||=e.startsWith(`/`)?w:d.value;let i=Yt(n,e,r.path),o=t.resolve({path:i.path},r),s=a.createHref(i.fullPath);return O(i,o,{params:ne(o.params),redirectedFrom:void 0,href:s})}r=O({},r||(e.path!=null&&e.path.startsWith(`/`)&&!(`name`in e&&e.name)?w:d.value));let o;if(e.path!=null)o=O({},e,{path:Yt(n,e.path,r.path).path});else{let t=O({},e.params);for(let e in t)t[e]??delete t[e];o=O({},e,{params:te(t)}),r.params=te(r.params)}let s=t.resolve(o,r),c=e.hash||``;s.params=h(ne(s.params));let l=Oe(i,O({},e,{hash:Ht(c),path:s.path})),u=a.createHref(l);return O({fullPath:l,hash:c,query:i===ie?ue(e.query):e.query||{}},s,{redirectedFrom:void 0,href:u})}function b(e){return typeof e==`string`?Yt(n,e,d.value.path):O({},e)}function le(e,t){if(m!==e)return oe(8,{from:t,to:e})}function de(e){return ve(e)}function pe(e){return de(O(b(e),{replace:!0}))}function me(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=b(i):{path:i},i.params={}),O({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function ve(e,t){let n=m=se(e),r=d.value,a=e.state,o=e.force,s=e.replace===!0,c=me(n,r);if(c)return ve(O(b(c),{state:typeof c==`object`?O({},a,c.state):a,force:o,replace:s}),t||n);let l=n;l.redirectedFrom=t;let u;return!o&&he(i,r,n)&&(u=oe(16,{to:l,from:r}),Ne(r,r,!0,!1)),(u?Promise.resolve(u):xe(l,r)).catch(e=>He(e)?He(e,2)?e:Me(e):ke(e,l,r)).then(e=>{if(e){if(He(e,2))return ve(O({replace:s},b(e.to),{state:typeof e.to==`object`?O({},a,e.to.state):a,force:o}),t||l)}else e=Ce(l,r,!0,s,a);return Se(l,r,e),e})}function ye(e,t){let n=le(e,t);return n?Promise.reject(n):Promise.resolve()}function be(e){let t=Le.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function xe(e,t){let n,[i,a,o]=ee(e,t);n=f(i.reverse(),`beforeRouteLeave`,e,t);for(let a of i)a.leaveGuards.forEach(i=>{n.push(r(i,e,t))});let l=ye.bind(null,e,t);return n.push(l),ze(n).then(()=>{n=[];for(let i of s.list())n.push(r(i,e,t));return n.push(l),ze(n)}).then(()=>{n=f(a,`beforeRouteUpdate`,e,t);for(let i of a)i.updateGuards.forEach(i=>{n.push(r(i,e,t))});return n.push(l),ze(n)}).then(()=>{n=[];for(let i of o)if(i.beforeEnter)if(Ie(i.beforeEnter))for(let a of i.beforeEnter)n.push(r(a,e,t));else n.push(r(i.beforeEnter,e,t));return n.push(l),ze(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=f(o,`beforeRouteEnter`,e,t,be),n.push(l),ze(n))).then(()=>{n=[];for(let i of c.list())n.push(r(i,e,t));return n.push(l),ze(n)}).catch(e=>He(e,8)?e:Promise.reject(e))}function Se(e,t,n){u.list().forEach(r=>be(()=>r(e,t,n)))}function Ce(e,t,n,r,i){let o=le(e,t);if(o)return o;let s=t===w,c=ut?history.state:{};n&&(r||s?a.replace(e.fullPath,O({scroll:s&&c&&c.scroll},i)):a.push(e.fullPath,i)),d.value=e,Ne(e,t,n,s),Me()}let Te;function Ee(){Te||=a.listen((e,t,n)=>{if(!Re.listening)return;let r=se(e),i=me(r,Re.currentRoute.value);if(i){ve(O(i,{replace:!0,force:!0}),r).catch(nt);return}m=r;let s=d.value;ut&&n.delta&&o(dt(s.fullPath,n.delta)),xe(r,s).catch(e=>He(e,12)?e:He(e,2)?(ve(O(b(e.to),{force:!0}),r).then(e=>{He(e,20)&&!n.delta&&n.type===`pop`&&a.go(-1,!1)}).catch(nt),Promise.reject()):(n.delta&&a.go(-n.delta,!1),ke(e,r,s))).then(e=>{e||=Ce(r,s,!1),e&&(n.delta&&!He(e,8)?a.go(-n.delta,!1):n.type===`pop`&&He(e,20)&&a.go(-1,!1)),Se(r,s,e)}).catch(nt)})}let x=_(),S=_(),C;function ke(e,t,n){Me(e);let r=S.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function je(){return C&&d.value!==w?Promise.resolve():new Promise((e,t)=>
2{x.add([e,t])})}function Me(e){return C||(C=!e,Ee(),x.list().forEach(([t,n])=>e?n(e):t()),x.reset()),e}function Ne(t,n,r,i){let{scrollBehavior:a}=e;if(!ut||!a)return Promise.resolve();let o=!r&&ge(dt(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return _e().then(()=>a(t,n,o)).then(e=>t===d.value&&e&&Ae(e)).catch(e=>t===d.value&&ke(e,t,n))}let Pe=e=>a.go(e),Fe,Le=new Set,Re={currentRoute:d,listening:!0,addRoute:g,removeRoute:re,clearRoutes:v,hasRoute:y,getRoutes:ae,resolve:se,options:e,push:de,replace:pe,go:Pe,back:()=>Pe(-1),forward:()=>Pe(1),beforeEach:s.add,beforeResolve:c.add,afterEach:u.add,onError:S.add,isReady:je,install(e){e.component(`RouterLink`,oi),e.component(`RouterView`,pi),e.config.globalProperties.$router=Re,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>E(d)}),ut&&!Fe&&d.value===w&&(Fe=!0,de(a.location).catch(e=>{}));let t={};for(let e in w)Object.defineProperty(t,e,{get:()=>d.value[e],enumerable:!0});e.provide(xt,Re),e.provide(Ft,tt(t)),e.provide(At,d);let n=e.unmount;Le.add(e),e.unmount=function(){Le.delete(e),Le.size<1&&(m=w,Te&&Te(),Te=null,d.value=w,Fe=!1,C=!1),n()}}};function ze(e){return e.reduce((e,t)=>e.then(()=>be(t)),Promise.resolve())}return Re}var hi=(()=>{let e={payload:!0,payload:!0},t={redirect:`/sitemap_index.xml`},n={};return(r,i)=>{let a=[];
2i.charCodeAt(i.length-1)===47&&(i=i.slice(0,-1)),i===``||i===`/en`?a.push({data:e}):i===`/sitemap.xml`?a.push({data:t}):i.charCodeAt(i.length-1)===47&&(i===`/`||i===`/en/`?a.push({data:e}):i===`/sitemap.xml/`&&a.push({data:t}));let o=i.split(`/`);return o.length>1&&o[o.length-1]===``&&(o.pop(),i=i.slice(0,-1)),o.length>1&&o[1]===`s`&&a.push({data:n,params:{_:i.slice(3)}}),a.reverse()}})(),gi=hi,_i=function(e){if(!e.includes(`%`))return e;let t=e.indexOf(`?`),n=t===-1?e:e.slice(0,t);try{return t===-1?decodeURI(n):decodeURI(n)+e.slice(t)}catch{return e}},vi=(e,t)=>{if(typeof e!=`string`)return e;let n=_i(e);return t?n.toLowerCase():n},yi=e=>_n.sensitive?Ut({},...hi(``,vi(e,!1)).map(e=>e.data).reverse()):Ut({},...gi(``,vi(e,!0)).map(e=>e.data).reverse()),bi=wt,xi=yi,Si;function Ci(){let e;return e=bi(Nt(`builds/meta/${Ve().app.buildId}.json`),{responseType:`json`}).then(e=>{if(!e||typeof e!=`object`||!Array.isArray(e.prerendered))throw Ar.NUXT_E5004();return e}),Si=e,e.catch(t=>{Si===e&&(Si=void 0),Ar.NUXT_E5002({cause:t})}),e}function wi(){return Si||Ci()}function Ti(e){let t=typeof e==`string`?e:e.path;try{return xi(t)}catch(e){return Ar.NUXT_E5003({path:t,cause:e}),{}}}var Ei=2**32-1,Di=Ei-1;function Oi(e){return!(!Number.isInteger(e)||e<0||e>Di)}function ki(e){return!(!Number.isInteger(e)||e<0||e>Ei)}function Ai(e){return Uint8Array.fromBase64(e).buffer}function ji(e){return Uint8Array.from(Buffer.from(e,`base64`)).buffer}function Mi(e){let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer}var Ni=typeof Uint8Array.fromBase64==`function`,Pi=typeof process==`object`&&process.versions?.node!==void 0,Fi=Ni?Ai:Pi?ji:Mi;function Ii(e,t){if(!t)return e;let n={};for(let r of Object.keys(e))n[r]=t[r]??e[r];return n}var Li=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,`byteLength`).get,Ri=typeof SharedArrayBuffer>`u`?void 0:Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,`byteLength`).get,zi=Object.freeze({fromPrimitive:e=>e,fromISOString:e=>new Date(e),fromStringValue:(e,t)=>e===`URL`?new URL(t):e===`URLSearchParams`?new URLSearchParams(t):Temporal[e.slice(9)].from(t),fromArrayBuffer:e=>e,fromRegExpInfo:(e,t)=>new RegExp(e,t),fromViewInfo:(e,t,n,r)=>{try{Li.call(t)}catch(e){if(!Ri)throw e;Ri.call(t)}let i=globalThis[e];return n===void 0?new i(t):new i(t,n,r)},box:e=>Object(e),createArray:e=>Array(e),createSparseArray:e=>{let t=[];return t[Di]=void 0,delete t[Di],t.length=e,t},createObject:()=>({}),createNullPrototypeObject:()=>Object.create(null),createSet:()=>new Set,createMap:()=>new Map,set:(e,t,n)=>{e[t]=n},addValue:(e,t)=>{e.add(t)},addEntry:(e,t,n)=>{e.set(t,n)}});function Bi(e,t,n){return Vi(JSON.parse(e),t,n)}function Vi(e,t,n){let r=Ii(zi,n?.operations);if(typeof e==`number`)return s(e,!0);if(!Array.isArray(e)||e.length===0)throw Error(`Invalid input`);let i=e,a=Array(i.length),o=null;function s(e,n=!1){if(e===-1)return r.fromPrimitive(void 0);if(e===-3)return r.fromPrimitive(NaN);if(e===-4)return r.fromPrimitive(1/0);if(e===-5)return r.fromPrimitive(-1/0);if(e===-6)return r.fromPrimitive(-0);if(n||typeof e!=`number`)throw Error(`Invalid input`);if(e in a)return a[e];if(e>=i.length)throw Error(`Invalid input`);let c=i[e];if(!c||typeof c!=`object`)a[e]=r.fromPrimitive(c);else if(Array.isArray(c))if(typeof c[0]==`string`){let n=c[0],l=t&&Object.hasOwn(t,n)?t[n]:void 0;if(l){let t=c[1];if(typeof t!=`number`&&(t=i.push(c[1])-1),Object.hasOwn(a,t))return a[e]=l(a[t]);if(o??=new Set,o.has(t))throw Error(`Invalid circular reference`);return o.add(t),a[e]=l(s(t)),o.delete(t),a[e]}switch(n){case`Date`:a[e]=r.fromISOString(c[1]);break;case`Set`:let t=r.createSet();a[e]=t;for(let e=1;e<c.length;e+=1)r.addValue(t,s(c[e]));break;case`Map`:let o=r.createMap();a[e]=o;for(let e=1;e<c.length;e+=2)r.addEntry(o,s(c[e]),s(c[e+1]));break;case`RegExp`:a[e]=r.fromRegExpInfo(c[1],c[2]);break;case`Object`:{let t=c[1];if(typeof i[t]==`object`&&i[t][0]!==`BigInt`)throw Error(`Invalid input`);a[e]=r.box(s(t));break}case`BigInt`:a[e]=r.fromPrimitive(BigInt(c[1]));break;case`null`:let l=r.createNullPrototypeObject();a[e]=l;for(let e=1;e<c.length;e+=2){let t=c[e];if(typeof t!=`string`)throw Error(`Cannot parse an object with a non-string key`);if(t===`__proto__`)throw Error("Cannot parse an object with a `__proto__` property");r.set(l,t,s(c[e+1]))}break;case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Float16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:case`DataView`:{if(i[c[1]][0]!==`ArrayBuffer`)throw Error(`Invalid data`);let t=s(c[1]);a[e]=r.fromViewInfo(n,t,c[2],c[3]);break}case`ArrayBuffer`:{let t=c[1];if(typeof t!=`string`)throw Error(`Invalid ArrayBuffer encoding`);a[e]=r.fromArrayBuffer(Fi(t));break}case`URL`:case`URLSearchParams`:case`Temporal.Duration`:case`Temporal.Instant`:case`Temporal.PlainDate`:case`Temporal.PlainTime`:case`Temporal.PlainDateTime`:case`Temporal.PlainMonthDay`:case`Temporal.PlainYearMonth`:case`Temporal.ZonedDateTime`:a[e]=r.fromStringValue(n,c[1]);break;default:throw Error(`Unknown type ${n}`)}}else if(c[0]===-7){let t=c[1];if(!ki(t))throw Error(`Invalid input`);let n=r.createSparseArray(t);a[e]=n;for(let e=2;e<c.length;e+=2){let i=c[e];if(!Oi(i)||i>=t)throw Error(`Invalid input`);
2r.set(n,i,s(c[e+1]))}}else{let t=r.createArray(c.length);a[e]=t;for(let e=0;e<c.length;e+=1){let n=c[e];n!==-2&&r.set(t,e,s(n))}}else{let t=r.createObject();a[e]=t;for(let e of Object.keys(c)){if(e===`__proto__`)throw Error("Cannot parse an object with a `__proto__` property");r.set(t,e,s(c[e]))}}return a[e]}return s(0)}async function Hi(e,t={}){return await Zi(e)&&await Ki(await Gi(e,t),Yi(e)?`default`:`force-cache`)||null}var Ui=`_payload.json`,Wi=`_b`;async function Gi(e,t={}){let n=new URL(e,`http://localhost`);if(n.host!==`localhost`||C(n.pathname,{acceptRelative:!0}))throw kr.NUXT_E7001({url:e});let r=Ve(),i=t.hash||(t.fresh?Date.now():r.app.buildId),a=r.app.cdnURL,o=a&&await Qi(e)?a:r.app.baseURL,s=ft(o,n.pathname,Ui);return Yi(e)||(n.search=``),i&&n.searchParams.set(Wi,String(i)),s+n.search}async function Ki(e,t){try{{let n=await fetch(e,{cache:t});return n.ok?await ta(await n.text()):null}}catch(t){kr.NUXT_E7002({url:e,cause:t})}return null}function qi(e){if(e.redirect)return!1;if(e.prerender)return!0}function Ji(e){return new URL(e,`http://localhost`).pathname}function Yi(e){return!!Ti({path:Ji(e)}).payload}async function Xi(e){e=Ji(e),e=e===`/`?e:e.replace(/\/$/,``);try{return(await wi()).prerendered.includes(e)}catch{return!1}}async function Zi(e=Kt().path){let t=Ti({path:Ji(e)});if(t.ssr===!1)return!1;let n=qi(t);return n===void 0?t.payload?!0:await Xi(e):n}async function Qi(e=Kt().path){let t=qi(Ti({path:Ji(e)}));return t===void 0?await Xi(e):t}var $i=null;async function ea(){if($i)return $i;let e=document.getElementById(`__NUXT_DATA__`);if(!e)return{};let t=await ta(e.textContent||``),n=e.dataset.src?await Ki(e.dataset.src,t.prerenderedAt?`force-cache`:`no-cache`):void 0;return $i={...t,...n,...window.__NUXT__},$i.config?.public&&($i.config.public=Se($i.config.public)),$i}async function ta(e){return await Bi(e,b()._payloadRevivers)}function na(e,t){b()._payloadRevivers[e]=t}function ra(e){try{return JSON.parse(e)}catch{return e}}var ia=[[`NuxtError`,e=>rt(e)],[`EmptyShallowRef`,e=>A(e===`_`?void 0:e===`0n`?BigInt(0):ra(e))],[`EmptyRef`,e=>t(e===`_`?void 0:e===`0n`?BigInt(0):ra(e))],[`ShallowRef`,e=>A(e)],[`ShallowReactive`,e=>tt(e)],[`Ref`,e=>t(e)],[`Reactive`,e=>Se(e)]],aa=k({name:`nuxt:revive-payload:client`,order:-30,async setup(e){let t,n;for(let[e,t]of ia)na(e,t);Object.assign(e.payload,([t,n]=Ot(()=>e.runWithContext(ea)),t=await t,n(),t)),delete window.__NUXT__}},1);function oa(e,t){t.push(Re),e.vueApp.use(t);let n=!0,r=()=>{n=!1,t.render()};t.hooks?.hook(`dom:beforeRender`,e=>{e.shouldRender=!n}),e.hooks.hook(`page:start`,()=>{n=!0}),e.hooks.hook(`page:finish`,()=>{e.isHydrating||r()}),e.hooks.hook(`app:error`,r),e.hooks.hook(`app:suspense:resolve`,r);let i=t.push.bind(t);t.push=((t,n)=>{let r=i(t,n),a=r.dispose.bind(r);return r.dispose=()=>{let t=e[`~transitionPromise`];t?t.finally(a):a()},r})}function sa(e,t,n){let r=e.push,i=e;i.ssr=!1,i.hooks=t,i.dirty=!!i.dirty,i.use=e=>Dr(i,e),i.render=()=>n(i);function a(){t.callHook(`entries:updated`,i),i._b||i.render()}return i.invalidate=()=>{for(let e of i.entries.values())delete e._tags;i.dirty=!0,a()},i.push=(n,o)=>{let s=o?.onRendered?t.hook(`dom:rendered`,o.onRendered):void 0,c=r(n,o),l=e.entries.get(c._i);return l&&(l._o=n),i.dirty=!0,a(),{_i:c._i,patch(e){c.patch(e),i.dirty=!0,a()},dispose(){s?.(),e.entries.has(c._i)&&(c.dispose(),i.invalidate())}}},i}var ca=/\s+/;function la(e={}){return t=>fa(t,e)}function ua(e){for(let t of e.entries.values())if(t._pending!==void 0)return!0;return!1}function da(e,t){let n={_d:t,_t:t.title,_e:new Map([[`htmlAttrs`,t.documentElement],[`bodyAttrs`,t.body]]),_p:{},_s:{},_l:new Map};for(let t of e.entries.values())if(t._o!==void 0){let e=t._o;for(let t of[`bodyAttrs`,`htmlAttrs`]){let r=e[t]?.class;if(typeof r==`string`){let e=n._e.get(t);for(let i of r.split(ca))i&&(n._p[`${t}:attr:class:${i}`]=()=>e.classList.remove(i))}}}return n}function fa(e,t={}){let n=t.document||e.resolvedOptions.document,r=e._dom;if(!n||e._du||r&&r._d===n&&!e.dirty&&!ua(e))return!1;let i=n.defaultView;e._du=!0;let a=!1;try{let o=function(e,t,n){d._s[e]=!n&&f[e]||t,delete f[e]},s=function(e,t,n,r,i,a){let s=`${e}:event:${t}`,c=d._l.get(s);if(c&&c[0]===a&&c[1]===n&&c[2]===r){o(s,c[4]);return}c?.[4]();let l=`data-${t}`,u=(e=>r.call(i,e)),f=()=>{a.removeEventListener(n,u),i.getAttribute(l)===``&&i.removeAttribute(l),d._l.get(s)?.[3]===u&&d._l.delete(s)};a.addEventListener(n,u),d._l.set(s,[a,n,r,u,f]),i.setAttribute(l,``),o(s,f,!0)},c=function({id:e,$el:t,tag:n}){if(d._e.set(e,t),!n.tag.endsWith(`Attrs`)){let r=n.textContent;r!=null&&r!==``&&(r!==t.textContent&&(t.textContent=r),o(`${e}:text`,()=>{t.textContent===r&&(t.textContent=``)},!0));let i=n.innerHTML;i!=null&&i!==``&&(i!==t.innerHTML&&(t.innerHTML=i),o(`${e}:html`,()=>{t.innerHTML===i&&(t.innerHTML=``)},!0));let a=`${e}:el`;o(a,f[a]||(()=>{t?.remove(),d._e.delete(e)}))}for(let r in n.props){let a=n.props[r];if(r[0]===`o`&&r[1]===`n`&&typeof a==`function`){let o=r.slice(2);t?.dataset?.[`${r}fired`]&&a.call(t,new((i?.Event)||Event)(o)),s(e,r,o,a,t,n.tag===`bodyAttrs`&&i?i:t);continue}let c=`${e}:attr:${r}`;if(r===`class`&&a)for(let e of a){let n=`${c}:${e}`;o(n,f[n]||(()=>t.classList.remove(e))),t.classList.contains(e)||t.classList.add(e)}else if(r===`style`&&a)for(let[e,n]of a){let r=`${c}:${e}`;o(r,f[r]||(()=>t.style.removeProperty(e))),t.style.setProperty(e,n)}else a!==!1&&a!==null&&(t.getAttribute(r)!==a&&t.setAttribute(r,a===!0?``:String(a)),o(c,f[c]||(()=>t.removeAttribute(r))))}},l={shouldRender:!0,tags:[]};if(xn(e,`dom:beforeRender`,l),!l.shouldRender)return!1;let u=r;if(u?._d!==n){if(u){for(let e in u._s)u._s[e]();for(let e in u._p)u._p[e]();u._s=u._p={},u._e.clear(),u._l.clear()}u=void 0}u?u._p=u._s:u=da(e,n),u._s={};let d=u,f=d._p,p=[],m={};e.dirty=!1;let ee=An(e,t.tagWeight?{tagWeight:t.tagWeight}:void 0),h=[],te={};for(let e of ee){let t=te[e._d]||0,r=(t?`${e._d}:${t}`:e._d)||e._h,i={tag:e,id:r,shouldRender:!0};if(e.tag===`meta`&&e._d&&Pn(e._d)&&(te[e._d]=t+1),h.push(i),e.tag===`title`){n.title=e.textContent,o(`title:`,()=>n.title=d._t);continue}i.$el=d._e.get(r),i.$el?c(i):Vn.has(e.tag)&&p.push(i)}if(p.length){let e=new Set(d._e.values());for(let t of[...n.body.children,...n.head.children]){let n=t.tagName.toLowerCase();if(!Vn.has(n)||e.has(t))continue;let r={innerHTML:t.innerHTML};for(let e of t.getAttributeNames())r[e]=t.getAttribute(e);let i=zn({tag:n,props:{}},r);i.key=t.getAttribute(`data-hid`)||void 0;let a=En(i)||Un(i),o=a,s=1;for(;d._e.has(o);)o=`${a}:${s++}
2`;d._e.set(o,t)}}for(let e of p){let t=d._e.get(e.id);e.$el=t||n.createElement(e.tag.tag),c(e),t||(m[e.tag.tagPosition||`head`]??=n.createDocumentFragment()).appendChild(e.$el)}m.head&&n.head.appendChild(m.head),m.bodyOpen&&n.body.insertBefore(m.bodyOpen,n.body.firstChild),m.bodyClose&&n.body.appendChild(m.bodyClose);for(let e in f)f[e]();e._dom=d,a=!0,xn(e,`dom:rendered`,{renders:h})}catch(t){throw e.dirty=!0,t}finally{e._du=!1}return a&&(e.dirty||ua(e))&&fa(e,t),a}var pa=e=>typeof e.tagPriority==`number`?e.tagPriority:100+(wn[e.tagPriority]||0);function ma(e={}){e.document=e.document||(typeof window<`u`?document:void 0);let t=e.render||la({document:e.document}),n=sa(Or(t,{document:e.document,propResolvers:e.propResolvers,_tagWeight:pa,init:[]}),In(e.hooks),t);return e.plugins?.forEach(e=>n.use(e)),e.init?.forEach(e=>e&&n.push(e)),n}function ha(e={}){let t=la(),n,r=0;return n=ma({render:()=>{let e=++r;setTimeout(()=>{e===r&&t(n)},0)},...e}),n.install=Xt(n),n}var ga={disableDefaults:!0,disableCapoSorting:!0,plugins:[gr,Sr,Er,hr]},_a=k({name:`nuxt:head`,enforce:`pre`,setup(e){oa(e,ha(ga))}}),va=/(:\w+)\([^)]+\)/g,ya=/(:\w+)[?+*]/g,ba=/:\w+/g,xa=(e,t)=>t.path.replace(va,`$1`).replace(ya,`$1`).replace(ba,t=>e.params[t.slice(1)]?.toString()||``),Sa=(e,t)=>{let n=e.route.matched.find(t=>t.components?.default===e.Component.type),r=t??n?.meta.key??(n&&xa(e.route,n));return typeof r==`function`?r(e.route):r},Ca=(e,t)=>({default:()=>e?u(pt,e===!0?{}:e,t):t});function wa(e){return Array.isArray(e)?e:[e]}var Ta=[Ge(async e=>{let t,n;if(!e.meta?.validate)return;let r=([t,n]=Ot(()=>Promise.resolve(e.meta.validate(e))),t=await t,n(),t);if(r!==!0)return rt({fatal:!0,status:r&&(r.status||r.statusCode)||404,statusText:r&&(r.statusText||r.statusMessage)||`Page Not Found: ${e.fullPath}`,data:{path:e.fullPath}})},1),Ge(e=>{let t=Ti({path:e.path});if(t.redirect){let n=t.redirect.includes(`#`)?t.redirect:t.redirect+e.hash;return C(n,{acceptRelative:!0})?(window.location.href=n,!1):n}})],Ea={},Da={pageTransition:{name:`page`,mode:`out-in`,onLeave:(e,t)=>{setTimeout(()=>{t()},500)}}}
2,Oa=[{name:`slug___da`,path:`/:slug(.*)*`,meta:Da||{},component:()=>$n(()=>import(`./Cu1VLvme.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)},{name:`slug___en`,path:`/en/:slug(.*)*`,meta:Da||{},component:()=>$n(()=>import(`./Cu1VLvme.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)},{name:void 0,path:`/sitemap.xml`,component:{}}];function ka(e,t,n){let{pathname:r,search:i,hash:a}=t,o=e.indexOf(`#`);if(o>-1){let t=a.includes(e.slice(o))?e.slice(o).length:1,n=a.slice(t);return n[0]!==`/`&&(n=`/`+n),de(n,``)}let s=de(r,e),c=!n||m(s,n)?s:n;return c+(c.includes(`?`)?``:i)+a}var Aa=k({name:`nuxt:router`,enforce:`pre`,async setup(e){let t,n,r=Ve().app.baseURL,i=_n.history?.(r)??Ir(r),a=_n.routes?([t,n]=Ot(()=>_n.routes(Oa)),t=await t,n(),t??Oa):Oa,o,s=mi({..._n,scrollBehavior:(e,t,n)=>{if(t===w){o=n;return}if(_n.scrollBehavior){if(s.options.scrollBehavior=_n.scrollBehavior,`scrollRestoration`in window.history){let e=s.beforeEach(()=>{e(),window.history.scrollRestoration=`manual`})}return _n.scrollBehavior(e,w,o||n)}},history:i,routes:a});`scrollRestoration`in window.history&&(window.history.scrollRestoration=`auto`),e.vueApp.use(s);let l=A(s.currentRoute.value);s.afterEach((e,t)=>{l.value=t}),Object.defineProperty(e.vueApp.config.globalProperties,"previousRoute",{get:()=>l.value});let u=ka(r,window.location,e.payload.path),d=A(s.currentRoute.value),f=()=>{d.value=s.currentRoute.value};s.afterEach((e,t)=>{let n=e.matched.at(-1)?.components?.default,r=t.matched.at(-1)?.components?.default;if(n===r){Sa({route:e,Component:{type:n}})===Sa({route:t,Component:{type:r}})&&f();return}e.matched.length<t.matched.length&&e.matched.every((e,n)=>e.components?.default===t.matched[n]?.components?.default)&&f()});let p={sync:f};for(let e in d.value)Object.defineProperty(p,e,{get:()=>d.value[e],enumerable:!0});e._route=tt(p),e._middleware||={global:[],named:{}};let ee=st();s.afterEach(async(t,n,r)=>{delete e._processingMiddleware,!e.isHydrating&&ee.value&&await e.runWithContext(et),r&&await e.callHook(`page:loading:end`)});try{[t,n]=Ot(()=>s.isReady()),await t,n()}catch(r){[t,n]=Ot(()=>zt(e,r)),await t,n()}let h=u===s.currentRoute.value.fullPath?s.currentRoute.value:s.resolve(u),te=s.currentRoute.value.fullPath,ne=e.isHydrating&&e.payload.prerenderedAt&&e.payload.path&&u!==e.payload.path&&m(s.currentRoute.value.path,e.payload.path);f();function g(t){!e.isHydrating&&t.fullPath!==ka(r,window.location)&&i.push(t.fullPath)}let _=e.payload.state._layout;return s.beforeEach(async(t,n)=>{await e.callHook(`page:loading:start`),t.meta=Se(t.meta),e.isHydrating&&_&&!Be(t.meta.layout)&&(t.meta.layout=_),e._processingMiddleware=!0;{let r=new Set([...Ta,...e._middleware.global]);for(let e of t.matched){let t=e.meta.middleware;if(t)for(let e of wa(t))r.add(e)}let i=Ti({path:t.path});if(i.appMiddleware)for(let e in i.appMiddleware)i.appMiddleware[e]?r.add(e):r.delete(e);for(let i of r){let r=typeof i==`string`?e._middleware.named[i]||await Ea[i]?.().then(e=>e.default||e):i;if(!r)throw c.NUXT_E2004({entry:String(i),validMiddleware:void 0});try{let i=await e.runWithContext(()=>r(t,n));if(!e.payload.serverRendered&&e.isHydrating&&(i===!1||i instanceof Error)){let t=i||rt({status:404,statusText:`Page Not Found: ${u}`});return await e.runWithContext(()=>vt(t)),!1}if(i===!0)continue;if(i===!1)return i;if(i)return Et(i)&&i.fatal&&(await e.runWithContext(()=>vt(i)),g(t)),i}catch(n){let r=rt(n);return r.fatal&&(await e.runWithContext(()=>vt(r)),g(t)),r}}}}),s.onError(async()=>{delete e._processingMiddleware,await e.callHook(`page:loading:end`)}),s.afterEach(t=>{if(t.matched.length===0&&!ee.value)return e.runWithContext(()=>vt(rt({status:404,fatal:!1,statusText:`Page not found: ${t.fullPath}`,data:{path:t.fullPath}})))}),e.hooks.hookOnce(`app:created`,async()=>{try{if(`name`in h&&(h.name=void 0),s.currentRoute.value.fullPath===te)if(ne){let t=s.resolve(e.payload.path);`name`in t&&(t.name=void 0),await s.replace({...t,force:!0});let n=()=>{e[`~restoreDeferredRoute`]&&(e[`~restoreDeferredRoute`]=void 0,s.currentRoute.value=s.resolve(u),f(),s.replace({...h,force:!0}).catch(()=>{}))};e[`~restoreDeferredRoute`]=n,e.hooks.hookOnce(`app:suspense:resolve`,n)}else await s.replace({...h,force:!0});s.options.scrollBehavior=_n.scrollBehavior}catch(t){await zt(e,t)}}),{provide:{router:s}}}},1),ja={system:-15,vendor:-5,nitro:-4,config:-3,i18n:-2,build:-1,runtime:0};function Ma(e){return typeof e==`function`?e():e&&e.__v_isRef===!0?e.value:e}function Na(e){e.indexable!==void 0&&(e.indexable=String(e.indexable)!==`false`),e.trailingSlash!==void 0&&!e.trailingSlash&&(e.trailingSlash=String(e.trailingSlash)!==`false`),e.url&&!C(String(e.url),{acceptRelative:!0,strict:!1})&&(e.url=be(String(e.url)));let t=Object.keys(e).sort((e,t)=>
2e.localeCompare(t)),n={};for(let r of t)n[r]=e[r];return n}function Pa(e){let t=e?.debug||!1,n=[];function r(e){if(!e||typeof e!=`object`||Object.keys(e).length===0)return()=>{};if(!e._context&&t){let t=Error(`tmp`).stack?.split(` 3`)[2]?.split(` `)[5];t?.includes(`/`)&&(t=`anonymous`),e._context=t}let r={};for(let t in e){let n=e[t];n!==void 0&&n!==``&&(r[t]=n)}return Object.keys(r).some(e=>!e.startsWith(`_`))?(n.push(r),()=>{let e=n.indexOf(r);e!==-1&&n.splice(e,1)}):()=>{}}function i(e){let t={};e?.debug&&(t._context={}),t._priority={};for(let r in n.sort((e,t)=>(e._priority||0)-(t._priority||0)))for(let i in n[r]){let a=i,o=e?.resolveRefs?Ma(n[r][i]):n[r][i];!i.startsWith(`_`)&&o!==void 0&&o!==``&&(t[i]=o,n[r]._priority!==void 0&&n[r]._priority!==-1&&(t._priority[a]=n[r]._priority),e?.debug&&(t._context[a]=n[r]._context?.[a]||n[r]._context||`anonymous`))}return e?.skipNormalize?t:Na(t)}return{stack:n,push:r,get:i}}var Fa=`$s`;function Ia(...e){let t=typeof e[e.length-1]==`string`?e.pop():void 0;typeof e[0]!=`string`&&e.unshift(t);let[n,r]=e;if(!n||typeof n!=`string`)throw kr.NUXT_E7009({key:n});if(r!==void 0&&typeof r!=`function`)throw kr.NUXT_E7007({type:typeof r});let i=Fa+n,a=b(),o=bt(a.payload.state,i);if(r&&(a._state[i]??={_default:r}),o.value===void 0&&r){let e=r();if(Le(e))return a.payload.state[i]=e,e;o.value=e}return o}function La(e={}){let t=e.path||window.location.pathname,n=new URL(t,window.location.href);if(n.host!==window.location.host)throw c.NUXT_E2010({path:t});if(n.protocol&&ve(n.protocol))throw c.NUXT_E2002({toPath:t,protocol:n.protocol});let r={};try{r=JSON.parse(sessionStorage.getItem(`nuxt:reload`)||`{}`)}catch{}if(e.force||r?.path!==t||r?.expires<Date.now()){try{sessionStorage.setItem(`nuxt:reload`,JSON.stringify({path:t,expires:Date.now()+(e.ttl??1e4)}))}catch{}if(e.persistState)try{sessionStorage.setItem(`nuxt:reload:state`,JSON.stringify({state:b().payload.state}))}catch{}window.location.pathname===t?window.location.reload():window.location.href=t}}function Ra(e={}){let t=A(``),n=A(e.politeness||`polite`),r=yn();function i(e=``,r=`polite`){t.value=e,n.value=r}function a(e){i(e,`polite`)}function o(e){i(e,`assertive`)}function s(){i(document?.title?.trim(),n.value)}function c(){r?.hooks?.removeHook(`dom:rendered`,s)}return s(),r?.hooks?.hook(`dom:rendered`,s),{_cleanup:c,message:t,politeness:n,set:i,polite:a,assertive:o}}function za(e={}){let t=b(),n=t._routeAnnouncer||=Ra(e);return e.politeness&&e.politeness!==n.politeness.value&&(n.politeness.value=e.politeness),se()&&(t._routeAnnouncerDeps||=0,t._routeAnnouncerDeps++,Ue(()=>{t._routeAnnouncerDeps--,t._routeAnnouncerDeps===0&&(n._cleanup(),delete t._routeAnnouncer)})),n}var Ba=yi;function Va(e,t){return E(t)??e?.meta.layout??Ba(e?.path??`/`).appLayout??`default`}var Ha=k({name:`nuxt-site-config:init`,enforce:`pre`,async setup(e){let t=Pa(),n=Ia(`site-config`);{let e=n.value||window.__NUXT_SITE_CONFIG__||{};for(let n in e)n[0]!==`_`&&t.push({[n]:e[n],_priority:e._priority?.[n]||-1})}return{provide:{nuxtSiteConfig:t}}}}),Ua=k({name:`nuxt:payload`,setup(e){let t=new Set;x().beforeResolve(async(n,r)=>{let i=Yi(n.path),a=i?Te(n.fullPath):n.path;if(a===(i?Te(r.fullPath):r.path))return;let o=await Hi(a);if(o){for(let n of t)delete e.static.data[n];for(let n in o.data)n in e.static.data||t.add(n),e.static.data[n]=o.data[n]}}),gt(()=>{e.hooks.hook(`link:prefetch`,async e=>{let{hostname:t,pathname:n}=new URL(e,window.location.href);t===window.location.hostname&&await Hi(e).catch(()=>{kr.NUXT_E7003({url:e})})}),navigator.connection?.effectiveType!==`slow-2g`&&setTimeout(wi,1e3)})}}),Wa=k(()=>{let e=x();gt(()=>{e.beforeResolve(async()=>{await new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})})})})}),Ga=k(e=>{let t;async function n(){let r;try{r=await wi()}catch(e){let t=e;if(!(`status`in t&&(t.status===404||t.status===403)))throw t}t&&clearTimeout(t),t=setTimeout(n,Pt);try{let n=await wt(Nt(`builds/latest.json`)+`?${Date.now()}`);n.id!==r?.id&&(e.hooks.callHook(`app:manifest:update`,n),t&&clearTimeout(t))}catch{}}gt(()=>{t=setTimeout(n,Pt)})}),Ka=k({name:`nuxt:chunk-reload-crawler`,setup(e){let t=!0;e.hooks.hookOnce(`app:suspense:resolve`,()=>{t=!1}),e.hook(`app:chunkError`,()=>{t&&Fe(navigator.userAgent)&&La()})}}),qa=k({name:`nuxt:chunk-reload`,setup(e){let t=x(),n=Ve(),r=new Set;t.beforeEach(()=>{r.clear()}),e.hook(`app:chunkError`,({error:e})=>{r.add(e)});function i(e){La({path:ft(n.app.baseURL,e.fullPath),persistState:!0})}e.hook(`app:manifest:update`,()=>{t.beforeResolve(i)}),t.onError((e,t)=>{r.has(e)&&i(t)})}}),Ja=k({name:`nuxt:island-link-navigation`,setup(e){}}),Ya=k({name:`nuxt:global-components`}),Xa={default:Je(()=>$n(()=>import(`./BuT-0jPG.js`).then(e=>e.default||e),__vite__mapDeps([7,1,8,2,6]),import.meta.url))},Za=k({name:`nuxt:prefetch`,setup(e){let t=x();e.hooks.hook(`app:mounted`,()=>{t.beforeEach(async e=>{let t=e?.meta?.layout;t&&typeof Xa[t]==`function`&&await Xa[t]()})}),e.hooks.hook(`link:prefetch`,e=>
vendor: 4,148 bytes, line 3
3{if(C(e))return;let n=t.resolve(e);if(!n)return;let r=n.meta.layout,i=wa(n.meta.middleware).filter(e=>typeof e==`string`);for(let e of i){let t=Ea[e];typeof t==`function`&&t()}typeof r==`string`&&r in Xa&&Rn(Xa[r])})}}),Qa=()=>void 0,$a={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},j=function(e,t){if(!e)throw eo(t)},eo=function(e){return Error(`Firebase Database (`+$a.SDK_VERSION+`) INTERNAL ASSERT FAILED: `+e)},to=function(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)==56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},no=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){let a=e[n++];t[r++]=String.fromCharCode((i&31)<<6|a&63)}else if(i>239&&i<365){let a=e[n++],o=e[n++],s=e[n++],c=((i&7)<<18|(a&63)<<12|(o&63)<<6|s&63)-65536;t[r++]=String.fromCharCode(55296+(c>>10)),t[r++]=String.fromCharCode(56320+(c&1023))}else{let a=e[n++],o=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(a&63)<<6|o&63)}}return t.join(``)},ro={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(e,t){if(!Array.isArray(e))throw Error(`encodeByteArray takes an array as a parameter`);this.init_();let n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){let i=e[t],a=t+1<e.length,o=a?e[t+1]:0,s=t+2<e.length,c=s?e[t+2]:0,l=i>>2,u=(i&3)<<4|o>>4,d=(o&15)<<2|c>>6,f=c&63;s||(f=64,a||(d=64)),r.push(n[l],n[u],n[d],n[f])}return r.join(``)},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(to(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):no(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){let i=n[e.charAt(t++)],a=t<e.length?n[e.charAt(t)]:0;++t;let o=t<e.length?n[e.charAt(t)]:64;++t;let s=t<e.length?n[e.charAt(t)]:64;if(++t,i==null||a==null||o==null||s==null)throw new io;let c=i<<2|a>>4;if(r.push(c),o!==64){let e=a<<4&240|o>>2;if(r.push(e),s!==64){let e=o<<6&192|s;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},io=class extends Error{constructor(){super(...arguments),this.name=`DecodeBase64StringError`}},ao=function(e){let t=to(e);return ro.encodeByteArray(t,!0)},oo=function(e){return ao(e).replace(/\./g,``)},so=function(e){try{return ro.decodeString(e,!0)}catch(e){console.error(`base64Decode failed: `,e)}return null};function co(e){return lo(void 0,e)}function lo(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:e===void 0&&(e={});break;case Array:e=[];break;default:return t}for(let n in t)!t.hasOwnProperty(n)||!uo(n)||(e[n]=lo(e[n],t[n]));return e}function uo(e){return e!==`__proto__`}function fo(){if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`Unable to locate global object.`)}var po=()=>fo().__FIREBASE_DEFAULTS__,mo=()=>{if(typeof process>`u`)return;let e={}.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},ho=()=>
3{if(typeof document>`u`)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let t=e&&so(e[1]);return t&&JSON.parse(t)},go=()=>{try{return Qa()||po()||mo()||ho()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},_o=e=>go()?.emulatorHosts?.[e],vo=e=>{let t=_o(e);if(!t)return;let n=t.lastIndexOf(`:`);if(n<=0||n+1===t.length)throw Error(`Invalid host ${t} with no separate hostname and port!`);let r=parseInt(t.substring(n+1),10);return t[0]===`[`?[t.substring(1,n-1),r]:[t.substring(0,n),r]},yo=()=>go()?.config,bo=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),typeof e==`function`&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,n))}}};function xo(e){try{return(e.startsWith(`http://`)||e.startsWith(`https://`)?new URL(e).hostname:e).endsWith(`.cloudworkstations.dev`)}catch{return!1}}async function So(e){return(await fetch(e,{credentials:`include`})).ok}function Co(e,t){if(e.uid)throw Error(`The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.`);let n={alg:`none`,type:`JWT`},r=t||`demo-project`,i=e.iat||0,a=e.sub||e.user_id;if(!a)throw Error(`mockUserToken must contain 'sub' or 'user_id' field!`);let o={iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:a,user_id:a,firebase:{sign_in_provider:`custom`,identities:{}},...e};return[oo(JSON.stringify(n)),oo(JSON.stringify(o)),``].join(`.`)}var wo={};function To(){let e={prod:[],emulator:[]};for(let t of Object.keys(wo))wo[t]?e.emulator.push(t):e.prod.push(t);return e}function Eo(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement(`div`),t.setAttribute(`id`,e),n=!0),{created:n,element:t}}var Do=!1;function Oo(e,t){if(typeof window>`u`||typeof document>`u`||!xo(window.location.host)||wo[e]===t||wo[e]||Do)return;wo[e]=t;function n(e){return`__firebase__banner__${e}`}let r=`__firebase__banner`,i=To().prod.length>0;function a(){let e=document.getElementById(r);e&&e.remove()}function o(e){e.style.display=`flex`,e.style.background=`#7faaf0`,e.style.position=`fixed`,e.style.bottom=`5px`,e.style.left=`5px`,e.style.padding=`.5em`,e.style.borderRadius=`5px`,e.style.alignItems=`center`}function s(e,t){e.setAttribute(`width`,`24`),e.setAttribute(`id`,t),e.setAttribute(`height`,`24`),e.setAttribute(`viewBox`,`0 0 24 24`),e.setAttribute(`fill`,`none`),e.style.marginLeft=`-6px`}function c(){let e=document.createElement(`span`);return e.style.cursor=`pointer`,e.style.marginLeft=`16px`,e.style.fontSize=`24px`,e.innerHTML=` ×`,e.onclick=()=>{Do=!0,a()},e}function l(e,t){e.setAttribute(`id`,t),e.innerText=`Learn more`,e.href=`https://firebase.google.com/docs/studio/preview-apps#preview-backend`,e.setAttribute(`target`,`__blank`),e.style.paddingLeft=`5px`,e.style.textDecoration=`underline`}function u(){let e=Eo(r),t=n(`text`),a=document.getElementById(t)||document.createElement(`span`),u=n(`learnmore`),d=document.getElementById(u)||document.createElement(`a`),f=n(`preprendIcon`),p=document.getElementById(f)||document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);if(e.created){let t=e.element;o(t),l(d,u);let n=c();s(p,f),t.append(p,a,d,n),document.body.appendChild(t)}i?(a.innerText=`Preview backend disconnected.`,p.innerHTML=`<g clip-path="url(#clip0_6013_33858)"> 4<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/> 5</g> 6<defs> 7<clipPath id="clip0_6013_33858"> 8<rect width="24" height="24" fill="white"/> 9</clipPath> 10</defs>`):(p.innerHTML=`<g clip-path="url(#clip0_6083_34804)"> 11<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444
1112.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/> 12</g> 13<defs> 14<clipPath id="clip0_6083_34804"> 15<rect width="24" height="24" fill="white"/> 16</clipPath> 17</defs>`,a.innerText=`Preview backend running in this workspace.`),a.setAttribute(`id`,t)}document.readyState===`loading`?window.addEventListener(`DOMContentLoaded`,u):u()}function ko(){return typeof navigator<`u`&&typeof navigator.userAgent==`string`?navigator.userAgent:``}function Ao(){return typeof window<`u`&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(ko())}function jo(){return typeof navigator==`object`&&navigator.product===`ReactNative`}function Mo(){return $a.NODE_CLIENT===!0||$a.NODE_ADMIN===!0}function No(){try{return typeof indexedDB==`object`}catch{return!1}}function Po(){return new Promise((e,t)=>{try{let n=!0,r=`validate-browser-context-for-indexeddb-analytics-module`,i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{t(i.error?.message||``)}}catch(e){t(e)}})}var Fo=`FirebaseError`,Io=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=Fo,Object.setPrototypeOf(this,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Lo.prototype.create)}},Lo=class{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){let n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],a=i?Ro(i,n):`Error`;return new Io(r,`${this.serviceName}: ${a} (${r}).`,n)}};function Ro(e,t){return e.replace(zo,(e,n)=>{let r=t[n];return r==null?`<${n}?>`:String(r)})}var zo=/\{\$([^}]+)}/g;function Bo(e){return JSON.parse(e)}function M(e){return JSON.stringify(e)}var Vo=function(e){let t={},n={},r={},i=``;try{let a=e.split(`.`);t=Bo(so(a[0])||``),n=Bo(so(a[1])||``),i=a[2],r=n.d||{},delete n.d}catch{}return{header:t,claims:n,data:r,signature:i}},Ho=function(e){let t=Vo(e).claims;return!!t&&typeof t==`object`&&t.hasOwnProperty(`iat`)},Uo=function(e){let t=Vo(e).claims;return typeof t==`object`&&t.admin===!0};function Wo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Go(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]}function Ko(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function qo(e,t,n){let r={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}function Jo(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);for(let i of n){if(!r.includes(i))return!1;let n=e[i],a=t[i];if(Yo(n)&&Yo(a)){if(!Jo(n,a))return!1}else if(n!==a)return!1}for(let e of r)if(!n.includes(e))return!1;return!0}function Yo(e){return typeof e==`object`&&!!e}function Xo(e){let t=[];
vendor: 24,087 bytes, line 17
17for(let[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+`=`+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+`=`+encodeURIComponent(r));return t.length?`&`+t.join(`&`):``}var Zo=class{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||=0;let n=this.W_;if(typeof e==`string`)for(let r=0;r<16;r++)n[r]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let r=0;r<16;r++)n[r]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let e=16;e<80;e++){let t=n[e-3]^n[e-8]^n[e-14]^n[e-16];n[e]=(t<<1|t>>>31)&4294967295}let r=this.chain_[0],i=this.chain_[1],a=this.chain_[2],o=this.chain_[3],s=this.chain_[4],c,l;for(let e=0;e<80;e++){e<40?e<20?(c=o^i&(a^o),l=1518500249):(c=i^a^o,l=1859775393):e<60?(c=i&a|o&(i|a),l=2400959708):(c=i^a^o,l=3395469782);let t=(r<<5|r>>>27)+c+s+l+n[e]&4294967295;s=o,o=a,a=(i<<30|i>>>2)&4294967295,i=r,r=t}this.chain_[0]=this.chain_[0]+r&4294967295,this.chain_[1]=this.chain_[1]+i&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+o&4294967295,this.chain_[4]=this.chain_[4]+s&4294967295}update(e,t){if(e==null)return;t===void 0&&(t=e.length);let n=t-this.blockSize,r=0,i=this.buf_,a=this.inbuf_;for(;r<t;){if(a===0)for(;r<=n;)this.compress_(e,r),r+=this.blockSize;if(typeof e==`string`){for(;r<t;)if(i[a]=e.charCodeAt(r),++a,++r,a===this.blockSize){this.compress_(i),a=0;break}}else for(;r<t;)if(i[a]=e[r],++a,++r,a===this.blockSize){this.compress_(i),a=0;break}}this.inbuf_=a,this.total_+=t}digest(){let e=[],t=this.total_*8;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let e=this.blockSize-1;e>=56;e--)this.buf_[e]=t&255,t/=256;this.compress_(this.buf_);let n=0;for(let t=0;t<5;t++)for(let r=24;r>=0;r-=8)e[n]=this.chain_[t]>>r&255,++n;return e}};function Qo(e,t){return`${e} failed: ${t} argument `}var $o=function(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i>=55296&&i<=56319){let t=i-55296;r++,j(r<e.length,`Surrogate pair missing trail surrogate.`);let n=e.charCodeAt(r)-56320;i=65536+(t<<10)+n}i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):i<65536?(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},es=function(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t++:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t};function ts(e){return e&&e._delegate?e._delegate:e}var ns=class{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,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}},rs=`[DEFAULT]`,is=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new bo;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){let t=this.normalizeInstanceIdentifier(e?.identifier),n=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}if(n)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(os(e))try{this.getOrInitializeService({instanceIdentifier:rs})}catch{}for(let[e,t]of this.instancesDeferred.entries()){let n=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch{}}}}clearInstance(e=rs){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>`INTERNAL`in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>`_delete`in e).map(e=>e._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=rs){return this.instances.has(e)}getOptions(e=rs){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(let[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){let n=this.normalizeInstanceIdentifier(t),r=this.onInitCallbacks.get(n)??new Set;r.add(e),this.onInitCallbacks.set(n,r);let i=this.instances.get(n);return i&&e(i,n),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){let n=this.onInitCallbacks.get(t);if(n)for(let r of n)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:as(e),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}return n||null}normalizeInstanceIdentifier(e=rs){return this.component?this.component.multipleInstances?e:rs:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!==`EXPLICIT`}};function as(e){return e===rs?void 0:e}function os(e){return e.instantiationMode===`EAGER`}var ss=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new is(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}},cs=[],N;(function(e){e[e.DEBUG=0]=`DEBUG`,e[e.VERBOSE=1]=`VERBOSE`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.SILENT=5]=`SILENT`})(N||={});var ls={debug:N.DEBUG,verbose:N.VERBOSE,info:N.INFO,warn:N.WARN,error:N.ERROR,silent:N.SILENT},us=N.INFO,ds={[N.DEBUG]:`log`,[N.VERBOSE]:`log`,[N.INFO]:`info`,[N.WARN]:`warn`,[N.ERROR]:`error`},fs=(e,t,...n)=>{if(t<e.logLevel)return;let r=new Date().toISOString(),i=ds[t];if(i)console[i](`[${r}] ${e.name}:`,...n);else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)},ps=class{constructor(e){this.name=e,this._logLevel=us,this._logHandler=fs,this._userLogHandler=null,cs.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in N))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e==`string`?ls[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!=`function`)throw 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,N.DEBUG,...e),this._logHandler(this,N.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,N.VERBOSE,...e),this._logHandler(this,N.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,N.INFO,...e),this._logHandler(this,N.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,N.WARN,...e),this._logHandler(this,N.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,N.ERROR,...e),this._logHandler(this,N.ERROR,...e)}},ms=(e,t)=>t.some(t=>e instanceof t),hs,gs;function _s(){return hs||=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]}function vs(){return gs||=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey]}var ys=new WeakMap,bs=new WeakMap,xs=new WeakMap,Ss=new WeakMap,Cs=new WeakMap;function ws(e){let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`success`,i),e.removeEventListener(`error`,a)},i=()=>{t(As(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener(`success`,i),e.addEventListener(`error`,a)});return t.then(t=>{t instanceof IDBCursor&&ys.set(t,e)}).catch(()=>{}),Cs.set(t,e),t}function Ts(e){if(bs.has(e))return;let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`complete`,i),e.removeEventListener(`error`,a),e.removeEventListener(`abort`,a)},i=()=>{t(),r()},a=()=>{n(e.error||new DOMException(`AbortError`,`AbortError`)),r()};e.addEventListener(`complete`,i),e.addEventListener(`error`,a),e.addEventListener(`abort`,a)});bs.set(e,t)}var Es={get(e,t,n){if(e instanceof IDBTransaction){if(t===`done`)return bs.get(e);if(t===`objectStoreNames`)return e.objectStoreNames||xs.get(e);if(t===`store`)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return As(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t===`done`||t===`store`)||t in e}};function Ds(e){Es=e(Es)}function Os(e){return e===IDBDatabase.prototype.transaction&&!(`objectStoreNames`in IDBTransaction.prototype)?function(t,...n){let r=e.call(js(this),t,...n);return xs.set(r,t.sort?t.sort():[t]),As(r)}:vs().includes(e)?function(...t){return e.apply(js(this),t),As(ys.get(this))}:function(...t){return As(e.apply(js(this),t))}}function ks(e){return typeof e==`function`?Os(e):(e instanceof IDBTransaction&&Ts(e),ms(e,_s())?new Proxy(e,Es):e)}function As(e){if(e instanceof IDBRequest)return ws(e);if(Ss.has(e))return Ss.get(e);let t=ks(e);return t!==e&&(Ss.set(e,t),Cs.set(t,e)),t}var js=e=>Cs.get(e);function Ms(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){let o=indexedDB.open(e,t),s=As(o);return r&&o.addEventListener(`upgradeneeded`,e=>{r(As(o.result),e.oldVersion,e.newVersion,As(o.transaction),e)}),n&&o.addEventListener(`blocked`,e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{a&&e.addEventListener(`close`,()=>a()),i&&e.addEventListener(`versionchange`,e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}var Ns=[`get`,`getKey`,`getAll`,`getAllKeys`,`count`],Ps=[`put`,`add`,`delete`,`clear`],Fs=new Map;function Is(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t==`string`))return;if(Fs.get(t))return Fs.get(t);let n=t.replace(/FromIndex$/,``),r=t!==n,i=Ps.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Ns.includes(n)))return;let a=async function(e,...t){let a=this.transaction(e,i?`readwrite`:`readonly`),o=a.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&a.done]))[0]};return Fs.set(t,a),a}Ds(e=>({...e,get:(t,n,r)=>Is(t,n)||e.get(t,n,r),has:(t,n)=>!!Is(t,n)||e.has(t,n)}));var Ls=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(Rs(e)){let t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(` `)}};function Rs(e){return e.getComponent()?.type===`VERSION`}var zs=`@firebase/app`,Bs=`0.14.6`,Vs=new ps(`@firebase/app`),Hs=`@firebase/app-compat`,Us=`@firebase/analytics-compat`,Ws=`@firebase/analytics`,Gs=`@firebase/app-check-compat`,Ks=`@firebase/app-check`,qs=`@firebase/auth`,Js=`@firebase/auth-compat`,Ys=`@firebase/database`,Xs=`@firebase/data-connect`,Zs=`@firebase/database-compat`,Qs=`@firebase/functions`,$s=`@firebase/functions-compat`,ec=`@firebase/installations`,tc=`@firebase/installations-compat`,nc=`@firebase/messaging`,rc=`@firebase/messaging-compat`,ic=`@firebase/performance`,ac=`@firebase/performance-compat`,oc=`@firebase/remote-config`,sc=`@firebase/remote-config-compat`,cc=`@firebase/storage`,lc=`@firebase/storage-compat`,uc=`@firebase/firestore`,dc=`@firebase/ai`,fc=`@firebase/firestore-compat`,pc=`firebase`,mc=`12.6.0`,hc=`[DEFAULT]`,gc={[zs]:`fire-core`,[Hs]:`fire-core-compat`,[Ws]:`fire-analytics`,[Us]:`fire-analytics-compat`,[Ks]:`fire-app-check`,[Gs]:`fire-app-check-compat`,[qs]:`fire-auth`,[Js]:`fire-auth-compat`,[Ys]:`fire-rtdb`,[Xs]:`fire-data-connect`,[Zs]:`fire-rtdb-compat`,[Qs]:`fire-fn`,[$s]:`fire-fn-compat`,[ec]:`fire-iid`,[tc]:`fire-iid-compat`,[nc]:`fire-fcm`,[rc]:`fire-fcm-compat`,[ic]:`fire-perf`,[ac]:`fire-perf-compat`,[oc]:`fire-rc`,[sc]:`fire-rc-compat`,[cc]:`fire-gcs`,[lc]:`fire-gcs-compat`,[uc]:`fire-fst`,[fc]:`fire-fst-compat`,[dc]:`fire-vertex`,"fire-js":`fire-js`,[pc]:`fire-js-all`},_c=new Map,vc=new Map,yc=new Map;function bc(e,t){try{e.container.addComponent(t)}catch(n){Vs.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function xc(e){let t=e.name;if(yc.has(t))return Vs.debug(`There were multiple attempts to register component ${t}.`),!1;yc.set(t,e);for(let t of _c.values())bc(t,e);for(let t of vc.values())bc(t,e);return!0}function Sc(e,t){let n=e.container.getProvider(`heartbeat`).getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Cc(e){return e!=null&&e.settings!==void 0}var wc=new Lo(`app`,`Firebase`,{"no-app":`No Firebase App '{$appName}' has been created - call initializeApp() first`,"bad-app-name":`Illegal App name: '{$appName}'`,"duplicate-app":`Firebase App named '{$appName}' already exists with different options or config`,"app-deleted":`Firebase App named '{$appName}' already deleted`,"server-app-deleted":`Firebase Server App has been deleted`,"no-options":`Need to provide options, when not being deployed to hosting via source.`,"invalid-app-argument":`firebase.{$appName}() takes either no argument or a Firebase App instance.`,"invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":`Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.`,"idb-get":`Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.`,"idb-set":`Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.`,"idb-delete":`Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.`,"finalization-registry-not-supported":`FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.`,"invalid-server-app-environment":`FirebaseServerApp is not for use in browser environments.`}),Tc=class{constructor(e,t,n){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new ns(`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 wc.create(`app-deleted`,{appName:this._name})}},Ec=mc;function Dc(e,t={}){let n=e;typeof t!=`object`&&(t={name:t});let r={name:hc,automaticDataCollectionEnabled:!0,...t},i=r.name;if(typeof i!=`string`||!i)throw wc.create(`bad-app-name`,{appName:String(i)});if(n||=yo(),!n)throw wc.create(`no-options`);let a=_c.get(i);if(a){if(Jo(n,a.options)&&Jo(r,a.config))return a;throw wc.create(`duplicate-app`,{appName:i})}let o=new ss(i);for(let e of yc.values())o.addComponent(e);let s=new Tc(n,r,o);return _c.set(i,s),s}function Oc(e=hc){let t=_c.get(e);if(!t&&e===`[DEFAULT]`&&yo())return Dc();if(!t)throw wc.create(`no-app`,{appName:e});return t}function kc(e,t,n){let r=gc[e]??e;n&&(r+=`-${n}`);let i=r.match(/\s|\//),a=t.match(/\s|\//);if(i||a){let e=[`Unable to register library "${r}" with version "${t}":`];i&&e.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&a&&e.push(`and`),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Vs.warn(e.join(` `));return}xc(new ns(`${r}-version`,()=>({library:r,version:t}),`VERSION`))}var Ac=`firebase-heartbeat-database`,jc=1,Mc=`firebase-heartbeat-store`,Nc=null;function Pc(){return Nc||=Ms(Ac,jc,{upgrade:(e,t)=>{if(t===0)try{e.createObjectStore(Mc)}catch(e){console.warn(e)}}}).catch(e=>{throw wc.create(`idb-open`,{originalErrorMessage:e.message})}),Nc}async function Fc(e){try{let t=(await Pc()).transaction(Mc),n=await t.objectStore(Mc).get(Lc(e));return await t.done,n}catch(e){if(e instanceof Io)Vs.warn(e.message);else{let t=wc.create(`idb-get`,{originalErrorMessage:e?.message});Vs.warn(t.message)}}}async function Ic(e,t){try{let n=(await Pc()).transaction(Mc,`readwrite`);await n.objectStore(Mc).put(t,Lc(e)),await n.done}catch(e){if(e instanceof Io)Vs.warn(e.message);else{let t=wc.create(`idb-set`,{originalErrorMessage:e?.message});Vs.warn(t.message)}}}function Lc(e){return`${e.name}!${e.options.appId}`}var Rc=1024,zc=30,Bc=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider(`app`).getImmediate();this._storage=new Uc(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{let e=this.container.getProvider(`platform-logger`).getImmediate().getPlatformInfoString(),t=Vc();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>zc){let e=Gc(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){Vs.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return``;let e=Vc(),{heartbeatsToSend:t,unsentEntries:n}=Hc(this._heartbeatsCache.heartbeats),r=oo(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(e){return Vs.warn(e),``}}};function Vc(){return new Date().toISOString().substring(0,10)}function Hc(e,t=Rc){let n=[],r=e.slice();for(let i of e){let e=n.find(e=>e.agent===i.agent);if(!e){if(n.push({agent:i.agent,dates:[i.date]}),Wc(n)>t){n.pop();break}}else if(e.dates.push(i.date),Wc(n)>t){e.dates.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}var Uc=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return No()?Po().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){let e=await Fc(this.app);return e?.heartbeats?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return Ic(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return Ic(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}};function Wc(e){return oo(JSON.stringify({version:2,heartbeats:e})).length}function Gc(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}function Kc(e){xc(new ns(`platform-logger`,e=>new Ls(e),`PRIVATE`)),xc(new ns(`heartbeat`,e=>new Bc(e),`PRIVATE`)),kc(zs,Bs,e),kc(zs,Bs,`esm2020`),kc(`fire-js`,``)}Kc(``),kc(`firebase`,`12.6.0`,`app`);var qc=`@firebase/database`,Jc=`1.1.0`,Yc=``;function Xc(e){Yc=e}var Zc=class{constructor(e){this.domStorage_=e,this.prefix_=`firebase:`}set(e,t){t==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),M(t))}get(e){let t=this.domStorage_.getItem(this.prefixedName_(e));return t==null?null:Bo(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}},Qc=class{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){t==null?delete this.cache_[e]:this.cache_[e]=t}get(e){return Wo(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}},$c=function(e){try{if(typeof window<`u`&&window[e]!==void 0){let t=window[e];return t.setItem(`firebase:sentinel`,`cache`),t.removeItem(`firebase:sentinel`),new Zc(t)}}catch{}return new Qc},el=$c(`localStorage`),tl=$c(`sessionStorage`),nl=new ps(`@firebase/database`),rl=(function(){let e=1;return function(){return e++}})(),il=function(e){let t=$o(e),n=new Zo;n.update(t);let r=n.digest();return ro.encodeByteArray(r)},al=function(...e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];Array.isArray(r)||r&&typeof r==`object`&&typeof r.length==`number`?t+=al.apply(null,r):t+=typeof r==`object`?M(r):r,t+=` `}return t},ol=null,sl=!0,cl=function(e,t){j(!t||e===!0||e===!1,`Can't turn on custom loggers persistently.`),e===!0?(nl.logLevel=N.VERBOSE,ol=nl.log.bind(nl),t&&tl.set(`logging_enabled`,!0)):typeof e==`function`?ol=e:(ol=null,tl.remove(`logging_enabled`))},P=function(...e){if(sl===!0&&(sl=!1,ol===null&&tl.get(`logging_enabled`)===!0&&cl(!0)),ol){let t=al.apply(null,e);ol(t)}},ll=function(e){return function(...t){P(e,...t)}},ul=function(...e){let t=`FIREBASE INTERNAL ERROR: `+al(...e);nl.error(t)},F=function(...e){let t=`FIREBASE FATAL ERROR: ${al(...e)}`;throw nl.error(t),Error(t)},I=function(...e){let t=`FIREBASE WARNING: `+al(...e);nl.warn(t)},dl=function(){typeof window<`u`&&window.location&&window.location.protocol&&window.location.protocol.indexOf(`https:`)!==-1&&I(`Insecure Firebase access from a secure page. Please use https in calls to new Firebase().`)},fl=function(e){return typeof e==`number`&&(e!==e||e===1/0||e===-1/0)},pl=function(e){if(Mo()||document.readyState===`complete`)e();else{let t=!1,n=function(){if(!document.body){setTimeout(n,10);return}t||(t=!0,e())};document.addEventListener?(document.addEventListener(`DOMContentLoaded`,n,!1),window.addEventListener(`load`,n,!1)):document.attachEvent&&(document.attachEvent(`onreadystatechange`,()=>{document.readyState===`complete`&&n()}),window.attachEvent(`onload`,n))}},ml=`[MIN_NAME]`,hl=`[MAX_NAME]`,gl=function(e,t){if(e===t)return 0;if(e===ml||t===hl)return-1;if(t===ml||e===hl)return 1;{let n=Ol(e),r=Ol(t);return n===null?r===null&&e<t?-1:1:r===null?-1:n-r===0?e.length-t.length:n-r}},_l=function(e,t){return e===t?0:e<t?-1:1},vl=function(e,t){if(t&&e in t)return t[e];throw Error(`Missing required key (`+e+`) in object: `+M(t))},yl=function(e){if(typeof e!=`object`||!e)return M(e);let t=[];for(let n in e)t.push(n);
17t.sort();let n=`{`;for(let r=0;r<t.length;r++)r!==0&&(n+=`,`),n+=M(t[r]),n+=`:`,n+=yl(e[t[r]]);return n+=`}`,n},bl=function(e,t){let n=e.length;if(n<=t)return[e];let r=[];for(let i=0;i<n;i+=t)i+t>n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r};function L(e,t){for(let n in e)e.hasOwnProperty(n)&&t(n,e[n])}var xl=function(e){j(!fl(e),`Invalid JSON number`);let t=1023,n,r,i,a,o;e===0?(r=0,i=0,n=+(1/e==-1/0)):(n=e<0,e=Math.abs(e),e>=2**-1022?(a=Math.min(Math.floor(Math.log(e)/Math.LN2),t),r=a+t,i=Math.round(e*2**(52-a)-2**52)):(r=0,i=Math.round(e/2**-1074)));let s=[];for(o=52;o;--o)s.push(i%2?1:0),i=Math.floor(i/2);for(o=11;o;--o)s.push(r%2?1:0),r=Math.floor(r/2);s.push(+!!n),s.reverse();let c=s.join(``),l=``;for(o=0;o<64;o+=8){let e=parseInt(c.substr(o,8),2).toString(16);e.length===1&&(e=`0`+e),l+=e}return l.toLowerCase()},Sl=function(){return!!(typeof window==`object`&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},Cl=function(){return typeof Windows==`object`&&typeof Windows.UI==`object`};function wl(e,t){let n=`Unknown Error`;e===`too_big`?n=`The data requested exceeds the maximum size that can be accessed with a single request.`:e===`permission_denied`?n=`Client doesn't have permission to access the desired data.`:e===`unavailable`&&(n=`The service is unavailable`);let r=Error(e+` at `+t._path.toString()+`: `+n);return r.code=e.toUpperCase(),r}var Tl=RegExp(`^-?(0*)\\d{1,10}$`),El=-2147483648,Dl=2147483647,Ol=function(e){if(Tl.test(e)){let t=Number(e);if(t>=El&&t<=Dl)return t}return null},kl=function(e){try{e()}catch(e){setTimeout(()=>{throw I(`Exception was thrown by user callback.`,e.stack||``),e},0)}},Al=function(){return(typeof window==`object`&&window.navigator&&window.navigator.userAgent||``).search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},jl=function(e,t){let n=setTimeout(e,t);
vendor: 55,557 bytes, lines 17-20
17return typeof n==`number`&&typeof Deno<`u`&&Deno.unrefTimer?Deno.unrefTimer(n):typeof n==`object`&&n.unref&&n.unref(),n},Ml=class{constructor(e,t){this.appCheckProvider=t,this.appName=e.name,Cc(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=t?.getImmediate({optional:!0}),this.appCheck||t?.get().then(e=>this.appCheck=e)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((t,n)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(t,n):t(null)},0)})}addTokenChangeListener(e){this.appCheckProvider?.get().then(t=>t.addTokenListener(e))}notifyForInvalidToken(){I(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}},Nl=class{constructor(e,t,n){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit(e=>this.auth_=e)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(e=>e&&e.code===`auth/token-not-initialized`?(P(`Got auth/token-not-initialized error. Treating as null token.`),null):Promise.reject(e)):new Promise((t,n)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(t,n):t(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(t=>t.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(t=>t.removeAuthTokenListener(e))}notifyForInvalidToken(){let e=`Provided authentication credentials for the app named "`+this.appName_+`" are invalid. This usually indicates your app was not initialized correctly. `;`credential`in this.firebaseOptions_?e+=`Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.`:`serviceAccount`in this.firebaseOptions_?e+=`Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.`:e+=`Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.`,I(e)}},Pl=class{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}};Pl.OWNER=`owner`;var Fl=`5`,Il=`v`,Ll=`s`,Rl=`r`,zl=`f`,Bl=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Vl=`ls`,Hl=`p`,Ul=`ac`,Wl=`websocket`,Gl=`long_polling`,Kl=class{constructor(e,t,n,r,i=!1,a=``,o=!1,s=!1,c=null){this.secure=t,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=a,this.includeNamespaceInQueryParams=o,this.isUsingEmulator=s,this.emulatorOptions=c,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(`.`)+1),this.internalHost=el.get(`host:`+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)===`s-`}isCustomHost(){return this._domain!==`firebaseio.com`&&this._domain!==`firebaseio-demo.com`}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&el.set(`host:`+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+=`<`+this.persistenceKey+`>`),e}toURLString(){let e=this.secure?`https://`:`http://`,t=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:``;return`${e}${this.host}/${t}`}};function ql(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams}function Jl(e,t,n){j(typeof t==`string`,`typeof type must == string`),j(typeof n==`object`,`typeof params must == object`);let r;if(t===Wl)r=(e.secure?`wss://`:`ws://`)+e.internalHost+`/.ws?`;else if(t===Gl)r=(e.secure?`https://`:`http://`)+e.internalHost+`/.lp?`;else throw Error(`Unknown connection type: `+t);ql(e)&&(n.ns=e.namespace);let i=[];return L(n,(e,t)=>{i.push(e+`=`+t)}),r+i.join(`&`)}var Yl=class{constructor(){this.counters_={}}incrementCounter(e,t=1){Wo(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return co(this.counters_)}},Xl={},Zl={};function Ql(e){let t=e.toString();return Xl[t]||(Xl[t]=new Yl),Xl[t]}function $l(e,t){let n=e.toString();return Zl[n]||(Zl[n]=t()),Zl[n]}var eu=class{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,t){for(this.pendingResponses[e]=t;this.pendingResponses[this.currentResponseNum];){let e=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let t=0;t<e.length;++t)e[t]&&kl(()=>{this.onMessage_(e[t])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&=(this.onClose(),null);break}this.currentResponseNum++}}},tu=`start`,nu=`close`,ru=`pLPCommand`,iu=`pRTLPCB`,au=`id`,ou=`pw`,su=`ser`,cu=`cb`,lu=`dframe`,uu=1870,du=30,fu=1840,pu=25e3,mu=3e4,hu=class e{constructor(e,t,n,r,i,a,o){this.connId=e,this.repoInfo=t,this.applicationId=n,this.appCheckToken=r,this.authToken=i,this.transportSessionId=a,this.lastSessionId=o,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=ll(e),this.stats_=Ql(t),this.urlFn=e=>(this.appCheckToken&&(e[Ul]=this.appCheckToken),Jl(t,Gl,e))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new eu(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_(`Timed out trying to connect.`),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(mu)),pl(()=>{if(this.isClosed_)return;this.scriptTagHolder=new gu((...e)=>{let[t,n,r,i,a]=e;if(this.incrementIncomingBytes_(e),this.scriptTagHolder)if(this.connectTimeoutTimer_&&=(clearTimeout(this.connectTimeoutTimer_),null),this.everConnected_=!0,t===tu)this.id=n,this.password=r;else if(t===nu)n?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(n,()=>{this.onClosed_()})):this.onClosed_();else throw Error(`Unrecognized command received: `+t)},(...e)=>{let[t,n]=e;this.incrementIncomingBytes_(e),this.myPacketOrderer.handleResponse(t,n)},()=>{this.onClosed_()},this.urlFn);let e={};e[tu]=`t`,e[su]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(e[cu]=this.scriptTagHolder.uniqueCallbackIdentifier),e[Il]=Fl,this.transportSessionId&&(e[Ll]=this.transportSessionId),this.lastSessionId&&(e[Vl]=this.lastSessionId),this.applicationId&&(e[Hl]=this.applicationId),this.appCheckToken&&(e[Ul]=this.appCheckToken),typeof location<`u`&&location.hostname&&Bl.test(location.hostname)&&(e[Rl]=zl);let t=this.urlFn(e);this.log_(`Connecting via long-poll to `+t),this.scriptTagHolder.addTag(t,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){e.forceAllow_=!0}static forceDisallow(){e.forceDisallow_=!0}static isAvailable(){return Mo()?!1:e.forceAllow_?!0:!e.forceDisallow_&&typeof document<`u`&&document.createElement!=null&&!Sl()&&!Cl()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&=(this.scriptTagHolder.close(),null),this.myDisconnFrame&&=(document.body.removeChild(this.myDisconnFrame),null),this.connectTimeoutTimer_&&=(clearTimeout(this.connectTimeoutTimer_),null)}onClosed_(){this.isClosed_||(this.log_(`Longpoll is closing itself`),this.shutdown_(),this.onDisconnect_&&=(this.onDisconnect_(this.everConnected_),null))}close(){this.isClosed_||(this.log_(`Longpoll is being closed.`),this.shutdown_())}send(e){let t=M(e);this.bytesSent+=t.length,this.stats_.incrementCounter(`bytes_sent`,t.length);let n=bl(ao(t),fu);for(let e=0;e<n.length;e++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,n.length,n[e]),this.curSegmentNum++}addDisconnectPingFrame(e,t){if(Mo())return;this.myDisconnFrame=document.createElement(`iframe`);let n={};n[lu]=`t`,n[au]=e,n[ou]=t,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display=`none`,document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){let t=M(e).length;this.bytesReceived+=t,this.stats_.incrementCounter(`bytes_received`,t)}},gu=class e{constructor(t,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0,Mo())this.commandCB=t,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=rl(),window[ru+this.uniqueCallbackIdentifier]=t,window[iu+this.uniqueCallbackIdentifier]=n,this.myIFrame=e.createIFrame_();let r=``;this.myIFrame.src&&this.myIFrame.src.substr(0,11)===`javascript:`&&(r=`<script>document.domain="`+document.domain+`";<\/script>`);let i=`<html><body>`+r+`</body></html>`;try{this.myIFrame.doc.open(),this.myIFrame.doc.write(i),this.myIFrame.doc.close()}catch(e){P(`frame writing exception`),e.stack&&P(e.stack),P(e)}}}static createIFrame_(){let e=document.createElement(`iframe`);if(e.style.display=`none`,document.body){document.body.appendChild(e);try{e.contentWindow.document||P(`No IE domain setting required`)}catch{e.src=`javascript:void((function(){document.open();document.domain='`+document.domain+`';document.close();})())`}}else throw`Document body has not initialized. Wait to initialize Firebase until after the document is ready.`;return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent=``,setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},0));let e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;let e={};e[au]=this.myID,e[ou]=this.myPW,e[su]=this.currentSerial;let t=this.urlFn(e),n=``,r=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+du+n.length<=uu;){let e=this.pendingSegs.shift();n=n+`&seg`+r+`=`+e.seg+`&ts`+r+`=`+e.ts+`&d`+r+`=`+e.d,r++}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1}enqueueSegment(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);let n=()=>{this.outstandingRequests.delete(t),this.newRequest_()},r=setTimeout(n,Math.floor(pu));this.addTag(e,()=>{clearTimeout(r),n()})}addTag(e,t){Mo()?this.doNodeLongPoll(e,t):setTimeout(()=>{try{if(!this.sendNewPolls)return;let n=this.myIFrame.doc.createElement(`script`);n.type=`text/javascript`,n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){let e=n.readyState;(!e||e===`loaded`||e===`complete`)&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),t())},n.onerror=()=>{P(`Long-poll script failed to load: `+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(n)}catch{}},1)}},_u=16384,vu=45e3,yu=null;typeof MozWebSocket<`u`?yu=MozWebSocket:typeof WebSocket<`u`&&(yu=WebSocket);var bu=class e{constructor(t,n,r,i,a,o,s){this.connId=t,this.applicationId=r,this.appCheckToken=i,this.authToken=a,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=ll(this.connId),this.stats_=Ql(n),this.connURL=e.connectionURL_(n,o,s,i,r),this.nodeAdmin=n.nodeAdmin}static connectionURL_(e,t,n,r,i){let a={};return a[Il]=Fl,!Mo()&&typeof location<`u`&&location.hostname&&Bl.test(location.hostname)&&(a[Rl]=zl),t&&(a[Ll]=t),n&&(a[Vl]=n),r&&(a[Ul]=r),i&&(a[Hl]=i),Jl(e,Wl,a)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_(`Websocket connecting to `+this.connURL),this.everConnected_=!1,el.set(`previous_websocket_failure`,!0);try{let e;if(Mo()){let t=this.nodeAdmin?`AdminNode`:`Node`;e={headers:{"User-Agent":`Firebase/${Fl}/${Yc}/${process.platform}/${t}`,"X-Firebase-GMPID":this.applicationId||``}},this.authToken&&(e.headers.Authorization=`Bearer ${this.authToken}`),this.appCheckToken&&(e.headers[`X-Firebase-AppCheck`]=this.appCheckToken);let n={},r=this.connURL.indexOf(`wss://`)===0?n.HTTPS_PROXY||n.https_proxy:n.HTTP_PROXY||n.http_proxy;r&&(e.proxy={origin:r})}this.mySock=new yu(this.connURL,[],e)}catch(e){this.log_(`Error instantiating WebSocket.`);let t=e.message||e.data;t&&this.log_(t),this.onClosed_();return}this.mySock.onopen=()=>{this.log_(`Websocket connected.`),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_(`Websocket connection was disconnected.`),this.mySock=null,this.onClosed_()},this.mySock.onmessage=e=>{this.handleIncomingFrame(e)},this.mySock.onerror=e=>{this.log_(`WebSocket error. Closing connection.`);let t=e.message||e.data;t&&this.log_(t),this.onClosed_()}}start(){}static forceDisallow(){e.forceDisallow_=!0}static isAvailable(){let t=!1;if(typeof navigator<`u`&&navigator.userAgent){let e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&e.length>1&&parseFloat(e[1])<4.4&&(t=!0)}return!t&&yu!==null&&!e.forceDisallow_}static previouslyFailed(){return el.isInMemoryStorage||el.get(`previous_websocket_failure`)===!0}markConnectionHealthy(){el.remove(`previous_websocket_failure`)}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){let e=this.frames.join(``);this.frames=null;let t=Bo(e);this.onMessage(t)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(j(this.frames===null,`We already have a frame buffer`),e.length<=6){let t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(this.mySock===null)return;let t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter(`bytes_received`,t.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(t);else{let e=this.extractFrameCount_(t);e!==null&&this.appendFrame_(e)}}send(e){this.resetKeepAlive();let t=M(e);this.bytesSent+=t.length,this.stats_.incrementCounter(`bytes_sent`,t.length);let n=bl(t,_u);n.length>1&&this.sendString_(String(n.length));for(let e=0;e<n.length;e++)this.sendString_(n[e])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&=(clearInterval(this.keepaliveTimer),null),this.mySock&&=(this.mySock.close(),null)}onClosed_(){this.isClosed_||(this.log_(`WebSocket is closing itself`),this.shutdown_(),this.onDisconnect&&=(this.onDisconnect(this.everConnected_),null))}close(){this.isClosed_||(this.log_(`WebSocket is being closed`),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_(`0`),this.resetKeepAlive()},Math.floor(vu))}sendString_(e){try{this.mySock.send(e)}catch(e){this.log_(`Exception thrown from WebSocket.send():`,e.message||e.data,`Closing connection.`),setTimeout(this.onClosed_.bind(this),0)}}};bu.responsesRequiredToBeHealthy=2,bu.healthyTimeout=3e4;var xu=class e{static get ALL_TRANSPORTS(){return[hu,bu]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(t){let n=bu&&bu.isAvailable(),r=n&&!bu.previouslyFailed();if(t.webSocketOnly&&(n||I(`wss:// URL used, but browser isn't known to support websockets. Trying anyway.`),r=!0),r)this.transports_=[bu];else{let t=this.transports_=[];for(let n of e.ALL_TRANSPORTS)n&&n.isAvailable()&&t.push(n);e.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw Error(`No transports available`)}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}};xu.globalTransportInitialized_=!1;var Su=6e4,Cu=5e3,wu=10240,Tu=102400,Eu=`t`,Du=`d`,Ou=`s`,ku=`r`,Au=`e`,ju=`o`,Mu=`a`,Nu=`n`,Pu=`p`,Fu=`h`,Iu=class{constructor(e,t,n,r,i,a,o,s,c,l){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.appCheckToken_=r,this.authToken_=i,this.onMessage_=a,this.onReady_=o,this.onDisconnect_=s,this.onKill_=c,this.lastSessionId=l,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=ll(`c:`+this.id+`:`),this.transportManager_=new xu(t),this.log_(`Connection created`),this.start_()}start_(){let e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let t=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(t,n)},0);let r=e.healthyTimeout||0;r>0&&(this.healthyTimeout_=jl(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>Tu?(this.log_(`Connection exceeded healthy timeout but has received `+this.conn_.bytesReceived+` bytes. Marking connection healthy.`),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>wu?this.log_(`Connection exceeded healthy timeout but has sent `+this.conn_.bytesSent+` bytes. Leaving connection alive.`):(this.log_(`Closing unhealthy connection after timeout.`),this.close()))},Math.floor(r)))}nextTransportId_(){return`c:`+this.id+`:`+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_(`Secondary connection lost.`),this.onSecondaryConnectionLost_()):this.log_(`closing an old connection`)}}connReceiver_(e){return t=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_(`message on old connection`))}}sendRequest(e){let t={t:`d`,d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_(`cleaning up and promoting a connection: `+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(Eu in e){let t=e[Eu];t===Mu?this.upgradeIfSecondaryHealthy_():t===ku?(this.log_(`Got a reset on secondary, closing it`),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):t===ju&&(this.log_(`got pong on secondary.`),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){let t=vl(`t`,e),n=vl(`d`,e);if(t===`c`)this.onSecondaryControl_(n);else if(t===`d`)this.pendingDataMessages.push(n);else throw Error(`Unknown protocol layer: `+t)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_(`Secondary connection is healthy.`),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_(`sending ping on secondary.`),this.secondaryConn_.send({t:`c`,d:{t:Pu,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_(`sending client ack on secondary`),this.secondaryConn_.send({t:`c`,d:{t:Mu,d:{}}}),this.log_(`Ending transmission on primary`),this.conn_.send({t:`c`,d:{t:Nu,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){let t=vl(`t`,e),n=vl(`d`,e);t===`c`?this.onControl_(n):t===`d`&&this.onDataMessage_(n)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_(`Primary connection is healthy.`),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){let t=vl(Eu,e);if(Du in e){let n=e[Du];if(t===Fu){let e={...n};this.repoInfo_.isUsingEmulator&&(e.h=this.repoInfo_.host),this.onHandshake_(e)}else if(t===Nu){this.log_(`recvd end transmission on primary`),this.rx_=this.secondaryConn_;for(let e=0;e<this.pendingDataMessages.length;++e)this.onDataMessage_(this.pendingDataMessages[e]);this.pendingDataMessages=[],this.tryCleanupConnection()}else t===Ou?this.onConnectionShutdown_(n):t===ku?this.onReset_(n):t===Au?ul(`Server Error: `+n):t===ju?(this.log_(`got pong on primary.`),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):ul(`Unknown control packet command: `+t)}}onHandshake_(e){let t=e.ts,n=e.v,r=e.h;this.sessionId=e.s,this.repoInfo_.host=r,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),Fl!==n&&I(`Protocol version mismatch detected`),this.tryStartUpgrade_())}tryStartUpgrade_(){let e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let t=this.connReceiver_(this.secondaryConn_),n=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(t,n),jl(()=>{this.secondaryConn_&&(this.log_(`Timed out trying to upgrade.`),this.secondaryConn_.close())},Math.floor(Su))}onReset_(e){this.log_(`Reset packet received. New host: `+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_(`Realtime connection established.`),this.conn_=e,this.state_=1,this.onReady_&&=(this.onReady_(t,this.sessionId),null),this.primaryResponsesRequired_===0?(this.log_(`Primary connection is healthy.`),this.isHealthy_=!0):jl(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(Cu))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_(`sending ping on primary.`),this.sendData_({t:`c`,d:{t:Pu,d:{}}}))}onSecondaryConnectionLost_(){let e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_(`Realtime connection failed.`),this.repoInfo_.isCacheableHost()&&(el.remove(`host:`+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_(`Realtime connection lost.`),this.close()}onConnectionShutdown_(e){this.log_(`Connection shutdown command received. Shutting down...`),this.onKill_&&=(this.onKill_(e),null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw`Connection is not connected`;this.tx_.send(e)}close(){this.state_!==2&&(this.log_(`Closing realtime connection.`),this.state_=2,this.closeConnections_(),this.onDisconnect_&&=(this.onDisconnect_(),null))}closeConnections_(){this.log_(`Shutting down all connections`),this.conn_&&=(this.conn_.close(),null),this.secondaryConn_&&=(this.secondaryConn_.close(),null),this.healthyTimeout_&&=(clearTimeout(this.healthyTimeout_),null)}},Lu=class{put(e,t,n,r){}merge(e,t,n,r){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,n){}onDisconnectMerge(e,t,n){}onDisconnectCancel(e,t){}reportStats(e){}},Ru=class{constructor(e){this.allowedEvents_=e,this.listeners_={},j(Array.isArray(e)&&e.length>0,`Requires a non-empty array`)}trigger(e,...t){if(Array.isArray(this.listeners_[e])){let n=[...this.listeners_[e]];for(let e=0;e<n.length;e++)n[e].callback.apply(n[e].context,t)}}on(e,t,n){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:n});let r=this.getInitialEvent(e);r&&t.apply(n,r)}off(e,t,n){this.validateEventType_(e);let r=this.listeners_[e]||[];for(let e=0;e<r.length;e++)if(r[e].callback===t&&(!n||n===r[e].context)){r.splice(e,1);return}}validateEventType_(e){j(this.allowedEvents_.find(t=>t===e),`Unknown event: `+e)}},zu=class e extends Ru{static getInstance(){return new e}constructor(){super([`online`]),this.online_=!0,typeof window<`u`&&window.addEventListener!==void 0&&!Ao()&&(window.addEventListener(`online`,()=>{this.online_||(this.online_=!0,this.trigger(`online`,!0))},!1),window.addEventListener(`offline`,()=>{this.online_&&(this.online_=!1,this.trigger(`online`,!1))},!1))}getInitialEvent(e){return j(e===`online`,`Unknown event type: `+e),[this.online_]}currentlyOnline(){return this.online_}},Bu=32,Vu=768,R=class{constructor(e,t){if(t===void 0){this.pieces_=e.split(`/`);let t=0;for(let e=0;e<this.pieces_.length;e++)this.pieces_[e].length>0&&(this.pieces_[t]=this.pieces_[e],t++);this.pieces_.length=t,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e=``;for(let t=this.pieceNum_;t<this.pieces_.length;t++)this.pieces_[t]!==``&&(e+=`/`+this.pieces_[t]);return e||`/`}};function z(){return new R(``)}function B(e){return e.pieceNum_>=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function Hu(e){return e.pieces_.length-e.pieceNum_}function V(e){let t=e.pieceNum_;return t<e.pieces_.length&&t++,new R(e.pieces_,t)}function Uu(e){return e.pieceNum_<e.pieces_.length?e.pieces_[e.pieces_.length-1]:null}function Wu(e){let t=``;for(let n=e.pieceNum_;n<e.pieces_.length;n++)e.pieces_[n]!==``&&(t+=`/`+encodeURIComponent(String(e.pieces_[n])));return t||`/`}function Gu(e,t=0){return e.pieces_.slice(e.pieceNum_+t)}function Ku(e){if(e.pieceNum_>=e.pieces_.length)return null;let t=[];for(let n=e.pieceNum_;n<e.pieces_.length-1;n++)t.push(e.pieces_[n]);return new R(t,0)}function H(e,t){let n=[];for(let t=e.pieceNum_;t<e.pieces_.length;t++)n.push(e.pieces_[t]);if(t instanceof R)for(let e=t.pieceNum_;e<t.pieces_.length;e++)n.push(t.pieces_[e]);else{let e=t.split(`/`);for(let t=0;t<e.length;t++)e[t].length>0&&n.push(e[t])}return new R(n,0)}function U(e){return e.pieceNum_>=e.pieces_.length}function W(e,t){let n=B(e),r=B(t);if(n===null)return t;if(n===r)return W(V(e),V(t));throw Error(`INTERNAL ERROR: innerPath (`+t+`) is not within outerPath (`+e+`)`)}function qu(e,t){if(Hu(e)!==Hu(t))return!1;for(let n=e.pieceNum_,r=t.pieceNum_;n<=e.pieces_.length;n++,r++)if(e.pieces_[n]!==t.pieces_[r])return!1;return!0}function G(e,t){let n=e.pieceNum_,r=t.pieceNum_;if(Hu(e)>Hu(t))return!1;for(;n<e.pieces_.length;){if(e.pieces_[n]!==t.pieces_[r])return!1;++n,++r}return!0}var Ju=class{constructor(e,t){this.errorPrefix_=t,this.parts_=Gu(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let e=0;e<this.parts_.length;e++)this.byteLength_+=es(this.parts_[e]);Zu(this)}};function Yu(e,t){e.parts_.length>0&&(e.byteLength_+=1),e.parts_.push(t),e.byteLength_+=es(t),Zu(e)}function Xu(e){let t=e.parts_.pop();e.byteLength_-=es(t),e.parts_.length>0&&--e.byteLength_}function Zu(e){if(e.byteLength_>Vu)throw Error(e.errorPrefix_+`has a key path longer than 768 bytes (`+e.byteLength_+`).`);if(e.parts_.length>Bu)throw Error(e.errorPrefix_+`path specified exceeds the maximum depth that can be written (32) or object contains a cycle `+Qu(e))}function Qu(e){return e.parts_.length===0?``:`in property '`+e.parts_.join(`.`)+`'`}var $u=class e extends Ru{static getInstance(){return new e}constructor(){super([`visible`]);let e,t;typeof document<`u`&&document.addEventListener!==void 0&&(document.hidden===void 0?document.mozHidden===void 0?document.msHidden===void 0?document.webkitHidden!==void 0&&(t=`webkitvisibilitychange`,e=`webkitHidden`):(t=`msvisibilitychange`,e=`msHidden`):(t=`mozvisibilitychange`,e=`mozHidden`):(t=`visibilitychange`,e=`hidden`)),this.visible_=!0,t&&document.addEventListener(t,()=>{let t=!document[e];t!==this.visible_&&(this.visible_=t,this.trigger(`visible`,t))},!1)}getInitialEvent(e){return j(e===`visible`,`Unknown event type: `+e),[this.visible_]}},ed=1e3,td=3e5,nd=3e4,rd=1.3,id=3e4,ad=`server_kill`,od=3,sd=class e extends Lu{constructor(t,n,r,i,a,o,s,c){if(super(),this.repoInfo_=t,this.applicationId_=n,this.onDataUpdate_=r,this.onConnectStatus_=i,this.onServerInfoUpdate_=a,this.authTokenProvider_=o,this.appCheckTokenProvider_=s,this.authOverride_=c,this.id=e.nextPersistentConnectionId_++,this.log_=ll(`p:`+this.id+`:`),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=ed,this.maxReconnectDelay_=td,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,c&&!Mo())throw Error(`Auth override specified in options, but not supported on non Node.js platforms`);$u.getInstance().on(`visible`,this.onVisible_,this),t.host.indexOf(`fblocal`)===-1&&zu.getInstance().on(`online`,this.onOnline_,this)}sendRequest(e,t,n){let r=++this.requestNumber_,i={r,a:e,b:t};this.log_(M(i)),j(this.connected_,`sendRequest call when we're not connected not allowed.`),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)}get(e){this.initConnection_();let t=new bo,n={action:`g`,request:{p:e._path.toString(),q:e._queryObject},onComplete:e=>{let n=e.d;e.s===`ok`?t.resolve(n):t.reject(n)}};this.outstandingGets_.push(n),this.outstandingGetCount_++;let r=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(r),t.promise}listen(e,t,n,r){this.initConnection_();let i=e._queryIdentifier,a=e._path.toString();this.log_(`Listen called for `+a+` `+i),this.listens.has(a)||this.listens.set(a,new Map),j(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),`listen() called for non-default but complete query`),j(!this.listens.get(a).has(i),`listen() called twice for same path/queryId.`);let o={onComplete:r,hashFn:t,query:e,tag:n};this.listens.get(a).set(i,o),this.connected_&&this.sendListen_(o)}sendGet_(e){let t=this.outstandingGets_[e];this.sendRequest(`g`,t.request,n=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(n)})}sendListen_(t){let n=t.query,r=n._path.toString(),i=n._queryIdentifier;this.log_(`Listen on `+r+` for `+i);let a={p:r};t.tag&&(a.q=n._queryObject,a.t=t.tag),a.h=t.hashFn(),this.sendRequest(`q`,a,a=>{let o=a.d,s=a.s;e.warnOnListenWarnings_(o,n),(this.listens.get(r)&&this.listens.get(r).get(i))===t&&(this.log_(`listen response`,a),s!==`ok`&&this.removeListen_(r,i),t.onComplete&&t.onComplete(s,o))})}static warnOnListenWarnings_(e,t){if(e&&typeof e==`object`&&Wo(e,`w`)){let n=Go(e,`w`);Array.isArray(n)&&~n.indexOf(`no_index`)&&I(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${`".indexOn": "`+t._queryParams.getIndex().toString()+`"`} at ${t._path.toString()} to your security rules for better performance.`)}}refreshAuthToken(e){this.authToken_=e,this.log_(`Auth token refreshed`),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest(`unauth`,{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&e.length===40||Uo(e))&&(this.log_(`Admin auth credential detected. Reducing max reconnect time.`),this.maxReconnectDelay_=nd)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_(`App check token refreshed`),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest(`unappeck`,{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){let e=this.authToken_,t=Ho(e)?`auth`:`gauth`,n={cred:e};this.authOverride_===null?n.noauth=!0:typeof this.authOverride_==`object`&&(n.authvar=this.authOverride_),this.sendRequest(t,n,t=>{let n=t.s,r=t.d||`error`;this.authToken_===e&&(n===`ok`?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(n,r))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest(`appcheck`,{token:this.appCheckToken_},e=>{let t=e.s,n=e.d||`error`;t===`ok`?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,n)})}unlisten(e,t){let n=e._path.toString(),r=e._queryIdentifier;this.log_(`Unlisten called for `+n+` `+r),j(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),`unlisten() called for non-default but complete query`),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,e._queryObject,t)}sendUnlisten_(e,t,n,r){this.log_(`Unlisten on `+e+` for `+t);let i={p:e};r&&(i.q=n,i.t=r),this.sendRequest(`n`,i)}onDisconnectPut(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_(`o`,e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:`o`,data:t,onComplete:n})}onDisconnectMerge(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_(`om`,e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:`om`,data:t,onComplete:n})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_(`oc`,e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:`oc`,data:null,onComplete:t})}sendOnDisconnect_(e,t,n,r){let i={p:t,d:n};this.log_(`onDisconnect `+e,i),this.sendRequest(e,i,e=>{r&&setTimeout(()=>{r(e.s,e.d)},0)})}put(e,t,n,r){this.putInternal(`p`,e,t,n,r)}merge(e,t,n,r){this.putInternal(`m`,e,t,n,r)}putInternal(e,t,n,r,i){this.initConnection_();let a={p:t,d:n};i!==void 0&&(a.h=i),this.outstandingPuts_.push({action:e,request:a,onComplete:r}),this.outstandingPutCount_++;let o=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(o):this.log_(`Buffering put: `+t)}sendPut_(e){let t=this.outstandingPuts_[e].action,n=this.outstandingPuts_[e].request,r=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,n,n=>{this.log_(t+` response`,n),delete this.outstandingPuts_[e],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),r&&r(n.s,n.d)})}reportStats(e){if(this.connected_){let t={c:e};this.log_(`reportStats`,t),this.sendRequest(`s`,t,e=>{if(e.s!==`ok`){let t=e.d;this.log_(`reportStats`,`Error sending stats: `+t)}})}}onDataMessage_(e){if(`r`in e){this.log_(`from server: `+M(e));let t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else if(`error`in e)throw`A server-side error has occurred: `+e.error;else`a`in e&&this.onDataPush_(e.a,e.b)}onDataPush_(e,t){this.log_(`handleServerMessage`,e,t),e===`d`?this.onDataUpdate_(t.p,t.d,!1,t.t):e===`m`?this.onDataUpdate_(t.p,t.d,!0,t.t):e===`c`?this.onListenRevoked_(t.p,t.q):e===`ac`?this.onAuthRevoked_(t.s,t.d):e===`apc`?this.onAppCheckRevoked_(t.s,t.d):e===`sd`?this.onSecurityDebugPacket_(t):ul(`Unrecognized action received from server: `+M(e)+` 18Are you using the latest client?`)}onReady_(e,t){this.log_(`connection ready`),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){j(!this.realtime_,`Scheduling a connect when we're already connected/ing?`),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_(`Window became visible. Reducing delay.`),this.reconnectDelay_=ed,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_(`Browser went online.`),this.reconnectDelay_=ed,this.realtime_||this.scheduleConnect_(0)):(this.log_(`Browser went offline. Killing connection.`),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_(`data client disconnected`),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&=(new Date().getTime()-this.lastConnectionEstablishedTime_>id&&(this.reconnectDelay_=ed),null):(this.log_(`Window isn't visible. Delaying reconnect.`),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());let e=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_),t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_(`Trying to reconnect in `+t+`ms`),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*rd)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_(`Making a connection attempt`),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;let t=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+`:`+e.nextConnectionId_++,a=this.lastSessionId,o=!1,s=null,c=function(){s?s.close():(o=!0,r())},l=function(e){j(s,`sendRequest call when we're not connected not allowed.`),s.sendRequest(e)};this.realtime_={close:c,sendRequest:l};let u=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{let[e,c]=await Promise.all([this.authTokenProvider_.getToken(u),this.appCheckTokenProvider_.getToken(u)]);o?P(`getToken() completed but was canceled`):(P(`getToken() completed. Creating connection.`),this.authToken_=e&&e.accessToken,this.appCheckToken_=c&&c.token,s=new Iu(i,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,t,n,r,e=>{I(e+` (`+this.repoInfo_.toString()+`)`),this.interrupt(ad)},a))}catch(e){this.log_(`Failed to get token: `+e),o||(this.repoInfo_.nodeAdmin&&I(e),c())}}}interrupt(e){P(`Interrupting connection for reason: `+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&=(clearTimeout(this.establishConnectionTimer_),null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){P(`Resuming connection for reason: `+e),delete this.interruptReasons_[e],Ko(this.interruptReasons_)&&(this.reconnectDelay_=ed,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){let t=e-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){let t=this.outstandingPuts_[e];t&&`h`in t.request&&t.queued&&(t.onComplete&&t.onComplete(`disconnect`),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(e,t){let n;n=t?t.map(e=>yl(e)).join(`$`):`default`;let r=this.removeListen_(e,n);r&&r.onComplete&&r.onComplete(`permission_denied`)}removeListen_(e,t){let n=new R(e).toString(),r;if(this.listens.has(n)){let e=this.listens.get(n);r=e.get(t),e.delete(t),e.size===0&&this.listens.delete(n)}else r=void 0;return r}onAuthRevoked_(e,t){P(`Auth token revoked: `+e+`/`+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(e===`invalid_token`||e===`permission_denied`)&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=od&&(this.reconnectDelay_=nd,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){P(`App check token revoked: `+e+`/`+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(e===`invalid_token`||e===`permission_denied`)&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=od&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):`msg`in e&&console.log(`FIREBASE: `+e.msg.replace(` 19`,` 20FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(let e of this.listens.values())for(let t of e.values())this.sendListen_(t);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){let e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){let e={},t=`js`;Mo()&&(t=this.repoInfo_.nodeAdmin?`admin_node`:`node`),e[`sdk.`+t+`.`+Yc.replace(/\./g,`-`)]=1,Ao()?e[`framework.cordova`]=1:jo()&&(e[`framework.reactnative`]=1),this.reportStats(e)}shouldReconnect_(){let e=zu.getInstance().currentlyOnline();return Ko(this.interruptReasons_)&&e}};sd.nextPersistentConnectionId_=0,sd.nextConnectionId_=0;var K=class e{constructor(e,t){this.name=e,this.node=t}static Wrap(t,n){return new e(t,n)}},cd=class{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){let n=new K(ml,e),r=new K(ml,t);return this.compare(n,r)!==0}minPost(){return K.MIN}},ld,ud=class extends cd{static get __EMPTY_NODE(){return ld}static set __EMPTY_NODE(e){ld=e}compare(e,t){return gl(e.name,t.name)}isDefinedOn(e){throw eo(`KeyIndex.isDefinedOn not expected to be called.`)}indexedValueChanged(e,t){return!1}minPost(){return K.MIN}maxPost(){return new K(hl,ld)}makePost(e,t){return j(typeof e==`string`,`KeyIndex indexValue must always be a string.`),new K(e,ld)}toString(){return`.key`}},dd=new ud,fd=class{constructor(e,t,n,r,i=null){this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];let a=1;for(;!e.isEmpty();)if(e=e,a=t?n(e.key,t):1,r&&(a*=-1),a<0)e=this.isReverse_?e.left:e.right;else if(a===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),t;if(t=this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}},q=class e{constructor(t,n,r,i,a){this.key=t,this.value=n,this.color=r??e.RED,this.left=i??J.EMPTY_NODE,this.right=a??J.EMPTY_NODE}copy(t,n,r,i,a){return new e(t??this.key,n??this.value,r??this.color,i??this.left,a??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this,i=n(e,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):i===0?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp_()}removeMin_(){if(this.left.isEmpty())return J.EMPTY_NODE;let e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,t){let n,r;if(n=this,t(e,n.key)<0)!n.left.isEmpty()&&!n.left.isRed_()&&!n.left.left.isRed_()&&(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),!n.right.isEmpty()&&!n.right.isRed_()&&!n.right.left.isRed_()&&(n=n.moveRedRight_()),t(e,n.key)===0){if(n.right.isEmpty())return J.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){let t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight_(){let t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip_(){let e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth_(){return 2**this.check_()<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw Error(`Red node has red child(`+this.key+`,`+this.value+`)`);if(this.right.isRed_())throw Error(`Right child of (`+this.key+`,`+this.value+`) is red`);let e=this.left.check_();if(e!==this.right.check_())throw Error(`Black depths differ`);return e+ +!this.isRed_()}};q.RED=!0,q.BLACK=!1;var pd=class{copy(e,t,n,r,i){return this}insert(e,t,n){return new q(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}},J=class e{constructor(t,n=e.EMPTY_NODE){this.comparator_=t,this.root_=n}insert(t,n){return new e(this.comparator_,this.root_.insert(t,n,this.comparator_).copy(null,null,q.BLACK,null,null))}remove(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,q.BLACK,null,null))}get(e){let t,n=this.root_;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),t===0)return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null}getPredecessorKey(e){let t,n=this.root_,r=null;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),t===0)if(!n.left.isEmpty()){for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}else if(r)return r.key;else return null;t<0?n=n.left:t>0&&(r=n,n=n.right)}throw Error(`Attempted to find predecessor key for a nonexistent key. What gives?`)}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new fd(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new fd(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new fd(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new fd(this.root_,null,this.comparator_,!0,e)}};J.EMPTY_NODE=new pd;function md(e,t){return gl(e.name,t.name)}function hd(e,t){return gl(e,t)}var gd;function _d(e){gd=e}var vd=function(e){return typeof e==`number`?`number:`+xl(e):`string:`+e},yd=function(e){if(e.isLeafNode()){let t=e.val();j(typeof t==`string`||typeof t==`number`||typeof t==`object`&&Wo(t,`.sv`),`Priority must be a string or number.`)}else j(e===gd||e.isEmpty(),`priority of unexpected type.`);j(e===gd||e.getPriority().isEmpty(),`Priority nodes can't have a priority of their own.`)},bd,xd=class e{static set __childrenNodeConstructor(e){bd=e}static get __childrenNodeConstructor(){return bd}constructor(t,n=e.__childrenNodeConstructor.EMPTY_NODE){this.value_=t,this.priorityNode_=n,this.lazyHash_=null,j(this.value_!==void 0&&this.value_!==null,`LeafNode shouldn't be created with null/undefined value.`),yd(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(t){return new e(this.value_,t)}getImmediateChild(t){return t===`.priority`?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE}getChild(t){return U(t)?this:B(t)===`.priority`?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(t,n){return t===`.priority`?this.updatePriority(n):n.isEmpty()&&t!==`.priority`?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.priorityNode_)}updateChild(t,n){let r=B(t);return r===null?n:n.isEmpty()&&r!==`.priority`?this:(j(r!==`.priority`||Hu(t)===1,`.priority must be the last token in a path`),this.updateImmediateChild(r,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(V(t),n)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,t){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let e=``;this.priorityNode_.isEmpty()||(e+=`priority:`+vd(this.priorityNode_.val())+`:`);let t=typeof this.value_;e+=t+`:`,e+=t===`number`?xl(this.value_):this.value_,this.lazyHash_=il(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:(j(t.isLeafNode(),`Unknown node type`),this.compareToLeafNode_(t))}compareToLeafNode_(t){let n=typeof t.value_,r=typeof this.value_,i=e.VALUE_TYPE_ORDER.indexOf(n),a=e.VALUE_TYPE_ORDER.indexOf(r);return j(i>=0,`Unknown leaf type: `+n),j(a>=0,`Unknown leaf type: `+r),i===a?r===`object`?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:a-i}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;if(e.isLeafNode()){let t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1}};xd.VALUE_TYPE_ORDER=[`object`,`boolean`,`number`,`string`];var Sd,Cd;function wd(e){Sd=e}function Td(e){Cd=e}var Y=new class extends cd{compare(e,t){let n=e.node.getPriority(),r=t.node.getPriority(),i=n.compareTo(r);return i===0?gl(e.name,t.name):i}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,t){return!e.getPriority().equals(t.getPriority())}minPost(){return K.MIN}maxPost(){return new K(hl,new xd(`[PRIORITY-POST]`,Cd))}makePost(e,t){return new K(t,new xd(`[PRIORITY-POST]`,Sd(e)))}toString(){return`.priority`}},Ed=Math.log(2),Dd=class{constructor(e){let t=e=>parseInt(Math.log(e)/Ed,10),n=e=>parseInt(Array(e+1).join(`1`),2);this.count=t(e+1),this.current_=this.count-1;let r=n(this.count);this.bits_=e+1&r}nextBitIsOne(){let e=!(this.bits_&1<<this.current_);return this.current_--,e}},Od=function(e,t,n,r){e.sort(t);let i=function(t,r){let a=r-t,o,s;if(a===0)return null;if(a===1)return o=e[t],s=n?n(o):o,new q(s,o.node,q.BLACK,null,null);{let c=parseInt(a/2,10)+t,l=i(t,c),u=i(c+1,r);return o=e[c],s=n?n(o):o,new q(s,o.node,q.BLACK,l,u)}},a=function(t){let r=null,a=null,o=e.length,s=function(t,r){let a=o-t,s=o;o-=t;let l=i(a+1,s),u=e[a],d=n?n(u):u;c(new q(d,u.node,r,null,l))},c=function(e){r?(r.left=e,r=e):(a=e,r=e)};for(let e=0;e<t.count;++e){let n=t.nextBitIsOne(),r=2**(t.count-(e+1));n?s(r,q.BLACK):(s(r,q.BLACK),s(r,q.RED))}return a}(new Dd(e.length));return new J(r||t,a)},kd,Ad={},jd=class e{static get Default(){return j(Ad&&Y,`ChildrenNode.ts has not been loaded`),kd||=new e({".priority":Ad},{".priority":Y}),kd}constructor(e,t){this.indexes_=e,this.indexSet_=t}get(e){let t=Go(this.indexes_,e);if(!t)throw Error(`No index defined for `+e);return t instanceof J?t:null}hasIndex(e){return Wo(this.indexSet_,e.toString())}addIndex(t,n){j(t!==dd,`KeyIndex always exists and isn't meant to be added to the IndexMap.`);let r=[],i=!1,a=n.getIterator(K.Wrap),o=a.getNext();for(;o;)i||=t.isDefinedOn(o.node),r.push(o),o=a.getNext();let s;s=i?Od(r,t.getCompare()):Ad;let c=t.toString(),l={...this.indexSet_};l[c]=t;let u={...this.indexes_};return u[c]=s,new e(u,l)}addToIndexes(t,n){let r=qo(this.indexes_,(e,r)=>{let i=Go(this.indexSet_,r);if(j(i,`Missing index implementation for `+r),e===Ad)if(i.isDefinedOn(t.node)){let e=[],r=n.getIterator(K.Wrap),a=r.getNext();for(;a;)a.name!==t.name&&e.push(a),a=r.getNext();return e.push(t),Od(e,i.getCompare())}else return Ad;{let r=n.get(t.name),i=e;return r&&(i=i.remove(new K(t.name,r))),i.insert(t,t.node)}});return new e(r,this.indexSet_)}removeFromIndexes(t,n){let r=qo(this.indexes_,e=>{if(e===Ad)return e;{let r=n.get(t.name);return r?e.remove(new K(t.name,r)):e}});return new e(r,this.indexSet_)}},Md,X=class e{static get EMPTY_NODE(){return Md||=new e(new J(hd),null,jd.Default)}constructor(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&yd(this.priorityNode_),this.children_.isEmpty()&&j(!this.priorityNode_||this.priorityNode_.isEmpty(),`An empty node cannot have a priority`)}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Md}updatePriority(t){return this.children_.isEmpty()?this:new e(this.children_,t,this.indexMap_)}getImmediateChild(e){if(e===`.priority`)return this.getPriority();{let t=this.children_.get(e);return t===null?Md:t}}getChild(e){let t=B(e);return t===null?this:this.getImmediateChild(t).getChild(V(e))}hasChild(e){return this.children_.get(e)!==null}updateImmediateChild(t,n){if(j(n,`We should always be passing snapshot nodes`),t===`.priority`)return this.updatePriority(n);{let r=new K(t,n),i,a;n.isEmpty()?(i=this.children_.remove(t),a=this.indexMap_.removeFromIndexes(r,this.children_)):(i=this.children_.insert(t,n),a=this.indexMap_.addToIndexes(r,this.children_));let o=i.isEmpty()?Md:this.priorityNode_;return new e(i,o,a)}}updateChild(e,t){let n=B(e);if(n===null)return t;{j(B(e)!==`.priority`||Hu(e)===1,`.priority must be the last token in a path`);let r=this.getImmediateChild(n).updateChild(V(e),t);return this.updateImmediateChild(n,r)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(t){if(this.isEmpty())return null;let n={},r=0,i=0,a=!0;if(this.forEachChild(Y,(o,s)=>{n[o]=s.val(t),r++,a&&e.INTEGER_REGEXP_.test(o)?i=Math.max(i,Number(o)):a=!1}),!t&&a&&i<2*r){let e=[];for(let t in n)e[t]=n[t];return e}return t&&!this.getPriority().isEmpty()&&(n[`.priority`]=this.getPriority().val()),n}hash(){if(this.lazyHash_===null){let e=``;this.getPriority().isEmpty()||(e+=`priority:`+vd(this.getPriority().val())+`:`),this.forEachChild(Y,(t,n)=>{let r=n.hash();r!==``&&(e+=`:`+t+`:`+r)}),this.lazyHash_=e===``?``:il(e)}return this.lazyHash_}getPredecessorChildName(e,t,n){let r=this.resolveIndex_(n);if(r){let n=r.getPredecessorKey(new K(e,t));return n?n.name:null}return this.children_.getPredecessorKey(e)}getFirstChildName(e){let t=this.resolveIndex_(e);if(t){let e=t.minKey();return e&&e.name}return this.children_.minKey()}getFirstChild(e){let t=this.getFirstChildName(e);return t?new K(t,this.children_.get(t)):null}getLastChildName(e){let t=this.resolveIndex_(e);if(t){let e=t.maxKey();return e&&e.name}return this.children_.maxKey()}getLastChild(e){let t=this.getLastChildName(e);return t?new K(t,this.children_.get(t)):null}forEachChild(e,t){let n=this.resolveIndex_(e);return n?n.inorderTraversal(e=>t(e.name,e.node)):this.children_.inorderTraversal(t)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,t){let n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,e=>e);{let n=this.children_.getIteratorFrom(e.name,K.Wrap),r=n.peek();for(;r!=null&&t.compare(r,e)<0;)n.getNext(),r=n.peek();return n}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,t){let n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,e=>e);{let n=this.children_.getReverseIteratorFrom(e.name,K.Wrap),r=n.peek();for(;r!=null&&t.compare(r,e)>0;)n.getNext(),r=n.peek();return n}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Nd?-1:0}withIndex(t){if(t===dd||this.indexMap_.hasIndex(t))return this;{let n=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,n)}}isIndexed(e){return e===dd||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;
20if(e.isLeafNode())return!1;{let t=e;if(!this.getPriority().equals(t.getPriority()))return!1;if(this.children_.count()===t.children_.count()){let e=this.getIterator(Y),n=t.getIterator(Y),r=e.getNext(),i=n.getNext();for(;r&&i;){if(r.name!==i.name||!r.node.equals(i.node))return!1;r=e.getNext(),i=n.getNext()}return r===null&&i===null}return!1}}resolveIndex_(e){return e===dd?null:this.indexMap_.get(e.toString())}};X.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;var Nd=new class extends X{constructor(){super(new J(hd),X.EMPTY_NODE,jd.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return X.EMPTY_NODE}isEmpty(){return!1}};Object.defineProperties(K,{MIN:{value:new K(ml,X.EMPTY_NODE)},MAX:{value:new K(hl,Nd)}}),ud.__EMPTY_NODE=X.EMPTY_NODE,xd.__childrenNodeConstructor=X,_d(Nd),Td(Nd);var Pd=!0;function Z(e,t=null){if(e===null)return X.EMPTY_NODE;if(typeof e==`object`&&`.priority`in e&&(t=e[`.priority`]),j(t===null||typeof t==`string`||typeof t==`number`||typeof t==`object`&&`.sv`in t,`Invalid priority type found: `+typeof t),typeof e==`object`&&`.value`in e&&e[`.value`]!==null&&(e=e[`.value`]),typeof e!=`object`||`.sv`in e)return new xd(e,Z(t));if(!(e instanceof Array)&&Pd){let n=[],r=!1;if(L(e,(e,t)=>{if(e.substring(0,1)!==`.`){let i=Z(t);i.isEmpty()||(r||=!i.getPriority().isEmpty(),n.push(new K(e,i)))}}),n.length===0)return X.EMPTY_NODE;let i=Od(n,md,e=>e.name,hd);if(r){let e=Od(n,Y.getCompare());return new X(i,Z(t),new jd({".priority":e},{".priority":Y}))}return new X(i,Z(t),jd.Default)}{let n=X.EMPTY_NODE;return L(e,(t,r)=>{if(Wo(e,t)&&t.substring(0,1)!==`.`){let e=Z(r);(e.isLeafNode()||!e.isEmpty())&&(n=n.updateImmediateChild(t,e))}}),n.updatePriority(Z(t))}}wd(Z);var Fd=class extends cd{constructor(e){super(),this.indexPath_=e,j(!U(e)&&B(e)!==`.priority`,`Can't create PathIndex with empty path or .priority key`)}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){let n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return i===0?gl(e.name,t.name):i}makePost(e,t){let n=Z(e);return new K(t,X.EMPTY_NODE.updateChild(this.indexPath_,n))}maxPost(){return new K(hl,X.EMPTY_NODE.updateChild(this.indexPath_,Nd))}toString(){return Gu(this.indexPath_,0).join(`/`)}},Id=new class extends cd{compare(e,t){let n=e.node.compareTo(t.node);return n===0?gl(e.name,t.name):n}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return K.MIN}maxPost(){return K.MAX}makePost(e,t){return new K(t,Z(e))}toString(){return`.value`}};function Ld(e){return{type:`value`,snapshotNode:e}}function Rd(e,t){return{type:`child_added`,snapshotNode:t,childName:e}}function zd(e,t){return{type:`child_removed`,snapshotNode:t,childName:e}}function Bd(e,t,n){return{type:`child_changed`,snapshotNode:t,childName:e,oldSnap:n}}function Vd(e,t){return{type:`child_moved`,snapshotNode:t,childName:e}}var Hd=class{constructor(e){this.index_=e}updateChild(e,t,n,r,i,a){j(e.isIndexed(this.index_),`A node must be indexed if only a child is updated`);let o=e.getImmediateChild(t);return o.getChild(r).equals(n.getChild(r))&&o.isEmpty()===n.isEmpty()||(a!=null&&(n.isEmpty()?e.hasChild(t)?a.trackChildChange(zd(t,o)):j(e.isLeafNode(),`A child remove without an old child only makes sense on a leaf node`):o.isEmpty()?a.trackChildChange(Rd(t,n)):a.trackChildChange(Bd(t,n,o))),e.isLeafNode()&&n.isEmpty())?e:e.updateImmediateChild(t,n).withIndex(this.index_)}updateFullNode(e,t,n){return n!=null&&(e.isLeafNode()||e.forEachChild(Y,(e,r)=>{t.hasChild(e)||n.trackChildChange(zd(e,r))}),t.isLeafNode()||t.forEachChild(Y,(t,r)=>{if(e.hasChild(t)){let i=e.getImmediateChild(t);i.equals(r)||n.trackChildChange(Bd(t,r,i))}else n.trackChildChange(Rd(t,r))})),t.withIndex(this.index_)}updatePriority(e,t){return e.isEmpty()?X.EMPTY_NODE:e.updatePriority(t)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}},Ud=class e{constructor(t){this.indexedFilter_=new Hd(t.getIndex()),this.index_=t.getIndex(),this.startPost_=e.getStartPost_(t),this.endPost_=e.getEndPost_(t),this.startIsInclusive_=!t.startAfterSet_,this.endIsInclusive_=!t.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){let t=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,n=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return t&&n}updateChild(e,t,n,r,i,a){return this.matches(new K(t,n))||(n=X.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,r,i,a)}updateFullNode(e,t,n){t.isLeafNode()&&(t=X.EMPTY_NODE);let r=t.withIndex(this.index_);r=r.updatePriority(X.EMPTY_NODE);let i=this;return t.forEachChild(Y,(e,t)=>{i.matches(new K(e,t))||(r=r.updateImmediateChild(e,X.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,r,n)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){let t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){let t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()}},Wd=class{constructor(e){this.withinDirectionalStart=e=>this.reverse_?this.withinEndPost(e):this.withinStartPost(e),this.withinDirectionalEnd=e=>this.reverse_?this.withinStartPost(e):this.withinEndPost(e),this.withinStartPost=e=>{let t=this.index_.compare(this.rangedFilter_.getStartPost(),e);return this.startIsInclusive_?t<=0:t<0},this.withinEndPost=e=>{let t=this.index_.compare(e,this.rangedFilter_.getEndPost());return this.endIsInclusive_?t<=0:t<0}
20,this.rangedFilter_=new Ud(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,t,n,r,i,a){return this.rangedFilter_.matches(new K(t,n))||(n=X.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,n,r,i,a):this.fullLimitUpdateChild_(e,t,n,i,a)}updateFullNode(e,t,n){let r;if(t.isLeafNode()||t.isEmpty())r=X.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<t.numChildren()&&t.isIndexed(this.index_)){r=X.EMPTY_NODE.withIndex(this.index_);let e;e=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let n=0;for(;e.hasNext()&&n<this.limit_;){let t=e.getNext();if(this.withinDirectionalStart(t))if(this.withinDirectionalEnd(t))r=r.updateImmediateChild(t.name,t.node),n++;else break}}else{r=t.withIndex(this.index_),r=r.updatePriority(X.EMPTY_NODE);let e;e=this.reverse_?r.getReverseIterator(this.index_):r.getIterator(this.index_);let n=0;for(;e.hasNext();){let t=e.getNext();n<this.limit_&&this.withinDirectionalStart(t)&&this.withinDirectionalEnd(t)?n++:r=r.updateImmediateChild(t.name,X.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,r,n)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,t,n,r,i){let a;if(this.reverse_){let e=this.index_.getCompare();a=(t,n)=>e(n,t)}else a=this.index_.getCompare();let o=e;j(o.numChildren()===this.limit_,``);let s=new K(t,n),c=this.reverse_?o.getFirstChild(this.index_):o.getLastChild(this.index_),l=this.rangedFilter_.matches(s);if(o.hasChild(t)){let e=o.getImmediateChild(t),u=r.getChildAfterChild(this.index_,c,this.reverse_);for(;u!=null&&(u.name===t||o.hasChild(u.name));)u=r.getChildAfterChild(this.index_,u,this.reverse_);let d=u==null?1:a(u,s);if(l&&!n.isEmpty()&&d>=0)return i?.trackChildChange(Bd(t,n,e)),o.updateImmediateChild(t,n);{i?.trackChildChange(zd(t,e));let n=o.updateImmediateChild(t,X.EMPTY_NODE);return u!=null&&this.rangedFilter_.matches(u)?(i?.trackChildChange(Rd(u.name,u.node)),n.updateImmediateChild(u.name,u.node)):n}}return n.isEmpty()?e:l&&a(c,s)>=0?(i!=null&&(i.trackChildChange(zd(c.name,c.node)),i.trackChildChange(Rd(t,n))),o.updateImmediateChild(t,n).updateImmediateChild(c.name,X.EMPTY_NODE)):e}},Gd=class e{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_=``,this.indexStartValue_=null,this.indexStartName_=``,this.indexEndValue_=null,this.indexEndName_=``,this.index_=Y}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===``?this.startSet_:this.viewFrom_===`l`}getIndexStartValue(){return j(this.startSet_,`Only valid if start has been set`),this.indexStartValue_}getIndexStartName(){return j(this.startSet_,`Only valid if start has been set`),this.startNameSet_?this.indexStartName_:ml}hasEnd(){return this.endSet_}getIndexEndValue(){return j(this.endSet_,`Only valid if end has been set`),this.indexEndValue_}getIndexEndName(){return j(this.endSet_,`Only valid if end has been set`),this.endNameSet_?this.indexEndName_:hl}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==``}getLimit(){return j(this.limitSet_,`Only valid if limit has been set`),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===Y}copy(){let t=new e;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.startAfterSet_=this.startAfterSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.endBeforeSet_=this.endBeforeSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_
vendor: 23,082 bytes, line 20
20=this.index_,t.viewFrom_=this.viewFrom_,t}};function Kd(e){return e.loadsAllData()?new Hd(e.getIndex()):e.hasLimit()?new Wd(e):new Ud(e)}function qd(e){let t={};if(e.isDefault())return t;let n;if(e.index_===Y?n=`$priority`:e.index_===Id?n=`$value`:e.index_===dd?n=`$key`:(j(e.index_ instanceof Fd,`Unrecognized index type!`),n=e.index_.toString()),t.orderBy=M(n),e.startSet_){let n=e.startAfterSet_?`startAfter`:`startAt`;t[n]=M(e.indexStartValue_),e.startNameSet_&&(t[n]+=`,`+M(e.indexStartName_))}if(e.endSet_){let n=e.endBeforeSet_?`endBefore`:`endAt`;t[n]=M(e.indexEndValue_),e.endNameSet_&&(t[n]+=`,`+M(e.indexEndName_))}return e.limitSet_&&(e.isViewFromLeft()?t.limitToFirst=e.limit_:t.limitToLast=e.limit_),t}function Jd(e){let t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_),t.sin=!e.startAfterSet_),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_),t.ein=!e.endBeforeSet_),e.limitSet_){t.l=e.limit_;let n=e.viewFrom_;n===``&&(n=e.isViewFromLeft()?`l`:`r`),t.vf=n}return e.index_!==Y&&(t.i=e.index_.toString()),t}var Yd=class e extends Lu{reportStats(e){throw Error(`Method not implemented.`)}static getListenId_(e,t){return t===void 0?(j(e._queryParams.isDefault(),`should have a tag if it's not a default query.`),e._path.toString()):`tag$`+t}constructor(e,t,n,r){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=n,this.appCheckTokenProvider_=r,this.log_=ll(`p:rest:`),this.listens_={}}listen(t,n,r,i){let a=t._path.toString();this.log_(`Listen called for `+a+` `+t._queryIdentifier);let o=e.getListenId_(t,r),s={};this.listens_[o]=s;let c=qd(t._queryParams);this.restRequest_(a+`.json`,c,(e,t)=>{let n=t;if(e===404&&(n=null,e=null),e===null&&this.onDataUpdate_(a,n,!1,r),Go(this.listens_,o)===s){let t;t=e?e===401?`permission_denied`:`rest_error:`+e:`ok`,i(t,null)}})}unlisten(t,n){let r=e.getListenId_(t,n);delete this.listens_[r]}get(e){let t=qd(e._queryParams),n=e._path.toString(),r=new bo;return this.restRequest_(n+`.json`,t,(e,t)=>{let i=t;e===404&&(i=null,e=null),e===null?(this.onDataUpdate_(n,i,!1,null),r.resolve(i)):r.reject(Error(i))}),r.promise}refreshAuthToken(e){}restRequest_(e,t={},n){return t.format=`export`,Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([r,i])=>{r&&r.accessToken&&(t.auth=r.accessToken),i&&i.token&&(t.ac=i.token);let a=(this.repoInfo_.secure?`https://`:`http://`)+this.repoInfo_.host+e+`?ns=`+this.repoInfo_.namespace+Xo(t);this.log_(`Sending REST request for `+a);let o=new XMLHttpRequest;o.onreadystatechange=()=>{if(n&&o.readyState===4){this.log_(`REST Response for `+a+` received. status:`,o.status,`response:`,o.responseText);let e=null;if(o.status>=200&&o.status<300){try{e=Bo(o.responseText)}catch{I(`Failed to parse JSON response for `+a+`: `+o.responseText)}n(null,e)}else o.status!==401&&o.status!==404&&I(`Got unsuccessful REST response for `+a+` Status: `+o.status),n(o.status);n=null}},o.open(`GET`,a,!0),o.send()})}},Xd=class{constructor(){this.rootNode_=X.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}};function Zd(){return{value:null,children:new Map}}function Qd(e,t,n){if(U(t))e.value=n,e.children.clear();else if(e.value!==null)e.value=e.value.updateChild(t,n);else{let r=B(t);e.children.has(r)||e.children.set(r,Zd());let i=e.children.get(r);t=V(t),Qd(i,t,n)}}function $d(e,t,n){e.value===null?ef(e,(e,r)=>{$d(r,new R(t.toString()+`/`+e),n)}):n(t,e.value)}function ef(e,t){e.children.forEach((e,n)=>{t(n,e)})}var tf=class{constructor(e){this.collection_=e,this.last_=null}get(){let e=this.collection_.get(),t={...e};return this.last_&&L(this.last_,(e,n)=>{t[e]=t[e]-n}),this.last_=e,t}},nf=1e4,rf=3e5,af=class{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new tf(e);let n=nf+2e4*Math.random();jl(this.reportStats_.bind(this),Math.floor(n))}reportStats_(){let e=this.statsListener_.get(),t={},n=!1;L(e,(e,r)=>{r>0&&Wo(this.statsToReport_,e)&&(t[e]=r,n=!0)}),n&&this.server_.reportStats(t),jl(this.reportStats_.bind(this),Math.floor(Math.random()*2*rf))}},Q;(function(e){e[e.OVERWRITE=0]=`OVERWRITE`,e[e.MERGE=1]=`MERGE`,e[e.ACK_USER_WRITE=2]=`ACK_USER_WRITE`,e[e.LISTEN_COMPLETE=3]=`LISTEN_COMPLETE`})(Q||={});function of(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function sf(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function cf(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}}var lf=class e{constructor(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=Q.ACK_USER_WRITE,this.source=of()}operationForChild(t){if(!U(this.path))return j(B(this.path)===t,`operationForChild called for unrelated child.`),new e(V(this.path),this.affectedTree,this.revert);if(this.affectedTree.value!=null)return j(this.affectedTree.children.isEmpty(),`affectedTree should not have overlapping affected paths.`),this;{let n=this.affectedTree.subtree(new R(t));return new e(z(),n,this.revert)}}},uf=class e{constructor(e,t){this.source=e,this.path=t,this.type=Q.LISTEN_COMPLETE}operationForChild(t){return U(this.path)?new e(this.source,z()):new e(this.source,V(this.path))}},df=class e{constructor(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=Q.OVERWRITE}operationForChild(t){return U(this.path)?new e(this.source,z(),this.snap.getImmediateChild(t)):new e(this.source,V(this.path),this.snap)}},ff=class e{constructor(e,t,n){this.source=e,this.path=t,this.children=n,this.type=Q.MERGE}operationForChild(t){if(U(this.path)){let n=this.children.subtree(new R(t));return n.isEmpty()?null:n.value?new df(this.source,z(),n.value):new e(this.source,z(),n)}return j(B(this.path)===t,`Can't get a merge for a child not on the path of the operation`),new e(this.source,V(this.path),this.children)}toString(){return`Operation(`+this.path+`: `+this.source.toString()+` merge: `+this.children.toString()+`)`}},pf=class{constructor(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(U(e))return this.isFullyInitialized()&&!this.filtered_;let t=B(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}},mf=class{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}};function hf(e,t,n,r){let i=[],a=[];return t.forEach(t=>{t.type===`child_changed`&&e.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&a.push(Vd(t.childName,t.snapshotNode))}),gf(e,i,`child_removed`,t,r,n),gf(e,i,`child_added`,t,r,n),gf(e,i,`child_moved`,a,r,n),gf(e,i,`child_changed`,t,r,n),gf(e,i,`value`,t,r,n),i}function gf(e,t,n,r,i,a){let o=r.filter(e=>e.type===n);o.sort((t,n)=>vf(e,t,n)),o.forEach(n=>{let r=_f(e,n,a);i.forEach(i=>{i.respondsTo(n.type)&&t.push(i.createEvent(r,e.query_))})})}function _f(e,t,n){return t.type===`value`||t.type===`child_removed`||(t.prevName=n.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}function vf(e,t,n){if(t.childName==null||n.childName==null)throw eo(`Should only compare child_ events.`);let r=new K(t.childName,t.snapshotNode),i=new K(n.childName,n.snapshotNode);return e.index_.compare(r,i)}function yf(e,t){return{eventCache:e,serverCache:t}}function bf(e,t,n,r){return yf(new pf(t,n,r),e.serverCache)}function xf(e,t,n,r){return yf(e.eventCache,new pf(t,n,r))}function Sf(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function Cf(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null}var wf,Tf=()=>(wf||=new J(_l),wf),$=class e{static fromObject(t){let n=new e(null);return L(t,(e,t)=>{n=n.set(new R(e),t)}),n}constructor(e,t=Tf()){this.value=e,this.children=t}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(this.value!=null&&t(this.value))return{path:z(),value:this.value};if(U(e))return null;{let n=B(e),r=this.children.get(n);if(r!==null){let i=r.findRootMostMatchingPathAndValue(V(e),t);return i==null?null:{path:H(new R(n),i.path),value:i.value}}return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(t){if(U(t))return this;{let n=B(t),r=this.children.get(n);return r===null?new e(null):r.subtree(V(t))}}set(t,n){if(U(t))return new e(n,this.children);{let r=B(t),i=(this.children.get(r)||new e(null)).set(V(t),n),a=this.children.insert(r,i);return new e(this.value,a)}}remove(t){if(U(t))return this.children.isEmpty()?new e(null):new e(null,this.children);{let n=B(t),r=this.children.get(n);if(r){let i=r.remove(V(t)),a;return a=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),this.value===null&&a.isEmpty()?new e(null):new e(this.value,a)}return this}}get(e){if(U(e))return this.value;{let t=B(e),n=this.children.get(t);return n?n.get(V(e)):null}}setTree(t,n){if(U(t))return n;{let r=B(t),i=(this.children.get(r)||new e(null)).setTree(V(t),n),a;return a=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),new e(this.value,a)}}fold(e){return this.fold_(z(),e)}fold_(e,t){let n={};return this.children.inorderTraversal((r,i)=>{n[r]=i.fold_(H(e,r),t)}),t(e,this.value,n)}findOnPath(e,t){return this.findOnPath_(e,z(),t)}findOnPath_(e,t,n){let r=this.value?n(t,this.value):!1;if(r)return r;if(U(e))return null;{let r=B(e),i=this.children.get(r);return i?i.findOnPath_(V(e),H(t,r),n):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,z(),t)}foreachOnPath_(t,n,r){if(U(t))return this;{this.value&&r(n,this.value);let i=B(t),a=this.children.get(i);return a?a.foreachOnPath_(V(t),H(n,i),r):new e(null)}}foreach(e){this.foreach_(z(),e)}foreach_(e,t){this.children.inorderTraversal((n,r)=>{r.foreach_(H(e,n),t)}),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal((t,n)=>{n.value&&e(t,n.value)})}},Ef=class e{constructor(e){this.writeTree_=e}static empty(){return new e(new $(null))}};function Df(e,t,n){if(U(t))return new Ef(new $(n));{let r=e.writeTree_.findRootMostValueAndPath(t);if(r!=null){let i=r.path,a=r.value,o=W(i,t);return a=a.updateChild(o,n),new Ef(e.writeTree_.set(i,a))}{let r=new $(n);return new Ef(e.writeTree_.setTree(t,r))}}}function Of(e,t,n){let r=e;return L(n,(e,n)=>{r=Df(r,H(t,e),n)}),r}function kf(e,t){return U(t)?Ef.empty():new Ef(e.writeTree_.setTree(t,new $(null)))}function Af(e,t){return jf(e,t)!=null}function jf(e,t){let n=e.writeTree_.findRootMostValueAndPath(t);return n==null?null:e.writeTree_.get(n.path).getChild(W(n.path,t))}function Mf(e){let t=[],n=e.writeTree_.value;return n==null?e.writeTree_.children.inorderTraversal((e,n)=>{n.value!=null&&t.push(new K(e,n.value))}):n.isLeafNode()||n.forEachChild(Y,(e,n)=>{t.push(new K(e,n))}),t}function Nf(e,t){if(U(t))return e;{let n=jf(e,t);return n==null?new Ef(e.writeTree_.subtree(t)):new Ef(new $(n))}}function Pf(e){return e.writeTree_.isEmpty()}function Ff(e,t){return If(z(),e.writeTree_,t)}function If(e,t,n){if(t.value!=null)return n.updateChild(e,t.value);{let r=null;return t.children.inorderTraversal((t,i)=>{t===`.priority`?(j(i.value!==null,`Priority writes must always be leaf nodes`),r=i.value):n=If(H(e,t),i,n)}),!n.getChild(e).isEmpty()&&r!==null&&(n=n.updateChild(H(e,`.priority`),r)),n}}function Lf(e,t){return ap(t,e)}function Rf(e,t,n,r,i){j(r>e.lastWriteId,`Stacking an older write on top of newer ones`),i===void 0&&(i=!0),e.allWrites.push({path:t,snap:n,writeId:r,visible:i}),i&&(e.visibleWrites=Df(e.visibleWrites,t,n)),e.lastWriteId=r}function zf(e,t){for(let n=0;n<e.allWrites.length;n++){let r=e.allWrites[n];if(r.writeId===t)return r}return null}function Bf(e,t){let n=e.allWrites.findIndex(e=>e.writeId===t);j(n>=0,`removeWrite called with nonexistent writeId.`);let r=e.allWrites[n];e.allWrites.splice(n,1);let i=r.visible,a=!1,o=e.allWrites.length-1;for(;i&&o>=0;){let t=e.allWrites[o];t.visible&&(o>=n&&Vf(t,r.path)?i=!1:G(r.path,t.path)&&(a=!0)),o--}if(!i)return!1;if(a)return Hf(e),!0;if(r.snap)e.visibleWrites=kf(e.visibleWrites,r.path);else{let t=r.children;L(t,t=>{e.visibleWrites=kf(e.visibleWrites,H(r.path,t))})}return!0}function Vf(e,t){if(e.snap)return G(e.path,t);for(let n in e.children)if(e.children.hasOwnProperty(n)&&G(H(e.path,n),t))return!0;return!1}function Hf(e){e.visibleWrites=Wf(e.allWrites,Uf,z()),e.lastWriteId=e.allWrites.length>0?e.allWrites[e.allWrites.length-1].writeId:-1}function Uf(e){return e.visible}function Wf(e,t,n){let r=Ef.empty();for(let i=0;i<e.length;++i){let a=e[i];if(t(a)){let e=a.path,t;if(a.snap)G(n,e)?(t=W(n,e),r=Df(r,t,a.snap)):G(e,n)&&(t=W(e,n),r=Df(r,z(),a.snap.getChild(t)));else if(a.children){if(G(n,e))t=W(n,e),r=Of(r,t,a.children);else if(G(e,n))if(t=W(e,n),U(t))r=Of(r,z(),a.children);else{let e=Go(a.children,B(t));if(e){let n=e.getChild(V(t));r=Df(r,z(),n)}}}else throw eo(`WriteRecord should have .snap or .children`)}}return r}function Gf(e,t,n,r,i){if(!r&&!i){let r=jf(e.visibleWrites,t);if(r!=null)return r;{let r=Nf(e.visibleWrites,t);return Pf(r)?n:n==null&&!Af(r,z())?null:Ff(r,n||X.EMPTY_NODE)}}{let a=Nf(e.visibleWrites,t);return!i&&Pf(a)?n:!i&&n==null&&!Af(a,z())?null:Ff(Wf(e.allWrites,function(e){return(e.visible||i)&&(!r||!~r.indexOf(e.writeId))&&(G(e.path,t)||G(t,e.path))},t),n||X.EMPTY_NODE)}}function Kf(e,t,n){let r=X.EMPTY_NODE,i=jf(e.visibleWrites,t);if(i)return i.isLeafNode()||i.forEachChild(Y,(e,t)=>{r=r.updateImmediateChild(e,t)}),r;if(n){let i=Nf(e.visibleWrites,t);return n.forEachChild(Y,(e,t)=>{let n=Ff(Nf(i,new R(e)),t);r=r.updateImmediateChild(e,n)}),Mf(i).forEach(e=>{r=r.updateImmediateChild(e.name,e.node)}),r}return Mf(Nf(e.visibleWrites,t)).forEach(e=>{r=r.updateImmediateChild(e.name,e.node)}),r}function qf(e,t,n,r,i){j(r||i,`Either existingEventSnap or existingServerSnap must exist`);let a=H(t,n);if(Af(e.visibleWrites,a))return null;{let t=Nf(e.visibleWrites,a);return Pf(t)?i.getChild(n):Ff(t,i.getChild(n))}}function Jf(e,t,n,r){let i=H(t,n);return jf(e.visibleWrites,i)??(r.isCompleteForChild(n)?Ff(Nf(e.visibleWrites,i),r.getNode().getImmediateChild(n)):null)}function Yf(e,t){return jf(e.visibleWrites,t)}function Xf(e,t,n,r,i,a,o){let s,c=Nf(e.visibleWrites,t),l=jf(c,z());if(l!=null)s=l;else if(n!=null)s=Ff(c,n);else return[];if(s=s.withIndex(o),!s.isEmpty()&&!s.isLeafNode()){let e=[],t=o.getCompare(),n=a?s.getReverseIteratorFrom(r,o):s.getIteratorFrom(r,o),c=n.getNext();for(;c&&e.length<i;)t(c,r)!==0&&e.push(c),c=n.getNext();return e}return[]}function Zf(){return{visibleWrites:Ef.empty(),allWrites:[],lastWriteId:-1}}function Qf(e,t,n,r){return Gf(e.writeTree,e.treePath,t,n,r)}function $f(e,t){return Kf(e.writeTree,e.treePath,t)}function ep(e,t,n,r){return qf(e.writeTree,e.treePath,t,n,r)}function tp(e,t){return Yf(e.writeTree,H(e.treePath,t))}function np(e,t,n,r,i,a){return Xf(e.writeTree,e.treePath,t,n,r,i,a)}function rp(e,t,n){return Jf(e.writeTree,e.treePath,t,n)}function ip(e,t){return ap(H(e.treePath,t),e.writeTree)}function ap(e,t){return{treePath:e,writeTree:t}}var op=class{constructor(){this.changeMap=new Map}trackChildChange(e){let t=e.type,n=e.childName;j(t===`child_added`||t===`child_changed`||t===`child_removed`,`Only child changes supported for tracking`),j(n!==`.priority`,`Only non-priority child changes can be tracked.`);let r=this.changeMap.get(n);if(r){let i=r.type;if(t===`child_added`&&i===`child_removed`)this.changeMap.set(n,Bd(n,e.snapshotNode,r.snapshotNode));else if(t===`child_removed`&&i===`child_added`)this.changeMap.delete(n);else if(t===`child_removed`&&i===`child_changed`)this.changeMap.set(n,zd(n,r.oldSnap));else if(t===`child_changed`&&i===`child_added`)this.changeMap.set(n,Rd(n,e.snapshotNode));else if(t===`child_changed`&&i===`child_changed`)this.changeMap.set(n,Bd(n,e.snapshotNode,r.oldSnap));else throw eo(`Illegal combination of changes: `+e+` occurred after `+r)}else this.changeMap.set(n,e)}getChanges(){return Array.from(this.changeMap.values())}},sp=new class{getCompleteChild(e){return null}getChildAfterChild(e,t,n){return null}},cp=class{constructor(e,t,n=null){this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}getCompleteChild(e){let t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{let t=this.optCompleteServerCache_==null?this.viewCache_.serverCache:new pf(this.optCompleteServerCache_,!0,!1);return rp(this.writes_,e,t)}}getChildAfterChild(e,t,n){let r=this.optCompleteServerCache_==null?Cf(this.viewCache_):this.optCompleteServerCache_,i=np(this.writes_,r,t,1,n,e);return i.length===0?null:i[0]}};function lp(e){return{filter:e}}function up(e,t){j(t.eventCache.getNode().isIndexed(e.filter.getIndex()),`Event snap not indexed`),j(t.serverCache.getNode().isIndexed(e.filter.getIndex()),`Server snap not indexed`)}function dp(e,t,n,r,i){let a=new op,o,s;if(n.type===Q.OVERWRITE){let c=n;c.source.fromUser?o=hp(e,t,c.path,c.snap,r,i,a):(j(c.source.fromServer,`Unknown source.`),s=c.source.tagged||t.serverCache.isFiltered()&&!U(c.path),o=mp(e,t,c.path,c.snap,r,i,s,a))}else if(n.type===Q.MERGE){let c=n;c.source.fromUser?o=_p(e,t,c.path,c.children,r,i,a):(j(c.source.fromServer,`Unknown source.`),s=c.source.tagged||t.serverCache.isFiltered(),o=yp(e,t,c.path,c.children,r,i,s,a))}else if(n.type===Q.ACK_USER_WRITE){let s=n;o=s.revert?Sp(e,t,s.path,r,i,a):bp(e,t,s.path,s.affectedTree,r,i,a)}else if(n.type===Q.LISTEN_COMPLETE)o=xp(e,t,n.path,r,a);else throw eo(`Unknown operation type: `+n.type);let c=a.getChanges();return fp(t,o,c),{viewCache:o,changes:c}}function fp(e,t,n){let r=t.eventCache;if(r.isFullyInitialized()){let i=r.getNode().isLeafNode()||r.getNode().isEmpty(),a=Sf(e);(n.length>0||!e.eventCache.isFullyInitialized()||i&&!r.getNode().equals(a)||!r.getNode().getPriority().equals(a.getPriority()))&&n.push(Ld(Sf(t)))}}function pp(e,t,n,r,i,a){let o=t.eventCache;if(tp(r,n)!=null)return t;{let s,c;if(U(n))if(j(t.serverCache.isFullyInitialized(),`If change path is empty, we must have complete server data`),t.serverCache.isFiltered()){let n=Cf(t),i=$f(r,n instanceof X?n:X.EMPTY_NODE);s=e.filter.updateFullNode(t.eventCache.getNode(),i,a)}else{let n=Qf(r,Cf(t));s=e.filter.updateFullNode(t.eventCache.getNode(),n,a)}else{let l=B(n);if(l===`.priority`){j(Hu(n)===1,`Can't have a priority with additional path components`);let i=o.getNode();c=t.serverCache.getNode();let a=ep(r,n,i,c);s=a==null?o.getNode():e.filter.updatePriority(i,a)}else{let u=V(n),d;if(o.isCompleteForChild(l)){c=t.serverCache.getNode();let e=ep(r,n,o.getNode(),c);d=e==null?o.getNode().getImmediateChild(l):o.getNode().getImmediateChild(l).updateChild(u,e)}else d=rp(r,l,t.serverCache);s=d==null?o.getNode():e.filter.updateChild(o.getNode(),l,d,u,i,a)}}return bf(t,s,o.isFullyInitialized()||U(n),e.filter.filtersNodes())}}function mp(e,t,n,r,i,a,o,s){let c=t.serverCache,l,u=o?e.filter:e.filter.getIndexedFilter();if(U(n))l=u.updateFullNode(c.getNode(),r,null);else if(u.filtersNodes()&&!c.isFiltered()){let e=c.getNode().updateChild(n,r);l=u.updateFullNode(c.getNode(),e,null)}else{let e=B(n);if(!c.isCompleteForPath(n)&&Hu(n)>1)return t;let i=V(n),a=c.getNode().getImmediateChild(e).updateChild(i,r);l=e===`.priority`?u.updatePriority(c.getNode(),a):u.updateChild(c.getNode(),e,a,i,sp,null)}let d=xf(t,l,c.isFullyInitialized()||U(n),u.filtersNodes());return pp(e,d,n,i,new cp(i,d,a),s)}function hp(e,t,n,r,i,a,o){let s=t.eventCache,c,l,u=new cp(i,t,a);if(U(n))l=e.filter.updateFullNode(t.eventCache.getNode(),r,o),c=bf(t,l,!0,e.filter.filtersNodes());else{let i=B(n);if(i===`.priority`)l=e.filter.updatePriority(t.eventCache.getNode(),r),c=bf(t,l,s.isFullyInitialized(),s.isFiltered());else{let a=V(n),l=s.getNode().getImmediateChild(i),d;if(U(a))d=r;else{let e=u.getCompleteChild(i);d=e==null?X.EMPTY_NODE:Uu(a)===`.priority`&&e.getChild(Ku(a)).isEmpty()?e:e.updateChild(a,r)}c=l.equals(d)?t:bf(t,e.filter.updateChild(s.getNode(),i,d,a,u,o),s.isFullyInitialized(),e.filter.filtersNodes())}}return c}function gp(e,t){return e.eventCache.isCompleteForChild(t)}function _p(e,t,n,r,i,a,o){let s=t;return r.foreach((r,c)=>{let l=H(n,r);gp(t,B(l))&&(s=hp(e,s,l,c,i,a,o))}),r.foreach((r,c)=>{let l=H(n,r);gp(t,B(l))||(s=hp(e,s,l,c,i,a,o))}),s}function vp(e,t,n){return n.foreach((e,n)=>{t=t.updateChild(e,n)}),t}function yp(e,t,n,r,i,a,o,s){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;let c=t,l;l=U(n)?r:new $(null).setTree(n,r);let u=t.serverCache.getNode();return l.children.inorderTraversal((n,r)=>{if(u.hasChild(n)){let l=vp(e,t.serverCache.getNode().getImmediateChild(n),r);c=mp(e,c,new R(n),l,i,a,o,s)}}),l.children.inorderTraversal((n,r)=>{let l=!t.serverCache.isCompleteForChild(n)&&r.value===null;if(!u.hasChild(n)&&!l){let l=vp(e,t.serverCache.getNode().getImmediateChild(n),r);c=mp(e,c,new R(n),l,i,a,o,s)}}),c}function bp(e,t,n,r,i,a,o){if(tp(i,n)!=null)return t;let s=t.serverCache.isFiltered(),c=t.serverCache;if(r.value!=null){if(U(n)&&c.isFullyInitialized()||c.isCompleteForPath(n))return mp(e,t,n,c.getNode().getChild(n),i,a,s,o);if(U(n)){let r=new $(null);return c.getNode().forEachChild(dd,(e,t)=>{r=r.set(new R(e),t)}),yp(e,t,n,r,i,a,s,o)}return t}{let l=new $(null);return r.foreach((e,t)=>{let r=H(n,e);c.isCompleteForPath(r)&&(l=l.set(e,c.getNode().getChild(r)))}),yp(e,t,n,l,i,a,s,o)}}function xp(e,t,n,r,i){let a=t.serverCache;return pp(e,xf(t,a.getNode(),a.isFullyInitialized()||U(n),a.isFiltered()),n,r,sp,i)}function Sp(e,t,n,r,i,a){let o;if(tp(r,n)!=null)return t;{let s=new cp(r,t,i),c=t.eventCache.getNode(),l;if(U(n)||B(n)===`.priority`){let n;if(t.serverCache.isFullyInitialized())n=Qf(r,Cf(t));else{let e=t.serverCache.getNode();j(e instanceof X,`serverChildren would be complete if leaf node`),n=$f(r,e)}n=n,l=e.filter.updateFullNode(c,n,a)}else{let i=B(n),u=rp(r,i,t.serverCache);u==null&&t.serverCache.isCompleteForChild(i)&&(u=c.getImmediateChild(i)),l=u==null?t.eventCache.getNode().hasChild(i)?e.filter.updateChild(c,i,X.EMPTY_NODE,V(n),s,a):c:e.filter.updateChild(c,i,u,V(n),s,a),l.isEmpty()&&t.serverCache.isFullyInitialized()&&(o=Qf(r,Cf(t)),o.isLeafNode()&&(l=e.filter.updateFullNode(l,o,a)))}return o=t.serverCache.isFullyInitialized()||tp(r,z())!=null,bf(t,l,o,e.filter.filtersNodes())}}var Cp=class{constructor(e,t){this.query_=e,this.eventRegistrations_=[];let n=this.query_._queryParams,r=new Hd(n.getIndex()),i=Kd(n);this.processor_=lp(i);let a=t.serverCache,o=t.eventCache,s=r.updateFullNode(X.EMPTY_NODE,a.getNode(),null),c=i.updateFullNode(X.EMPTY_NODE,o.getNode(),null),l=new pf(s,a.isFullyInitialized(),r.filtersNodes()),u=new pf(c,o.isFullyInitialized(),i.filtersNodes());this.viewCache_=yf(u,l),this.eventGenerator_=new mf(this.query_)}get query(){return this.query_}};function wp(e){return e.viewCache_.serverCache.getNode()}function Tp(e,t){let n=Cf(e.viewCache_);return n&&(e.query._queryParams.loadsAllData()||!U(t)&&!n.getImmediateChild(B(t)).isEmpty())?n.getChild(t):null}function Ep(e){return e.eventRegistrations_.length===0}function Dp(e,t){e.eventRegistrations_.push(t)}function Op(e,t,n){let r=[];
20if(n){j(t==null,`A cancel should cancel all event registrations.`);let i=e.query._path;e.eventRegistrations_.forEach(e=>{let t=e.createCancelEvent(n,i);t&&r.push(t)})}if(t){let n=[];for(let r=0;r<e.eventRegistrations_.length;++r){let i=e.eventRegistrations_[r];if(!i.matches(t))n.push(i);else if(t.hasAnyCallback()){n=n.concat(e.eventRegistrations_.slice(r+1));break}}e.eventRegistrations_=n}else e.eventRegistrations_=[];return r}function kp(e,t,n,r){t.type===Q.MERGE&&t.source.queryId!==null&&(j(Cf(e.viewCache_),`We should always have a full cache before handling merges`),j(Sf(e.viewCache_),`Missing event cache, even though we have a server cache`));let i=e.viewCache_,a=dp(e.processor_,i,t,n,r);return up(e.processor_,a.viewCache),j(a.viewCache.serverCache.isFullyInitialized()||!i.serverCache.isFullyInitialized(),`Once a server snap is complete, it should never go back`),e.viewCache_=a.viewCache,jp(e,a.changes,a.viewCache.eventCache.getNode(),null)}function Ap(e,t){let n=e.viewCache_.eventCache,r=[];return n.getNode().isLeafNode()||n.getNode().forEachChild(Y,(e,t)=>{r.push(Rd(e,t))}),n.isFullyInitialized()&&r.push(Ld(n.getNode())),jp(e,r,n.getNode(),t)}function jp(e,t,n,r){let i=r?[r]:e.eventRegistrations_;return hf(e.eventGenerator_,t,n,i)}var Mp,Np=class{constructor(){this.views=new Map}};function Pp(e){j(!Mp,`__referenceConstructor has already been defined`),Mp=e}function Fp(){return j(Mp,`Reference.ts has not been loaded`),Mp}function Ip(e){return e.views.size===0}function Lp(e,t,n,r){let i=t.source.queryId;if(i!==null){let a=e.views.get(i);return j(a!=null,`SyncTree gave us an op for an invalid query.`),kp(a,t,n,r)}{let i=[];for(let a of e.views.values())i=i.concat(kp(a,t,n,r));return i}}function Rp(e,t,n,r,i){let a=t._queryIdentifier,o=e.views.get(a);if(!o){let e=Qf(n,i?r:null),a=!1;return e?a=!0:r instanceof X?(e=$f(n,r),a=!1):(e=X.EMPTY_NODE,a=!1),new Cp(t,yf(new pf(e,a,!1),new pf(r,i,!1)))}return o}function zp(e,t,n,r,i,a){let o=Rp(e,t,r,i,a);return e.views.has(t._queryIdentifier)||e.views.set(t._queryIdentifier,o),Dp(o,n),Ap(o,n)}function Bp(e,t,n,r){let i=t._queryIdentifier,a=[],o=[],s=Gp(e);if(i==="default")for(let[t,i]of e.views.entries())o=o.concat(Op(i,n,r)),Ep(i)&&(e.views.delete(t),i.query._queryParams.loadsAllData()||a.push(i.query));else{let t=e.views.get(i);t&&(o=o.concat(Op(t,n,r)),Ep(t)&&(e.views.delete(i),t.query._queryParams.loadsAllData()||a.push(t.query)))}return s&&!Gp(e)&&a.push(new(Fp())(t._repo,t._path)),{removed:a,events:o}}function Vp(e){let t=[];for(let n of e.views.values())n.query._queryParams.loadsAllData()||t.push(n);return t}function Hp(e,t){let n=null;for(let r of e.views.values())n||=Tp(r,t);return n}function Up(e,t){if(t._queryParams.loadsAllData())return Kp(e);{let n=t._queryIdentifier;return e.views.get(n)}}function Wp(e,t){return Up(e,t)!=null}function Gp(e){return Kp(e)!=null}function Kp(e){for(let t of e.views.values())if(t.query._queryParams.loadsAllData())return t;return null}var qp;function Jp(e){j(!qp,`__referenceConstructor has already been defined`),qp=e}function Yp(){return j(qp,`Reference.ts has not been loaded`),qp}var Xp=1,Zp=class{constructor(e){this.listenProvider_=e,this.syncPointTree_=new $(null),this.pendingWriteTree_=Zf(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}};function Qp(e,t,n,r,i){return Rf(e.pendingWriteTree_,t,n,r,i),i?lm(e,new df(of(),t,n)):[]}function $p(e,t,n=!1){let r=zf(e.pendingWriteTree_,t);if(Bf(e.pendingWriteTree_,t)){let t=new $(null);return r.snap==null?L(r.children,e=>{t=t.set(new R(e),!0)}):t=t.set(z(),!0),lm(e,new lf(r.path,t,n))}return[]}function em(e,t,n){return lm(e,new df(sf(),t,n))}function tm(e,t,n){let r=$.fromObject(n);return lm(e,new ff(sf(),t,r))}function nm(e,t){return lm(e,new uf(sf(),t))}function rm(e,t,n){let r=hm(e,n);if(r){let n=gm(r),i=n.path,a=n.queryId,o=W(i,t);return _m(e,i,new uf(cf(a),o))}return[]}function im(e,t,n,r,i=!1){let a=t._path,o=e.syncPointTree_.get(a),s=[];if(o&&(t._queryIdentifier==="default"||Wp(o,t))){let c=Bp(o,t,n,r);Ip(o)&&(e.syncPointTree_=e.syncPointTree_.remove(a));let l=c.removed;if(s=c.events,!i){let n=l.findIndex(e=>e._queryParams.loadsAllData())!==-1,i=e.syncPointTree_.findOnPath(a,(e,t)=>Gp(t));if(n&&!i){let t=e.syncPointTree_.subtree(a);if(!t.isEmpty()){let n=vm(t);for(let t=0;t<n.length;++t){let r=n[t],i=r.query,a=fm(e,r);
20e.listenProvider_.startListening(ym(i),pm(e,i),a.hashFn,a.onComplete)}}}!i&&l.length>0&&!r&&(n?e.listenProvider_.stopListening(ym(t),null):l.forEach(t=>{let n=e.queryToTagMap.get(mm(t));e.listenProvider_.stopListening(ym(t),n)}))}bm(e,l)}return s}function am(e,t,n,r){let i=hm(e,r);if(i!=null){let r=gm(i),a=r.path,o=r.queryId,s=W(a,t);return _m(e,a,new df(cf(o),s,n))}return[]}function om(e,t,n,r){let i=hm(e,r);if(i){let r=gm(i),a=r.path,o=r.queryId,s=W(a,t),c=$.fromObject(n);return _m(e,a,new ff(cf(o),s,c))}return[]}function sm(e,t,n,r=!1){let i=t._path,a=null,o=!1;e.syncPointTree_.foreachOnPath(i,(e,t)=>{let n=W(e,i);a||=Hp(t,n),o||=Gp(t)});let s=e.syncPointTree_.get(i);s?(o||=Gp(s),a||=Hp(s,z())):(s=new Np,e.syncPointTree_=e.syncPointTree_.set(i,s));let c;a==null?(c=!1,a=X.EMPTY_NODE,e.syncPointTree_.subtree(i).foreachChild((e,t)=>{let n=Hp(t,z());n&&(a=a.updateImmediateChild(e,n))})):c=!0;let l=Wp(s,t);if(!l&&!t._queryParams.loadsAllData()){let n=mm(t);j(!e.queryToTagMap.has(n),`View does not exist, but we have a tag`);let r=xm();e.queryToTagMap.set(n,r),e.tagToQueryMap.set(r,n)}let u=Lf(e.pendingWriteTree_,i),d=zp(s,t,n,u,a,c);if(!l&&!o&&!r){let n=Up(s,t);d=d.concat(Sm(e,t,n))}return d}function cm(e,t,n){let r=e.pendingWriteTree_;return Gf(r,t,e.syncPointTree_.findOnPath(t,(e,n)=>{let r=Hp(n,W(e,t));if(r)return r}),n,!0)}function lm(e,t){return um(t,e.syncPointTree_,null,Lf(e.pendingWriteTree_,z()))}function um(e,t,n,r){if(U(e.path))return dm(e,t,n,r);{let i=t.get(z());n==null&&i!=null&&(n=Hp(i,z()));let a=[],o=B(e.path),s=e.operationForChild(o),c=t.children.get(o);if(c&&s){let e=n?n.getImmediateChild(o):null,t=ip(r,o);a=a.concat(um(s,c,e,t))}return i&&(a=a.concat(Lp(i,e,r,n))),a}}function dm(e,t,n,r){let i=t.get(z());n==null&&i!=null&&(n=Hp(i,z()));let a=[];return t.children.inorderTraversal((t,i)=>{let o=n?n.getImmediateChild(t):null,s=ip(r,t),c=e.operationForChild(t);c&&(a=a.concat(dm(c,i,o,s)))}),i&&(a=a.concat(Lp(i,e,r,n))),a}function fm(e,t){let n=t.query,r=pm(e,n);return{hashFn:()=>(wp(t)||X.EMPTY_NODE).hash(),onComplete:t=>{if(t===`ok`)return r?rm(e,n._path,r):nm(e,n._path);{let r=wl(t,n);return im(e,n,null,r)}}}}function pm(e,t){let n=mm(t);return e.queryToTagMap.get(n)}function mm(e){return e._path.toString()+`$`+e._queryIdentifier}function hm(e,t){return e.tagToQueryMap.get(t)}function gm(e){let t=e.indexOf(`$`);return j(t!==-1&&t<e.length-1,`Bad queryKey.`),{queryId:e.substr(t+1),path:new R(e.substr(0,t))}}function _m(e,t,n){let r=e.syncPointTree_.get(t);return j(r,`Missing sync point for query tag that we're tracking`),Lp(r,n,Lf(e.pendingWriteTree_,t),null)}function vm(e){return e.fold((e,t,n)=>{if(t&&Gp(t))return[Kp(t)];{let e=[];return t&&(e=Vp(t)),L(n,(t,n)=>{e=e.concat(n)}),e}})}
20function ym(e){return e._queryParams.loadsAllData()&&!e._queryParams.isDefault()?new(Yp())(e._repo,e._path):e}function bm(e,t){for(let n=0;n<t.length;++n){let r=t[n];if(!r._queryParams.loadsAllData()){let t=mm(r),n=e.queryToTagMap.get(t);e.queryToTagMap.delete(t),e.tagToQueryMap.delete(n)}}}function xm(){return Xp++}function Sm(e,t,n){let r=t._path,i=pm(e,t),a=fm(e,n),o=e.listenProvider_.startListening(ym(t),i,a.hashFn,a.onComplete),s=e.syncPointTree_.subtree(r);if(i)j(!Gp(s.value),`If we're adding a query, it shouldn't be shadowed`);else{let t=s.fold((e,t,n)=>{if(!U(e)&&t&&Gp(t))return[Kp(t).query];{let e=[];return t&&(e=e.concat(Vp(t).map(e=>e.query))),L(n,(t,n)=>{e=e.concat(n)}),e}});for(let n=0;n<t.length;++n){let r=t[n];e.listenProvider_.stopListening(ym(r),pm(e,r))}}return o}var Cm=class e{constructor(e){this.node_=e}getImmediateChild(t){let n=this.node_.getImmediateChild(t);return new e(n)}node(){return this.node_}},wm=class e{constructor(e,t){this.syncTree_=e,this.path_=t}getImmediateChild(t){let n=H(this.path_,t);return new e(this.syncTree_,n)}node(){return cm(this.syncTree_,this.path_)}},Tm=function(e){return e||={},e.timestamp=e.timestamp||new Date().getTime(),e},Em=function(e,t,n){if(!e||typeof e!=`object`)return e;if(j(`.sv`in e,`Unexpected leaf node or priority contents`),typeof e[`.sv`]==`string`)return Dm(e[`.sv`],t,n);if(typeof e[`.sv`]==`object`)return Om(e[`.sv`],t);j(!1,`Unexpected server value: `+JSON.stringify(e,null,2))},Dm=function(e,t,n){switch(e){case`timestamp`:return n.timestamp;default:j(!1,`Unexpected server value: `+e)}},Om=function(e,t,n){e.hasOwnProperty(`increment`)||j(!1,`Unexpected server value: `+JSON.stringify(e,null,2));let r=e.increment;typeof r!=`number`&&j(!1,`Unexpected increment value: `+r);let i=t.node();if(j(i!=null,`Expected ChildrenNode.EMPTY_NODE for nulls`),!i.isLeafNode())return r;let a=i.getValue();return typeof a==`number`?a+r:r},km=function(e,t,n,r){return jm(t,new wm(n,e),r)},Am=function(e,t,n){return jm(e,new Cm(t),n)};function jm(e,t,n){let r=Em(e.getPriority().val(),t.getImmediateChild(`.priority`),n),i;if(e.isLeafNode()){let i=e,a=Em(i.getValue(),t,n);return a!==i.getValue()||r!==i.getPriority().val()?new xd(a,Z(r)):e}{let a=e;return i=a,r!==a.getPriority().val()&&(i=i.updatePriority(new xd(r))),a.forEachChild(Y,(e,r)=>{let a=jm(r,t.getImmediateChild(e),n);a!==r&&(i=i.updateImmediateChild(e,a))}),i}}var Mm=class{constructor(e=``,t=null,n={children:{},childCount:0}){this.name=e,this.parent=t,this.node=n}};function Nm(e,t){let n=t instanceof R?t:new R(t),r=e,i=B(n);for(;i!==null;){let e=Go(r.node.children,i)||{children:{},childCount:0};r=new Mm(i,r,e),n=V(n),i=B(n)}return r}function Pm(e){return e.node.value}function Fm(e,t){e.node.value=t,Hm(e)}function Im(e){return e.node.childCount>0}function Lm(e){return Pm(e)===void 0&&!Im(e)}function Rm(e,t){L(e.node.children,(n,r)=>{t(new Mm(n,e,r))})}function zm(e,t,n,r){n&&!r&&t(e),Rm(e,e=>{zm(e,t,!0,r)}),n&&r&&t(e)}function Bm(e,t,n){let r=n?e:e.parent;for(;r!==null;){if(t(r))return!0;r=r.parent}return!1}function Vm(e){return new R(e.parent===null?e.name:Vm(e.parent)+`/`+e.name)}function Hm(e){e.parent!==null&&Um(e.parent,e.name,e)}function Um(e,t,n){let r=Lm(n),i=Wo(e.node.children,t);r&&i?(delete e.node.children[t],e.node.childCount--,Hm(e)):!r&&!i&&(e.node.children[t]=n.node,e.node.childCount++,Hm(e))}var Wm=/[\[\].#$\/\u0000-\u001F\u007F]/,Gm=/[\[\].#$\u0000-\u001F\u007F]/,Km=10485760,qm=function(e){return typeof e==`string`&&e.length!==0&&!Wm.test(e)},Jm=function(e){return typeof e==`string`&&e.length!==0&&!Gm.test(e)},Ym=function(e){return e&&=e.replace(/^\/*\.info(\/|$)/,`/`),Jm(e)},Xm=function(e,t,n){let r=n instanceof R?new Ju(n,e):n;if(t===void 0)throw Error(e+`contains undefined `+Qu(r));if(typeof t==`function`)throw Error(e+`contains a function `+Qu(r)+` with contents = `+t.toString());if(fl(t))throw Error(e+`contains `+t.toString()+` `+Qu(r));if(typeof t==`string`&&t.length>Km/3&&es(t)>Km)throw Error(e+`contains a string greater than 10485760 utf8 bytes `+Qu(r)+` ('`+t.substring(0,50)+`...')`);if(t&&typeof t==`object`){let n=!1,i=!1;if(L(t,(t,a)=>{if(t===`.value`)n=!0;else if(t!==`.priority`&&t!==`.sv`&&(i=!0,!qm(t)))throw Error(e+` contains an invali
20d key (`+t+`) `+Qu(r)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);Yu(r,t),Xm(e,a,r),Xu(r)}),n&&i)throw Error(e+` contains ".value" child `+Qu(r)+` in addition to actual children.`)}},Zm=function(e,t,n,r){if(!(r&&n===void 0)&&!Jm(n))throw Error(Qo(e,t)+`was an invalid path = "`+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},Qm=function(e,t,n,r){n&&=n.replace(/^\/*\.info(\/|$)/,`/`),Zm(e,t,n,r)},$m=function(e,t){let n=t.path.toString();if(typeof t.repoInfo.host!=`string`||t.repoInfo.host.length===0||!qm(t.repoInfo.namespace)&&t.repoInfo.host.split(`:`)[0]!==`localhost`||n.length!==0&&!Ym(n))throw Error(Qo(e,`url`)+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)},eh=class{constructor(){this.eventLists_=[],this.recursionDepth_=0}};function th(e,t){let n=null;for(let r=0;r<t.length;r++){let i=t[r],a=i.getPath();n!==null&&!qu(a,n.path)&&(e.eventLists_.push(n),n=null),n===null&&(n={events:[],path:a}),n.events.push(i)}n&&e.eventLists_.push(n)}function nh(e,t,n){th(e,n),ih(e,e=>qu(e,t))}function rh(e,t,n){th(e,n),ih(e,e=>G(e,t)||G(t,e))}function ih(e,t){e.recursionDepth_++;let n=!0;for(let r=0;r<e.eventLists_.length;r++){let i=e.eventLists_[r];if(i){let a=i.path;t(a)?(ah(e.eventLists_[r]),e.eventLists_[r]=null):n=!1}}n&&(e.eventLists_=[]),e.recursionDepth_--}function ah(e){for(let t=0;t<e.events.length;t++){let n=e.events[t];if(n!==null){e.events[t]=null;let r=n.getEventRunner();ol&&P(`event: `+n.toString()),kl(r)}}}var oh=`repo_interrupt`,sh=25,ch=class{constructor(e,t,n,r){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=n,this.appCheckProvider_=r,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new eh,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Zd(),this.transactionQueueTree_=new Mm,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?`https://`:`http://`)+this.repoInfo_.host}};function lh(e,t,n){if(e.stats_=Ql(e.repoInfo_),e.forceRestClient_||Al())e.server_=new Yd(e.repoInfo_,(t,n,r,i)=>{fh(e,t,n,r,i)},e.authTokenProvider_,e.appCheckProvider_),setTimeout(()=>ph(e,!0),0);else{if(n!=null){if(typeof n!=`object`)throw Error(`Only objects are supported for option databaseAuthVariableOverride`);try{M(n)}catch(e){throw Error(`Invalid authOverride provided: `+e)}}e.persistentConnection_=new sd(e.repoInfo_,t,(t,n,r,i)=>{fh(e,t,n,r,i)},t=>{ph(e,t)},t=>{mh(e,t)},e.authTokenProvider_,e.appCheckProvider_,n),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener(t=>{e.server_.refreshAuthToken(t)}),e.appCheckProvider_.addTokenChangeListener(t=>{e.server_.refreshAppCheckToken(t.token)}),e.statsReporter_=$l(e.repoInfo_,()=>new af(e.stats_,e.server_)),e.infoData_=new Xd,e.infoSyncTree_=new Zp({startListening:(t,n,r,i)=>{let a=[],o=e.infoData_.getNode(t._path);return o.isEmpty()||(a=em(e.infoSyncTree_,t._path,o),setTimeout(()=>{i(`ok`)},0)),a},stopListening:()=>{}}),hh(e,`connected`,!1),e.serverSyncTree_=new Zp({startListening:(t,n,r,i)=>(e.server_.listen(t,r,n,(n,r)=>{let a=i(n,r);rh(e.eventQueue_,t._path,a)}),[]),stopListening:(t,n)=>{e.server_.unlisten(t,n)}})}function uh(e){let t=e.infoData_.getNode(new R(`.info/serverTimeOffset`)).val()||0;return new Date().getTime()+t}function dh(e){return Tm({timestamp:uh(e)})}function fh(e,t,n,r,i){e.dataUpdateCount++;let a=new R(t);n=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,n):n;let o=[];if(i)if(r){let t=qo(n,e=>Z(e));o=om(e.serverSyncTree_,a,t,i)}else{let t=Z(n);o=am(e.serverSyncTree_,a,t,i)}else if(r){let t=qo(n,e=>Z(e));o=tm(e.serverSyncTree_,a,t)}else{let t=Z(n);o=em(e.serverSyncTree_,a,t)}let s=a;o.length>0&&(s=Th(e,a)),rh(e.eventQueue_,s,o)}function ph(e,t){hh(e,`connected`,t),t===!1&&_h(e)}function mh(e,t){L(t,(t,n)=>{hh(e,t,n)})}function hh(e,t,n){let r=new R(`/.info/`+t),i=Z(n);e.infoData_.updateSnapshot(r,i);let a=em(e.infoSyncTree_,r,i);rh(e.eventQueue_,r,a)}function gh(e){return e.nextWriteId_++}function _h(e){xh(e,`onDisconnectEvents`);let t=dh(e),n=Zd();$d(e.onDisconnect_,z(),(r,i)=>{let a=km(r,i,e.serverSyncTree_,t);Qd(n,r,a)});let r=[];$d(n,z(),(t,n)=>{r=r.concat(em(e.serverSyncTree_,t,n)),Th(e,jh(e,t))}),e.onDisconnect_=Zd(),rh(e.eventQueue_,z(),r)}function vh(e,t,n){let r;r=B(t._path)===`.info`?sm(e.infoSyncTree_,t,n):sm(e.serverSyncTree_,t,n),nh(e.eventQueue_,t._path,r)}
vendor: 4,364 bytes, line 20
20function yh(e,t,n){let r;r=B(t._path)===`.info`?im(e.infoSyncTree_,t,n):im(e.serverSyncTree_,t,n),nh(e.eventQueue_,t._path,r)}function bh(e){e.persistentConnection_&&e.persistentConnection_.interrupt(oh)}function xh(e,...t){let n=``;e.persistentConnection_&&(n=e.persistentConnection_.id+`:`),P(n,...t)}function Sh(e,t,n){return cm(e.serverSyncTree_,t,n)||X.EMPTY_NODE}function Ch(e,t=e.transactionQueueTree_){if(t||Ah(e,t),Pm(t)){let n=Oh(e,t);j(n.length>0,`Sending zero length transaction queue`),n.every(e=>e.status===0)&&wh(e,Vm(t),n)}else Im(t)&&Rm(t,t=>{Ch(e,t)})}function wh(e,t,n){let r=Sh(e,t,n.map(e=>e.currentWriteId)),i=r,a=r.hash();for(let e=0;e<n.length;e++){let r=n[e];j(r.status===0,`tryToSendTransactionQueue_: items in queue should all be run.`),r.status=1,r.retryCount++;let a=W(t,r.path);i=i.updateChild(a,r.currentOutputSnapshotRaw)}let o=i.val(!0),s=t;e.server_.put(s.toString(),o,r=>{xh(e,`transaction put response`,{path:s.toString(),status:r});let i=[];if(r===`ok`){let r=[];for(let t=0;t<n.length;t++)n[t].status=2,i=i.concat($p(e.serverSyncTree_,n[t].currentWriteId)),n[t].onComplete&&r.push(()=>n[t].onComplete(null,!0,n[t].currentOutputSnapshotResolved)),n[t].unwatcher();Ah(e,Nm(e.transactionQueueTree_,t)),Ch(e,e.transactionQueueTree_),rh(e.eventQueue_,t,i);for(let e=0;e<r.length;e++)kl(r[e])}else{if(r===`datastale`)for(let e=0;e<n.length;e++)n[e].status===3?n[e].status=4:n[e].status=0;else{I(`transaction at `+s.toString()+` failed: `+r);for(let e=0;e<n.length;e++)n[e].status=4,n[e].abortReason=r}Th(e,t)}},a)}function Th(e,t){let n=Dh(e,t),r=Vm(n);return Eh(e,Oh(e,n),r),r}function Eh(e,t,n){if(t.length===0)return;let r=[],i=[],a=t.filter(e=>e.status===0).map(e=>e.currentWriteId);for(let o=0;o<t.length;o++){let s=t[o],c=W(n,s.path),l=!1,u;if(j(c!==null,`rerunTransactionsUnderNode_: relativePath should not be null.`),s.status===4)l=!0,u=s.abortReason,i=i.concat($p(e.serverSyncTree_,s.currentWriteId,!0));else if(s.status===0)if(s.retryCount>=sh)l=!0,u=`maxretry`,i=i.concat($p(e.serverSyncTree_,s.currentWriteId,!0));else{let n=Sh(e,s.path,a);s.currentInputSnapshot=n;let r=t[o].update(n.val());if(r!==void 0){Xm(`transaction failed: Data returned `,r,s.path);let t=Z(r);typeof r==`object`&&r&&Wo(r,`.priority`)||(t=t.updatePriority(n.getPriority()));let o=s.currentWriteId,c=dh(e),l=Am(t,n,c);s.currentOutputSnapshotRaw=t,s.currentOutputSnapshotResolved=l,s.currentWriteId=gh(e),a.splice(a.indexOf(o),1),i=i.concat(Qp(e.serverSyncTree_,s.path,l,s.currentWriteId,s.applyLocally)),i=i.concat($p(e.serverSyncTree_,o,!0))}else l=!0,u=`nodata`,i=i.concat($p(e.serverSyncTree_,s.currentWriteId,!0))}rh(e.eventQueue_,n,i),i=[],l&&(t[o].status=2,(function(e){setTimeout(e,0)})(t[o].unwatcher),t[o].onComplete&&(u===`nodata`?r.push(()=>t[o].onComplete(null,!1,t[o].currentInputSnapshot)):r.push(()=>t[o].onComplete(Error(u),!1,null))))}Ah(e,e.transactionQueueTree_);for(let e=0;e<r.length;e++)kl(r[e]);Ch(e,e.transactionQueueTree_)}function Dh(e,t){let n,r=e.transactionQueueTree_;for(n=B(t);n!==null&&Pm(r)===void 0;)r=Nm(r,n),t=V(t),n=B(t);return r}function Oh(e,t){let n=[];return kh(e,t,n),n.sort((e,t)=>e.order-t.order),n}function kh(e,t,n){let r=Pm(t);if(r)for(let e=0;e<r.length;e++)n.push(r[e]);Rm(t,t=>{kh(e,t,n)})}function Ah(e,t){let n=Pm(t);if(n){let e=0;for(let t=0;t<n.length;t++)n[t].status!==2&&(n[e]=n[t],e++);n.length=e,Fm(t,n.length>0?n:void 0)}Rm(t,t=>{Ah(e,t)})}function jh(e,t){let n=Vm(Dh(e,t)),r=Nm(e.transactionQueueTree_,t);return Bm(r,t=>{Mh(e,t)}),Mh(e,r),zm(r,t=>{Mh(e,t)}),n}function Mh(e,t){let n=Pm(t);if(n){let r=[],i=[],a=-1;for(let t=0;t<n.length;t++)n[t].status===3||(n[t].status===1?(j(a===t-1,`All SENT items should be at beginning of queue.`),a=t,n[t].status=3,n[t].abortReason=`set`):(j(n[t].status===0,`Unexpected transaction status in abort`),n[t].unwatcher(),i=i.concat($p(e.serverSyncTree_,n[t].currentWriteId,!0)),n[t].onComplete&&r.push(n[t].onComplete.bind(null,Error(`set`),!1,null))));a===-1?Fm(t,void 0):n.length=a+1,rh(e.eventQueue_,Vm(t),i);for(let e=0;e<r.length;e++)kl(r[e])}}function Nh(e){let t=``,n=e.split(`/`);for(let e=0;e<n.length;e++)if(n[e].length>0){let r=n[e];try{r=decodeURIComponent(r.replace(/\+/g,` `))}catch{}t+=`/`+r}return t}function Ph(e){let t={};e.charAt(0)===`?`&&(e=e.substring(1));for(let n of e.split(`&`)){if(n.length===0)continue;let r=n.split(`=`);
vendor: 6,802 bytes, line 20
20r.length===2?t[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):I(`Invalid query segment '${n}' in query '${e}'`)}return t}var Fh=function(e,t){let n=Ih(e),r=n.namespace;n.domain===`firebase.com`&&F(n.host+` is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead`),(!r||r===`undefined`)&&n.domain!==`localhost`&&F(`Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com`),n.secure||dl();let i=n.scheme===`ws`||n.scheme===`wss`;return{repoInfo:new Kl(n.host,n.secure,r,i,t,``,r!==n.subdomain),path:new R(n.pathString)}},Ih=function(e){let t=``,n=``,r=``,i=``,a=``,o=!0,s=`https`,c=443;if(typeof e==`string`){let l=e.indexOf(`//`);l>=0&&(s=e.substring(0,l-1),e=e.substring(l+2));let u=e.indexOf(`/`);u===-1&&(u=e.length);let d=e.indexOf(`?`);d===-1&&(d=e.length),t=e.substring(0,Math.min(u,d)),u<d&&(i=Nh(e.substring(u,d)));let f=Ph(e.substring(Math.min(e.length,d)));l=t.indexOf(`:`),l>=0?(o=s===`https`||s===`wss`,c=parseInt(t.substring(l+1),10)):l=t.length;let p=t.slice(0,l);if(p.toLowerCase()===`localhost`)n=`localhost`;else if(p.split(`.`).length<=2)n=p;else{let e=t.indexOf(`.`);r=t.substring(0,e).toLowerCase(),n=t.substring(e+1),a=r}`ns`in f&&(a=f.ns)}return{host:t,port:c,domain:n,subdomain:r,secure:o,scheme:s,pathString:i,namespace:a}},Lh=class{constructor(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}getPath(){let e=this.snapshot.ref;return this.eventType===`value`?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+`:`+this.eventType+`:`+M(this.snapshot.exportVal())}},Rh=class{constructor(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}getPath(){return this.path}getEventType(){return`cancel`}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+`:cancel`}},zh=class{constructor(e,t){this.snapshotCallback=e,this.cancelCallback=t}onValue(e,t){this.snapshotCallback.call(null,e,t)}onCancel(e){return j(this.hasCancelCallback,`Raising a cancel event on a listener with no cancel callback`),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}},Bh=class e{constructor(e,t,n,r){this._repo=e,this._path=t,this._queryParams=n,this._orderByCalled=r}get key(){return U(this._path)?null:Uu(this._path)}get ref(){return new Vh(this._repo,this._path)}get _queryIdentifier(){let e=yl(Jd(this._queryParams));return e===`{}`?`default`:e}get _queryObject(){return Jd(this._queryParams)}isEqual(t){if(t=ts(t),!(t instanceof e))return!1;let n=this._repo===t._repo,r=qu(this._path,t._path),i=this._queryIdentifier===t._queryIdentifier;return n&&r&&i}toJSON(){return this.toString()}toString(){return this._repo.toString()+Wu(this._path)}},Vh=class e extends Bh{constructor(e,t){super(e,t,new Gd,!1)}get parent(){let t=Ku(this._path);return t===null?null:new e(this._repo,t)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}},Hh=class e{constructor(e,t,n){this._node=e,this.ref=t,this._index=n}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(t){let n=new R(t),r=Wh(this.ref,t);return new e(this._node.getChild(n),r,Y)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(t){return!this._node.isLeafNode()&&!!this._node.forEachChild(this._index,(n,r)=>t(new e(r,Wh(this.ref,n),Y)))}hasChild(e){let t=new R(e);return!this._node.getChild(t).isEmpty()}hasChildren(){return!this._node.isLeafNode()&&!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}};function Uh(e,t){return e=ts(e),e._checkNotDeleted(`ref`),t===void 0?e._root:Wh(e._root,t)}function Wh(e,t){return e=ts(e),B(e._path)===null?Qm(`child`,`path`,t,!1):Zm(`child`,`path`,t,!1),new Vh(e._repo,H(e._path,t))}var Gh=class e{constructor(e){this.callbackContext=e}respondsTo(e){return e===`value`}createEvent(e,t){let n=t._queryParams.getIndex();return new Lh(`value`,this,new Hh(e.snapshotNode,new Vh(t._repo,t._path),n))}getEventRunner(e){return e.getEventType()===`cancel`?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new Rh(this,e,t):null}matches(t){return t instanceof e?!t.callbackContext||!this.callbackContext||t.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}},Kh=class e{constructor(e,t){this.eventType=e,this.callbackContext=t}respondsTo(e){let t=e===`children_added`?`child_added`:e;return t=t===`children_removed`?`child_removed`:t,this.eventType===t}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new Rh(this,e,t):null}createEvent(e,t){j(e.childName!=null,`Child events should have a childName.`);let n=Wh(new Vh(t._repo,t._path),e.childName),r=t._queryParams.getIndex();return new Lh(e.type,this,new Hh(e.snapshotNode,n,r),e.prevName)}getEventRunner(e){return e.getEventType()===`cancel`?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(t){return t instanceof e&&this.eventType===t.eventType&&(!this.callbackContext||!t.callbackContext||this.callbackContext.matches(t.callbackContext))}hasAnyCallback(){return!!this.callbackContext}};function qh(e,t,n,r,i){let a;if(typeof r==`object`&&(a=void 0,i=r),typeof r==`function`&&(a=r),i&&i.onlyOnce){let t=n,r=(n,r)=>{yh(e._repo,e,s),t(n,r)};r.userCallback=n.userCallback,r.context=n.context,n=r}let o=new zh(n,a||void 0),s=t===`value`?new Gh(o):new Kh(t,o);return vh(e._repo,e,s),()=>yh(e._repo,e,s)}function Jh(e,t,n,r){return qh(e,`value`,t,n,r)}Pp(Vh),Jp(Vh);var Yh=`FIREBASE_DATABASE_EMULATOR_HOST`,Xh={},Zh=!1;function Qh(e,t,n,r){let i=t.lastIndexOf(`:`);e.repoInfo_=new Kl(t,xo(t.substring(0,i)),e.repoInfo_.namespace,e.repoInfo_.webSocketOnly,e.repoInfo_.nodeAdmin,e.repoInfo_.persistenceKey,e.repoInfo_.includeNamespaceInQueryParams,!0,n),r&&(e.authTokenProvider_=r)}function $h(e,t,n,r,i){let a=r||e.options.databaseURL;a===void 0&&(e.options.projectId||F(`Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp().`),P(`Using default host for project `,e.options.projectId),a=`${e.options.projectId}-default-rtdb.firebaseio.com`);let o=Fh(a,i),s=o.repoInfo,c,l;typeof process<`u`&&(l={}[Yh]),l?(c=!0,a=`http://${l}?ns=${s.namespace}`,o=Fh(a,i),s=o.repoInfo):c=!o.repoInfo.secure;
20let u=i&&c?new Pl(Pl.OWNER):new Nl(e.name,e.options,t);return $m(`Invalid Firebase Database URL`,o),U(o.path)||F(`Database URL must point to the root of a Firebase Database (not including a child path).`),new ng(tg(s,e,u,new Ml(e,n)),e)}function eg(e,t){let n=Xh[t];(!n||n[e.key]!==e)&&F(`Database ${t}(${e.repoInfo_}) has already been deleted.`),bh(e),delete n[e.key]}function tg(e,t,n,r){let i=Xh[t.name];i||(i={},Xh[t.name]=i);let a=i[e.toURLString()];return a&&F(`Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.`),a=new ch(e,Zh,n,r),i[e.toURLString()]=a,a}var ng=class{constructor(e,t){this._repoInternal=e,this.app=t,this.type=`database`,this._instanceStarted=!1}get _repo(){return this._instanceStarted||=(lh(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),!0),this._repoInternal}get _root(){return this._rootInternal||=new Vh(this._repo,z()),this._rootInternal}_delete(){return this._rootInternal!==null&&(eg(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&F(`Cannot call `+e+` on a deleted database.`)}};function rg(e=Oc(),t){let n=Sc(e,`database`).getImmediate({identifier:t});if(!n._instanceStarted){let e=vo(`database`);e&&ig(n,...e)}return n}function ig(e,t,n,r={}){e=ts(e),e._checkNotDeleted(`useEmulator`);let i=`${t}:${n}`,a=e._repoInternal;if(e._instanceStarted){if(i===e._repoInternal.repoInfo_.host&&Jo(r,a.repoInfo_.emulatorOptions))return;F(`connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.`)}let o;a.repoInfo_.nodeAdmin?(r.mockUserToken&&F(`mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".`),o=new Pl(Pl.OWNER)):r.mockUserToken&&(o=new Pl(typeof r.mockUserToken==`string`?r.mockUserToken:Co(r.mockUserToken,e.app.options.projectId))),xo(t)&&(So(t),Oo(`Database`,!0)),Qh(a,i,r,o)}function ag(e){Xc(Ec),xc(new ns(`database`,(e,{instanceIdentifier:t})=>$h(e.getProvider(`app`).getImmediate(),e.getProvider(`auth-internal`),e.getProvider(`app-check-internal`),t),`PUBLIC`).setMultipleInstances(!0)),kc(qc,Jc,e),kc(qc,Jc,`esm2020`)}sd.prototype.simpleListen=function(e,t){this.sendRequest(`q`,{p:e},t)},sd.prototype.echo=function(e,t){this.sendRequest(`echo`,{d:e},t)},ag();var og=k(e=>{let t=async(e,t,r,i)=>{let a=document.createElement(`button`),o=`http://www.w3.org/2000/svg`,s=document.createElementNS(o,`svg`);s.setAttribute(`xmlns`,o),s.setAttribute(`width`,`20`),s.setAttribute(`height`,`20`),s.setAttribute(`viewBox`,`0 0 24 24`),s.setAttribute(`fill`,`none`),s.setAttribute(`stroke`,`currentColor`),s.setAttribute(`stroke-width`,`2`),s.setAttribute(`class`,`h-5 w-5`),s.setAttribute(`style`,`display:block;`);let c=document.createElementNS(o,`path`);c.setAttribute(`stroke-linecap`,`round`),c.setAttribute(`stroke-linejoin`,`round`),c.setAttribute(`d`,`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`),s.appendChild(c),a.appendChild(s),Object.assign(a.style,{display:`flex`,alignItems:`center`,justifyContent:`center`,position:`fixed`,bottom:`1.5rem`,left:`1.5rem`,zIndex:`50`,padding:`0.75rem`,background:`#1d4ed8`,color:`#fff`,borderRadius:`0.5rem`,boxShadow:`0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -4px rgba(0,0,0,0.1)`,border:`none`,cursor:`pointer`,outline:`none`,transition:`all 0.2s`}),a.title=`Refresh`,a.addEventListener(`mouseenter`,()=>{a.style.background=`#1e40af`}),a.addEventListener(`mouseleave`,()=>{a.style.background=`#1d4ed8`}),a.addEventListener(`mousedown`,()=>{a.style.transform=`scale(0.95)`}),a.addEventListener(`mouseup`,()=>{a.style.transform=``}),a.addEventListener(`touchstart`,()=>{a.style.transform=`scale(0.95)`}),a.addEventListener(`touchend`,()=>{a.style.transform=``}),a.addEventListener(`click`,()=>{t.value=`page-refresh-`+Date.now()}),document.body.appendChild(a),await n(e,r,i)},n=async(e,t,n)=>{if(!e)return;document.addEventListener(`click`,e=>{if(e.target.closest(`.flex-section`)){let t=e.target.closest(`.flex-section`).dataset.index;window.parent.postMessage({type:`fmBlockClick`,data:{index:t}},`*`)}});let r=Ve(),i;try{let t=await fetch(`/api/flowmate/session/?sessionId=`+e),n=await t.json();i=t.ok&&!n?.error&&n?.apiKey?n:r.public?.flowmatePlugins?.firebase}catch{i=r.public?.flowmatePlugins?.firebase}if(!i)throw Error(`Firebase configuration is missing or invalid`);let a=rg(Dc(i));Jh(Uh(a,`sessions/`+e+`/context`),e=>{let n=e.val();n!==null&&(t.value=n)}),Jh(Uh(a,`sessions/`+e+`/activeBlockIndex`),e=>{let t=e.val();if(t!==null){n.value=t;let e=document.querySelector(`main [data-index="${n.value}"]`);
20e&&(document.querySelectorAll(`.flex-section`).forEach(e=>{e.classList.remove(`fm-active`)}),e.classList.add(`fm-active`),window.scrollTo({top:e.offsetTop-100,behavior:`smooth`}))}})};return{provide:{initFlowmate:(e,n,r,i)=>t(e,n,r,i),readSession:(e,t,r)=>n(e,t,r)}}}),sg=new Map;function cg(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(cg);let t=dn(null);for(let n of Object.keys(e))t[n]=cg(e[n]);return t}var lg=d((e,t,n)=>{if(t===`messages`||t===`datetimeFormats`||t===`numberFormats`)return e[t]??=dn(null),nn(n,e[t]),!0});async function ug(e){let t=b(),n={messages:dn(null)};for(let r of e){let e=await r().then(e=>dg(e)?e.default:e),i=an(e)?await t.runWithContext(()=>e()):e;n=lg(dn(null),i,n)}return n.fallbackLocale??=!1,n}var dg=e=>pn(e)===`[object Module]`;async function fg(e,t){let n=b();try{let r=await n.runWithContext(t.load).then(e=>dg(e)?e.default:e);return an(r)?await n.runWithContext(()=>r(e)):r}catch(t){throw Error(`Failed loading locale (${e}): `+t.message,{cause:t})}}async function pg(e,t=[]){let n=b(),r=await Promise.all(t.map(async t=>{let r=mg(t),i=r||await n.runWithContext(()=>fg(e,t));return!r&&t.cache!==!1&&sg.set(t.key,{ttl:Date.now()+864e5,value:i}),i})),i={};for(let e of r)nn(e,i);return i}function mg(e){if(e.cache===!1)return;let t=sg.get(e.key);if(t!=null)return t.ttl>Date.now()?t.value:void 0}function hg(e){return t=>!e.dynamic.includes(t)&&!e.undeliverable.includes(t)}function gg(e){return t=>!e.ssr||e.undeliverable.includes(t)||e.dynamic.includes(t)&&(e.prerender||e.ssg)}function _g(e){return e!=null&&`global`in e&&`mode`in e?e.global:e}function vg(e){let t=_g(e);return`__composer`in t?t.__composer:t}function yg(e,t){return e?e.$config.public.i18n:Ve(t).public.i18n}function bg(e){let t=yg(e).detectBrowserLanguage,n=t||{};return{...n,enabled:!!t,cookieKey:n.cookieKey||`i18n_redirected`}}function xg(e){if(e)return{path:`/`+(sn(e)?e:e.path).replace(/^\//,``),code:!sn(e)&&e.statusCode||302}}var Sg={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`};function Cg(e){return e.replace(/["'&<>]/g,e=>Sg[e])}var wg=()=>Ia(`i18n:cached-locale-configs`,()=>void 0),Tg=()=>Ia(`i18n:resolved-locale`,()=>``);function Eg(e,t){let n=!an(t)&&me(t).protocol;return n?{host:e.host,protocol:n}:e}function Dg(e){let{baseUrl:t,appBase:n,domains:r,getDomainForHost:i,getDomainFromLocale:a}=e,o=an(t)?t:()=>r&&i()||t||``;return e=>ft(e&&a(e)||o(),n)}function Og({cookieCrossOrigin:e,cookieDomain:t,cookieSecure:n,cookieKey:r}){let i=new Date;return vn(r||`i18n_redirected`,{path:`/`,readonly:!1,expires:new Date(i.setDate(i.getDate()+365)),sameSite:e?`none`:`lax`,domain:t||void 0,secure:e||n})}var kg=hg({dynamic:[],undeliverable:[]});function Ag(e,t,n,r=!1){let i=_g(t),a=yg(e),o=bg(e),s=wg(),c=Og(o),l=new Set,u=e=>s.value[e],d,f=()=>d??=Eg(on({xForwardedHost:!0}),a.baseUrl),p=Dg({baseUrl:an(a.baseUrl)?()=>a.baseUrl(e):a.baseUrl,appBase:e.$config.app.baseURL,domains:!1,getDomainForHost:()=>$t(a.domainLocales,f()),getDomainFromLocale:e=>Kn(a.domainLocales,f(),e)}),m=p,ee=Tg(),h=gg({ssr:!0,ssg:!1,prerender:!1,dynamic:[],undeliverable:[]}),te=e=>``,ne=async t=>{if(!(t in Qt))return;let n=await e.runWithContext(()=>pg(t,Qt[t])),a=r?cg(n):n;i.mergeLocaleMessage(t,a)},g=async e=>{if(!(e in Qt))return;let t=e=>Object.keys(e).filter(e=>!_.usesRuntimeLoaders(e)),n=u(e)?.cacheable?{}:{"Cache-Control":`no-cache`},r=ft(te(e),`/_i18n`,{da:`c37ef9b3`,en:`c37ef9b3`}[e],e,`messages.json`),a=await $fetch(r,{headers:n});for(let e of t(a))i.mergeLocaleMessage(e,a[e])},_={vueI18n:t,initial:!0,preloaded:!1,config:a,rootRedirect:xg(a.rootRedirect),redirectStatusCode:a.redirectStatusCode??302,usesRuntimeLoaders:e=>h(e),getDefaultLocale:()=>n,getLocale:()=>E(i.locale),setLocale:async t=>{let n=_.getLocale();t===n||!Jn(t)||(Le(i.locale)?i.locale.value=t:i.locale=t,await e.callHook(`i18n:localeSwitched`,{newLocale:t,oldLocale:n}),ee.value=t)},setLocaleSuspend:async t=>{Jn(t)&&(_.vueI18n.__pendingLocale=t,_.vueI18n.__pendingLocalePromise=new Promise(e=>{_.vueI18n.__resolvePendingLocalePromise=async()=>{_.setCookieLocale(t),await _.setLocale(t),_.vueI18n.__pendingLocale=void 0,e()}}),(e.isHydrating||!_.config.skipSettingLocaleOnNavigate)&&await _.vueI18n.__resolvePendingLocalePromise?.())},getLocales:()=>E(i.locales).map(e=>sn(e)?{code:e,domains:[],defaultForDomains:[]}:e),setCookieLocale:e=>{o.useCookie&&Jn(e)&&(c.value=e)},getBaseUrl:p,getCanonicalBaseUrl:m,loadMessages:async t=>{if(!(e.isHydrating&&l.has(t)))try{let e=u(t)?.fallbacks??[],n=e.includes(t)?e:[...e,t];if(!n.some(e=>_.usesRuntimeLoaders(e)))return await g(t);for(let e of n)try{await(_.usesRuntimeLoaders(e)?ne(e):g(e))}catch(t){console.warn(`Failed to load messages for locale "${e}"`,t)}}catch(e){console.warn(`Failed to load messages for locale "${t}"`,e)}finally{l.add(t)}},composableCtx:void 0};return _.composableCtx=On(_,e),_}
20function jg(e){if(e._nuxtI18n==null)throw Error(`Nuxt I18n context has not been set up yet.`);return e._nuxtI18n}function Mg(e){let{strategy:t,compactRoutes:n}=e;function r(r){if(t===`no_prefix`||r.name==null)return!1;let i=String(r.name);return cn(i)!==i||n&&r.matched.some(e=>e.meta.__i18nCompact)?!1:!e.getLocaleCodes().some(t=>e.hasRoute(jn(i,t,!1)))}return function(t,n,i=!1){let a=e.localeReach?.(n);if(a===`off-host`)return;if(a===`other-domain`){if(r(t)||i)return;let a=e.switchLocalePath(n,t);return!a||!C(a,{strict:!0})?void 0:{path:a,code:e.redirectStatusCode,external:!0}}if(t.path===`/`&&e.rootRedirect)return{path:e.localePath(e.rootRedirect.path,n),code:e.rootRedirect.code};if(r(t)||i||e.routeLocale(t)===n)return;let o=e.switchLocalePath(n,t)||e.localePath(t.fullPath,n);if(!te(o,t.fullPath))return{path:o,code:e.redirectStatusCode}}}function Ng(e,t){let n=[];for(let[r,i]of t.entries()){let a=e.find(e=>e.language?.toLowerCase()===i.toLowerCase());if(a){n.push({code:a.code,score:1-r/t.length});break}}for(let[r,i]of t.entries()){let a=i.split(`-`)[0].toLowerCase(),o=e.find(e=>e.language?.split(`-`)[0].toLowerCase()===a);if(o){n.push({code:o.code,score:.999-r/t.length});break}}return n}function Pg(e,t){return e.score===t.score?t.code.length-e.code.length:t.score-e.score}function Fg(e,t){return Ng(e.map(e=>({code:e.code,language:e.language||e.code})),t).sort(Pg).at(0)?.code??``}var Ig=(e,t)=>vn(t).value||void 0,Lg=(e,t)=>Mn(t),Rg=e=>Fg(gn,navigator.languages),zg=e=>new URL(window.location.href).host,Bg=e=>{let t=document.referrer;try{return t&&new URL(t).host||void 0}catch{return}},Vg=e=>gn.map(t=>un(t,e)),Hg=(e,t,n)=>{let r=yg(n),i,a,o=()=>i??=zg(e),s=()=>a??=Vg(r.domainLocales);return{cookie:()=>Ig(e,t.cookieKey),header:()=>void 0,navigator:()=>Rg(e),host:e=>en(s(),o(),Zt(e)),route:t=>Lg(e,t),onHost:e=>!e||tn(s(),o(),e)?e:void 0,fromOwnDomain:()=>{let t=Bg(e);return!!t&&s().some(e=>hn(e,t))},cookieSpans:()=>!!t.cookieDomain&&mn(s(),t.cookieDomain)}};function Ug(e){let{detection:t,routing:n,domains:r}=e,i=e.isSupportedLocale??Jn;function o(e,r){return n?!!(t.redirectOn===`root`&&e!==`/`||t.redirectOn===`no prefix`&&!t.alwaysRedirect&&i(r)):!1}return function(e,s,c){let l=sn(s)?a(s).pathname:s.path,u=e=>e,d=r?e.onHost:u;function*f(){let i=c&&t.enabled&&!o(l,e.route(l));if(i){let t=r&&!e.fromOwnDomain(),n=t&&e.cookieSpans()?u:d,i=t?u:d;yield n(e.cookie()),yield i(e.header()),yield i(e.navigator())}r&&(yield e.host(l)),n&&(yield e.route(s)),i&&(yield d(t.fallbackLocale))}for(let e of f())if(e&&i(e))return e;return``}}async function Wg(e,t){let n=jg(e),r=n.getLocale();if(t===r&&!n.initial&&(!n.vueI18n.__pendingLocale||n.vueI18n.__pendingLocale===t))return t;let i={oldLocale:r,newLocale:t,initialSetup:n.initial,context:e},a=await e.callHook(`i18n:beforeLocaleSwitch`,i);return a??=i.newLocale,Jn(a)&&(t=a),await n.loadMessages(t),await n.setLocaleSuspend(t),t}function Gg(e,t){let n=bg(e),r=Hg(Qe(e),n,e),i=jg(e);
20return Ug({detection:n,routing:!0,domains:!1})(r,t,i.initial)||i.getLocale()||i.getDefaultLocale()||``}function Kg(e,t,n){let r=jg(e),i=bn(e),a=Hg(Qe(),bg(e),e),o=Mg({localeReach:void 0,rootRedirect:r.rootRedirect,redirectStatusCode:r.redirectStatusCode,localePath:(e,t)=>Nn(i,e,t),switchLocalePath:(e,t)=>kn(i,e,t),routeLocale:e=>a.route(e),hasRoute:e=>i.router.hasRoute(e),getLocaleCodes:()=>i.getLocales().map(e=>e.code),strategy:`prefix_except_default`,compactRoutes:!1})(t,n,!!r.vueI18n.__pendingLocale&&!!b()._processingMiddleware);if(o)return Jt(o.path,{redirectCode:o.code,external:o.external})}var qg=k({name:`i18n:plugin:route-locale-detect`,dependsOn:[`i18n:plugin`],async setup(e){let t,n,r=b(e._id),i=jg(r),a=Tg();[t,n]=Ot(()=>r.runWithContext(()=>Wg(r,i.initial&&a.value||Gg(r,r.$router.currentRoute.value)))),await t,n(),at(`locale-changing`,Ge(async e=>{let t,n,a=([t,n]=Ot(()=>r.runWithContext(()=>Wg(r,Gg(r,e)))),t=await t,n(),t);return i.initial=!1,r.runWithContext(()=>Kg(r,e,a))},1),{global:!0})}},1);function Jg(e,{extendComposer:t,extendComposerInstance:n}){let r=Dt(),i=e.install.bind(e);e.install=(a,...o)=>{let s=ln({},o[0]);s.__composerExtend=t=>(n(t,vg(e)),()=>{}),e.mode===`legacy`&&(s.__vueI18nExtend=e=>(n(e,vg(e)),()=>{})),Reflect.apply(i,e,[a,s]);let c=vg(e);if(r.run(()=>{t(c),e.mode===`legacy`&&`__composer`in e.global&&n(e.global,vg(e.global))}),e.mode===`composition`&&a.config.globalProperties.$i18n!=null&&n(a.config.globalProperties.$i18n,c),a.unmount){let e=a.unmount.bind(a);a.unmount=()=>{r.stop(),e()}}}}var Yg=async e=>{let t=await ug(rn);t.locale=e||t.locale||`en-US`,t.defaultLocale=e,t.fallbackLocale??=!1,t.messages??={};for(let e of Yn)t.messages[e]??={};return t},Xg=k({name:`i18n:plugin`,parallel:!1,async setup(e){let n,r;Object.defineProperty(e.versions,"nuxtI18n",{get:()=>`10.6.0`});let i=b(e._id),a=yg(i),o=i.ssrContext?.event?.context?.nuxtI18n?.vueI18nOptions,s=Sn(on({xForwardedHost:!0}).host,a.defaultLocale),c=o||([n,r]=Ot(()=>Yg(s)),n=await n,r(),n),l=wg();l.value??=Gn(c.fallbackLocale),It(Yn.filter(kg).map(e=>`/_i18n/${{da:`c37ef9b3`,en:`c37ef9b3`}[e]}/${e}/messages.json`));let u=Dn(c),d=Hg(Qe(i),bg(i),i),f=Ag(i,u,c.defaultLocale,!!c.flatJson);i._nuxtI18n=f,Jg(u,{extendComposer(e){e.locales=T(()=>a.locales.map(e=>un(e,a.domainLocales))),e.localeCodes=T(()=>Yn);let n=t(f.getBaseUrl());e.baseUrl=T(()=>n.value),je(e.locale,()=>n.value=f.getBaseUrl()),e.strategy=`prefix_except_default`,e.localeProperties=T(()=>un(gn.find(t=>t.code===e.locale.value)||{code:e.locale.value,domains:[],defaultForDomains:[]},a.domainLocales)),e.setLocale=async e=>{await Wg(i,e),await i.runWithContext(()=>Kg(i,i.$router.currentRoute.value,e))},e.loadLocaleMessages=f.loadMessages,e.differentDomains=!1,e.defaultLocale=c.defaultLocale,e.getBrowserLocale=()=>qn(d.navigator()),e.getLocaleCookie=()=>qn(d.cookie()),e.setLocaleCookie=f.setCookieLocale,e.finalizePendingLocaleChange=async()=>{u.__pendingLocale&&await u.__resolvePendingLocalePromise?.()},e.waitForPendingLocaleChange=async()=>{await u?.__pendingLocalePromise}},extendComposerInstance(e,t){let n=[[`locales`,()=>t.locales],[`localeCodes`,()=>t.localeCodes],[`baseUrl`,()=>t.baseUrl],[`strategy`,()=>`prefix_except_default`],[`localeProperties`,()=>t.localeProperties],[`setLocale`,()=>e=>Reflect.apply(t.setLocale,t,[e])],[`loadLocaleMessages`,()=>e=>Reflect.apply(t.loadLocaleMessages,t,[e])],[`differentDomains`,()=>!1],[`defaultLocale`,()=>t.defaultLocale],[`getBrowserLocale`,()=>()=>Reflect.apply(t.getBrowserLocale,t,[])],[`getLocaleCookie`,()=>()=>Reflect.apply(t.getLocaleCookie,t,[])],[`setLocaleCookie`,()=>e=>Reflect.apply(t.setLocaleCookie,t,[e])],[`finalizePendingLocaleChange`,()=>()=>Reflect.apply(t.finalizePendingLocaleChange,t,[])],[`waitForPendingLocaleChange`,()=>()=>Reflect.apply(t.waitForPendingLocaleChange,t,[])]];for(let[t,r]of n)Object.defineProperty(e,t,{get:r})}}),i.vueApp.use(u),Object.defineProperty(i,"$i18n",{get:()=>_g(u)}),i.provide(`localeHead`,e=>Tn(i._nuxtI18n.composableCtx,e)),i.provide(`localePath`,Fn(i)),i.provide(`localeRoute`,Bn(i)),i.provide(`routeBaseName`,Cn(i)),i.provide(`getRouteBaseName`,Cn(i)),i.provide(`switchLocalePath`,Wn(i))}},1),Zg=`nuxt-i18n-slp`,Qg=new RegExp([`<!--${Zg}-\\[(\\w+)\\]-->`,`.+?`,`<!--/${Zg}-->`].join(``),`g`),$g=k({name:`i18n:plugin:switch-locale-path-ssr`,dependsOn:[`i18n:plugin`],setup(e){let t=b(e._id),n=Wn(t);t.hook(`app:rendered`,e=>{e.renderResult?.html!=null&&(e.renderResult.html=e.renderResult.html.replaceAll(Qg,(e,t)=>{let r=Cg(n(t??``));return e.replace(/href="([^"]+)"/,()=>`href="${r||`#`}" `)}))})}}),e_=k({name:`i18n:plugin:preload`,dependsOn:[`i18n:plugin`],async setup(e){}},1);function t_(e){return e?.defaultForDomains?.[0]||e?.domain||e?.domains?.[0]}function n_(e,t){return t_(e)||t_(t)}var r_=[`i18n:plugin`,`i18n:plugin:ssg-detect`,`i18n:plugin:route-locale-detect`];function i_(){return b().$nuxtSiteConfig}function a_(e){let t=kt(e.locales).find(t=>t.code===e.defaultLocale);return t?.language||t?.iso||e.defaultLocale}function o_(e,t){let n=kt(e.baseUrl)||void 0;if(!kt(e.differentDomains))return n;let r=kt(e.locales).find(t=>t.code===kt(e.defaultLocale)),i=n_(kt(e.localeProperties),r);return i?C(i,{strict:!0})?i:`${t}//${i}`:n}function s_(e){let t=kt(e.localeProperties);return t.language?t.language:a_(e)}function c_(e){return e.te(`nuxtSiteConfig.description`)?e.t(`nuxtSiteConfig.description`):void 0}function l_(e){return e.te(`nuxtSiteConfig.name`)?e.t(`nuxtSiteConfig.name`):void 0}var u_=k({name:`nuxt-site-config:i18n`,dependsOn:r_,setup(e){let t=e.$i18n;if(!t)return;let n=i_(),r=on().protocol,i=kt(t.baseUrl);if(i){let e=n.get({resolveRefs:!0}),t=e.url;if(t&&!t.includes(`localhost`)){let n=me(i,`https://`),r=me(t,`https://`);n.host!==r.host&&e.env===`production`&&console.error(`[Nuxt Site Config] Your I18n baseUrl \`${n.host}\` doesn't match your site url ${r.host}. This will cause production SEO issues. Either provide a matching baseUrl or remove the site url config.`)}}let a=T(()=>a_(t)),o=T(()=>
20o_(t,r)),s=T(()=>s_(t)),c=T(()=>c_(t)),l=T(()=>l_(t)),u;je(t.locale,()=>{u&&u(),u=n.push({_priority:ja.build,_context:`@nuxtjs/i18n`,url:o,defaultLocale:a,currentLocale:s,description:c,name:l})},{immediate:!0})}}),d_=k(e=>{let t=jt();return e.vueApp.use(t),Ye(t),e.payload&&e.payload.pinia&&(t.state.value=e.payload.pinia),{provide:{pinia:t}}}),f_=k(e=>{let t=Xn();function n(e){let n=t.api;return e&&(n+=e),n}function r(e){return e.url.replace(/^.*\/\/[^\/]+/,``)}return{provide:{apiReqUrl:(e,t)=>n(e,t),testApi:`https://api.nuxtjs.dev/mountains`,getInternalPath:e=>r(e)}}}),p_=/^(GTM|G)-[0-9A-Z]+$/;function m_(e){if(typeof e!=`string`||!p_.test(e)){let t=String(e).toUpperCase().replace(/.*-|[^0-9A-Z]/g,``),n=t.length===0?``:` Did you mean 'GTM-${t}' or 'G-${t}'?`;throw Error(`'${e}' is not a valid GTM-ID (${p_}).${n}`)}}function h_(e,t=`dataLayer`){return e[t]||(e[t]=[]),e[t]}function g_(e,t){let n=document,r=n.createElement(`script`),i=n=>{t.onReady?.({id:e,script:r}),r.removeEventListener(`load`,i)};r.addEventListener(`load`,i);let a=t.dataLayerName??`dataLayer`;if(h_(window,a).push({event:`gtm.js`,"gtm.start":new Date().getTime()}),!e)return r;r.async=!t.defer,r.defer=!!(t.defer||t.compatibility),t.nonce&&r.setAttribute(`nonce`,t.nonce),t.scriptType&&(r.type=t.scriptType);let o=new URLSearchParams({id:e,...t.dataLayerName?{l:t.dataLayerName}:{},...t.queryParams??{}});r.src=`${t.source??`https://www.googletagmanager.com/gtm.js`}?${o}`;let s=t.parentElement??n.body;if(typeof s?.appendChild!=`function`)throw Error(`parentElement must be a DOM element`);return s.appendChild(r),r}function __(e=`https://www.googletagmanager.com/gtm.js`){return Array.from(document.getElementsByTagName(`script`)).some(t=>t.src.includes(e))}var v_=class{id;options;scriptElements=[];constructor(e){if(Array.isArray(e.id))for(let t of e.id)m_(typeof t==`string`?t:t.id);else m_(e.id);this.id=e.id,this.options={enabled:!0,debug:!1,loadScript:!0,defer:!1,compatibility:!1,dataLayerName:`dataLayer`,...e},delete this.options.id}isInBrowserContext=()=>typeof window<`u`;enabled(){return this.options.enabled??!0}enable(e=!0,t){if(this.options.enabled=e,this.isInBrowserContext()&&e&&!__(t)&&this.options.loadScript)if(Array.isArray(this.id))this.id.forEach(e=>{let t;t=typeof e==`string`?g_(e,{...this.options}):g_(e.id,{...this.options,queryParams:e.queryParams}),this.scriptElements.push(t)});else{let e=g_(this.id,{...this.options});this.scriptElements.push(e)}}debugEnabled(){return this.options.debug??!1}debug(e){this.options.debug=e}dataLayer(){return this.isInBrowserContext()&&this.options.enabled?h_(window,this.options.dataLayerName):!1}trackView(e,t,n={}){let r=this.isInBrowserContext()&&(this.options.enabled??!1);this.options.debug&&console.log(`[GTM-Support${r?``:`(disabled)`}]: Dispatching TrackView`,{screenName:e,path:t}),r&&h_(window,this.options.dataLayerName).push({...n,event:this.options.trackViewEventProperty??`content-view`,"content-name":t,"content-view-name":e})}trackEvent({event:e,category:t=null,action:n=null,label:r=null,value:i=null,noninteraction:a=!1,...o}={}){let s=this.isInBrowserContext()&&(this.options.enabled??!1);this.options.debug&&console.log(`[GTM-Support${s?``:`(disabled)`}]: Dispatching event`,{event:e,category:t,action:n,label:r,value:i,...o}),s&&h_(window,this.options.dataLayerName).push({event:e??`interaction`,target:t,action:n,"target-properties":r,value:i,"interaction-type":a,...o})}push(e){let t=this.isInBrowserContext()&&(this.options.enabled??!1);this.options.debug&&console.log(`[GTM-Support${t?``:`(disabled)`}]: Dispatching event`,e),t&&h_(window,this.options.dataLayerName).push(e)}},y_;function b_(e,t={id:``}){t={trackOnNextTick:!1,...t},y_=new v_(t),e.config.globalProperties.$gtm=y_,y_.isInBrowserContext()&&(t.vueRouter&&x_(e,t.vueRouter,t.ignoredViews,t.trackOnNextTick,t.vueRouterAdditionalEventData),y_.options.enabled&&y_.options.loadScript&&(Array.isArray(t.id)?t.id.forEach(e=>{if(typeof e==`string`)g_(e,t);else{let n={...t};e.queryParams!=null&&(n.queryParams={...n.queryParams,...e.queryParams}),g_(e.id,n)}}):g_(t.id,t))),e.provide(`gtm`,t)}function x_(e,t,n=[],r,i=()=>({})){function a(e,t){return e instanceof Error&&!!(e.type&t)}t.afterEach(async(e,o,s)=>{if(typeof e.name!=`string`||Array.isArray(n)&&n.includes(e.name)||typeof n==`function`&&n(e,o))return;let c=e.meta&&typeof e.meta.gtm==`string`&&e.meta.gtm?e.meta.gtm:e.name;a(s,4)?y_?.debugEnabled()&&console.log(`[VueGtm]: '${c}' not tracked due to navigation aborted`):a(s,8)&&y_?.debugEnabled()&&console.log(`[VueGtm]: '${c}' not tracked due to navigation cancelled`);let l={...await i(e,o),...e.meta?.gtmAdditionalEventData},u=t.options?.history?.base??``;u.endsWith(`/`)||(u+=`/`),u+=e.fullPath.startsWith(`/`)?e.fullPath.substring(1):e.fullPath,r?_e(()=>{y_?.trackView(c,u,l)}):y_?.trackView(c,u,l)})}function S_(e){return{install:t=>b_(t,e)}}var C_=[aa,_a,Aa,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Za,og,qg,Xg,$g,e_,u_,d_,f_,k(e=>{let t=Ve();e.vueApp.use(S_({id:t.public.gtmId,defer:!1,compatibility:!1,enabled:t.public.gtmEnabled,debug:!1,loadScript:!0,vueRouter:x(),trackOnNextTick:!1,pageTracking:!0,pageViewEventName:`nuxtRoute`,respectDoNotTrack:!1}))}),k({name:`i18n:plugin:ssg-detect`,dependsOn:[`i18n:plugin`,`i18n:plugin:route-locale-detect`],enforce:`post`,setup(e){}})],w_=Gt({name:`NuxtRouteAnnouncer`,props:{atomic:{type:Boolean,default:!1},politeness:{type:String,default:`polite`}},setup(e,{slots:t,expose:n}
20){let{set:r,polite:i,assertive:a,message:o,politeness:s}=za({politeness:e.politeness}),c=T(()=>{if(s.value===`assertive`)return`alert`;if(s.value!==`off`)return`status`});return n({set:r,polite:i,assertive:a,message:o,politeness:s}),()=>u(`span`,{class:`nuxt-route-announcer`,style:{position:`absolute`}},u(`span`,{role:c.value,"aria-live":s.value,"aria-atomic":e.atomic,style:{border:`0`,clip:`rect(0 0 0 0)`,"clip-path":`inset(50%)`,height:`1px`,width:`1px`,overflow:`hidden`,position:`absolute`,"white-space":`nowrap`,"word-wrap":`normal`,margin:`-1px`,padding:`0`}},t.default?t.default({message:o.value}):o.value))}}),T_=(e=`RouteProvider`)=>Gt({name:e,props:{route:{type:Object,required:!0},vnode:Object,vnodeRef:Object,renderKey:String,trackRootNodes:Boolean,routeRecord:Object},setup(e){let t=e.renderKey,n=e.route,r={};for(let i in e.route)Object.defineProperty(r,i,{get:()=>t===e.renderKey?e.route[i]:n[i],enumerable:!0});return y(ke,tt(r)),()=>e.vnode?u(e.vnode,{ref:e.vnodeRef}):e.vnode}}),E_=T_(),D_=new WeakMap,O_=Gt({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(e,{attrs:n,slots:r,expose:a}){let o=b(),s=t(),c=S(ke,null),l=new Set,d;a({pageRef:s});let f=S(Me,null),p,m=o.deferHydration(),ee=!1,h=!1,te,ne=0;if(o.isHydrating){let e=o.hooks.hookOnce(`app:error`,m),t=x().beforeEach(()=>{e(),t()})}e.pageKey&&je(()=>e.pageKey,(e,t)=>{e!==t&&o.callHook(`page:loading:start`)});let g=!1;{let e=x().beforeResolve(()=>{g=!1});i(()=>{e(),m()})}return()=>u(pi,{name:e.name,route:e.route,...n},{default:j_(t=>{let n=k_(c,t.route,t.Component),i=c&&c.matched.length===t.route.matched.length;if(!t.Component){if(p&&!i&&!N_(p))return p;m();return}if(p&&f&&!N_(p)&&!f.isCurrent(t.route))return p;if(n&&c&&(!f||f?.isCurrent(c)))return(i||p)&&!N_(p)?p:null;let a=Sa(t,e.pageKey),_=A_(c,t.route,t.Component);!o.isHydrating&&d===a&&!_&&_e(()=>{g||(g=!0,o.callHook(`page:loading:end`))}),ee&&d!==a&&h&&ne++,d=a;let re=!!(e.transition??t.route.meta.pageTransition??Ce),ie=re&&We([e.transition,t.route.meta.pageTransition,Ce,{onAfterLeave(){o[`~transitionFinish`]?.(),delete o[`~transitionFinish`],delete o[`~transitionPromise`],o.callHook(`page:transition:finish`,t.Component)}}]),v=e.keepalive??t.route.meta.keepalive??!1,ae=t.Component.type,y=ae.name||ae.__name;t.route.meta.keepalive&&y&&l.add(y);let oe;if(l.size>0&&e.keepalive==null&&(!v||typeof v==`object`&&v&&v.include)){let e=typeof v==`object`&&v?{...v}:{},t=e.include?Array.isArray(e.include)?e.include:[e.include]:[];oe={...e,include:Array.from(new Set([...t,...l]))}}else oe=v;return p=Bt(re&&ie,Ca(oe,u(Lt,{key:ne,suspensible:!0,onPending:()=>{ee=!0,re&&!o[`~transitionPromise`]&&(o[`~transitionPromise`]=new Promise(e=>{o[`~transitionFinish`]=e})),te=o.callHook(`page:start`,t.Component)}
20,onResolve:async()=>{ee=!1,h=!0,o.isHydrating&&o[`~restoreDeferredRoute`]?.();try{await _e(),o._route.sync?.(),await te,await o.callHook(`page:finish`,t.Component),!g&&!_&&(g=!0,await o.callHook(`page:loading:end`))}finally{m()}}},{default:()=>{let e={key:a||void 0,vnode:r.default?M_(r.default,t):t.Component,route:t.route,renderKey:a||void 0,trackRootNodes:re,vnodeRef:s,routeRecord:void 0};if(!oe)return u(E_,e);let n=ae,i=D_.get(n);return i||(i=T_(y),D_.set(n,i)),u(i,e)}}))).default(),p})})}});function k_(e,t,n){if(!e)return!1;let r=t.matched.findIndex(e=>e.components?.default===n?.type);if(r===-1)return!1;let i=t.matched.slice(0,r).filter(e=>e.components?.default);if(!i.length)return!1;let a=e.matched.filter(e=>e.components?.default);return i.some((e,t)=>e.components?.default!==a[t]?.components?.default)||n&&Sa({route:t,Component:n})!==Sa({route:e,Component:n})}function A_(e,t,n){return e?t.matched.findIndex(e=>e.components?.default===n?.type)<t.matched.length-1:!1}function j_(e){let t=(t=>{let n=e(t);return Array.isArray(n)?n:n==null||!h(n)?[ot()]:[n]});return t._n=!0,t}function M_(e,t){let n=e(t);return n.length===1?u(n[0]):u(Xe,void 0,n)}function N_(e){return!!e&&(!!e.suspense?.isUnmounted||!!e.component?.isUnmounted)}var P_=Gt({name:`LayoutLoader`,inheritAttrs:!1,props:{name:String,layoutProps:Object},setup(e,t){return()=>u(Xa[e.name],e.layoutProps,t.slots)}}),F_=Gt({name:`NuxtLayout`,inheritAttrs:!1,props:{name:{type:[String,Boolean,Object],default:null},fallback:{type:[String,Object],default:null}},setup(e,t){let n=b(),r=S(ke),i=!r||r===Kt()?lt():r,a=T(()=>{let t=Va(i,e.name);return t&&!(t in Xa)&&e.fallback&&(t=E(e.fallback)),t});y(v,a);let o=A();t.expose({layoutRef:o});let s=n.deferHydration();if(n.isHydrating){let e=n.hooks.hookOnce(`app:error`,s),t=x().beforeEach(()=>{e(),t()})}let c;return()=>{let r=!!a.value&&a.value in Xa&&!!(i?.meta.layoutTransition??!1),l=r&&We([i?.meta.layoutTransition,!1,{onBeforeLeave(){n[`~transitionPromise`]=new Promise(e=>{n[`~transitionFinish`]=e})},onAfterLeave(){n[`~transitionFinish`]?.(),delete n[`~transitionFinish`],delete n[`~transitionPromise`]}}]),d=c;return c=a.value,Bt(l,{default:()=>u(Lt,{suspensible:!0,onResolve:async()=>{await _e(s)}},{default:()=>u(I_,{layoutProps:p(t.attrs,i.meta.layoutProps??{},{ref:o}),key:a.value||void 0,name:a.value,shouldProvide:!e.name,isRenderingNewLayout:e=>e!==d&&e===a.value,hasTransition:r},t.slots)})}).default()}}}),I_=Gt({name:`NuxtLayoutProvider`,inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean},isRenderingNewLayout:{type:Function,required:!0}},setup(e,t){let n=e.name;e.shouldProvide&&y(Me,{isCurrent:e=>n===!1||n===Va(e)});let r=S(ke),i=r&&r===Kt(),a=S(Me,null);if(i){let t=lt(),n={};for(let i in t){let o=i;Object.defineProperty(n,o,{enumerable:!0,get:()=>e.isRenderingNewLayout(e.name)&&(!a||a.isCurrent(t))?t[o]:r[o]})}y(ke,tt(n))}return()=>!n||typeof n==`string`&&!(n in Xa)?t.slots.default?.():u(P_,{key:n,layoutProps:e.layoutProps,name:n},t.slots)}}),L_=Tt(w_),R_={};function z_(e,t){let n=L_,r=O_,i=F_;return g(),_t(i,null,{default:Pe(()=>[qt(n),qt(r)]),_:1})}var B_=Zn(R_,[[`render`,z_]]),V_={id:`mainLayout`},H_={id:`mainLayout`,class:`relative min-h-svh`,ref:`layout`},U_={class:`super-container`},W_={class:`pb-32 pt-32 grid grid-cols-12 z-10 relative`},G_={class:`col-span-12`},K_={class:`mb-4`},q_={class:`mb-0`},J_={class:`flex mt-6`},Y_={class:`absolute bottom-0 left-0 z-10 pointer-events-none`},X_={class:`overflow-hidden`},Z_={class:`translate-y-[2.5vw]`},Q_={__name:`error`,props:{error:Object},setup(e){let{getSeoHead:t}=tr(),n=ct();Ve();let r=e,{t:i}=Ln(),a=()=>et({redirect:`/`}),o={title:r.error.statusCode.toString()+` | Checkmate Digitalt Bureau`,og_title:r.error.statusCode.toString()+` | Checkmate Digitalt Bureau`,robots:{index:`noindex`,follow:`nofollow`,"max-image-preview":`max-image-preview:none`,"max-snippet":`max-snippet:-1`,"max-video-preview":`max-video-preview:-1`}};return fn(t(o)),(e,t)=>{let i=rr,o=nr,s=ir,c=Hn,l=er,u=Qn;return g(),it(Xe,null,[qt(i),D(`div`,V_,[qt(o),qt(s),D(`main`,{style:Ct(`--bg-color:`+E(n).getCurrentBgColor+`;--text-color:`+E(n).getCurrentTextColor+`;--color-duration:`+E(n).getCurrentDuration+`;`)},[qt(u,{"background-color":`#FF7F48`,"text-color":`#FFFBD9`},{default:Pe(()=>[D(`div`,H_,[D(`div`,U_,[D(`div`,W_,[D(`div`,G_,[D(`h1`,K_,Mt(e.$t(`gameOver`)),1),D(`p`,q_,Mt(e.$t(`goToFrontPageOrUseNavigation`)),1),D(`div`,J_,[qt(c,{onClick:a,path:`/`,"no-link":!0,class:`btn outlined`},{default:Pe(()=>[Vt(Mt(e.$t(`goToFrontPage`)),1)]),_:1})])]),t[0]||=D(`div`,{class:`col-span-12 gh-1 pt-global`},null,-1)])]),D(`div`,Y_,[D(`div`,X_,[D(`div`,Z_,[qt(l,{text:r.error.statusCode.toString(),"is-in-hero":!1,"line-height":`0.76`,scale:`103`},null,8,[`text`])])])])],512)]),_:1})],4)])],64)}}},$_=()=>null,ev={key:0},tv={__name:`nuxt-root`,setup(e){let t=b(),n=t.deferHydration();if(t.isHydrating){let e=t.hooks.hookOnce(`app:error`,n),r=x().beforeEach(()=>{e(),r()})}window.location.pathname,y(ke,Kt()),t.hooks.callHookWith(e=>e.map(e=>e()),`vue:setup`,[]);let r=st();function i(e,n,r){let i=t.vueApp.config.errorHandler;if(i&&!i.__nuxt_default)try{i(e,n,r)}
20catch(e){console.error("[nuxt] Error in `app.config.errorHandler`",e)}}return pe((e,n,r)=>{if(t.hooks.callHook(`vue:error`,e,n,r)?.catch(e=>console.error("[nuxt] Error in `vue:error` hook",e)),Fe(navigator.userAgent))return ht(t,e),!1;if(Et(e)&&(e.fatal||e.unhandled))return t.runWithContext(()=>vt(e)),i(e,n,r),!1}),(e,t)=>(g(),_t(Lt,{onResolve:E(n)},{default:Pe(()=>[E(!1)?(g(),it(`div`,ev)):E(r)?(g(),_t(E(Q_),{key:1,error:E(r)},null,8,[`error`])):E(!1)?(g(),_t(E($_),{key:2,context:E(!1)},null,8,[`context`])):E(!1)?(g(),_t(s(E(!1)),{key:3})):(g(),_t(E(B_),{key:4}))]),_:1},8,[`onResolve`]))}},nv;{let e;nv=async function(){if(e)return e;let t=!!(window.__NUXT__?.serverRendered??document.getElementById(`__NUXT_DATA__`)?.dataset.ssr===`true`),r=t?St(tv):Ke(tv),i=le({vueApp:r});async function a(e){await i.callHook(`app:error`,e),i.payload.error||=rt(e)}a.__nuxt_default=!0,r.config.errorHandler=a,i.hook(`app:suspense:resolve`,()=>{r.config.errorHandler===a&&(r.config.errorHandler=void 0)}),!t&&n.id&&i.hook(`app:suspense:resolve`,()=>{document.getElementById(n.id)?.remove()});try{await re(i,C_)}catch(e){a(e)}try{await i.hooks.callHook(`app:created`,r),await i.hooks.callHook(`app:beforeMount`,r),r.mount(yt),await i.hooks.callHook(`app:mounted`,r),await _e()}catch(e){a(e)}return r},e=nv().catch(e=>{throw Ze.NUXT_E1009({cause:e}),e})}
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.