(()=>{var _I=Object.create;var Lo=Object.defineProperty;var EI=Object.getOwnPropertyDescriptor;var II=Object.getOwnPropertyNames;var TI=Object.getPrototypeOf,SI=Object.prototype.hasOwnProperty;var kI=(s,e,t)=>e in s?Lo(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var V=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),AI=(s,e)=>{for(var t in e)Lo(s,t,{get:e[t],enumerable:!0})},xI=(s,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of II(e))!SI.call(s,a)&&a!==t&&Lo(s,a,{get:()=>e[a],enumerable:!(o=EI(e,a))||o.enumerable});return s};var on=(s,e,t)=>(t=s!=null?_I(TI(s)):{},xI(e||!s||!s.__esModule?Lo(t,"default",{value:s,enumerable:!0}):t,s));var St=(s,e,t)=>(kI(s,typeof e!="symbol"?e+"":e,t),t);var Jf=V((GL,Sb)=>{"use strict";Sb.exports=function(e,t){return function(){return e.apply(t,arguments)}}});var Ie=V((KL,Rb)=>{"use strict";var eC=Jf(),Zf=Object.prototype.toString,ep=function(s){return function(e){var t=Zf.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())}}(Object.create(null));function qn(s){return s=s.toLowerCase(),function(t){return ep(t)===s}}function uu(s){return Array.isArray(s)}function Xf(s){return typeof s=="undefined"}function tC(s){return s!==null&&!Xf(s)&&s.constructor!==null&&!Xf(s.constructor)&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}var kb=qn("ArrayBuffer");function nC(s){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&kb(s.buffer),e}function rC(s){return typeof s=="string"}function Ab(s){return typeof s=="number"}function xb(s){return s!==null&&typeof s=="object"}function cu(s){if(ep(s)!=="object")return!1;var e=Object.getPrototypeOf(s);return e===null||e===Object.prototype}function iC(s){return s&&Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}var sC=qn("Date"),oC=qn("File"),aC=qn("Blob"),cC=qn("FileList");function tp(s){return Zf.call(s)==="[object Function]"}function uC(s){return xb(s)&&tp(s.pipe)}function lC(s){var e="[object FormData]";return s&&(typeof FormData=="function"&&s instanceof FormData||Zf.call(s)===e||tp(s.toString)&&s.toString()===e)}var hC=qn("URLSearchParams");function dC(s){return s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function fC(){var s;return typeof navigator!="undefined"&&((s=navigator.product)==="ReactNative"||s==="NativeScript"||s==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function np(s,e){if(!(s===null||typeof s=="undefined"))if(typeof s!="object"&&(s=[s]),uu(s))for(var t=0,o=s.length;t<o;t++)e.call(null,s[t],t,s);else for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&e.call(null,s[a],a,s)}function Yf(){var s={};function e(a,u){cu(s[u])&&cu(a)?s[u]=Yf(s[u],a):cu(a)?s[u]=Yf({},a):uu(a)?s[u]=a.slice():s[u]=a}for(var t=0,o=arguments.length;t<o;t++)np(arguments[t],e);return s}function pC(s,e,t){return np(e,function(a,u){t&&typeof a=="function"?s[u]=eC(a,t):s[u]=a}),s}function mC(s){return s.charCodeAt(0)===65279&&(s=s.slice(1)),s}function gC(s,e,t,o){s.prototype=Object.create(e.prototype,o),s.prototype.constructor=s,t&&Object.assign(s.prototype,t)}function yC(s,e,t,o){var a,u,l,h={};if(e=e||{},s==null)return e;do{for(a=Object.getOwnPropertyNames(s),u=a.length;u-- >0;)l=a[u],(!o||o(l,s,e))&&!h[l]&&(e[l]=s[l],h[l]=!0);s=t!==!1&&Object.getPrototypeOf(s)}while(s&&(!t||t(s,e))&&s!==Object.prototype);return e}function vC(s,e,t){s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=e.length;var o=s.indexOf(e,t);return o!==-1&&o===t}function wC(s){if(!s)return null;if(uu(s))return s;var e=s.length;if(!Ab(e))return null;for(var t=new Array(e);e-- >0;)t[e]=s[e];return t}var bC=function(s){return function(e){return s&&e instanceof s}}(typeof Uint8Array!="undefined"&&Object.getPrototypeOf(Uint8Array));function _C(s,e){for(var t=s&&s[Symbol.iterator],o=t.call(s),a;(a=o.next())&&!a.done;){var u=a.value;e.call(s,u[0],u[1])}}function EC(s,e){for(var t,o=[];(t=s.exec(e))!==null;)o.push(t);return o}var IC=qn("HTMLFormElement"),TC=function(e){return function(t,o){return e.call(t,o)}}(Object.prototype.hasOwnProperty);Rb.exports={isArray:uu,isArrayBuffer:kb,isBuffer:tC,isFormData:lC,isArrayBufferView:nC,isString:rC,isNumber:Ab,isObject:xb,isPlainObject:cu,isEmptyObject:iC,isUndefined:Xf,isDate:sC,isFile:oC,isBlob:aC,isFunction:tp,isStream:uC,isURLSearchParams:hC,isStandardBrowserEnv:fC,forEach:np,merge:Yf,extend:pC,trim:dC,stripBOM:mC,inherits:gC,toFlatObject:yC,kindOf:ep,kindOfTest:qn,endsWith:vC,toArray:wC,isTypedArray:bC,isFileList:cC,forEachEntry:_C,matchAll:EC,isHTMLForm:IC,hasOwnProperty:TC}});var zn=V((WL,Db)=>{"use strict";var Cb=Ie();function _i(s,e,t,o,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),o&&(this.request=o),a&&(this.response=a)}Cb.inherits(_i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Ob=_i.prototype,Nb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(function(s){Nb[s]={value:s}});Object.defineProperties(_i,Nb);Object.defineProperty(Ob,"isAxiosError",{value:!0});_i.from=function(s,e,t,o,a,u){var l=Object.create(Ob);return Cb.toFlatObject(s,l,function(d){return d!==Error.prototype}),_i.call(l,s.message,e,t,o,a),l.cause=s,l.name=s.name,u&&Object.assign(l,u),l};Db.exports=_i});var Lb=V((QL,Pb)=>{"use strict";Pb.exports=typeof self=="object"?self.FormData:window.FormData});var Ub=V((JL,Mb)=>{Mb.exports=Lb()});var oo=V((XL,Bb)=>{"use strict";var ue=Ie(),SC=zn(),kC=Ub();function rp(s){return ue.isPlainObject(s)||ue.isArray(s)}function $b(s){return ue.endsWith(s,"[]")?s.slice(0,-2):s}function Fb(s,e,t){return s?s.concat(e).map(function(a,u){return a=$b(a),!t&&u?"["+a+"]":a}).join(t?".":""):e}function AC(s){return ue.isArray(s)&&!s.some(rp)}var xC=ue.toFlatObject(ue,{},null,function(e){return/^is[A-Z]/.test(e)});function RC(s){return s&&ue.isFunction(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator]}function CC(s,e,t){if(!ue.isObject(s))throw new TypeError("target must be an object");e=e||new(kC||FormData),t=ue.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,E){return!ue.isUndefined(E[b])});var o=t.metaTokens,a=t.visitor||p,u=t.dots,l=t.indexes,h=t.Blob||typeof Blob!="undefined"&&Blob,d=h&&RC(e);if(!ue.isFunction(a))throw new TypeError("visitor must be a function");function f(w){if(w===null)return"";if(ue.isDate(w))return w.toISOString();if(!d&&ue.isBlob(w))throw new SC("Blob is not supported. Use a Buffer instead.");return ue.isArrayBuffer(w)||ue.isTypedArray(w)?d&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function p(w,b,E){var k=w;if(w&&!E&&typeof w=="object"){if(ue.endsWith(b,"{}"))b=o?b:b.slice(0,-2),w=JSON.stringify(w);else if(ue.isArray(w)&&AC(w)||ue.isFileList(w)||ue.endsWith(b,"[]")&&(k=ue.toArray(w)))return b=$b(b),k.forEach(function(C,P){!ue.isUndefined(C)&&e.append(l===!0?Fb([b],P,u):l===null?b:b+"[]",f(C))}),!1}return rp(w)?!0:(e.append(Fb(E,b,u),f(w)),!1)}var m=[],g=Object.assign(xC,{defaultVisitor:p,convertValue:f,isVisitable:rp});function y(w,b){if(!ue.isUndefined(w)){if(m.indexOf(w)!==-1)throw Error("Circular reference detected in "+b.join("."));m.push(w),ue.forEach(w,function(k,x){var C=!ue.isUndefined(k)&&a.call(e,k,ue.isString(x)?x.trim():x,b,g);C===!0&&y(k,b?b.concat(x):[x])}),m.pop()}}if(!ue.isObject(s))throw new TypeError("data must be an object");return y(s),e}Bb.exports=CC});var ip=V((YL,zb)=>{"use strict";var OC=oo();function jb(s){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'\(\)~]|%20|%00/g,function(o){return e[o]})}function Vb(s,e){this._pairs=[],s&&OC(s,this,e)}var qb=Vb.prototype;qb.append=function(e,t){this._pairs.push([e,t])};qb.toString=function(e){var t=e?function(o){return e.call(this,o,jb)}:jb;return this._pairs.map(function(a){return t(a[0])+"="+t(a[1])},"").join("&")};zb.exports=Vb});var sp=V((ZL,Hb)=>{"use strict";var NC=Ie(),DC=ip();function PC(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Hb.exports=function(e,t,o){if(!t)return e;var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a));var u=o&&o.encode||PC,l=o&&o.serialize,h;return l?h=l(t,o):h=NC.isURLSearchParams(t)?t.toString():new DC(t,o).toString(u),h&&(e+=(e.indexOf("?")===-1?"?":"&")+h),e}});var Kb=V((eM,Gb)=>{"use strict";var LC=Ie();function ao(){this.handlers=[]}ao.prototype.use=function(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1};ao.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};ao.prototype.clear=function(){this.handlers&&(this.handlers=[])};ao.prototype.forEach=function(e){LC.forEach(this.handlers,function(o){o!==null&&e(o)})};Gb.exports=ao});var op=V((tM,Wb)=>{"use strict";var MC=Ie();Wb.exports=function(e,t){MC.forEach(e,function(a,u){u!==t&&u.toUpperCase()===t.toUpperCase()&&(e[t]=a,delete e[u])})}});var ap=V((nM,Qb)=>{"use strict";Qb.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var Xb=V((rM,Jb)=>{"use strict";var UC=ip();Jb.exports=typeof URLSearchParams!="undefined"?URLSearchParams:UC});var Zb=V((iM,Yb)=>{"use strict";Yb.exports=FormData});var t_=V((sM,e_)=>{"use strict";e_.exports={isBrowser:!0,classes:{URLSearchParams:Xb(),FormData:Zb(),Blob},protocols:["http","https","file","blob","url","data"]}});var lu=V((oM,n_)=>{"use strict";n_.exports=t_()});var s_=V((aM,i_)=>{"use strict";var FC=Ie(),$C=oo(),r_=lu();i_.exports=function(e,t){return $C(e,new r_.classes.URLSearchParams,Object.assign({visitor:function(o,a,u,l){return r_.isNode&&FC.isBuffer(o)?(this.append(a,o.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},t))}});var cp=V((cM,o_)=>{"use strict";var Hn=Ie();function BC(s){return Hn.matchAll(/\w+|\[(\w*)]/g,s).map(function(e){return e[0]==="[]"?"":e[1]||e[0]})}function jC(s){var e={},t=Object.keys(s),o,a=t.length,u;for(o=0;o<a;o++)u=t[o],e[u]=s[u];return e}function VC(s){function e(o,a,u,l){var h=o[l++],d=Number.isFinite(+h),f=l>=o.length;if(h=!h&&Hn.isArray(u)?u.length:h,f)return Hn.hasOwnProperty(u,h)?u[h]=[u[h],a]:u[h]=a,!d;(!u[h]||!Hn.isObject(u[h]))&&(u[h]=[]);var p=e(o,a,u[h],l);return p&&Hn.isArray(u[h])&&(u[h]=jC(u[h])),!d}if(Hn.isFormData(s)&&Hn.isFunction(s.entries)){var t={};return Hn.forEachEntry(s,function(o,a){e(BC(o),a,t,0)}),t}return null}o_.exports=VC});var c_=V((uM,a_)=>{"use strict";var up=zn();a_.exports=function(e,t,o){var a=o.config.validateStatus;!o.status||!a||a(o.status)?e(o):t(new up("Request failed with status code "+o.status,[up.ERR_BAD_REQUEST,up.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}});var l_=V((lM,u_)=>{"use strict";var hu=Ie();u_.exports=hu.isStandardBrowserEnv()?function(){return{write:function(t,o,a,u,l,h){var d=[];d.push(t+"="+encodeURIComponent(o)),hu.isNumber(a)&&d.push("expires="+new Date(a).toGMTString()),hu.isString(u)&&d.push("path="+u),hu.isString(l)&&d.push("domain="+l),h===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(t){var o=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var d_=V((hM,h_)=>{"use strict";h_.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}});var p_=V((dM,f_)=>{"use strict";f_.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}});var lp=V((fM,m_)=>{"use strict";var qC=d_(),zC=p_();m_.exports=function(e,t){return e&&!qC(t)?zC(e,t):t}});var y_=V((pM,g_)=>{"use strict";var hp=Ie(),HC=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];g_.exports=function(e){var t={},o,a,u;return e&&hp.forEach(e.split(`
`),function(h){if(u=h.indexOf(":"),o=hp.trim(h.slice(0,u)).toLowerCase(),a=hp.trim(h.slice(u+1)),o){if(t[o]&&HC.indexOf(o)>=0)return;o==="set-cookie"?t[o]=(t[o]?t[o]:[]).concat([a]):t[o]=t[o]?t[o]+", "+a:a}}),t}});var b_=V((mM,w_)=>{"use strict";var v_=Ie();w_.exports=v_.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),o;function a(u){var l=u;return e&&(t.setAttribute("href",l),l=t.href),t.setAttribute("href",l),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return o=a(window.location.href),function(l){var h=v_.isString(l)?a(l):l;return h.protocol===o.protocol&&h.host===o.host}}():function(){return function(){return!0}}()});var co=V((gM,E_)=>{"use strict";var dp=zn(),GC=Ie();function __(s,e,t){dp.call(this,s==null?"canceled":s,dp.ERR_CANCELED,e,t),this.name="CanceledError"}GC.inherits(__,dp,{__CANCEL__:!0});E_.exports=__});var T_=V((yM,I_)=>{"use strict";I_.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}});var fp=V((vM,S_)=>{"use strict";var Ei=Ie(),KC=c_(),WC=l_(),QC=sp(),JC=lp(),XC=y_(),YC=b_(),ZC=ap(),En=zn(),eO=co(),tO=T_(),nO=lu();S_.exports=function(e){return new Promise(function(o,a){var u=e.data,l=e.headers,h=e.responseType,d=e.withXSRFToken,f;function p(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}Ei.isFormData(u)&&Ei.isStandardBrowserEnv()&&delete l["Content-Type"];var m=new XMLHttpRequest;if(e.auth){var g=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";l.Authorization="Basic "+btoa(g+":"+y)}var w=JC(e.baseURL,e.url);m.open(e.method.toUpperCase(),QC(w,e.params,e.paramsSerializer),!0),m.timeout=e.timeout;function b(){if(m){var x="getAllResponseHeaders"in m?XC(m.getAllResponseHeaders()):null,C=!h||h==="text"||h==="json"?m.responseText:m.response,P={data:C,status:m.status,statusText:m.statusText,headers:x,config:e,request:m};KC(function(ee){o(ee),p()},function(ee){a(ee),p()},P),m=null}}if("onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(b)},m.onabort=function(){m&&(a(new En("Request aborted",En.ECONNABORTED,e,m)),m=null)},m.onerror=function(){a(new En("Network Error",En.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){var C=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",P=e.transitional||ZC;e.timeoutErrorMessage&&(C=e.timeoutErrorMessage),a(new En(C,P.clarifyTimeoutError?En.ETIMEDOUT:En.ECONNABORTED,e,m)),m=null},Ei.isStandardBrowserEnv()&&(d&&Ei.isFunction(d)&&(d=d(e)),d||d!==!1&&YC(w))){var E=e.xsrfHeaderName&&e.xsrfCookieName&&WC.read(e.xsrfCookieName);E&&(l[e.xsrfHeaderName]=E)}"setRequestHeader"in m&&Ei.forEach(l,function(C,P){typeof u=="undefined"&&P.toLowerCase()==="content-type"?delete l[P]:m.setRequestHeader(P,C)}),Ei.isUndefined(e.withCredentials)||(m.withCredentials=!!e.withCredentials),h&&h!=="json"&&(m.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&m.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&m.upload&&m.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(x){m&&(a(!x||x.type?new eO(null,e,m):x),m.abort(),m=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),!u&&u!==!1&&u!==0&&u!==""&&(u=null);var k=tO(w);if(k&&nO.protocols.indexOf(k)===-1){a(new En("Unsupported protocol "+k+":",En.ERR_BAD_REQUEST,e));return}m.send(u)})}});var fu=V((wM,C_)=>{"use strict";var ke=Ie(),k_=op(),A_=zn(),rO=ap(),iO=oo(),sO=s_(),x_=lu(),oO=cp(),aO={"Content-Type":"application/x-www-form-urlencoded"};function R_(s,e){!ke.isUndefined(s)&&ke.isUndefined(s["Content-Type"])&&(s["Content-Type"]=e)}function cO(){var s;return typeof XMLHttpRequest!="undefined"?s=fp():typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&(s=fp()),s}function uO(s,e,t){if(ke.isString(s))try{return(e||JSON.parse)(s),ke.trim(s)}catch(o){if(o.name!=="SyntaxError")throw o}return(t||JSON.stringify)(s)}var du={transitional:rO,adapter:cO(),transformRequest:[function(e,t){k_(t,"Accept"),k_(t,"Content-Type");var o=t&&t["Content-Type"]||"",a=o.indexOf("application/json")>-1,u=ke.isObject(e);u&&ke.isHTMLForm(e)&&(e=new FormData(e));var l=ke.isFormData(e);if(l)return a?JSON.stringify(oO(e)):e;if(ke.isArrayBuffer(e)||ke.isBuffer(e)||ke.isStream(e)||ke.isFile(e)||ke.isBlob(e))return e;if(ke.isArrayBufferView(e))return e.buffer;if(ke.isURLSearchParams(e))return R_(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var h;if(u){if(o.indexOf("application/x-www-form-urlencoded")!==-1)return sO(e,this.formSerializer).toString();if((h=ke.isFileList(e))||o.indexOf("multipart/form-data")>-1){var d=this.env&&this.env.FormData;return iO(h?{"files[]":e}:e,d&&new d,this.formSerializer)}}return u||a?(R_(t,"application/json"),uO(e)):e}],transformResponse:[function(e){var t=this.transitional||du.transitional,o=t&&t.forcedJSONParsing,a=this.responseType==="json";if(e&&ke.isString(e)&&(o&&!this.responseType||a)){var u=t&&t.silentJSONParsing,l=!u&&a;try{return JSON.parse(e)}catch(h){if(l)throw h.name==="SyntaxError"?A_.from(h,A_.ERR_BAD_RESPONSE,this,null,this.response):h}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:x_.classes.FormData,Blob:x_.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ke.forEach(["delete","get","head"],function(e){du.headers[e]={}});ke.forEach(["post","put","patch"],function(e){du.headers[e]=ke.merge(aO)});C_.exports=du});var N_=V((bM,O_)=>{"use strict";var lO=Ie(),hO=fu();O_.exports=function(e,t,o,a){var u=this||hO;return lO.forEach(a,function(h){e=h.call(u,e,t,o)}),e}});var pp=V((_M,D_)=>{"use strict";D_.exports=function(e){return!!(e&&e.__CANCEL__)}});var U_=V((EM,M_)=>{"use strict";var P_=Ie(),mp=N_(),dO=pp(),fO=fu(),pO=co(),L_=op();function gp(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new pO}M_.exports=function(e){gp(e),e.headers=e.headers||{},e.data=mp.call(e,e.data,e.headers,null,e.transformRequest),L_(e.headers,"Accept"),L_(e.headers,"Content-Type"),e.headers=P_.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),P_.forEach(["delete","get","head","post","put","patch","common"],function(a){delete e.headers[a]});var t=e.adapter||fO.adapter;return t(e).then(function(a){return gp(e),a.data=mp.call(e,a.data,a.headers,a.status,e.transformResponse),a},function(a){return dO(a)||(gp(e),a&&a.response&&(a.response.data=mp.call(e,a.response.data,a.response.headers,a.response.status,e.transformResponse))),Promise.reject(a)})}});var yp=V((IM,F_)=>{"use strict";var Ye=Ie();F_.exports=function(e,t){t=t||{};var o={};function a(p,m){return Ye.isPlainObject(p)&&Ye.isPlainObject(m)?Ye.merge(p,m):Ye.isEmptyObject(m)?Ye.merge({},p):Ye.isPlainObject(m)?Ye.merge({},m):Ye.isArray(m)?m.slice():m}function u(p){if(Ye.isUndefined(t[p])){if(!Ye.isUndefined(e[p]))return a(void 0,e[p])}else return a(e[p],t[p])}function l(p){if(!Ye.isUndefined(t[p]))return a(void 0,t[p])}function h(p){if(Ye.isUndefined(t[p])){if(!Ye.isUndefined(e[p]))return a(void 0,e[p])}else return a(void 0,t[p])}function d(p){if(p in t)return a(e[p],t[p]);if(p in e)return a(void 0,e[p])}var f={url:l,method:l,data:l,baseURL:h,transformRequest:h,transformResponse:h,paramsSerializer:h,timeout:h,timeoutMessage:h,withCredentials:h,withXSRFToken:h,adapter:h,responseType:h,xsrfCookieName:h,xsrfHeaderName:h,onUploadProgress:h,onDownloadProgress:h,decompress:h,maxContentLength:h,maxBodyLength:h,beforeRedirect:h,transport:h,httpAgent:h,httpsAgent:h,cancelToken:h,socketPath:h,responseEncoding:h,validateStatus:d};return Ye.forEach(Object.keys(e).concat(Object.keys(t)),function(m){var g=f[m]||u,y=g(m);Ye.isUndefined(y)&&g!==d||(o[m]=y)}),o}});var vp=V((TM,$_)=>{$_.exports={version:"0.28.1"}});var V_=V((SM,j_)=>{"use strict";var mO=vp().version,Gn=zn(),wp={};["object","boolean","number","function","string","symbol"].forEach(function(s,e){wp[s]=function(o){return typeof o===s||"a"+(e<1?"n ":" ")+s}});var B_={};wp.transitional=function(e,t,o){function a(u,l){return"[Axios v"+mO+"] Transitional option '"+u+"'"+l+(o?". "+o:"")}return function(u,l,h){if(e===!1)throw new Gn(a(l," has been removed"+(t?" in "+t:"")),Gn.ERR_DEPRECATED);return t&&!B_[l]&&(B_[l]=!0,console.warn(a(l," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(u,l,h):!0}};function gO(s,e,t){if(typeof s!="object")throw new Gn("options must be an object",Gn.ERR_BAD_OPTION_VALUE);for(var o=Object.keys(s),a=o.length;a-- >0;){var u=o[a],l=e[u];if(l){var h=s[u],d=h===void 0||l(h,u,s);if(d!==!0)throw new Gn("option "+u+" must be "+d,Gn.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Gn("Unknown option "+u,Gn.ERR_BAD_OPTION)}}j_.exports={assertOptions:gO,validators:wp}});var G_=V((kM,H_)=>{"use strict";var _p=Ie(),yO=sp(),q_=Kb(),z_=U_(),pu=yp(),vO=lp(),bp=V_(),Kn=bp.validators;function Ii(s){this.defaults=s,this.interceptors={request:new q_,response:new q_}}Ii.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=pu(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var o=t.transitional;o!==void 0&&bp.assertOptions(o,{silentJSONParsing:Kn.transitional(Kn.boolean),forcedJSONParsing:Kn.transitional(Kn.boolean),clarifyTimeoutError:Kn.transitional(Kn.boolean)},!1);var a=t.paramsSerializer;a!==void 0&&bp.assertOptions(a,{encode:Kn.function,serialize:Kn.function},!0),_p.isFunction(a)&&(t.paramsSerializer={serialize:a});var u=[],l=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(t)===!1||(l=l&&w.synchronous,u.unshift(w.fulfilled,w.rejected))});var h=[];this.interceptors.response.forEach(function(w){h.push(w.fulfilled,w.rejected)});var d;if(!l){var f=[z_,void 0];for(Array.prototype.unshift.apply(f,u),f=f.concat(h),d=Promise.resolve(t);f.length;)d=d.then(f.shift(),f.shift());return d}for(var p=t;u.length;){var m=u.shift(),g=u.shift();try{p=m(p)}catch(y){g(y);break}}try{d=z_(p)}catch(y){return Promise.reject(y)}for(;h.length;)d=d.then(h.shift(),h.shift());return d};Ii.prototype.getUri=function(e){e=pu(this.defaults,e);var t=vO(e.baseURL,e.url);return yO(t,e.params,e.paramsSerializer)};_p.forEach(["delete","get","head","options"],function(e){Ii.prototype[e]=function(t,o){return this.request(pu(o||{},{method:e,url:t,data:(o||{}).data}))}});_p.forEach(["post","put","patch"],function(e){function t(o){return function(u,l,h){return this.request(pu(h||{},{method:e,headers:o?{"Content-Type":"multipart/form-data"}:{},url:u,data:l}))}}Ii.prototype[e]=t(),Ii.prototype[e+"Form"]=t(!0)});H_.exports=Ii});var W_=V((AM,K_)=>{"use strict";var wO=co();function Ti(s){if(typeof s!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(a){e=a});var t=this;this.promise.then(function(o){if(t._listeners){for(var a=t._listeners.length;a-- >0;)t._listeners[a](o);t._listeners=null}}),this.promise.then=function(o){var a,u=new Promise(function(l){t.subscribe(l),a=l}).then(o);return u.cancel=function(){t.unsubscribe(a)},u},s(function(a,u,l){t.reason||(t.reason=new wO(a,u,l),e(t.reason))})}Ti.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Ti.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};Ti.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}};Ti.source=function(){var e,t=new Ti(function(a){e=a});return{token:t,cancel:e}};K_.exports=Ti});var J_=V((xM,Q_)=>{"use strict";Q_.exports=function(e){return function(o){return e.apply(null,o)}}});var Y_=V((RM,X_)=>{"use strict";var bO=Ie();X_.exports=function(e){return bO.isObject(e)&&e.isAxiosError===!0}});var eE=V((CM,Ip)=>{"use strict";var Ep=Ie(),_O=Jf(),mu=G_(),EO=yp(),IO=fu(),TO=cp();function Z_(s){var e=new mu(s),t=_O(mu.prototype.request,e);return Ep.extend(t,mu.prototype,e),Ep.extend(t,e),t.create=function(a){return Z_(EO(s,a))},t}var Ze=Z_(IO);Ze.Axios=mu;Ze.CanceledError=co();Ze.CancelToken=W_();Ze.isCancel=pp();Ze.VERSION=vp().version;Ze.toFormData=oo();Ze.AxiosError=zn();Ze.Cancel=Ze.CanceledError;Ze.all=function(e){return Promise.all(e)};Ze.spread=J_();Ze.isAxiosError=Y_();Ze.formToJSON=function(s){return TO(Ep.isHTMLForm(s)?new FormData(s):s)};Ip.exports=Ze;Ip.exports.default=Ze});var uo=V((OM,tE)=>{tE.exports=eE()});var go=V((Wn,bE)=>{var wu=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof global!="undefined"&&global,bu=function(){function s(){this.fetch=!1,this.DOMException=wu.DOMException}return s.prototype=wu,new s}();(function(s){var e=function(t){var o=typeof s!="undefined"&&s||typeof self!="undefined"&&self||typeof global!="undefined"&&global||{},a={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function u(_){return _&&DataView.prototype.isPrototypeOf(_)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(_){return _&&l.indexOf(Object.prototype.toString.call(_))>-1};function d(_){if(typeof _!="string"&&(_=String(_)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(_)||_==="")throw new TypeError('Invalid character in header field name: "'+_+'"');return _.toLowerCase()}function f(_){return typeof _!="string"&&(_=String(_)),_}function p(_){var R={next:function(){var W=_.shift();return{done:W===void 0,value:W}}};return a.iterable&&(R[Symbol.iterator]=function(){return R}),R}function m(_){this.map={},_ instanceof m?_.forEach(function(R,W){this.append(W,R)},this):Array.isArray(_)?_.forEach(function(R){if(R.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+R.length);this.append(R[0],R[1])},this):_&&Object.getOwnPropertyNames(_).forEach(function(R){this.append(R,_[R])},this)}m.prototype.append=function(_,R){_=d(_),R=f(R);var W=this.map[_];this.map[_]=W?W+", "+R:R},m.prototype.delete=function(_){delete this.map[d(_)]},m.prototype.get=function(_){return _=d(_),this.has(_)?this.map[_]:null},m.prototype.has=function(_){return this.map.hasOwnProperty(d(_))},m.prototype.set=function(_,R){this.map[d(_)]=f(R)},m.prototype.forEach=function(_,R){for(var W in this.map)this.map.hasOwnProperty(W)&&_.call(R,this.map[W],W,this)},m.prototype.keys=function(){var _=[];return this.forEach(function(R,W){_.push(W)}),p(_)},m.prototype.values=function(){var _=[];return this.forEach(function(R){_.push(R)}),p(_)},m.prototype.entries=function(){var _=[];return this.forEach(function(R,W){_.push([W,R])}),p(_)},a.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function g(_){if(!_._noBody){if(_.bodyUsed)return Promise.reject(new TypeError("Already read"));_.bodyUsed=!0}}function y(_){return new Promise(function(R,W){_.onload=function(){R(_.result)},_.onerror=function(){W(_.error)}})}function w(_){var R=new FileReader,W=y(R);return R.readAsArrayBuffer(_),W}function b(_){var R=new FileReader,W=y(R),se=/charset=([A-Za-z0-9_-]+)/.exec(_.type),fe=se?se[1]:"utf-8";return R.readAsText(_,fe),W}function E(_){for(var R=new Uint8Array(_),W=new Array(R.length),se=0;se<R.length;se++)W[se]=String.fromCharCode(R[se]);return W.join("")}function k(_){if(_.slice)return _.slice(0);var R=new Uint8Array(_.byteLength);return R.set(new Uint8Array(_)),R.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(_){this.bodyUsed=this.bodyUsed,this._bodyInit=_,_?typeof _=="string"?this._bodyText=_:a.blob&&Blob.prototype.isPrototypeOf(_)?this._bodyBlob=_:a.formData&&FormData.prototype.isPrototypeOf(_)?this._bodyFormData=_:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)?this._bodyText=_.toString():a.arrayBuffer&&a.blob&&u(_)?(this._bodyArrayBuffer=k(_.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(_)||h(_))?this._bodyArrayBuffer=k(_):this._bodyText=_=Object.prototype.toString.call(_):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof _=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var _=g(this);if(_)return _;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var _=g(this);return _||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(w);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var _=g(this);if(_)return _;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(ee)}),this.json=function(){return this.text().then(JSON.parse)},this}var C=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function P(_){var R=_.toUpperCase();return C.indexOf(R)>-1?R:_}function K(_,R){if(!(this instanceof K))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var W=R.body;if(_ instanceof K){if(_.bodyUsed)throw new TypeError("Already read");this.url=_.url,this.credentials=_.credentials,R.headers||(this.headers=new m(_.headers)),this.method=_.method,this.mode=_.mode,this.signal=_.signal,!W&&_._bodyInit!=null&&(W=_._bodyInit,_.bodyUsed=!0)}else this.url=String(_);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new m(R.headers)),this.method=P(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal||function(){if("AbortController"in o){var X=new AbortController;return X.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&W)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(W),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var se=/([?&])_=[^&]*/;if(se.test(this.url))this.url=this.url.replace(se,"$1_="+new Date().getTime());else{var fe=/\?/;this.url+=(fe.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}K.prototype.clone=function(){return new K(this,{body:this._bodyInit})};function ee(_){var R=new FormData;return _.trim().split("&").forEach(function(W){if(W){var se=W.split("="),fe=se.shift().replace(/\+/g," "),X=se.join("=").replace(/\+/g," ");R.append(decodeURIComponent(fe),decodeURIComponent(X))}}),R}function Te(_){var R=new m,W=_.replace(/\r?\n[\t ]+/g," ");return W.split("\r").map(function(se){return se.indexOf(`
`)===0?se.substr(1,se.length):se}).forEach(function(se){var fe=se.split(":"),X=fe.shift().trim();if(X){var Po=fe.join(":").trim();try{R.append(X,Po)}catch($u){console.warn("Response "+$u.message)}}}),R}x.call(K.prototype);function ce(_,R){if(!(this instanceof ce))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=R.statusText===void 0?"":""+R.statusText,this.headers=new m(R.headers),this.url=R.url||"",this._initBody(_)}x.call(ce.prototype),ce.prototype.clone=function(){return new ce(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},ce.error=function(){var _=new ce(null,{status:200,statusText:""});return _.ok=!1,_.status=0,_.type="error",_};var ft=[301,302,303,307,308];ce.redirect=function(_,R){if(ft.indexOf(R)===-1)throw new RangeError("Invalid status code");return new ce(null,{status:R,headers:{location:_}})},t.DOMException=o.DOMException;try{new t.DOMException}catch{t.DOMException=function(R,W){this.message=R,this.name=W;var se=Error(R);this.stack=se.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function Vi(_,R){return new Promise(function(W,se){var fe=new K(_,R);if(fe.signal&&fe.signal.aborted)return se(new t.DOMException("Aborted","AbortError"));var X=new XMLHttpRequest;function Po(){X.abort()}X.onload=function(){var De={statusText:X.statusText,headers:Te(X.getAllResponseHeaders()||"")};fe.url.indexOf("file://")===0&&(X.status<200||X.status>599)?De.status=200:De.status=X.status,De.url="responseURL"in X?X.responseURL:De.headers.get("X-Request-URL");var Yn="response"in X?X.response:X.responseText;setTimeout(function(){W(new ce(Yn,De))},0)},X.onerror=function(){setTimeout(function(){se(new TypeError("Network request failed"))},0)},X.ontimeout=function(){setTimeout(function(){se(new TypeError("Network request timed out"))},0)},X.onabort=function(){setTimeout(function(){se(new t.DOMException("Aborted","AbortError"))},0)};function $u(De){try{return De===""&&o.location.href?o.location.href:De}catch{return De}}if(X.open(fe.method,$u(fe.url),!0),fe.credentials==="include"?X.withCredentials=!0:fe.credentials==="omit"&&(X.withCredentials=!1),"responseType"in X&&(a.blob?X.responseType="blob":a.arrayBuffer&&(X.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof m||o.Headers&&R.headers instanceof o.Headers)){var Jp=[];Object.getOwnPropertyNames(R.headers).forEach(function(De){Jp.push(d(De)),X.setRequestHeader(De,f(R.headers[De]))}),fe.headers.forEach(function(De,Yn){Jp.indexOf(Yn)===-1&&X.setRequestHeader(Yn,De)})}else fe.headers.forEach(function(De,Yn){X.setRequestHeader(Yn,De)});fe.signal&&(fe.signal.addEventListener("abort",Po),X.onreadystatechange=function(){X.readyState===4&&fe.signal.removeEventListener("abort",Po)}),X.send(typeof fe._bodyInit=="undefined"?null:fe._bodyInit)})}return Vi.polyfill=!0,o.fetch||(o.fetch=Vi,o.Headers=m,o.Request=K,o.Response=ce),t.Headers=m,t.Request=K,t.Response=ce,t.fetch=Vi,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(bu);bu.fetch.ponyfill=!0;delete bu.fetch.polyfill;var ki=wu.fetch?wu:bu;Wn=ki.fetch;Wn.default=ki.fetch;Wn.fetch=ki.fetch;Wn.Headers=ki.Headers;Wn.Request=ki.Request;Wn.Response=ki.Response;bE.exports=Wn});var $E=V((WU,FE)=>{var UE=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};FE.exports=function(){if(this)return this;if(typeof globalThis=="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return UE()}try{return __global__||UE()}finally{delete Object.prototype.__global__}}()});var BE=V((QU,jO)=>{jO.exports={name:"websocket",description:"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",keywords:["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],author:"Brian McKelvey <theturtle32@gmail.com> (https://github.com/theturtle32)",contributors:["I\xF1aki Baz Castillo <ibc@aliax.net> (http://dev.sipdoc.net)"],version:"1.0.35",repository:{type:"git",url:"https://github.com/theturtle32/WebSocket-Node.git"},homepage:"https://github.com/theturtle32/WebSocket-Node",engines:{node:">=4.0.0"},dependencies:{bufferutil:"^4.0.1",debug:"^2.2.0","es5-ext":"^0.10.63","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2",yaeti:"^0.0.6"},devDependencies:{"buffer-equal":"^1.0.0",gulp:"^4.0.2","gulp-jshint":"^2.0.4","jshint-stylish":"^2.2.1",jshint:"^2.0.0",tape:"^4.9.1"},config:{verbose:!1},scripts:{test:"tape test/unit/*.js",gulp:"gulp"},main:"index",directories:{lib:"./lib"},browser:"lib/browser.js",license:"Apache-2.0"}});var VE=V((JU,jE)=>{jE.exports=BE().version});var HE=V((XU,zE)=>{var Or;if(typeof globalThis=="object")Or=globalThis;else try{Or=$E()}catch{}finally{if(!Or&&typeof window!="undefined"&&(Or=window),!Or)throw new Error("Could not determine global this")}var bo=Or.WebSocket||Or.MozWebSocket,VO=VE();function qE(s,e){var t;return e?t=new bo(s,e):t=new bo(s),t}bo&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(s){Object.defineProperty(qE,s,{get:function(){return bo[s]}})});zE.exports={w3cwebsocket:bo?qE:null,version:VO}});var Mo,RI=new Uint8Array(16);function Bu(){if(!Mo&&(Mo=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Mo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Mo(RI)}var Xp=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function CI(s){return typeof s=="string"&&Xp.test(s)}var Yp=CI;var Pe=[];for(Uo=0;Uo<256;++Uo)Pe.push((Uo+256).toString(16).substr(1));var Uo;function OI(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Pe[s[e+0]]+Pe[s[e+1]]+Pe[s[e+2]]+Pe[s[e+3]]+"-"+Pe[s[e+4]]+Pe[s[e+5]]+"-"+Pe[s[e+6]]+Pe[s[e+7]]+"-"+Pe[s[e+8]]+Pe[s[e+9]]+"-"+Pe[s[e+10]]+Pe[s[e+11]]+Pe[s[e+12]]+Pe[s[e+13]]+Pe[s[e+14]]+Pe[s[e+15]]).toLowerCase();if(!Yp(t))throw TypeError("Stringified UUID is invalid");return t}var Zp=OI;function NI(s,e,t){s=s||{};var o=s.random||(s.rng||Bu)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){t=t||0;for(var a=0;a<16;++a)e[t+a]=o[a];return e}return Zp(o)}var kt=NI;var qi=["w-el","wized"],zi=()=>{let s=A.configuration.actions||[],e=A.configuration.requests||[],t=A.configuration.auth&&A.configuration.auth["access-control"]?A.configuration.auth["access-control"]:[],o={},a=[],u=[];qi.forEach(l=>{let h=document.querySelectorAll(`[${l}]`),d=Array.from(h).map(p=>p.getAttribute(l));Array.from(new Set(d)).forEach(p=>{u.push(p),p&&(o[p]=document.querySelectorAll(`[${l}=${p}]`))})}),s.forEach(l=>{let{attributes:h=[]}=l;h.forEach(d=>{if(u.includes(d.name))return;u.push(d.name);let f=[];qi.forEach(p=>{d.name&&(f=[...f,...document.querySelectorAll(`[${p}="${d.name}"]`)])}),f.length>0?o[d.name]=f:a.push(d.name)})}),e.forEach(l=>{if(l.appId==="upload"&&l.file){let h=[];qi.forEach(d=>{l.file&&(h=[...h,...document.querySelectorAll(`[${d}="${l.file}"]`)])}),(h==null?void 0:h.length)>0?o[l.file]=h:a.push(l.file)}!l.trigger||l.trigger.length===0||l.trigger.forEach(h=>{if(h["trigger-type"]==="attribute-present"&&h["trigger-attribute-present"]){let d=h["trigger-attribute-present"];if(u.includes(d))return;u.push(d);let f=[];qi.forEach(p=>{d&&(f=[...f,...document.querySelectorAll(`[${p}="${d}"]`)])}),f.length>0?o[d]=f:a.push(d)}})}),t.forEach(l=>{let{attribute:h}=l;if(!h||u.includes(h))return;u.push(h);let d=[];qi.forEach(f=>{h&&(d=[...d,...document.querySelectorAll(`[${f}="${h}"]`)])}),d.length>0?o[h]=d:a.push(h)}),A.elements=o,A.notFoundAttributes=a};function om(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var tr=om();function DI(s){tr=s}var am=/[&<>"']/,PI=new RegExp(am.source,"g"),cm=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,LI=new RegExp(cm.source,"g"),MI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},em=s=>MI[s];function $e(s,e){if(e){if(am.test(s))return s.replace(PI,em)}else if(cm.test(s))return s.replace(LI,em);return s}var UI=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function um(s){return s.replace(UI,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}var FI=/(^|[^\[])\^/g;function oe(s,e){s=typeof s=="string"?s:s.source,e=e||"";let t={replace:(o,a)=>(a=a.source||a,a=a.replace(FI,"$1"),s=s.replace(o,a),t),getRegex:()=>new RegExp(s,e)};return t}var $I=/[^\w:]/g,BI=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function tm(s,e,t){if(s){let o;try{o=decodeURIComponent(um(t)).replace($I,"").toLowerCase()}catch{return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}e&&!BI.test(t)&&(t=zI(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}var Fo={},jI=/^[^:]+:\/*[^/]*$/,VI=/^([^:]+:)[\s\S]*$/,qI=/^([^:]+:\/*[^/]*)[\s\S]*$/;function zI(s,e){Fo[" "+s]||(jI.test(s)?Fo[" "+s]=s+"/":Fo[" "+s]=$o(s,"/",!0)),s=Fo[" "+s];let t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(VI,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(qI,"$1")+e:s+e}var Bo={exec:function(){}};function nm(s,e){let t=s.replace(/\|/g,(u,l,h)=>{let d=!1,f=l;for(;--f>=0&&h[f]==="\\";)d=!d;return d?"|":" |"}),o=t.split(/ \|/),a=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),o.length>e)o.splice(e);else for(;o.length<e;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(/\\\|/g,"|");return o}function $o(s,e,t){let o=s.length;if(o===0)return"";let a=0;for(;a<o;){let u=s.charAt(o-a-1);if(u===e&&!t)a++;else if(u!==e&&t)a++;else break}return s.slice(0,o-a)}function HI(s,e){if(s.indexOf(e[1])===-1)return-1;let t=s.length,o=0,a=0;for(;a<t;a++)if(s[a]==="\\")a++;else if(s[a]===e[0])o++;else if(s[a]===e[1]&&(o--,o<0))return a;return-1}function GI(s){s&&s.sanitize&&!s.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function rm(s,e){if(e<1)return"";let t="";for(;e>1;)e&1&&(t+=s),e>>=1,s+=s;return t+s}function im(s,e,t,o){let a=e.href,u=e.title?$e(e.title):null,l=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){o.state.inLink=!0;let h={type:"link",raw:t,href:a,title:u,text:l,tokens:o.inlineTokens(l)};return o.state.inLink=!1,h}return{type:"image",raw:t,href:a,title:u,text:$e(l)}}function KI(s,e){let t=s.match(/^(\s+)(?:```)/);if(t===null)return e;let o=t[1];return e.split(`
`).map(a=>{let u=a.match(/^\s+/);if(u===null)return a;let[l]=u;return l.length>=o.length?a.slice(o.length):a}).join(`
`)}var Hi=class{constructor(e){this.options=e||tr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let o=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?o:$o(o,`
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let o=t[0],a=KI(o,t[3]||"");return{type:"code",raw:o,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:a}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let o=t[2].trim();if(/#$/.test(o)){let a=$o(o,"#");(this.options.pedantic||!a||/ $/.test(a))&&(o=a.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let o=t[0].replace(/^ *>[ \t]?/gm,""),a=this.lexer.state.top;this.lexer.state.top=!0;let u=this.lexer.blockTokens(o);return this.lexer.state.top=a,{type:"blockquote",raw:t[0],tokens:u,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let o,a,u,l,h,d,f,p,m,g,y,w,b=t[1].trim(),E=b.length>1,k={type:"list",raw:"",ordered:E,start:E?+b.slice(0,-1):"",loose:!1,items:[]};b=E?`\\d{1,9}\\${b.slice(-1)}`:`\\${b}`,this.options.pedantic&&(b=E?b:"[*+-]");let x=new RegExp(`^( {0,3}${b})((?:[	 ][^\\n]*)?(?:\\n|$))`);for(;e&&(w=!1,!(!(t=x.exec(e))||this.rules.block.hr.test(e)));){if(o=t[0],e=e.substring(o.length),p=t[2].split(`
`,1)[0].replace(/^\t+/,P=>" ".repeat(3*P.length)),m=e.split(`
`,1)[0],this.options.pedantic?(l=2,y=p.trimLeft()):(l=t[2].search(/[^ ]/),l=l>4?1:l,y=p.slice(l),l+=t[1].length),d=!1,!p&&/^ *$/.test(m)&&(o+=m+`
`,e=e.substring(m.length+1),w=!0),!w){let P=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),K=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),ee=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),Te=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;e&&(g=e.split(`
`,1)[0],m=g,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),!(ee.test(m)||Te.test(m)||P.test(m)||K.test(e)));){if(m.search(/[^ ]/)>=l||!m.trim())y+=`
`+m.slice(l);else{if(d||p.search(/[^ ]/)>=4||ee.test(p)||Te.test(p)||K.test(p))break;y+=`
`+m}!d&&!m.trim()&&(d=!0),o+=g+`
`,e=e.substring(g.length+1),p=m.slice(l)}}k.loose||(f?k.loose=!0:/\n *\n *$/.test(o)&&(f=!0)),this.options.gfm&&(a=/^\[[ xX]\] /.exec(y),a&&(u=a[0]!=="[ ] ",y=y.replace(/^\[[ xX]\] +/,""))),k.items.push({type:"list_item",raw:o,task:!!a,checked:u,loose:!1,text:y}),k.raw+=o}k.items[k.items.length-1].raw=o.trimRight(),k.items[k.items.length-1].text=y.trimRight(),k.raw=k.raw.trimRight();let C=k.items.length;for(h=0;h<C;h++)if(this.lexer.state.top=!1,k.items[h].tokens=this.lexer.blockTokens(k.items[h].text,[]),!k.loose){let P=k.items[h].tokens.filter(ee=>ee.type==="space"),K=P.length>0&&P.some(ee=>/\n.*\n/.test(ee.raw));k.loose=K}if(k.loose)for(h=0;h<C;h++)k.items[h].loose=!0;return k}}html(e){let t=this.rules.block.html.exec(e);if(t){let o={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};if(this.options.sanitize){let a=this.options.sanitizer?this.options.sanitizer(t[0]):$e(t[0]);o.type="paragraph",o.text=a,o.tokens=this.lexer.inline(a)}return o}}def(e){let t=this.rules.block.def.exec(e);if(t){let o=t[1].toLowerCase().replace(/\s+/g," "),a=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",u=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:o,raw:t[0],href:a,title:u}}}table(e){let t=this.rules.block.table.exec(e);if(t){let o={type:"table",header:nm(t[1]).map(a=>({text:a})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(o.header.length===o.align.length){o.raw=t[0];let a=o.align.length,u,l,h,d;for(u=0;u<a;u++)/^ *-+: *$/.test(o.align[u])?o.align[u]="right":/^ *:-+: *$/.test(o.align[u])?o.align[u]="center":/^ *:-+ *$/.test(o.align[u])?o.align[u]="left":o.align[u]=null;for(a=o.rows.length,u=0;u<a;u++)o.rows[u]=nm(o.rows[u],o.header.length).map(f=>({text:f}));for(a=o.header.length,l=0;l<a;l++)o.header[l].tokens=this.lexer.inline(o.header[l].text);for(a=o.rows.length,l=0;l<a;l++)for(d=o.rows[l],h=0;h<d.length;h++)d[h].tokens=this.lexer.inline(d[h].text);return o}}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let o=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:o,tokens:this.lexer.inline(o)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:$e(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):$e(t[0]):t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let o=t[2].trim();if(!this.options.pedantic&&/^</.test(o)){if(!/>$/.test(o))return;let l=$o(o.slice(0,-1),"\\");if((o.length-l.length)%2===0)return}else{let l=HI(t[2],"()");if(l>-1){let d=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,d).trim(),t[3]=""}}let a=t[2],u="";if(this.options.pedantic){let l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);l&&(a=l[1],u=l[3])}else u=t[3]?t[3].slice(1,-1):"";return a=a.trim(),/^</.test(a)&&(this.options.pedantic&&!/>$/.test(o)?a=a.slice(1):a=a.slice(1,-1)),im(t,{href:a&&a.replace(this.rules.inline._escapes,"$1"),title:u&&u.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let o;if((o=this.rules.inline.reflink.exec(e))||(o=this.rules.inline.nolink.exec(e))){let a=(o[2]||o[1]).replace(/\s+/g," ");if(a=t[a.toLowerCase()],!a){let u=o[0].charAt(0);return{type:"text",raw:u,text:u}}return im(o,a,o[0],this.lexer)}}emStrong(e,t,o=""){let a=this.rules.inline.emStrong.lDelim.exec(e);if(!a||a[3]&&o.match(/[\p{L}\p{N}]/u))return;let u=a[1]||a[2]||"";if(!u||u&&(o===""||this.rules.inline.punctuation.exec(o))){let l=a[0].length-1,h,d,f=l,p=0,m=a[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+l);(a=m.exec(t))!=null;){if(h=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!h)continue;if(d=h.length,a[3]||a[4]){f+=d;continue}else if((a[5]||a[6])&&l%3&&!((l+d)%3)){p+=d;continue}if(f-=d,f>0)continue;d=Math.min(d,d+f+p);let g=e.slice(0,l+a.index+(a[0].length-h.length)+d);if(Math.min(l,d)%2){let w=g.slice(1,-1);return{type:"em",raw:g,text:w,tokens:this.lexer.inlineTokens(w)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let o=t[2].replace(/\n/g," "),a=/[^ ]/.test(o),u=/^ /.test(o)&&/ $/.test(o);return a&&u&&(o=o.substring(1,o.length-1)),o=$e(o,!0),{type:"codespan",raw:t[0],text:o}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){let o=this.rules.inline.autolink.exec(e);if(o){let a,u;return o[2]==="@"?(a=$e(this.options.mangle?t(o[1]):o[1]),u="mailto:"+a):(a=$e(o[1]),u=a),{type:"link",raw:o[0],text:a,href:u,tokens:[{type:"text",raw:a,text:a}]}}}url(e,t){let o;if(o=this.rules.inline.url.exec(e)){let a,u;if(o[2]==="@")a=$e(this.options.mangle?t(o[0]):o[0]),u="mailto:"+a;else{let l;do l=o[0],o[0]=this.rules.inline._backpedal.exec(o[0])[0];while(l!==o[0]);a=$e(o[0]),o[1]==="www."?u="http://"+o[0]:u=o[0]}return{type:"link",raw:o[0],text:a,href:u,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(e,t){let o=this.rules.inline.text.exec(e);if(o){let a;return this.lexer.state.inRawBlock?a=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(o[0]):$e(o[0]):o[0]:a=$e(this.options.smartypants?t(o[0]):o[0]),{type:"text",raw:o[0],text:a}}}},$={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Bo,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};$._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;$._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;$.def=oe($.def).replace("label",$._label).replace("title",$._title).getRegex();$.bullet=/(?:[*+-]|\d{1,9}[.)])/;$.listItemStart=oe(/^( *)(bull) */).replace("bull",$.bullet).getRegex();$.list=oe($.list).replace(/bull/g,$.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$.def.source+")").getRegex();$._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";$._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;$.html=oe($.html,"i").replace("comment",$._comment).replace("tag",$._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();$.paragraph=oe($._paragraph).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex();$.blockquote=oe($.blockquote).replace("paragraph",$.paragraph).getRegex();$.normal={...$};$.gfm={...$.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};$.gfm.table=oe($.gfm.table).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex();$.gfm.paragraph=oe($._paragraph).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",$.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex();$.pedantic={...$.normal,html:oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Bo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:oe($.normal._paragraph).replace("hr",$.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",$.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};var L={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Bo,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Bo,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};L._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";L.punctuation=oe(L.punctuation).replace(/punctuation/g,L._punctuation).getRegex();L.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;L.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;L._comment=oe($._comment).replace("(?:-->|$)","-->").getRegex();L.emStrong.lDelim=oe(L.emStrong.lDelim).replace(/punct/g,L._punctuation).getRegex();L.emStrong.rDelimAst=oe(L.emStrong.rDelimAst,"g").replace(/punct/g,L._punctuation).getRegex();L.emStrong.rDelimUnd=oe(L.emStrong.rDelimUnd,"g").replace(/punct/g,L._punctuation).getRegex();L._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;L._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;L._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;L.autolink=oe(L.autolink).replace("scheme",L._scheme).replace("email",L._email).getRegex();L._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;L.tag=oe(L.tag).replace("comment",L._comment).replace("attribute",L._attribute).getRegex();L._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;L._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;L._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;L.link=oe(L.link).replace("label",L._label).replace("href",L._href).replace("title",L._title).getRegex();L.reflink=oe(L.reflink).replace("label",L._label).replace("ref",$._label).getRegex();L.nolink=oe(L.nolink).replace("ref",$._label).getRegex();L.reflinkSearch=oe(L.reflinkSearch,"g").replace("reflink",L.reflink).replace("nolink",L.nolink).getRegex();L.normal={...L};L.pedantic={...L.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:oe(/^!?\[(label)\]\((.*?)\)/).replace("label",L._label).getRegex(),reflink:oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",L._label).getRegex()};L.gfm={...L.normal,escape:oe(L.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};L.gfm.url=oe(L.gfm.url,"i").replace("email",L.gfm._extended_email).getRegex();L.breaks={...L.gfm,br:oe(L.br).replace("{2,}","*").getRegex(),text:oe(L.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function WI(s){return s.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function sm(s){let e="",t,o,a=s.length;for(t=0;t<a;t++)o=s.charCodeAt(t),Math.random()>.5&&(o="x"+o.toString(16)),e+="&#"+o+";";return e}var Zn=class s{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||tr,this.options.tokenizer=this.options.tokenizer||new Hi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:$.normal,inline:L.normal};this.options.pedantic?(t.block=$.pedantic,t.inline=L.pedantic):this.options.gfm&&(t.block=$.gfm,this.options.breaks?t.inline=L.breaks:t.inline=L.gfm),this.tokenizer.rules=t}static get rules(){return{block:$,inline:L}}static lex(e,t){return new s(t).lex(e)}static lexInline(e,t){return new s(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
`),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g,"    ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(h,d,f)=>d+"    ".repeat(f.length));let o,a,u,l;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(h=>(o=h.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))){if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length),o.raw.length===1&&t.length>0?t[t.length-1].raw+=`
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length),a=t[t.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=`
`+o.raw,a.text+=`
`+o.text,this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length),a=t[t.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=`
`+o.raw,a.text+=`
`+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(u=e,this.options.extensions&&this.options.extensions.startBlock){let h=1/0,d=e.slice(1),f;this.options.extensions.startBlock.forEach(function(p){f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(u=e.substring(0,h+1))}if(this.state.top&&(o=this.tokenizer.paragraph(u))){a=t[t.length-1],l&&a.type==="paragraph"?(a.raw+=`
`+o.raw,a.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(o),l=u.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length),a=t[t.length-1],a&&a.type==="text"?(a.raw+=`
`+o.raw,a.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(o);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let o,a,u,l=e,h,d,f;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(h=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)p.includes(h[0].slice(h[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,h.index)+"["+rm("a",h[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(h=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,h.index)+"["+rm("a",h[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(h=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,h.index+h[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(d||(f=""),d=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(p=>(o=p.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))){if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),a=t[t.length-1],a&&o.type==="text"&&a.type==="text"?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length),a=t[t.length-1],a&&o.type==="text"&&a.type==="text"?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,l,f)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e,sm)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e,sm))){e=e.substring(o.raw.length),t.push(o);continue}if(u=e,this.options.extensions&&this.options.extensions.startInline){let p=1/0,m=e.slice(1),g;this.options.extensions.startInline.forEach(function(y){g=y.call({lexer:this},m),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(u=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(u,WI)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(f=o.raw.slice(-1)),d=!0,a=t[t.length-1],a&&a.type==="text"?(a.raw+=o.raw,a.text+=o.text):t.push(o);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}},Gi=class{constructor(e){this.options=e||tr}code(e,t,o){let a=(t||"").match(/\S*/)[0];if(this.options.highlight){let u=this.options.highlight(e,a);u!=null&&u!==e&&(o=!0,e=u)}return e=e.replace(/\n$/,"")+`
`,a?'<pre><code class="'+this.options.langPrefix+$e(a)+'">'+(o?e:$e(e,!0))+`</code></pre>
`:"<pre><code>"+(o?e:$e(e,!0))+`</code></pre>
`}blockquote(e){return`<blockquote>
${e}</blockquote>
`}html(e){return e}heading(e,t,o,a){if(this.options.headerIds){let u=this.options.headerPrefix+a.slug(o);return`<h${t} id="${u}">${e}</h${t}>
`}return`<h${t}>${e}</h${t}>
`}hr(){return this.options.xhtml?`<hr/>
`:`<hr>
`}list(e,t,o){let a=t?"ol":"ul",u=t&&o!==1?' start="'+o+'"':"";return"<"+a+u+`>
`+e+"</"+a+`>
`}listitem(e){return`<li>${e}</li>
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>
`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+t+`</table>
`}tablerow(e){return`<tr>
${e}</tr>
`}tablecell(e,t){let o=t.header?"th":"td";return(t.align?`<${o} align="${t.align}">`:`<${o}>`)+e+`</${o}>
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,o){if(e=tm(this.options.sanitize,this.options.baseUrl,e),e===null)return o;let a='<a href="'+e+'"';return t&&(a+=' title="'+t+'"'),a+=">"+o+"</a>",a}image(e,t,o){if(e=tm(this.options.sanitize,this.options.baseUrl,e),e===null)return o;let a=`<img src="${e}" alt="${o}"`;return t&&(a+=` title="${t}"`),a+=this.options.xhtml?"/>":">",a}text(e){return e}},jo=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,o){return""+o}image(e,t,o){return""+o}br(){return""}},Vo=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let o=e,a=0;if(this.seen.hasOwnProperty(o)){a=this.seen[e];do a++,o=e+"-"+a;while(this.seen.hasOwnProperty(o))}return t||(this.seen[e]=a,this.seen[o]=0),o}slug(e,t={}){let o=this.serialize(e);return this.getNextSafeSlug(o,t.dryrun)}},er=class s{constructor(e){this.options=e||tr,this.options.renderer=this.options.renderer||new Gi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new jo,this.slugger=new Vo}static parse(e,t){return new s(t).parse(e)}static parseInline(e,t){return new s(t).parseInline(e)}parse(e,t=!0){let o="",a,u,l,h,d,f,p,m,g,y,w,b,E,k,x,C,P,K,ee,Te=e.length;for(a=0;a<Te;a++){if(y=e[a],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[y.type]&&(ee=this.options.extensions.renderers[y.type].call({parser:this},y),ee!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(y.type))){o+=ee||"";continue}switch(y.type){case"space":continue;case"hr":{o+=this.renderer.hr();continue}case"heading":{o+=this.renderer.heading(this.parseInline(y.tokens),y.depth,um(this.parseInline(y.tokens,this.textRenderer)),this.slugger);continue}case"code":{o+=this.renderer.code(y.text,y.lang,y.escaped);continue}case"table":{for(m="",p="",h=y.header.length,u=0;u<h;u++)p+=this.renderer.tablecell(this.parseInline(y.header[u].tokens),{header:!0,align:y.align[u]});for(m+=this.renderer.tablerow(p),g="",h=y.rows.length,u=0;u<h;u++){for(f=y.rows[u],p="",d=f.length,l=0;l<d;l++)p+=this.renderer.tablecell(this.parseInline(f[l].tokens),{header:!1,align:y.align[l]});g+=this.renderer.tablerow(p)}o+=this.renderer.table(m,g);continue}case"blockquote":{g=this.parse(y.tokens),o+=this.renderer.blockquote(g);continue}case"list":{for(w=y.ordered,b=y.start,E=y.loose,h=y.items.length,g="",u=0;u<h;u++)x=y.items[u],C=x.checked,P=x.task,k="",x.task&&(K=this.renderer.checkbox(C),E?x.tokens.length>0&&x.tokens[0].type==="paragraph"?(x.tokens[0].text=K+" "+x.tokens[0].text,x.tokens[0].tokens&&x.tokens[0].tokens.length>0&&x.tokens[0].tokens[0].type==="text"&&(x.tokens[0].tokens[0].text=K+" "+x.tokens[0].tokens[0].text)):x.tokens.unshift({type:"text",text:K}):k+=K),k+=this.parse(x.tokens,E),g+=this.renderer.listitem(k,P,C);o+=this.renderer.list(g,w,b);continue}case"html":{o+=this.renderer.html(y.text);continue}case"paragraph":{o+=this.renderer.paragraph(this.parseInline(y.tokens));continue}case"text":{for(g=y.tokens?this.parseInline(y.tokens):y.text;a+1<Te&&e[a+1].type==="text";)y=e[++a],g+=`
`+(y.tokens?this.parseInline(y.tokens):y.text);o+=t?this.renderer.paragraph(g):g;continue}default:{let ce='Token with "'+y.type+'" type was not found.';if(this.options.silent){console.error(ce);return}else throw new Error(ce)}}}return o}parseInline(e,t){t=t||this.renderer;let o="",a,u,l,h=e.length;for(a=0;a<h;a++){if(u=e[a],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[u.type]&&(l=this.options.extensions.renderers[u.type].call({parser:this},u),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type))){o+=l||"";continue}switch(u.type){case"escape":{o+=t.text(u.text);break}case"html":{o+=t.html(u.text);break}case"link":{o+=t.link(u.href,u.title,this.parseInline(u.tokens,t));break}case"image":{o+=t.image(u.href,u.title,u.text);break}case"strong":{o+=t.strong(this.parseInline(u.tokens,t));break}case"em":{o+=t.em(this.parseInline(u.tokens,t));break}case"codespan":{o+=t.codespan(u.text);break}case"br":{o+=t.br();break}case"del":{o+=t.del(this.parseInline(u.tokens,t));break}case"text":{o+=t.text(u.text);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent){console.error(d);return}else throw new Error(d)}}}return o}},Lr=class{constructor(e){this.options=e||tr}preprocess(e){return e}postprocess(e){return e}};St(Lr,"passThroughHooks",new Set(["preprocess","postprocess"]));function QI(s,e,t){return o=>{if(o.message+=`
Please report this to https://github.com/markedjs/marked.`,s){let a="<p>An error occurred:</p><pre>"+$e(o.message+"",!0)+"</pre>";if(e)return Promise.resolve(a);if(t){t(null,a);return}return a}if(e)return Promise.reject(o);if(t){t(o);return}throw o}}function lm(s,e){return(t,o,a)=>{typeof o=="function"&&(a=o,o=null);let u={...o};o={...F.defaults,...u};let l=QI(o.silent,o.async,a);if(typeof t=="undefined"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(GI(o),o.hooks&&(o.hooks.options=o),a){let h=o.highlight,d;try{o.hooks&&(t=o.hooks.preprocess(t)),d=s(t,o)}catch(m){return l(m)}let f=function(m){let g;if(!m)try{o.walkTokens&&F.walkTokens(d,o.walkTokens),g=e(d,o),o.hooks&&(g=o.hooks.postprocess(g))}catch(y){m=y}return o.highlight=h,m?l(m):a(null,g)};if(!h||h.length<3||(delete o.highlight,!d.length))return f();let p=0;F.walkTokens(d,function(m){m.type==="code"&&(p++,setTimeout(()=>{h(m.text,m.lang,function(g,y){if(g)return f(g);y!=null&&y!==m.text&&(m.text=y,m.escaped=!0),p--,p===0&&f()})},0))}),p===0&&f();return}if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(t):t).then(h=>s(h,o)).then(h=>o.walkTokens?Promise.all(F.walkTokens(h,o.walkTokens)).then(()=>h):h).then(h=>e(h,o)).then(h=>o.hooks?o.hooks.postprocess(h):h).catch(l);try{o.hooks&&(t=o.hooks.preprocess(t));let h=s(t,o);o.walkTokens&&F.walkTokens(h,o.walkTokens);let d=e(h,o);return o.hooks&&(d=o.hooks.postprocess(d)),d}catch(h){return l(h)}}}function F(s,e,t){return lm(Zn.lex,er.parse)(s,e,t)}F.options=F.setOptions=function(s){return F.defaults={...F.defaults,...s},DI(F.defaults),F};F.getDefaults=om;F.defaults=tr;F.use=function(...s){let e=F.defaults.extensions||{renderers:{},childTokens:{}};s.forEach(t=>{let o={...t};if(o.async=F.defaults.async||o.async||!1,t.extensions&&(t.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if(a.renderer){let u=e.renderers[a.name];u?e.renderers[a.name]=function(...l){let h=a.renderer.apply(this,l);return h===!1&&(h=u.apply(this,l)),h}:e.renderers[a.name]=a.renderer}if(a.tokenizer){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[a.level]?e[a.level].unshift(a.tokenizer):e[a.level]=[a.tokenizer],a.start&&(a.level==="block"?e.startBlock?e.startBlock.push(a.start):e.startBlock=[a.start]:a.level==="inline"&&(e.startInline?e.startInline.push(a.start):e.startInline=[a.start]))}a.childTokens&&(e.childTokens[a.name]=a.childTokens)}),o.extensions=e),t.renderer){let a=F.defaults.renderer||new Gi;for(let u in t.renderer){let l=a[u];a[u]=(...h)=>{let d=t.renderer[u].apply(a,h);return d===!1&&(d=l.apply(a,h)),d}}o.renderer=a}if(t.tokenizer){let a=F.defaults.tokenizer||new Hi;for(let u in t.tokenizer){let l=a[u];a[u]=(...h)=>{let d=t.tokenizer[u].apply(a,h);return d===!1&&(d=l.apply(a,h)),d}}o.tokenizer=a}if(t.hooks){let a=F.defaults.hooks||new Lr;for(let u in t.hooks){let l=a[u];Lr.passThroughHooks.has(u)?a[u]=h=>{if(F.defaults.async)return Promise.resolve(t.hooks[u].call(a,h)).then(f=>l.call(a,f));let d=t.hooks[u].call(a,h);return l.call(a,d)}:a[u]=(...h)=>{let d=t.hooks[u].apply(a,h);return d===!1&&(d=l.apply(a,h)),d}}o.hooks=a}if(t.walkTokens){let a=F.defaults.walkTokens;o.walkTokens=function(u){let l=[];return l.push(t.walkTokens.call(this,u)),a&&(l=l.concat(a.call(this,u))),l}}F.setOptions(o)})};F.walkTokens=function(s,e){let t=[];for(let o of s)switch(t=t.concat(e.call(F,o)),o.type){case"table":{for(let a of o.header)t=t.concat(F.walkTokens(a.tokens,e));for(let a of o.rows)for(let u of a)t=t.concat(F.walkTokens(u.tokens,e));break}case"list":{t=t.concat(F.walkTokens(o.items,e));break}default:F.defaults.extensions&&F.defaults.extensions.childTokens&&F.defaults.extensions.childTokens[o.type]?F.defaults.extensions.childTokens[o.type].forEach(function(a){t=t.concat(F.walkTokens(o[a],e))}):o.tokens&&(t=t.concat(F.walkTokens(o.tokens,e)))}return t};F.parseInline=lm(Zn.lexInline,er.parseInline);F.Parser=er;F.parser=er.parse;F.Renderer=Gi;F.TextRenderer=jo;F.Lexer=Zn;F.lexer=Zn.lex;F.Tokenizer=Hi;F.Slugger=Vo;F.Hooks=Lr;F.parse=F;var GD=F.options,KD=F.setOptions,WD=F.use,QD=F.walkTokens,JD=F.parseInline;var XD=er.parse,YD=Zn.lex;var nt=(s,e,t)=>{let o="";if(t){let a=new Date;a.setTime(a.getTime()+t*24*60*60*1e3),o=`; expires=${a.toUTCString()}`}document.cookie=`${s}=${(e||"")+o}; path=/`},qo=s=>{let e=`${s}=`,t=document.cookie.split(";");for(let o=0;o<t.length;o+=1){let a=t[o];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(e)===0)return a.substring(e.length,a.length)}return null},hm=s=>{document.cookie=`${s}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`},Mr=s=>{switch(s){case"1-day":return 1;case"1-week":return 7;case"1-month":return 30;case"1-year":return 365}};var dm=s=>{switch(s){case 100:return"Subscription";case 200:return"Success";case 201:return"Created";case 202:return"Accepted";case 204:return"No content";case 206:return"Partial content";case 300:return"Multiple choices";case 301:return"Moved permanently";case 302:return"Redirect";case 303:return"See other";case 400:return"Bad request";case 401:return"Unauthorized";case 402:return"Not accepted";case 403:return"Forbidden";case 404:return"Not found";case 405:return"Method not allowed";case 406:return"Not accepted";case 407:return"Proxy authentication required";case 408:return"Request timeout";case 500:return"Server error";case 501:return"Not implimented";case 502:return"Bad gateway";case 503:return"Service unavailable";case 504:return"Gateway timeout";case 505:return"HTTP version not supported";case void 0:return"";default:return String(s)}},fm=(s,e="",t={})=>{let o=(a,u="",l={})=>{u=u?`${u}.`:"";for(let h in a)Object.prototype.hasOwnProperty.call(a,h)&&(l[u+h]=a[h],typeof a[h]=="object"&&a[h]!==null&&fm(a[h],u+h,l));return l};return t[e]||(t[e]=s),typeof s=="string"?(t[e]=s,t):e&&typeof s=="object"&&s!==null&&Object.keys(s).length===0?(t[e]=Array.isArray(s)?[]:{},t):(Array.isArray(s)?s.forEach((a,u)=>{t[`${e}[${u}]`]=a,typeof a=="object"&&a!==null&&o(a,`${e}[${u}]`,t)}):o(s,`${e}`,t),t)},an=()=>{let s={href:"",path:"",parameter:{}};Object.keys(T).filter(u=>u.startsWith("n.parameter.")).forEach(u=>{s.parameter[u.replace("n.parameter.","")]=T[u].value}),s.href=T["n.href"].value,s.path=T["n.path"].value;let e={};Object.keys(T).filter(u=>u.startsWith("v.")).forEach(u=>{e[u.replace("v.","")]=T[u].value});let t={};Object.keys(T).filter(u=>u.startsWith("c.")).forEach(u=>{t[u.replace("c.","")]=T[u].value});let o={};Object.keys(T).filter(u=>u.startsWith("i.")).forEach(u=>{o[u.replace("i.","")]=T[u].value});let a={};return Object.keys(T).filter(u=>u.startsWith("r.")).forEach(u=>{let l=u.split(".");a[l[1]]||(a[l[1]]={d:T[`r.${l[1]}.d`].value,$:{isRequesting:T[`r.${l[1]}.$.isRequesting`].value,hasRequested:T[`r.${l[1]}.$.hasRequested`].value,statusCode:T[`r.${l[1]}.$.statusCode`].value,status:T[`r.${l[1]}.$.status`].value}})}),{n:s,v:e,c:t,i:o,r:a}},ju=s=>{let e=[],t=0;if(s&&s.length>0)for(let o=0;o<s.length;o)if(s[o]==="{"&&s[o+1]==="{"){o+=2;for(let a=o;a<s.length;a)if(s[a]==="}"&&s[a+1]==="}"){s.substring(t,o-2)&&e.push({type:"text",value:s.substring(t,o-2),location:{start:t,end:o-3}}),s.substring(o,a)&&e.push({type:"code",value:s.substring(o,a),location:{start:o-2,end:a+1}}),o=a+1,t=o+1;break}else a++}else o++;return s&&s.substring(t)&&e.push({type:"text",value:s.substring(t),location:{start:t,end:s.length}}),e},JI=s=>{if((t=>{try{JSON.parse(t)}catch{return!1}return!0})(s))return JSON.parse(s);if(!Number.isNaN(s)&&!Number.isNaN(parseFloat(s))&&!isNaN(s)&&String(s)[0]!=="0")return Number(s);if(s==="true"||s==="false")return s==="true";if(!(s===void 0||s==="undefined"))return s},XI=s=>typeof s=="number"?"Number":typeof s=="boolean"?"Boolean":Array.isArray(s)?"Array":s===null?"Null":typeof s=="object"?"Object":typeof s=="string"?"String":typeof s=="undefined"?"Undefined":"Unknown",YI=s=>{let e=[],t=s,o=[];for(;t;)o.unshift(t),t=t.parentNode;return o.splice(0,3),o.forEach(a=>{let u=a.getAttribute("w-list-index-variable");u&&e.push({value:Number(a.getAttribute("w-list-index-value")),name:u})}),e},ZI=(s,e)=>{let t=fm(s),o=[],a=Object.keys(t),u=[];a.forEach(h=>{if(h.includes("i.")){let d=h.split(".");d[1]=`["${d[1]}"]`,u.push(d.join(""))}}),a.push(...u),a.forEach(h=>{e.includes(h)&&h.length>1&&o.push(h)}),o.forEach((h,d)=>{if(h.includes('["')){let f=h.split('["');f[1]=f[1].replace('"]',""),o[d]=f.join(".")}});let l=[];return o.forEach(h=>{let d=h.split(".");if(d[0]==="r"){if(d.length===3&&d[2]==="$"||d.length===2)return;if(d[2]==="d"){h=`${d[0]}.${d[1]}.${d[2]}`,l.push(h);return}l.push(h)}else l.push(h)}),l},eT=(value,element,originalValue)=>{let{n,v,c,i,r}=an(),replacementVariables=YI(element);replacementVariables.forEach(s=>{v[s.name]=s.value});let paths=ZI({n,v,c,i,r},value),regex=/r+\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])+\./g,matches=value.match(regex);if(matches&&(matches==null?void 0:matches.length)>0)for(let s=0;s<matches.length;s++){let e=matches[s].split("."),t=`${e[0]}[${e[1]}].`;value=value.replace(matches[s],t)}let result;try{return result=eval(value),{value:result,paths}}catch(s){return{error:s instanceof Error?s.message:"Error during data evaluation",value:result,paths}}},I=(s,e)=>{try{let t,o="",a=[];return ju(s).forEach(l=>{if(l.type==="text"&&(o+=l.value),l.type==="code"){l={...l,value:l.value};let h=eT(l.value,e,s);!o&&(Array.isArray(h.value)||typeof h.value=="object")?o=h.value:o+=h.value,t=h.error,a=[...a,...h.paths]}}),o=JI(o),{type:XI(o),value:o,error:t,paths:a}}catch(t){let o=t instanceof Error?t.message:"Error during data evaluation";return console.log(o),{error:o,type:"Undefined",value:void 0,paths:[]}}};var[mm,nr]=(()=>{let s,e=new Promise(t=>{s=t});return[s,e]})(),Fr={data:{get:async s=>{await nr;let e=an(),t=pm(s).split("."),o=e;return t.forEach(a=>{o=o[a]}),o},getAll:async()=>(await nr,an()),listen:async(s,e)=>{await nr;let t=pm(s).split(".");t.length>3&&t[2]==="d"&&(t=t.slice(0,3));let o=t.join("."),a=an();t.forEach(l=>{a=a[l]});let u=kt();Be(o,a,{type:"callback",id:u,callback:e})},setVariable:async(s,e)=>(await nr,T[`v.${s}`].set(e),e),setCookie:async(s,e,t)=>(await nr,nt("wized_"+s,e,t),T[`c.${s}`].set(e),e)},request:{execute:async s=>{await nr;let e=A.configuration.requests.find(t=>t.name===s||t.id===s);return e||console.error(`Request "${s}" not found`),await pt(e.id)},await:async(s,e)=>{await nr;let t=A.configuration.requests.find(a=>a.name===s||a.id===s);t||console.error(`Request "${s}" not found`);let o=kt();Fr._store._requestCallbacks[t.id]?Fr._store._requestCallbacks[t.id][o]=e:Fr._store._requestCallbacks[t.id]={[o]:e}},awaitAllPageLoad:s=>{let e=kt();Fr._store._requestInitalCallbacks[e]=s}},_store:{_requestCallbacks:{},_requestInitalCallbacks:{}}},gm=()=>{window.Wized=Fr},pm=s=>{let e=s.match(/\[(.*?)\]/g);return e&&e.forEach(t=>{let o=t.replace("[",".").replace("]","");s=s.replace(t,o)}),s},rr=Fr;var Vu=document.querySelector("script[data-wized-id]"),ym=Vu==null?void 0:Vu.src,zo=ym.includes("localhost")?"development":ym.includes("https://se.wized.com")?"staging":"production",ir={mode:zo,serverUrl:"",configuratorUrl:""};zo==="development"?(ir.serverUrl="http://localhost:3000/",ir.configuratorUrl="http://localhost:8080/"):zo==="staging"?(ir.serverUrl="https://ss.wized.com/",ir.configuratorUrl="https://sa.wized.com/"):zo==="production"&&(ir.serverUrl="https://server.wized.com/",ir.configuratorUrl="https://app.wized.com/");var te=ir;var vm=[],mt=()=>{let s=kt();return vm.push(s),s},Ae=s=>vm.includes(s);var wm=["w-el","wized"],qu=()=>{let s=new URLSearchParams(window.location.search),e={};for(let[t,o]of Array.from(s.entries()))t!=="WIZED_ENV"&&t!=="WIZED_VERSION"&&(e[t]=o);if(e.url){let t=new URLSearchParams(new URL(e.url).search);for(let[o,a]of Array.from(t.entries()))o!=="WIZED_ENV"&&o!=="WIZED_VERSION"&&(e[o]=a);delete e.url}return e["login-token"]&&nt("wized-auth",e["login-token"],30),e["w-backup-configuration"]&&delete e["w-backup-configuration"],e},tT=()=>{let s={};return wm.forEach(e=>{var u;let t=document.querySelectorAll(`input[${e}]`),o=document.querySelectorAll(`textarea[${e}]`),a=document.querySelectorAll(`select[${e}]`);for(let l of Array.from(t))l.type==="radio"?s[l.getAttribute(e)]=(u=document.querySelector(`input[name=${l.getAttribute("name")}]:checked`))==null?void 0:u.value:l.type==="checkbox"?s[l.getAttribute(e)]=l.checked:s[l.getAttribute(e)]=l.value;for(let l of Array.from(o))s[l.getAttribute(e)]=l.value;for(let l of Array.from(a))s[l.getAttribute(e)]=l.value}),s},nT=s=>{var t;let e={};return(t=s.cookies)==null||t.forEach(o=>{e[o.name]=qo("wized_"+o.name)||void 0}),e},rT=s=>{var t;let e={};return(t=s.variables)==null||t.forEach(o=>{e[o.name]=o.initialValue?I(o.initialValue).value:void 0}),e},zu=(s,e)=>{for(let t of s)if(t.tagName==="INPUT")if(t.type!=="radio"&&t.type!=="checkbox"){let o=mt();t.addEventListener("input",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}}),t.addEventListener("change",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}}),t.addEventListener("blur",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}})}else{let o=T[`i.${t.getAttribute(e)}`];if(t.type==="radio"){let a=document.querySelectorAll(`input[name=${t.getAttribute("name")}]`);Array.from(a).forEach(u=>{let l=mt();u.addEventListener("change",h=>{Ae(l)&&At(t,o,document.querySelector(`input[name=${t.getAttribute("name")}]:checked`).value)})})}else if(t.type==="checkbox"){let a=mt();t.addEventListener("change",u=>{Ae(a)&&At(t,o,t.checked)})}}else if(t.tagName==="TEXTAREA"){let o=mt();t.addEventListener("input",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}}),t.addEventListener("change",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}}),t.addEventListener("blur",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}})}else if(t.tagName==="SELECT"){let o=mt();t.addEventListener("input",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}}),t.addEventListener("change",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}}),t.addEventListener("blur",a=>{if(Ae(o)){let u=T[`i.${t.getAttribute(e)}`];At(t,u,t.value)}})}},At=(s,e,t)=>{let o=s.closest("[w-list-index-value]");if(!o)e.set(t);else{let a=o.getAttribute("w-list-index-value"),u=[...e.value];Array.isArray(u)&&(u[a]=t,e.set(u))}},bm=()=>{var l;let{configuration:s}=A,e=qu();(l=s.parameters)==null||l.forEach(h=>{e[h.name]&&(T[`n.parameter.${h.name}`]=new rt(`n.parameter.${h.name}`,e[h.name]))});let t=new URL(window.location.href.includes("localhost")||window.location.href.includes("server.wized.com")||window.location.href.includes("http://ss.wized.com")?new URL(location.href).searchParams.get("url"):window.location.href);T["n.href"]=new rt("n.href",t.href),T["n.path"]=new rt("n.path",t.pathname);let o=tT();for(let h in o){let d=new rt(`i.${h}`,o[h]);T[`i.${h}`]=d}let a=nT(s);for(let h in a)T[`c.${h}`]=new rt(`c.${h}`,a[h]);let u=rT(s);for(let h in u)T[`v.${h}`]=new rt(`v.${h}`,u[h]);wm.forEach(h=>{let d=document.querySelectorAll(`input[${h}]`),f=document.querySelectorAll(`textarea[${h}]`),p=document.querySelectorAll(`select[${h}]`),m=[...Array.from(d),...Array.from(f),...Array.from(p)];zu(m,h)}),Hu(),gt({type:"data",data:an()})},Hu=()=>{let{requests:s}=A.configuration;!s||s.length===0||s.forEach(e=>{iT(e)})},iT=s=>{T[`r.${s.number}.d`]||(T[`r.${s.number}.d`]=new rt(`r.${s.number}.d`,{})),T[`r.${s.number}.$.isRequesting`]||(T[`r.${s.number}.$.isRequesting`]=new rt(`r.${s.number}.$.isRequesting`,!1)),T[`r.${s.number}.$.hasRequested`]||(T[`r.${s.number}.$.hasRequested`]=new rt(`r.${s.number}.$.hasRequested`,!1)),T[`r.${s.number}.$.statusCode`]||(T[`r.${s.number}.$.statusCode`]=new rt(`r.${s.number}.$.statusCode`,void 0)),T[`r.${s.number}.$.status`]||(T[`r.${s.number}.$.status`]=new rt(`r.${s.number}.$.status`,""))};var Gu=!1,_m=s=>{var a;Gu=!0;let e=A.elements,t=((a=A.configuration.actions)==null?void 0:a.flatMap(u=>u.attributes.map(l=>l.name)))||[],o=document.createElement("div");o.id="x-ray-attributes",o.style.position="absolute",o.style.zIndex="99999999999999",o.style.width="100vw",o.style.height=`${document.body.scrollHeight}`,o.style.backgroundColor=s==="light"?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 1)",o.style.pointerEvents="none",o.style.top="0rem",o.style.left="0rem",document.body.appendChild(o),Object.keys(e).forEach(u=>{let l=t.includes(u)?"#3371f2":"#000";Im(u,l,e,o)})},Em=(s,e)=>{if(Gu)return;if(s.length===0){Ho();return}let t={},o=A.elements;if(s.forEach(u=>{o[u]&&(t[u]=o[u])}),Object.keys(t).length===0){Ho();return}let a=document.createElement("div");a.id="x-ray-attributes",a.style.position="absolute",a.style.zIndex="99999999999999",a.style.width="100vw",a.style.height=`${document.body.scrollHeight}`,a.style.backgroundColor=e==="light"?"rgba(255, 255, 255, 1)":"rgba(0, 0, 0, 1)",a.style.pointerEvents="none",a.style.top="0rem",a.style.left="0rem",document.body.appendChild(a),Object.keys(o).forEach(u=>Im(u,e==="light"?"#3371f2":"#fff",t,a))},Im=(s,e,t,o)=>{let a=t[s];a&&a.forEach(u=>{let{top:l,left:h,width:d,height:f}=u.getBoundingClientRect(),p=document.createElement("div");p.style.position="absolute",p.style.top=`${l+window.scrollY}px`,p.style.left=`${h}px`,p.style.width=`${d}px`,p.style.height=`${f}px`,p.style.border=`2px solid ${e}`,p.style.pointerEvents="none",p.id=s;let m=document.createElement("div");m.textContent=s,m.style.top="0px",m.style.left="0px",m.style.paddingLeft="5px",m.style.paddingRight="5px",m.style.backgroundColor=`${e}`,m.style.display="inline-block",m.style.fontSize="10px",m.style.lineHeight="18px",m.style.fontFamily="system-ui, sans-serif",m.style.color=e==="#fff"?"#000":"#fff",m.style.transform=l<19?"translateY(0px)":"translateY(-18px)",m.style.position="relative",p.appendChild(m),o.appendChild(p)})},Ho=()=>{Gu=!1,document.querySelectorAll("#x-ray-attributes").forEach(e=>e.remove())};var Tm=()=>{var o,a,u;let e=document.documentElement.getAttribute("data-wf-site"),t=new Date(((u=(a=(o=Array.from(document.childNodes).find(l=>{var h;return l.nodeType===Node.COMMENT_NODE&&((h=l.nodeValue)==null?void 0:h.includes("Last Published:"))}))==null?void 0:o.nodeValue)==null?void 0:a.match(/Last Published:\s*(.+)/))==null?void 0:u[1])||"").getTime()||null;return{siteId:e,lastPublishedDate:t}},Sm=()=>{window.location!==window.parent.location&&window.addEventListener("message",s=>{var e;if(te.configuratorUrl===s.origin+"/"){if(s.data.type==="request"){let t=s.data.id;pt(t)}if(s.data.type==="initialize"&&document.location.reload(),s.data.type==="configuration-update"&&(A.configuration=s.data.data,(e=A.configuration.apps)==null||e.push({id:"upload",name:"File upload",icon:"data-out",type:"upload"}),Hu()),s.data.type==="report-href"){let{href:t}=window.location;gt({type:"href",data:{href:t}})}if(s.data.type==="x-ray"){let{active:t}=s.data.data;t?_m(s.data.data.mode):Ho()}if(s.data.type==="x-ray-specific"&&Em(s.data.data.attributeList,s.data.data.mode),s.data.type==="evaluate"){let t=I(s.data.value);gt({type:"evaluation-result",data:t})}if(s.data.type==="parse"){let t=ju(s.data.value);gt({type:"parsing-result",data:t})}}},!1)},km=(s,e)=>{gt({type:"data-change",data:{path:s,value:e}})},Am=s=>{gt({type:"request-log",data:s})},xm=s=>{let e=new URLSearchParams(new URL(s).search).get("url");if(e){let o=new URL(e),a=new URLSearchParams(o.search);a.delete("WIZED_VERSION"),a.delete("WIZED_ENV"),e=o.href}if(s){let o=new URL(s),a=new URLSearchParams(o.search);a.delete("WIZED_VERSION"),a.delete("WIZED_ENV"),s=o.href}let t=qu();gt({type:"page",data:{url:e||s,parameters:t}})},Rm=s=>{console.log("Pushing version",s),gt({type:"version",data:{version:s}})},Cm=()=>{gt({type:"ask-for-configuration"})},Go,gt=s=>{if(window.location!==window.parent.location){Go||(Go=window.parent);let e=new URL(window.location.href);e.origin.includes("wized.com")||e.origin.includes("localhost")?Go.postMessage(JSON.parse(JSON.stringify(s)),te.configuratorUrl):Go.postMessage(JSON.parse(JSON.stringify(s)),e.origin)}};var Om=()=>{let{origin:s}=window.location,{hostname:e}=window.location;if(s==="http://localhost:3000"||s==="https://ss.wized.com"||s==="https://server.wized.com"){let t=new URL(window.location.href),a=new URLSearchParams(t.search).get("url");e=new URL(a).hostname}return e},Wi=s=>{if(origin.includes("http://localhost")||origin==="https://ss.wized.com"||origin==="https://server.wized.com"){let e="";try{let t=new URL(s);e=origin+"/v2/page/proxy?url="+t.href}catch{let o=window.location.search,a=new URLSearchParams(o),u=new URL(a.get("url"));u.search="",u.pathname=s,e=origin+"/v2/page/proxy?url="+u.href}return e}return s},yt=(s,e)=>{window.location.href!==Wi(s)&&(e?window.open(Wi(s),"_blank").focus():window.location.href=Wi(s))},Nm=()=>{document.addEventListener("keydown",s=>{s.key==="Enter"&&s.target.tagName==="INPUT"&&s.preventDefault()})};var Dm=s=>{let e=new URLSearchParams(window.location.search);return e.get("url")?new URLSearchParams(new URL(e.get("url")).search).get(s):e.get(s)};var xt=()=>{let s=document.querySelector("script[data-wized-id]").getAttribute("data-wized-id");return s||""};var oT=s=>e=>`${s}__${e}`;async function Ku(s,e,t){var d,f,p,m,g,y;let o=oT("airtable"),a=xt(),u=s[o("method")],l=s[o("auth-method")],h=s[o("api-type")];try{if(h==="database"){if(u==="get"){let w=I(s[o("record-id")],t).value;return await(await fetch(`${te.serverUrl}v2/request/airtable/get`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,recordId:w}})})).json()}if(u==="get-list"){let w=[];return(d=s.filtering)==null||d.forEach(E=>{try{w.push(I(E.filtering__airtable__variable,t).value)}catch(k){console.error(k)}}),await(await fetch(`${te.serverUrl}v2/request/airtable/get-list`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,filterVariables:w}})})).json()}if(u==="create"){let w={};return Object.keys(s).filter(E=>E.startsWith("fld")).forEach(E=>{I(s[E],t).value&&(w[E]=I(s[E],t).value)}),await(await fetch(`${te.serverUrl}v2/request/airtable/create`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,input:w}})})).json()}if(u==="update"){let w={};Object.keys(s).filter(k=>k.startsWith("fld")).forEach(k=>{I(s[k],t).value&&(w[k]=I(s[k],t).value)});let b=I(s["airtable__record-id"],t).value;return await(await fetch(`${te.serverUrl}v2/request/airtable/update`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,recordId:b,input:w}})})).json()}if(u==="delete"){let w=I(s["airtable__record-id"],t).value;return await(await fetch(`${te.serverUrl}v2/request/airtable/delete`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,recordId:w}})})).json()}}if(h==="authentication"){if(l==="create-user"){let w=I(s.airtable__email,t).value,b=I(s.airtable__password,t).value,E=I(s.airtable__page,t).value,k={};Object.keys(s).filter(P=>P.startsWith("fld")).forEach(P=>{I(s[P],t).value&&(k[P]=I(s[P],t).value)});let C=await(await fetch(`${te.serverUrl}v2/request/airtable/create-user`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,email:w,password:b,page:E,url:new URLSearchParams(location.search).get("url")?new URLSearchParams(location.search).get("url"):location.href,input:k}})})).json();return(f=C==null?void 0:C.data)!=null&&f.accessToken&&b&&nt("wized-auth",C.data.accessToken,30),C}if(l==="login"){let w=I(s.airtable__email,t).value,b=s["airtable__is-password-required"],E=I(s.airtable__password,t).value,k=I(s.airtable__page,t).value;if(b&&!E)throw new Error("Password is required.");if(!/\S+@\S+\.\S+/.test(String(w)))throw new Error("Invalid email address.");let C=await(await fetch(`${te.serverUrl}v2/request/airtable/login`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,email:w,password:E,page:k,url:new URLSearchParams(location.search).get("url")?new URLSearchParams(location.search).get("url"):location.href}})})).json();return(p=C==null?void 0:C.data)!=null&&p.accessToken&&E&&nt("wized-auth",C.data.accessToken,30),C}if(u==="load-user"){let w=qo("wized-auth");return await(await fetch(`${te.serverUrl}v2/request/airtable/auth`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,authToken:w}})})).json()}if(l==="logout")return hm("wized-auth"),window.location.reload(),{status:200,data:{message:"Logout successful."}};if(l==="request-password-reset"){let w=I(s.airtable__email,t).value,b=I(s.airtable__page,t).value;return await(await fetch(`${te.serverUrl}v2/request/airtable/request-password-reset`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,email:w,page:b,url:new URLSearchParams(location.search).get("url")?new URLSearchParams(location.search).get("url"):location.href}})})).json()}if(l==="reset-password"){let w=I(s.airtable__password,t).value,b=Dm("reset-token");if(!b)throw new Error("Reset token is required. Check your password reset URL.");let k=await(await fetch(`${te.serverUrl}v2/request/airtable/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},referrerPolicy:"origin",body:JSON.stringify({environment:A.configuration.type,data:{projectId:a,requestId:s.id,password:w,resetToken:b}})})).json();return(m=k==null?void 0:k.data)!=null&&m.accessToken&&nt("wized-auth",k.data.accessToken,30),k}}}catch(w){return{status:500,data:{error:(y=(g=w==null?void 0:w.response)==null?void 0:g.data)!=null&&y.error?w.response.data.error:w.message?w.message:"Unknown error while exectuting airtable request."}}}return{status:500,data:{error:"Unknown airtable method"}}}var Lm=function(s){let e=[],t=0;for(let o=0;o<s.length;o++){let a=s.charCodeAt(o);a<128?e[t++]=a:a<2048?(e[t++]=a>>6|192,e[t++]=a&63|128):(a&64512)===55296&&o+1<s.length&&(s.charCodeAt(o+1)&64512)===56320?(a=65536+((a&1023)<<10)+(s.charCodeAt(++o)&1023),e[t++]=a>>18|240,e[t++]=a>>12&63|128,e[t++]=a>>6&63|128,e[t++]=a&63|128):(e[t++]=a>>12|224,e[t++]=a>>6&63|128,e[t++]=a&63|128)}return e},aT=function(s){let e=[],t=0,o=0;for(;t<s.length;){let a=s[t++];if(a<128)e[o++]=String.fromCharCode(a);else if(a>191&&a<224){let u=s[t++];e[o++]=String.fromCharCode((a&31)<<6|u&63)}else if(a>239&&a<365){let u=s[t++],l=s[t++],h=s[t++],d=((a&7)<<18|(u&63)<<12|(l&63)<<6|h&63)-65536;e[o++]=String.fromCharCode(55296+(d>>10)),e[o++]=String.fromCharCode(56320+(d&1023))}else{let u=s[t++],l=s[t++];e[o++]=String.fromCharCode((a&15)<<12|(u&63)<<6|l&63)}}return e.join("")},Mm={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(s,e){if(!Array.isArray(s))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[];for(let a=0;a<s.length;a+=3){let u=s[a],l=a+1<s.length,h=l?s[a+1]:0,d=a+2<s.length,f=d?s[a+2]:0,p=u>>2,m=(u&3)<<4|h>>4,g=(h&15)<<2|f>>6,y=f&63;d||(y=64,l||(g=64)),o.push(t[p],t[m],t[g],t[y])}return o.join("")},encodeString(s,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(s):this.encodeByteArray(Lm(s),e)},decodeString(s,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(s):aT(this.decodeStringToByteArray(s,e))},decodeStringToByteArray(s,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,o=[];for(let a=0;a<s.length;){let u=t[s.charAt(a++)],h=a<s.length?t[s.charAt(a)]:0;++a;let f=a<s.length?t[s.charAt(a)]:64;++a;let m=a<s.length?t[s.charAt(a)]:64;if(++a,u==null||h==null||f==null||m==null)throw new Qu;let g=u<<2|h>>4;if(o.push(g),f!==64){let y=h<<4&240|f>>2;if(o.push(y),m!==64){let w=f<<6&192|m;o.push(w)}}}return o},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let s=0;s<this.ENCODED_VALS.length;s++)this.byteToCharMap_[s]=this.ENCODED_VALS.charAt(s),this.charToByteMap_[this.byteToCharMap_[s]]=s,this.byteToCharMapWebSafe_[s]=this.ENCODED_VALS_WEBSAFE.charAt(s),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[s]]=s,s>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(s)]=s,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(s)]=s)}}},Qu=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},cT=function(s){let e=Lm(s);return Mm.encodeByteArray(e,!0)},Ji=function(s){return cT(s).replace(/\./g,"")},Xu=function(s){try{return Mm.decodeString(s,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function uT(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("Unable to locate global object.")}var lT=()=>uT().__FIREBASE_DEFAULTS__,hT=()=>{if(typeof process=="undefined"||typeof process.env=="undefined")return;let s=process.env.__FIREBASE_DEFAULTS__;if(s)return JSON.parse(s)},dT=()=>{if(typeof document=="undefined")return;let s;try{s=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=s&&Xu(s[1]);return e&&JSON.parse(e)},Wo=()=>{try{return lT()||hT()||dT()}catch(s){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${s}`);return}},Yu=s=>{var e,t;return(t=(e=Wo())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[s]},Qo=s=>{let e=Yu(s);if(!e)return;let t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);let o=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),o]:[e.substring(0,t),o]},Zu=()=>{var s;return(s=Wo())===null||s===void 0?void 0:s.config},el=s=>{var e;return(e=Wo())===null||e===void 0?void 0:e[`_${s}`]};var Ko=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,o)=>{t?this.reject(t):this.resolve(o),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,o))}}};function Jo(s,e){if(s.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let t={alg:"none",type:"JWT"},o=e||"demo-project",a=s.iat||0,u=s.sub||s.user_id;if(!u)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");let l=Object.assign({iss:`https://securetoken.google.com/${o}`,aud:o,iat:a,exp:a+3600,auth_time:a,sub:u,user_id:u,firebase:{sign_in_provider:"custom",identities:{}}},s);return[Ji(JSON.stringify(t)),Ji(JSON.stringify(l)),""].join(".")}function xe(){return typeof navigator!="undefined"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Um(){return typeof window!="undefined"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(xe())}function Fm(){var s;let e=(s=Wo())===null||s===void 0?void 0:s.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function $m(){let s=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof s=="object"&&s.id!==void 0}function Bm(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function jm(){let s=xe();return s.indexOf("MSIE ")>=0||s.indexOf("Trident/")>=0}function tl(){try{return typeof indexedDB=="object"}catch{return!1}}function Vm(){return new Promise((s,e)=>{try{let t=!0,o="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(o);a.onsuccess=()=>{a.result.close(),t||self.indexedDB.deleteDatabase(o),s(!0)},a.onupgradeneeded=()=>{t=!1},a.onerror=()=>{var u;e(((u=a.error)===null||u===void 0?void 0:u.message)||"")}}catch(t){e(t)}})}var fT="FirebaseError",Ke=class s extends Error{constructor(e,t,o){super(t),this.code=e,this.customData=o,this.name=fT,Object.setPrototypeOf(this,s.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,cn.prototype.create)}},cn=class{constructor(e,t,o){this.service=e,this.serviceName=t,this.errors=o}create(e,...t){let o=t[0]||{},a=`${this.service}/${e}`,u=this.errors[e],l=u?pT(u,o):"Error",h=`${this.serviceName}: ${l} (${a}).`;return new Ke(a,h,o)}};function pT(s,e){return s.replace(mT,(t,o)=>{let a=e[o];return a!=null?String(a):`<${o}?>`})}var mT=/\{\$([^}]+)}/g;function qm(s){for(let e in s)if(Object.prototype.hasOwnProperty.call(s,e))return!1;return!0}function sr(s,e){if(s===e)return!0;let t=Object.keys(s),o=Object.keys(e);for(let a of t){if(!o.includes(a))return!1;let u=s[a],l=e[a];if(Pm(u)&&Pm(l)){if(!sr(u,l))return!1}else if(u!==l)return!1}for(let a of o)if(!t.includes(a))return!1;return!0}function Pm(s){return s!==null&&typeof s=="object"}function Br(s){let e=[];for(let[t,o]of Object.entries(s))Array.isArray(o)?o.forEach(a=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(a))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(o));return e.length?"&"+e.join("&"):""}function jr(s){let e={};return s.replace(/^\?/,"").split("&").forEach(o=>{if(o){let[a,u]=o.split("=");e[decodeURIComponent(a)]=decodeURIComponent(u)}}),e}function Vr(s){let e=s.indexOf("?");if(!e)return"";let t=s.indexOf("#",e);return s.substring(e,t>0?t:void 0)}function zm(s,e){let t=new Ju(s,e);return t.subscribe.bind(t)}var Ju=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(o=>{this.error(o)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,o){let a;if(e===void 0&&t===void 0&&o===void 0)throw new Error("Missing Observer.");gT(e,["next","error","complete"])?a=e:a={next:e,error:t,complete:o},a.next===void 0&&(a.next=Wu),a.error===void 0&&(a.error=Wu),a.complete===void 0&&(a.complete=Wu);let u=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?a.error(this.finalError):a.complete()}catch{}}),this.observers.push(a),u}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(o){typeof console!="undefined"&&console.error&&console.error(o)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function gT(s,e){if(typeof s!="object"||s===null)return!1;for(let t of e)if(t in s&&typeof s[t]=="function")return!0;return!1}function Wu(){}var CP=4*60*60*1e3;function re(s){return s&&s._delegate?s._delegate:s}var it=class{constructor(e,t,o){this.name=e,this.instanceFactory=t,this.type=o,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var or="[DEFAULT]";var nl=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 o=new Ko;if(this.instancesDeferred.set(t,o),this.isInitialized(t)||this.shouldAutoInitialize())try{let a=this.getOrInitializeService({instanceIdentifier:t});a&&o.resolve(a)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let o=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),a=(t=e==null?void 0:e.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(o)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:o})}catch(u){if(a)return null;throw u}else{if(a)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(vT(e))try{this.getOrInitializeService({instanceIdentifier:or})}catch{}for(let[t,o]of this.instancesDeferred.entries()){let a=this.normalizeInstanceIdentifier(t);try{let u=this.getOrInitializeService({instanceIdentifier:a});o.resolve(u)}catch{}}}}clearInstance(e=or){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=or){return this.instances.has(e)}getOptions(e=or){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,o=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(o))throw Error(`${this.name}(${o}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let a=this.getOrInitializeService({instanceIdentifier:o,options:t});for(let[u,l]of this.instancesDeferred.entries()){let h=this.normalizeInstanceIdentifier(u);o===h&&l.resolve(a)}return a}onInit(e,t){var o;let a=this.normalizeInstanceIdentifier(t),u=(o=this.onInitCallbacks.get(a))!==null&&o!==void 0?o:new Set;u.add(e),this.onInitCallbacks.set(a,u);let l=this.instances.get(a);return l&&e(l,a),()=>{u.delete(e)}}invokeOnInitCallbacks(e,t){let o=this.onInitCallbacks.get(t);if(o)for(let a of o)try{a(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let o=this.instances.get(e);if(!o&&this.component&&(o=this.component.instanceFactory(this.container,{instanceIdentifier:yT(e),options:t}),this.instances.set(e,o),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(o,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,o)}catch{}return o||null}normalizeInstanceIdentifier(e=or){return this.component?this.component.multipleInstances?e:or:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function yT(s){return s===or?void 0:s}function vT(s){return s.instantiationMode==="EAGER"}var Xo=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new nl(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var wT=[],Y;(function(s){s[s.DEBUG=0]="DEBUG",s[s.VERBOSE=1]="VERBOSE",s[s.INFO=2]="INFO",s[s.WARN=3]="WARN",s[s.ERROR=4]="ERROR",s[s.SILENT=5]="SILENT"})(Y||(Y={}));var bT={debug:Y.DEBUG,verbose:Y.VERBOSE,info:Y.INFO,warn:Y.WARN,error:Y.ERROR,silent:Y.SILENT},_T=Y.INFO,ET={[Y.DEBUG]:"log",[Y.VERBOSE]:"log",[Y.INFO]:"info",[Y.WARN]:"warn",[Y.ERROR]:"error"},IT=(s,e,...t)=>{if(e<s.logLevel)return;let o=new Date().toISOString(),a=ET[e];if(a)console[a](`[${o}]  ${s.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},xn=class{constructor(e){this.name=e,this._logLevel=_T,this._logHandler=IT,this._userLogHandler=null,wT.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Y))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?bT[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Y.DEBUG,...e),this._logHandler(this,Y.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Y.VERBOSE,...e),this._logHandler(this,Y.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Y.INFO,...e),this._logHandler(this,Y.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Y.WARN,...e),this._logHandler(this,Y.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Y.ERROR,...e),this._logHandler(this,Y.ERROR,...e)}};var TT=(s,e)=>e.some(t=>s instanceof t),Hm,Gm;function ST(){return Hm||(Hm=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function kT(){return Gm||(Gm=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Km=new WeakMap,il=new WeakMap,Wm=new WeakMap,rl=new WeakMap,ol=new WeakMap;function AT(s){let e=new Promise((t,o)=>{let a=()=>{s.removeEventListener("success",u),s.removeEventListener("error",l)},u=()=>{t(Mt(s.result)),a()},l=()=>{o(s.error),a()};s.addEventListener("success",u),s.addEventListener("error",l)});return e.then(t=>{t instanceof IDBCursor&&Km.set(t,s)}).catch(()=>{}),ol.set(e,s),e}function xT(s){if(il.has(s))return;let e=new Promise((t,o)=>{let a=()=>{s.removeEventListener("complete",u),s.removeEventListener("error",l),s.removeEventListener("abort",l)},u=()=>{t(),a()},l=()=>{o(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",u),s.addEventListener("error",l),s.addEventListener("abort",l)});il.set(s,e)}var sl={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return il.get(s);if(e==="objectStoreNames")return s.objectStoreNames||Wm.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return Mt(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Qm(s){sl=s(sl)}function RT(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let o=s.call(Yo(this),e,...t);return Wm.set(o,e.sort?e.sort():[e]),Mt(o)}:kT().includes(s)?function(...e){return s.apply(Yo(this),e),Mt(Km.get(this))}:function(...e){return Mt(s.apply(Yo(this),e))}}function CT(s){return typeof s=="function"?RT(s):(s instanceof IDBTransaction&&xT(s),TT(s,ST())?new Proxy(s,sl):s)}function Mt(s){if(s instanceof IDBRequest)return AT(s);if(rl.has(s))return rl.get(s);let e=CT(s);return e!==s&&(rl.set(s,e),ol.set(e,s)),e}var Yo=s=>ol.get(s);function Xm(s,e,{blocked:t,upgrade:o,blocking:a,terminated:u}={}){let l=indexedDB.open(s,e),h=Mt(l);return o&&l.addEventListener("upgradeneeded",d=>{o(Mt(l.result),d.oldVersion,d.newVersion,Mt(l.transaction),d)}),t&&l.addEventListener("blocked",d=>t(d.oldVersion,d.newVersion,d)),h.then(d=>{u&&d.addEventListener("close",()=>u()),a&&d.addEventListener("versionchange",f=>a(f.oldVersion,f.newVersion,f))}).catch(()=>{}),h}var OT=["get","getKey","getAll","getAllKeys","count"],NT=["put","add","delete","clear"],al=new Map;function Jm(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(al.get(e))return al.get(e);let t=e.replace(/FromIndex$/,""),o=e!==t,a=NT.includes(t);if(!(t in(o?IDBIndex:IDBObjectStore).prototype)||!(a||OT.includes(t)))return;let u=async function(l,...h){let d=this.transaction(l,a?"readwrite":"readonly"),f=d.store;return o&&(f=f.index(h.shift())),(await Promise.all([f[t](...h),a&&d.done]))[0]};return al.set(e,u),u}Qm(s=>({...s,get:(e,t,o)=>Jm(e,t)||s.get(e,t,o),has:(e,t)=>!!Jm(e,t)||s.has(e,t)}));var ul=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(DT(t)){let o=t.getImmediate();return`${o.library}/${o.version}`}else return null}).filter(t=>t).join(" ")}};function DT(s){let e=s.getComponent();return(e==null?void 0:e.type)==="VERSION"}var ll="@firebase/app",Ym="0.9.13";var ar=new xn("@firebase/app"),PT="@firebase/app-compat",LT="@firebase/analytics-compat",MT="@firebase/analytics",UT="@firebase/app-check-compat",FT="@firebase/app-check",$T="@firebase/auth",BT="@firebase/auth-compat",jT="@firebase/database",VT="@firebase/database-compat",qT="@firebase/functions",zT="@firebase/functions-compat",HT="@firebase/installations",GT="@firebase/installations-compat",KT="@firebase/messaging",WT="@firebase/messaging-compat",QT="@firebase/performance",JT="@firebase/performance-compat",XT="@firebase/remote-config",YT="@firebase/remote-config-compat",ZT="@firebase/storage",eS="@firebase/storage-compat",tS="@firebase/firestore",nS="@firebase/firestore-compat",rS="firebase",iS="9.23.0";var hl="[DEFAULT]",sS={[ll]:"fire-core",[PT]:"fire-core-compat",[MT]:"fire-analytics",[LT]:"fire-analytics-compat",[FT]:"fire-app-check",[UT]:"fire-app-check-compat",[$T]:"fire-auth",[BT]:"fire-auth-compat",[jT]:"fire-rtdb",[VT]:"fire-rtdb-compat",[qT]:"fire-fn",[zT]:"fire-fn-compat",[HT]:"fire-iid",[GT]:"fire-iid-compat",[KT]:"fire-fcm",[WT]:"fire-fcm-compat",[QT]:"fire-perf",[JT]:"fire-perf-compat",[XT]:"fire-rc",[YT]:"fire-rc-compat",[ZT]:"fire-gcs",[eS]:"fire-gcs-compat",[tS]:"fire-fst",[nS]:"fire-fst-compat","fire-js":"fire-js",[rS]:"fire-js-all"};var Zo=new Map,dl=new Map;function oS(s,e){try{s.container.addComponent(e)}catch(t){ar.debug(`Component ${e.name} failed to register with FirebaseApp ${s.name}`,t)}}function Ut(s){let e=s.name;if(dl.has(e))return ar.debug(`There were multiple attempts to register component ${e}.`),!1;dl.set(e,s);for(let t of Zo.values())oS(t,s);return!0}function cr(s,e){let t=s.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),s.container.getProvider(e)}var aS={"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","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}."},Rn=new cn("app","Firebase",aS);var fl=class{constructor(e,t,o){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=o,this.container.addComponent(new it("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 Rn.create("app-deleted",{appName:this._name})}};var Ft=iS;function Yi(s,e={}){let t=s;typeof e!="object"&&(e={name:e});let o=Object.assign({name:hl,automaticDataCollectionEnabled:!1},e),a=o.name;if(typeof a!="string"||!a)throw Rn.create("bad-app-name",{appName:String(a)});if(t||(t=Zu()),!t)throw Rn.create("no-options");let u=Zo.get(a);if(u){if(sr(t,u.options)&&sr(o,u.config))return u;throw Rn.create("duplicate-app",{appName:a})}let l=new Xo(a);for(let d of dl.values())l.addComponent(d);let h=new fl(t,o,l);return Zo.set(a,h),h}function qr(s=hl){let e=Zo.get(s);if(!e&&s===hl&&Zu())return Yi();if(!e)throw Rn.create("no-app",{appName:s});return e}function st(s,e,t){var o;let a=(o=sS[s])!==null&&o!==void 0?o:s;t&&(a+=`-${t}`);let u=a.match(/\s|\//),l=e.match(/\s|\//);if(u||l){let h=[`Unable to register library "${a}" with version "${e}":`];u&&h.push(`library name "${a}" contains illegal characters (whitespace or "/")`),u&&l&&h.push("and"),l&&h.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ar.warn(h.join(" "));return}Ut(new it(`${a}-version`,()=>({library:a,version:e}),"VERSION"))}var cS="firebase-heartbeat-database",uS=1,Xi="firebase-heartbeat-store",cl=null;function ng(){return cl||(cl=Xm(cS,uS,{upgrade:(s,e)=>{switch(e){case 0:s.createObjectStore(Xi)}}}).catch(s=>{throw Rn.create("idb-open",{originalErrorMessage:s.message})})),cl}async function lS(s){try{return await(await ng()).transaction(Xi).objectStore(Xi).get(rg(s))}catch(e){if(e instanceof Ke)ar.warn(e.message);else{let t=Rn.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});ar.warn(t.message)}}}async function Zm(s,e){try{let o=(await ng()).transaction(Xi,"readwrite");await o.objectStore(Xi).put(e,rg(s)),await o.done}catch(t){if(t instanceof Ke)ar.warn(t.message);else{let o=Rn.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});ar.warn(o.message)}}}function rg(s){return`${s.name}!${s.options.appId}`}var hS=1024,dS=30*24*60*60*1e3,pl=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new ml(t),this._heartbeatsCachePromise=this._storage.read().then(o=>(this._heartbeatsCache=o,o))}async triggerHeartbeat(){let t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=eg();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(a=>a.date===o)))return this._heartbeatsCache.heartbeats.push({date:o,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(a=>{let u=new Date(a.date).valueOf();return Date.now()-u<=dS}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";let e=eg(),{heartbeatsToSend:t,unsentEntries:o}=fS(this._heartbeatsCache.heartbeats),a=Ji(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}};function eg(){return new Date().toISOString().substring(0,10)}function fS(s,e=hS){let t=[],o=s.slice();for(let a of s){let u=t.find(l=>l.agent===a.agent);if(u){if(u.dates.push(a.date),tg(t)>e){u.dates.pop();break}}else if(t.push({agent:a.agent,dates:[a.date]}),tg(t)>e){t.pop();break}o=o.slice(1)}return{heartbeatsToSend:t,unsentEntries:o}}var ml=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return tl()?Vm().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await lS(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){let a=await this.read();return Zm(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:a.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){let a=await this.read();return Zm(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:a.lastSentHeartbeatDate,heartbeats:[...a.heartbeats,...e.heartbeats]})}else return}};function tg(s){return Ji(JSON.stringify({version:2,heartbeats:s})).length}function pS(s){Ut(new it("platform-logger",e=>new ul(e),"PRIVATE")),Ut(new it("heartbeat",e=>new pl(e),"PRIVATE")),st(ll,Ym,s),st(ll,Ym,"esm2017"),st("fire-js","")}pS("");var mS="firebase",gS="9.23.0";st(mS,gS,"app");function ea(s,e){var t={};for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&e.indexOf(o)<0&&(t[o]=s[o]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(s);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(s,o[a])&&(t[o[a]]=s[o[a]]);return t}function vg(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}var wg=vg,bg=new cn("auth","Firebase",vg());var aa=new xn("@firebase/auth");function yS(s,...e){aa.logLevel<=Y.WARN&&aa.warn(`Auth (${Ft}): ${s}`,...e)}function na(s,...e){aa.logLevel<=Y.ERROR&&aa.error(`Auth (${Ft}): ${s}`,...e)}function vt(s,...e){throw Ll(s,...e)}function Bt(s,...e){return Ll(s,...e)}function _g(s,e,t){let o=Object.assign(Object.assign({},wg()),{[e]:t});return new cn("auth","Firebase",o).create(e,{appName:s.name})}function vS(s,e,t){let o=t;if(!(e instanceof o))throw o.name!==e.constructor.name&&vt(s,"argument-error"),_g(s,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Ll(s,...e){if(typeof s!="string"){let t=e[0],o=[...e.slice(1)];return o[0]&&(o[0].appName=s.name),s._errorFactory.create(t,...o)}return bg.create(s,...e)}function M(s,e,...t){if(!s)throw Ll(e,...t)}function $t(s){let e="INTERNAL ASSERTION FAILED: "+s;throw na(e),new Error(e)}function ln(s,e){s||$t(e)}function _l(){var s;return typeof self!="undefined"&&((s=self.location)===null||s===void 0?void 0:s.href)||""}function wS(){return ig()==="http:"||ig()==="https:"}function ig(){var s;return typeof self!="undefined"&&((s=self.location)===null||s===void 0?void 0:s.protocol)||null}function bS(){return typeof navigator!="undefined"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(wS()||$m()||"connection"in navigator)?navigator.onLine:!0}function _S(){if(typeof navigator=="undefined")return null;let s=navigator;return s.languages&&s.languages[0]||s.language||null}var ur=class{constructor(e,t){this.shortDelay=e,this.longDelay=t,ln(t>e,"Short delay should be less than long delay!"),this.isMobile=Um()||Bm()}get(){return bS()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};function Ml(s,e){ln(s.emulator,"Emulator should always be set here");let{url:t}=s.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}var ca=class{static initialize(e,t,o){this.fetchImpl=e,t&&(this.headersImpl=t),o&&(this.responseImpl=o)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self!="undefined"&&"fetch"in self)return self.fetch;$t("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self!="undefined"&&"Headers"in self)return self.Headers;$t("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self!="undefined"&&"Response"in self)return self.Response;$t("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};var ES={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};var IS=new ur(3e4,6e4);function Se(s,e){return s.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:s.tenantId}):e}async function je(s,e,t,o,a={}){return Eg(s,a,async()=>{let u={},l={};o&&(e==="GET"?l=o:u={body:JSON.stringify(o)});let h=Br(Object.assign({key:s.config.apiKey},l)).slice(1),d=await s._getAdditionalHeaders();return d["Content-Type"]="application/json",s.languageCode&&(d["X-Firebase-Locale"]=s.languageCode),ca.fetch()(Ig(s,s.config.apiHost,t,h),Object.assign({method:e,headers:d,referrerPolicy:"no-referrer"},u))})}async function Eg(s,e,t){s._canInitEmulator=!1;let o=Object.assign(Object.assign({},ES),e);try{let a=new El(s),u=await Promise.race([t(),a.promise]);a.clearNetworkTimeout();let l=await u.json();if("needConfirmation"in l)throw Zi(s,"account-exists-with-different-credential",l);if(u.ok&&!("errorMessage"in l))return l;{let h=u.ok?l.errorMessage:l.error.message,[d,f]=h.split(" : ");if(d==="FEDERATED_USER_ID_ALREADY_LINKED")throw Zi(s,"credential-already-in-use",l);if(d==="EMAIL_EXISTS")throw Zi(s,"email-already-in-use",l);if(d==="USER_DISABLED")throw Zi(s,"user-disabled",l);let p=o[d]||d.toLowerCase().replace(/[_\s]+/g,"-");if(f)throw _g(s,p,f);vt(s,p)}}catch(a){if(a instanceof Ke)throw a;vt(s,"network-request-failed",{message:String(a)})}}async function Dn(s,e,t,o,a={}){let u=await je(s,e,t,o,a);return"mfaPendingCredential"in u&&vt(s,"multi-factor-auth-required",{_serverResponse:u}),u}function Ig(s,e,t,o){let a=`${e}${t}?${o}`;return s.config.emulator?Ml(s.config,a):`${s.config.apiScheme}://${a}`}var El=class{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,o)=>{this.timer=setTimeout(()=>o(Bt(this.auth,"network-request-failed")),IS.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}};function Zi(s,e,t){let o={appName:s.name};t.email&&(o.email=t.email),t.phoneNumber&&(o.phoneNumber=t.phoneNumber);let a=Bt(s,e,o);return a.customData._tokenResponse=t,a}async function TS(s,e){return je(s,"POST","/v1/accounts:delete",e)}async function SS(s,e){return je(s,"POST","/v1/accounts:lookup",e)}function es(s){if(s)try{let e=new Date(Number(s));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Tg(s,e=!1){let t=re(s),o=await t.getIdToken(e),a=Ul(o);M(a&&a.exp&&a.auth_time&&a.iat,t.auth,"internal-error");let u=typeof a.firebase=="object"?a.firebase:void 0,l=u==null?void 0:u.sign_in_provider;return{claims:a,token:o,authTime:es(gl(a.auth_time)),issuedAtTime:es(gl(a.iat)),expirationTime:es(gl(a.exp)),signInProvider:l||null,signInSecondFactor:(u==null?void 0:u.sign_in_second_factor)||null}}function gl(s){return Number(s)*1e3}function Ul(s){let[e,t,o]=s.split(".");if(e===void 0||t===void 0||o===void 0)return na("JWT malformed, contained fewer than 3 sections"),null;try{let a=Xu(t);return a?JSON.parse(a):(na("Failed to decode base64 JWT payload"),null)}catch(a){return na("Caught error parsing JWT payload as JSON",a==null?void 0:a.toString()),null}}function kS(s){let e=Ul(s);return M(e,"internal-error"),M(typeof e.exp!="undefined","internal-error"),M(typeof e.iat!="undefined","internal-error"),Number(e.exp)-Number(e.iat)}async function Hr(s,e,t=!1){if(t)return e;try{return await e}catch(o){throw o instanceof Ke&&AS(o)&&s.auth.currentUser===s&&await s.auth.signOut(),o}}function AS({code:s}){return s==="auth/user-disabled"||s==="auth/user-token-expired"}var Il=class{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){let o=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),o}else{this.errorBackoff=3e4;let a=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,a)}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}};var ua=class{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=es(this.lastLoginAt),this.creationTime=es(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};async function la(s){var e;let t=s.auth,o=await s.getIdToken(),a=await Hr(s,SS(t,{idToken:o}));M(a==null?void 0:a.users.length,t,"internal-error");let u=a.users[0];s._notifyReloadListener(u);let l=!((e=u.providerUserInfo)===null||e===void 0)&&e.length?RS(u.providerUserInfo):[],h=xS(s.providerData,l),d=s.isAnonymous,f=!(s.email&&u.passwordHash)&&!(h!=null&&h.length),p=d?f:!1,m={uid:u.localId,displayName:u.displayName||null,photoURL:u.photoUrl||null,email:u.email||null,emailVerified:u.emailVerified||!1,phoneNumber:u.phoneNumber||null,tenantId:u.tenantId||null,providerData:h,metadata:new ua(u.createdAt,u.lastLoginAt),isAnonymous:p};Object.assign(s,m)}async function Sg(s){let e=re(s);await la(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function xS(s,e){return[...s.filter(o=>!e.some(a=>a.providerId===o.providerId)),...e]}function RS(s){return s.map(e=>{var{providerId:t}=e,o=ea(e,["providerId"]);return{providerId:t,uid:o.rawId||"",displayName:o.displayName||null,email:o.email||null,phoneNumber:o.phoneNumber||null,photoURL:o.photoUrl||null}})}async function CS(s,e){let t=await Eg(s,{},async()=>{let o=Br({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:a,apiKey:u}=s.config,l=Ig(s,a,"/v1/token",`key=${u}`),h=await s._getAdditionalHeaders();return h["Content-Type"]="application/x-www-form-urlencoded",ca.fetch()(l,{method:"POST",headers:h,body:o})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}var ha=class s{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){M(e.idToken,"internal-error"),M(typeof e.idToken!="undefined","internal-error"),M(typeof e.refreshToken!="undefined","internal-error");let t="expiresIn"in e&&typeof e.expiresIn!="undefined"?Number(e.expiresIn):kS(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return M(!this.accessToken||this.refreshToken,e,"user-token-expired"),!t&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:o,refreshToken:a,expiresIn:u}=await CS(e,t);this.updateTokensAndExpiration(o,a,Number(u))}updateTokensAndExpiration(e,t,o){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+o*1e3}static fromJSON(e,t){let{refreshToken:o,accessToken:a,expirationTime:u}=t,l=new s;return o&&(M(typeof o=="string","internal-error",{appName:e}),l.refreshToken=o),a&&(M(typeof a=="string","internal-error",{appName:e}),l.accessToken=a),u&&(M(typeof u=="number","internal-error",{appName:e}),l.expirationTime=u),l}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new s,this.toJSON())}_performRefresh(){return $t("not implemented")}};function Cn(s,e){M(typeof s=="string"||typeof s=="undefined","internal-error",{appName:e})}var ts=class s{constructor(e){var{uid:t,auth:o,stsTokenManager:a}=e,u=ea(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Il(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=o,this.stsTokenManager=a,this.accessToken=a.accessToken,this.displayName=u.displayName||null,this.email=u.email||null,this.emailVerified=u.emailVerified||!1,this.phoneNumber=u.phoneNumber||null,this.photoURL=u.photoURL||null,this.isAnonymous=u.isAnonymous||!1,this.tenantId=u.tenantId||null,this.providerData=u.providerData?[...u.providerData]:[],this.metadata=new ua(u.createdAt||void 0,u.lastLoginAt||void 0)}async getIdToken(e){let t=await Hr(this,this.stsTokenManager.getToken(this.auth,e));return M(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Tg(this,e)}reload(){return Sg(this)}_assign(e){this!==e&&(M(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new s(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){M(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let o=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),o=!0),t&&await la(this),await this.auth._persistUserIfCurrent(this),o&&this.auth._notifyListenersIfCurrent(this)}async delete(){let e=await this.getIdToken();return await Hr(this,TS(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var o,a,u,l,h,d,f,p;let m=(o=t.displayName)!==null&&o!==void 0?o:void 0,g=(a=t.email)!==null&&a!==void 0?a:void 0,y=(u=t.phoneNumber)!==null&&u!==void 0?u:void 0,w=(l=t.photoURL)!==null&&l!==void 0?l:void 0,b=(h=t.tenantId)!==null&&h!==void 0?h:void 0,E=(d=t._redirectEventId)!==null&&d!==void 0?d:void 0,k=(f=t.createdAt)!==null&&f!==void 0?f:void 0,x=(p=t.lastLoginAt)!==null&&p!==void 0?p:void 0,{uid:C,emailVerified:P,isAnonymous:K,providerData:ee,stsTokenManager:Te}=t;M(C&&Te,e,"internal-error");let ce=ha.fromJSON(this.name,Te);M(typeof C=="string",e,"internal-error"),Cn(m,e.name),Cn(g,e.name),M(typeof P=="boolean",e,"internal-error"),M(typeof K=="boolean",e,"internal-error"),Cn(y,e.name),Cn(w,e.name),Cn(b,e.name),Cn(E,e.name),Cn(k,e.name),Cn(x,e.name);let ft=new s({uid:C,auth:e,email:g,emailVerified:P,displayName:m,isAnonymous:K,photoURL:w,phoneNumber:y,tenantId:b,stsTokenManager:ce,createdAt:k,lastLoginAt:x});return ee&&Array.isArray(ee)&&(ft.providerData=ee.map(Vi=>Object.assign({},Vi))),E&&(ft._redirectEventId=E),ft}static async _fromIdTokenResponse(e,t,o=!1){let a=new ha;a.updateFromServerResponse(t);let u=new s({uid:t.localId,auth:e,stsTokenManager:a,isAnonymous:o});return await la(u),u}};var sg=new Map;function un(s){ln(s instanceof Function,"Expected a class definition");let e=sg.get(s);return e?(ln(e instanceof s,"Instance stored in cache mismatched with class"),e):(e=new s,sg.set(s,e),e)}var da=class{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}};da.type="NONE";var Tl=da;function ra(s,e,t){return`firebase:${s}:${e}:${t}`}var fa=class s{constructor(e,t,o){this.persistence=e,this.auth=t,this.userKey=o;let{config:a,name:u}=this.auth;this.fullUserKey=ra(this.userKey,a.apiKey,u),this.fullPersistenceKey=ra("persistence",a.apiKey,u),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);return e?ts._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,o="authUser"){if(!t.length)return new s(un(Tl),e,o);let a=(await Promise.all(t.map(async f=>{if(await f._isAvailable())return f}))).filter(f=>f),u=a[0]||un(Tl),l=ra(o,e.config.apiKey,e.name),h=null;for(let f of t)try{let p=await f._get(l);if(p){let m=ts._fromJSON(e,p);f!==u&&(h=m),u=f;break}}catch{}let d=a.filter(f=>f._shouldAllowMigration);return!u._shouldAllowMigration||!d.length?new s(u,e,o):(u=d[0],h&&await u._set(l,h.toJSON()),await Promise.all(t.map(async f=>{if(f!==u)try{await f._remove(l)}catch{}})),new s(u,e,o))}};function og(s){let e=s.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(xg(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(kg(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Cg(e))return"Blackberry";if(Og(e))return"Webos";if(Fl(e))return"Safari";if((e.includes("chrome/")||Ag(e))&&!e.includes("edge/"))return"Chrome";if(Rg(e))return"Android";{let t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,o=s.match(t);if((o==null?void 0:o.length)===2)return o[1]}return"Other"}function kg(s=xe()){return/firefox\//i.test(s)}function Fl(s=xe()){let e=s.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Ag(s=xe()){return/crios\//i.test(s)}function xg(s=xe()){return/iemobile/i.test(s)}function Rg(s=xe()){return/android/i.test(s)}function Cg(s=xe()){return/blackberry/i.test(s)}function Og(s=xe()){return/webos/i.test(s)}function Da(s=xe()){return/iphone|ipad|ipod/i.test(s)||/macintosh/i.test(s)&&/mobile/i.test(s)}function OS(s=xe()){var e;return Da(s)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function NS(){return jm()&&document.documentMode===10}function Ng(s=xe()){return Da(s)||Rg(s)||Og(s)||Cg(s)||/windows phone/i.test(s)||xg(s)}function DS(){try{return!!(window&&window!==window.top)}catch{return!1}}function Dg(s,e=[]){let t;switch(s){case"Browser":t=og(xe());break;case"Worker":t=`${og(xe())}-${s}`;break;default:t=s}let o=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Ft}/${o}`}async function Pg(s,e){return je(s,"GET","/v2/recaptchaConfig",Se(s,e))}function ag(s){return s!==void 0&&s.enterprise!==void 0}var pa=class{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some(t=>t.provider==="EMAIL_PASSWORD_PROVIDER"&&t.enforcementState!=="OFF")}};function PS(){var s,e;return(e=(s=document.getElementsByTagName("head"))===null||s===void 0?void 0:s[0])!==null&&e!==void 0?e:document}function Lg(s){return new Promise((e,t)=>{let o=document.createElement("script");o.setAttribute("src",s),o.onload=e,o.onerror=a=>{let u=Bt("internal-error");u.customData=a,t(u)},o.type="text/javascript",o.charset="UTF-8",PS().appendChild(o)})}function Mg(s){return`__${s}${Math.floor(Math.random()*1e6)}`}var LS="https://www.google.com/recaptcha/enterprise.js?render=",MS="recaptcha-enterprise",US="NO_RECAPTCHA",ma=class{constructor(e){this.type=MS,this.auth=pn(e)}async verify(e="verify",t=!1){async function o(u){if(!t){if(u.tenantId==null&&u._agentRecaptchaConfig!=null)return u._agentRecaptchaConfig.siteKey;if(u.tenantId!=null&&u._tenantRecaptchaConfigs[u.tenantId]!==void 0)return u._tenantRecaptchaConfigs[u.tenantId].siteKey}return new Promise(async(l,h)=>{Pg(u,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(d=>{if(d.recaptchaKey===void 0)h(new Error("recaptcha Enterprise site key undefined"));else{let f=new pa(d);return u.tenantId==null?u._agentRecaptchaConfig=f:u._tenantRecaptchaConfigs[u.tenantId]=f,l(f.siteKey)}}).catch(d=>{h(d)})})}function a(u,l,h){let d=window.grecaptcha;ag(d)?d.enterprise.ready(()=>{d.enterprise.execute(u,{action:e}).then(f=>{l(f)}).catch(()=>{l(US)})}):h(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((u,l)=>{o(this.auth).then(h=>{if(!t&&ag(window.grecaptcha))a(h,u,l);else{if(typeof window=="undefined"){l(new Error("RecaptchaVerifier is only supported in browser"));return}Lg(LS+h).then(()=>{a(h,u,l)}).catch(d=>{l(d)})}}).catch(h=>{l(h)})})}};async function Gr(s,e,t,o=!1){let a=new ma(s),u;try{u=await a.verify(t)}catch{u=await a.verify(t,!0)}let l=Object.assign({},e);return o?Object.assign(l,{captchaResp:u}):Object.assign(l,{captchaResponse:u}),Object.assign(l,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(l,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),l}var Sl=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let o=u=>new Promise((l,h)=>{try{let d=e(u);l(d)}catch(d){h(d)}});o.onAbort=t,this.queue.push(o);let a=this.queue.length-1;return()=>{this.queue[a]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let o of this.queue)await o(e),o.onAbort&&t.push(o.onAbort)}catch(o){t.reverse();for(let a of t)try{a()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:o==null?void 0:o.message})}}};var kl=class{constructor(e,t,o,a){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=o,this.config=a,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new ga(this),this.idTokenSubscription=new ga(this),this.beforeStateQueue=new Sl(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=bg,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=a.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=un(t)),this._initializationPromise=this.queue(async()=>{var o,a;if(!this._deleted&&(this.persistenceManager=await fa.create(this,e),!this._deleted)){if(!((o=this._popupRedirectResolver)===null||o===void 0)&&o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((a=this.currentUser)===null||a===void 0?void 0:a.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t;let o=await this.assertedPersistence.getCurrentUser(),a=o,u=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let l=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,h=a==null?void 0:a._redirectEventId,d=await this.tryRedirectSignIn(e);(!l||l===h)&&(d!=null&&d.user)&&(a=d.user,u=!0)}if(!a)return this.directlySetCurrentUser(null);if(!a._redirectEventId){if(u)try{await this.beforeStateQueue.runMiddleware(a)}catch(l){a=o,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(l))}return a?this.reloadAndSetCurrentUserOrClear(a):this.directlySetCurrentUser(null)}return M(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===a._redirectEventId?this.directlySetCurrentUser(a):this.reloadAndSetCurrentUserOrClear(a)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await la(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=_S()}async _delete(){this._deleted=!0}async updateCurrentUser(e){let t=e?re(e):null;return t&&M(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&M(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(un(e))})}async initializeRecaptchaConfig(){let e=await Pg(this,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),t=new pa(e);this.tenantId==null?this._agentRecaptchaConfig=t:this._tenantRecaptchaConfigs[this.tenantId]=t,t.emailPasswordEnabled&&new ma(this).verify()}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new cn("auth","Firebase",e())}onAuthStateChanged(e,t,o){return this.registerStateListener(this.authStateSubscription,e,t,o)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,o){return this.registerStateListener(this.idTokenSubscription,e,t,o)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){let o=await this.getOrInitRedirectPersistenceManager(t);return e===null?o.removeCurrentUser():o.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&un(e)||this._popupRedirectResolver;M(t,this,"argument-error"),this.redirectPersistenceManager=await fa.create(this,[un(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,o;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((o=this.redirectUser)===null||o===void 0?void 0:o._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let o=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==o&&(this.lastNotifiedUid=o,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,o,a){if(this._deleted)return()=>{};let u=typeof t=="function"?t:t.next.bind(t),l=this._isInitialized?Promise.resolve():this._initializationPromise;return M(l,this,"internal-error"),l.then(()=>u(this.currentUser)),typeof t=="function"?e.addObserver(t,o,a):e.addObserver(t)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return M(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Dg(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;let t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);let o=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());o&&(t["X-Firebase-Client"]=o);let a=await this._getAppCheckToken();return a&&(t["X-Firebase-AppCheck"]=a),t}async _getAppCheckToken(){var e;let t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t!=null&&t.error&&yS(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}};function pn(s){return re(s)}var ga=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=zm(t=>this.observer=t)}get next(){return M(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};function Ug(s,e){let t=cr(s,"auth");if(t.isInitialized()){let a=t.getImmediate(),u=t.getOptions();if(sr(u,e!=null?e:{}))return a;vt(a,"already-initialized")}return t.initialize({options:e})}function FS(s,e){let t=(e==null?void 0:e.persistence)||[],o=(Array.isArray(t)?t:[t]).map(un);e!=null&&e.errorMap&&s._updateErrorMap(e.errorMap),s._initializeWithPersistence(o,e==null?void 0:e.popupRedirectResolver)}function Fg(s,e,t){let o=pn(s);M(o._canInitEmulator,o,"emulator-config-failed"),M(/^https?:\/\//.test(e),o,"invalid-emulator-scheme");let a=!!(t!=null&&t.disableWarnings),u=$g(e),{host:l,port:h}=$S(e),d=h===null?"":`:${h}`;o.config.emulator={url:`${u}//${l}${d}/`},o.settings.appVerificationDisabledForTesting=!0,o.emulatorConfig=Object.freeze({host:l,port:h,protocol:u.replace(":",""),options:Object.freeze({disableWarnings:a})}),a||BS()}function $g(s){let e=s.indexOf(":");return e<0?"":s.substr(0,e+1)}function $S(s){let e=$g(s),t=/(\/\/)?([^?#/]+)/.exec(s.substr(e.length));if(!t)return{host:"",port:null};let o=t[2].split("@").pop()||"",a=/^(\[[^\]]+\])(:|$)/.exec(o);if(a){let u=a[1];return{host:u,port:cg(o.substr(u.length+1))}}else{let[u,l]=o.split(":");return{host:u,port:cg(l)}}}function cg(s){if(!s)return null;let e=Number(s);return isNaN(e)?null:e}function BS(){function s(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console!="undefined"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window!="undefined"&&typeof document!="undefined"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",s):s())}var lr=class{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return $t("not implemented")}_getIdTokenResponse(e){return $t("not implemented")}_linkToIdToken(e,t){return $t("not implemented")}_getReauthenticationResolver(e){return $t("not implemented")}};async function jS(s,e){return je(s,"POST","/v1/accounts:resetPassword",Se(s,e))}async function Bg(s,e){return je(s,"POST","/v1/accounts:update",e)}async function yl(s,e){return Dn(s,"POST","/v1/accounts:signInWithPassword",Se(s,e))}async function jg(s,e){return je(s,"POST","/v1/accounts:sendOobCode",Se(s,e))}async function VS(s,e){return jg(s,e)}async function vl(s,e){return jg(s,e)}async function qS(s,e){return Dn(s,"POST","/v1/accounts:signInWithEmailLink",Se(s,e))}async function zS(s,e){return Dn(s,"POST","/v1/accounts:signInWithEmailLink",Se(s,e))}var ns=class s extends lr{constructor(e,t,o,a=null){super("password",o),this._email=e,this._password=t,this._tenantId=a}static _fromEmailAndPassword(e,t){return new s(e,t,"password")}static _fromEmailAndCode(e,t,o=null){return new s(e,t,"emailLink",o)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;if(t!=null&&t.email&&(t!=null&&t.password)){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){var t;switch(this.signInMethod){case"password":let o={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};if(!((t=e._getRecaptchaConfig())===null||t===void 0)&&t.emailPasswordEnabled){let a=await Gr(e,o,"signInWithPassword");return yl(e,a)}else return yl(e,o).catch(async a=>{if(a.code==="auth/missing-recaptcha-token"){console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");let u=await Gr(e,o,"signInWithPassword");return yl(e,u)}else return Promise.reject(a)});case"emailLink":return qS(e,{email:this._email,oobCode:this._password});default:vt(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Bg(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return zS(e,{idToken:t,email:this._email,oobCode:this._password});default:vt(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}};async function zr(s,e){return Dn(s,"POST","/v1/accounts:signInWithIdp",Se(s,e))}var HS="http://localhost",hn=class s extends lr{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new s(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):vt("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e,{providerId:o,signInMethod:a}=t,u=ea(t,["providerId","signInMethod"]);if(!o||!a)return null;let l=new s(o,a);return l.idToken=u.idToken||void 0,l.accessToken=u.accessToken||void 0,l.secret=u.secret,l.nonce=u.nonce,l.pendingToken=u.pendingToken||null,l}_getIdTokenResponse(e){let t=this.buildRequest();return zr(e,t)}_linkToIdToken(e,t){let o=this.buildRequest();return o.idToken=t,zr(e,o)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,zr(e,t)}buildRequest(){let e={requestUri:HS,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=Br(t)}return e}};async function GS(s,e){return je(s,"POST","/v1/accounts:sendVerificationCode",Se(s,e))}async function KS(s,e){return Dn(s,"POST","/v1/accounts:signInWithPhoneNumber",Se(s,e))}async function WS(s,e){let t=await Dn(s,"POST","/v1/accounts:signInWithPhoneNumber",Se(s,e));if(t.temporaryProof)throw Zi(s,"account-exists-with-different-credential",t);return t}var QS={USER_NOT_FOUND:"user-not-found"};async function JS(s,e){let t=Object.assign(Object.assign({},e),{operation:"REAUTH"});return Dn(s,"POST","/v1/accounts:signInWithPhoneNumber",Se(s,t),QS)}var rs=class s extends lr{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new s({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new s({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return KS(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return WS(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return JS(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:o,verificationCode:a}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:o,code:a}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){typeof e=="string"&&(e=JSON.parse(e));let{verificationId:t,verificationCode:o,phoneNumber:a,temporaryProof:u}=e;return!o&&!t&&!a&&!u?null:new s({verificationId:t,verificationCode:o,phoneNumber:a,temporaryProof:u})}};function XS(s){switch(s){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function YS(s){let e=jr(Vr(s)).link,t=e?jr(Vr(e)).deep_link_id:null,o=jr(Vr(s)).deep_link_id;return(o?jr(Vr(o)).link:null)||o||t||e||s}var ya=class s{constructor(e){var t,o,a,u,l,h;let d=jr(Vr(e)),f=(t=d.apiKey)!==null&&t!==void 0?t:null,p=(o=d.oobCode)!==null&&o!==void 0?o:null,m=XS((a=d.mode)!==null&&a!==void 0?a:null);M(f&&p&&m,"argument-error"),this.apiKey=f,this.operation=m,this.code=p,this.continueUrl=(u=d.continueUrl)!==null&&u!==void 0?u:null,this.languageCode=(l=d.languageCode)!==null&&l!==void 0?l:null,this.tenantId=(h=d.tenantId)!==null&&h!==void 0?h:null}static parseLink(e){let t=YS(e);try{return new s(t)}catch{return null}}};var hr=class s{constructor(){this.providerId=s.PROVIDER_ID}static credential(e,t){return ns._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let o=ya.parseLink(t);return M(o,"argument-error"),ns._fromEmailAndCode(e,o.code,o.tenantId)}};hr.PROVIDER_ID="password";hr.EMAIL_PASSWORD_SIGN_IN_METHOD="password";hr.EMAIL_LINK_SIGN_IN_METHOD="emailLink";var is=class{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}};var On=class extends is{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}},dr=class s extends On{static credentialFromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;return M("providerId"in t&&"signInMethod"in t,"argument-error"),hn._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return M(e.idToken||e.accessToken,"argument-error"),hn._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return s.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return s.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:o,oauthTokenSecret:a,pendingToken:u,nonce:l,providerId:h}=e;if(!o&&!a&&!t&&!u||!h)return null;try{return new s(h)._credential({idToken:t,accessToken:o,nonce:l,pendingToken:u})}catch{return null}}};var Nn=class s extends On{constructor(){super("facebook.com")}static credential(e){return hn._fromParams({providerId:s.PROVIDER_ID,signInMethod:s.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return s.credentialFromTaggedObject(e)}static credentialFromError(e){return s.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return s.credential(e.oauthAccessToken)}catch{return null}}};Nn.FACEBOOK_SIGN_IN_METHOD="facebook.com";Nn.PROVIDER_ID="facebook.com";var dn=class s extends On{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return hn._fromParams({providerId:s.PROVIDER_ID,signInMethod:s.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return s.credentialFromTaggedObject(e)}static credentialFromError(e){return s.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:o}=e;if(!t&&!o)return null;try{return s.credential(t,o)}catch{return null}}};dn.GOOGLE_SIGN_IN_METHOD="google.com";dn.PROVIDER_ID="google.com";var ss=class s extends On{constructor(){super("github.com")}static credential(e){return hn._fromParams({providerId:s.PROVIDER_ID,signInMethod:s.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return s.credentialFromTaggedObject(e)}static credentialFromError(e){return s.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return s.credential(e.oauthAccessToken)}catch{return null}}};ss.GITHUB_SIGN_IN_METHOD="github.com";ss.PROVIDER_ID="github.com";var fn=class s extends On{constructor(){super("twitter.com")}static credential(e,t){return hn._fromParams({providerId:s.PROVIDER_ID,signInMethod:s.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return s.credentialFromTaggedObject(e)}static credentialFromError(e){return s.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:o}=e;if(!t||!o)return null;try{return s.credential(t,o)}catch{return null}}};fn.TWITTER_SIGN_IN_METHOD="twitter.com";fn.PROVIDER_ID="twitter.com";async function wl(s,e){return Dn(s,"POST","/v1/accounts:signUp",Se(s,e))}var Kr=class s{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,o,a=!1){let u=await ts._fromIdTokenResponse(e,o,a),l=ug(o);return new s({user:u,providerId:l,_tokenResponse:o,operationType:t})}static async _forOperation(e,t,o){await e._updateTokensIfNecessary(o,!0);let a=ug(o);return new s({user:e,providerId:a,_tokenResponse:o,operationType:t})}};function ug(s){return s.providerId?s.providerId:"phoneNumber"in s?"phone":null}var Al=class s extends Ke{constructor(e,t,o,a){var u;super(t.code,t.message),this.operationType=o,this.user=a,Object.setPrototypeOf(this,s.prototype),this.customData={appName:e.name,tenantId:(u=e.tenantId)!==null&&u!==void 0?u:void 0,_serverResponse:t.customData._serverResponse,operationType:o}}static _fromErrorAndOperation(e,t,o,a){return new s(e,t,o,a)}};function Vg(s,e,t,o){return(e==="reauthenticate"?t._getReauthenticationResolver(s):t._getIdTokenResponse(s)).catch(u=>{throw u.code==="auth/multi-factor-auth-required"?Al._fromErrorAndOperation(s,u,e,o):u})}async function ZS(s,e,t=!1){let o=await Hr(s,e._linkToIdToken(s.auth,await s.getIdToken()),t);return Kr._forOperation(s,"link",o)}async function ek(s,e,t=!1){let{auth:o}=s,a="reauthenticate";try{let u=await Hr(s,Vg(o,a,e,s),t);M(u.idToken,o,"internal-error");let l=Ul(u.idToken);M(l,o,"internal-error");let{sub:h}=l;return M(s.uid===h,o,"user-mismatch"),Kr._forOperation(s,a,u)}catch(u){throw(u==null?void 0:u.code)==="auth/user-not-found"&&vt(o,"user-mismatch"),u}}async function qg(s,e,t=!1){let o="signIn",a=await Vg(s,o,e),u=await Kr._fromIdTokenResponse(s,o,a);return t||await s._updateCurrentUser(u.user),u}async function zg(s,e){return qg(pn(s),e)}function ia(s,e,t){var o;M(((o=t.url)===null||o===void 0?void 0:o.length)>0,s,"invalid-continue-uri"),M(typeof t.dynamicLinkDomain=="undefined"||t.dynamicLinkDomain.length>0,s,"invalid-dynamic-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(M(t.iOS.bundleId.length>0,s,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(M(t.android.packageName.length>0,s,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}async function $l(s,e,t){var o;let a=pn(s),u={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};if(!((o=a._getRecaptchaConfig())===null||o===void 0)&&o.emailPasswordEnabled){let l=await Gr(a,u,"getOobCode",!0);t&&ia(a,l,t),await vl(a,l)}else t&&ia(a,u,t),await vl(a,u).catch(async l=>{if(l.code==="auth/missing-recaptcha-token"){console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");let h=await Gr(a,u,"getOobCode",!0);t&&ia(a,h,t),await vl(a,h)}else return Promise.reject(l)})}async function Bl(s,e,t){await jS(re(s),{oobCode:e,newPassword:t})}async function jl(s,e,t){var o;let a=pn(s),u={returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},l;if(!((o=a._getRecaptchaConfig())===null||o===void 0)&&o.emailPasswordEnabled){let f=await Gr(a,u,"signUpPassword");l=wl(a,f)}else l=wl(a,u).catch(async f=>{if(f.code==="auth/missing-recaptcha-token"){console.log("Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow.");let p=await Gr(a,u,"signUpPassword");return wl(a,p)}else return Promise.reject(f)});let h=await l.catch(f=>Promise.reject(f)),d=await Kr._fromIdTokenResponse(a,"signIn",h);return await a._updateCurrentUser(d.user),d}function Vl(s,e,t){return zg(re(s),hr.credential(e,t))}async function ql(s,e){let t=re(s),a={requestType:"VERIFY_EMAIL",idToken:await s.getIdToken()};e&&ia(t.auth,a,e);let{email:u}=await VS(t.auth,a);u!==s.email&&await s.reload()}function zl(s,e){return tk(re(s),e,null)}async function tk(s,e,t){let{auth:o}=s,u={idToken:await s.getIdToken(),returnSecureToken:!0};e&&(u.email=e),t&&(u.password=t);let l=await Hr(s,Bg(o,u));await s._updateTokensIfNecessary(l,!0)}function Hg(s,e,t,o){return re(s).onIdTokenChanged(e,t,o)}function Gg(s,e,t){return re(s).beforeAuthStateChanged(e,t)}function Hl(s,e,t,o){return re(s).onAuthStateChanged(e,t,o)}function Gl(s){return re(s).signOut()}function nk(s,e){return je(s,"POST","/v2/accounts/mfaEnrollment:start",Se(s,e))}function rk(s,e){return je(s,"POST","/v2/accounts/mfaEnrollment:finalize",Se(s,e))}function ik(s,e){return je(s,"POST","/v2/accounts/mfaEnrollment:start",Se(s,e))}function sk(s,e){return je(s,"POST","/v2/accounts/mfaEnrollment:finalize",Se(s,e))}var va="__sak";var wa=class{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(va,"1"),this.storage.removeItem(va),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}};function ok(){let s=xe();return Fl(s)||Da(s)}var ak=1e3,ck=10,ba=class extends wa{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=ok()&&DS(),this.fallbackToPolling=Ng(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let o=this.storage.getItem(t),a=this.localCache[t];o!==a&&e(t,a,o)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((l,h,d)=>{this.notifyListeners(l,d)});return}let o=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){let l=this.storage.getItem(o);if(e.newValue!==l)e.newValue!==null?this.storage.setItem(o,e.newValue):this.storage.removeItem(o);else if(this.localCache[o]===e.newValue&&!t)return}let a=()=>{let l=this.storage.getItem(o);!t&&this.localCache[o]===l||this.notifyListeners(o,l)},u=this.storage.getItem(o);NS()&&u!==e.newValue&&e.newValue!==e.oldValue?setTimeout(a,ck):a()}notifyListeners(e,t){this.localCache[e]=t;let o=this.listeners[e];if(o)for(let a of Array.from(o))a(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,o)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:o}),!0)})},ak)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}};ba.type="LOCAL";var Kg=ba;var _a=class extends wa{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}};_a.type="SESSION";var Kl=_a;function uk(s){return Promise.all(s.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}var Ea=class s{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let t=this.receivers.find(a=>a.isListeningto(e));if(t)return t;let o=new s(e);return this.receivers.push(o),o}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let t=e,{eventId:o,eventType:a,data:u}=t.data,l=this.handlersMap[a];if(!(l!=null&&l.size))return;t.ports[0].postMessage({status:"ack",eventId:o,eventType:a});let h=Array.from(l).map(async f=>f(t.origin,u)),d=await uk(h);t.ports[0].postMessage({status:"done",eventId:o,eventType:a,response:d})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}};Ea.receivers=[];function Wl(s="",e=10){let t="";for(let o=0;o<e;o++)t+=Math.floor(Math.random()*10);return s+t}var xl=class{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,o=50){let a=typeof MessageChannel!="undefined"?new MessageChannel:null;if(!a)throw new Error("connection_unavailable");let u,l;return new Promise((h,d)=>{let f=Wl("",20);a.port1.start();let p=setTimeout(()=>{d(new Error("unsupported_event"))},o);l={messageChannel:a,onMessage(m){let g=m;if(g.data.eventId===f)switch(g.data.status){case"ack":clearTimeout(p),u=setTimeout(()=>{d(new Error("timeout"))},3e3);break;case"done":clearTimeout(u),h(g.data.response);break;default:clearTimeout(p),clearTimeout(u),d(new Error("invalid_response"));break}}},this.handlers.add(l),a.port1.addEventListener("message",l.onMessage),this.target.postMessage({eventType:e,eventId:f,data:t},[a.port2])}).finally(()=>{l&&this.removeMessageHandler(l)})}};function jt(){return window}function lk(s){jt().location.href=s}function Wg(){return typeof jt().WorkerGlobalScope!="undefined"&&typeof jt().importScripts=="function"}async function hk(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function dk(){var s;return((s=navigator==null?void 0:navigator.serviceWorker)===null||s===void 0?void 0:s.controller)||null}function fk(){return Wg()?self:null}var Qg="firebaseLocalStorageDb",pk=1,Ia="firebaseLocalStorage",Jg="fbase_key",fr=class{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}};function Pa(s,e){return s.transaction([Ia],e?"readwrite":"readonly").objectStore(Ia)}function mk(){let s=indexedDB.deleteDatabase(Qg);return new fr(s).toPromise()}function Rl(){let s=indexedDB.open(Qg,pk);return new Promise((e,t)=>{s.addEventListener("error",()=>{t(s.error)}),s.addEventListener("upgradeneeded",()=>{let o=s.result;try{o.createObjectStore(Ia,{keyPath:Jg})}catch(a){t(a)}}),s.addEventListener("success",async()=>{let o=s.result;o.objectStoreNames.contains(Ia)?e(o):(o.close(),await mk(),e(await Rl()))})})}async function lg(s,e,t){let o=Pa(s,!0).put({[Jg]:e,value:t});return new fr(o).toPromise()}async function gk(s,e){let t=Pa(s,!1).get(e),o=await new fr(t).toPromise();return o===void 0?null:o.value}function hg(s,e){let t=Pa(s,!0).delete(e);return new fr(t).toPromise()}var yk=800,vk=3,Ta=class{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Rl(),this.db)}async _withRetries(e){let t=0;for(;;)try{let o=await this._openDb();return await e(o)}catch(o){if(t++>vk)throw o;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Wg()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ea._getInstance(fk()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await hk(),!this.activeServiceWorker)return;this.sender=new xl(this.activeServiceWorker);let o=await this.sender._send("ping",{},800);o&&!((e=o[0])===null||e===void 0)&&e.fulfilled&&!((t=o[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||dk()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;let e=await Rl();return await lg(e,va,"1"),await hg(e,va),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(o=>lg(o,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(o=>gk(o,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>hg(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(a=>{let u=Pa(a,!1).getAll();return new fr(u).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];let t=[],o=new Set;for(let{fbase_key:a,value:u}of e)o.add(a),JSON.stringify(this.localCache[a])!==JSON.stringify(u)&&(this.notifyListeners(a,u),t.push(a));for(let a of Object.keys(this.localCache))this.localCache[a]&&!o.has(a)&&(this.notifyListeners(a,null),t.push(a));return t}notifyListeners(e,t){this.localCache[e]=t;let o=this.listeners[e];if(o)for(let a of Array.from(o))a(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),yk)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}};Ta.type="LOCAL";var Xg=Ta;function wk(s,e){return je(s,"POST","/v2/accounts/mfaSignIn:start",Se(s,e))}function bk(s,e){return je(s,"POST","/v2/accounts/mfaSignIn:finalize",Se(s,e))}function _k(s,e){return je(s,"POST","/v2/accounts/mfaSignIn:finalize",Se(s,e))}var n1=Mg("rcb"),r1=new ur(3e4,6e4);var Ek="recaptcha";async function Ik(s,e,t){var o;let a=await t.verify();try{M(typeof a=="string",s,"argument-error"),M(t.type===Ek,s,"argument-error");let u;if(typeof e=="string"?u={phoneNumber:e}:u=e,"session"in u){let l=u.session;if("phoneNumber"in u)return M(l.type==="enroll",s,"internal-error"),(await nk(s,{idToken:l.credential,phoneEnrollmentInfo:{phoneNumber:u.phoneNumber,recaptchaToken:a}})).phoneSessionInfo.sessionInfo;{M(l.type==="signin",s,"internal-error");let h=((o=u.multiFactorHint)===null||o===void 0?void 0:o.uid)||u.multiFactorUid;return M(h,s,"missing-multi-factor-info"),(await wk(s,{mfaPendingCredential:l.credential,mfaEnrollmentId:h,phoneSignInInfo:{recaptchaToken:a}})).phoneResponseInfo.sessionInfo}}else{let{sessionInfo:l}=await GS(s,{phoneNumber:u.phoneNumber,recaptchaToken:a});return l}}finally{t._reset()}}var os=class s{constructor(e){this.providerId=s.PROVIDER_ID,this.auth=pn(e)}verifyPhoneNumber(e,t){return Ik(this.auth,e,re(t))}static credential(e,t){return rs._fromVerification(e,t)}static credentialFromResult(e){let t=e;return s.credentialFromTaggedObject(t)}static credentialFromError(e){return s.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:o}=e;return t&&o?rs._fromTokenResponse(t,o):null}};os.PROVIDER_ID="phone";os.PHONE_SIGN_IN_METHOD="phone";function Yg(s,e){return e?un(e):(M(s._popupRedirectResolver,s,"argument-error"),s._popupRedirectResolver)}var as=class extends lr{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return zr(e,this._buildIdpRequest())}_linkToIdToken(e,t){return zr(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return zr(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}};function Tk(s){return qg(s.auth,new as(s),s.bypassAuthState)}function Sk(s){let{auth:e,user:t}=s;return M(t,e,"internal-error"),ek(t,new as(s),s.bypassAuthState)}async function kk(s){let{auth:e,user:t}=s;return M(t,e,"internal-error"),ZS(t,new as(s),s.bypassAuthState)}var Sa=class{constructor(e,t,o,a,u=!1){this.auth=e,this.resolver=o,this.user=a,this.bypassAuthState=u,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(o){this.reject(o)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:o,postBody:a,tenantId:u,error:l,type:h}=e;if(l){this.reject(l);return}let d={auth:this.auth,requestUri:t,sessionId:o,tenantId:u||void 0,postBody:a||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(h)(d))}catch(f){this.reject(f)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Tk;case"linkViaPopup":case"linkViaRedirect":return kk;case"reauthViaPopup":case"reauthViaRedirect":return Sk;default:vt(this.auth,"internal-error")}}resolve(e){ln(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ln(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}};var Ak=new ur(2e3,1e4);async function Wr(s,e,t){let o=pn(s);vS(s,e,is);let a=Yg(o,t);return new ka(o,"signInViaPopup",e,a).executeNotNull()}var ka=class s extends Sa{constructor(e,t,o,a,u){super(e,t,a,u),this.provider=o,this.authWindow=null,this.pollId=null,s.currentPopupAction&&s.currentPopupAction.cancel(),s.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return M(e,this.auth,"internal-error"),e}async onExecution(){ln(this.filter.length===1,"Popup operations only handle one event");let e=Wl();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(Bt(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(Bt(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,s.currentPopupAction=null}pollUserCancellation(){let e=()=>{var t,o;if(!((o=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||o===void 0)&&o.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Bt(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Ak.get())};e()}};ka.currentPopupAction=null;var xk="pendingRedirect",sa=new Map,Cl=class extends Sa{constructor(e,t,o=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,o),this.eventId=null}async execute(){let e=sa.get(this.auth._key());if(!e){try{let o=await Rk(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(o)}catch(t){e=()=>Promise.reject(t)}sa.set(this.auth._key(),e)}return this.bypassAuthState||sa.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}};async function Rk(s,e){let t=Nk(e),o=Ok(s);if(!await o._isAvailable())return!1;let a=await o._get(t)==="true";return await o._remove(t),a}function Ck(s,e){sa.set(s._key(),e)}function Ok(s){return un(s._redirectPersistence)}function Nk(s){return ra(xk,s.config.apiKey,s.name)}async function Dk(s,e,t=!1){let o=pn(s),a=Yg(o,e),l=await new Cl(o,a,t).execute();return l&&!t&&(delete l.user._redirectEventId,await o._persistUserIfCurrent(l.user),await o._setRedirectUser(null,e)),l}var Pk=10*60*1e3,Ol=class{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(o=>{this.isEventForConsumer(e,o)&&(t=!0,this.sendToConsumer(e,o),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Lk(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var o;if(e.error&&!Zg(e)){let a=((o=e.error.code)===null||o===void 0?void 0:o.split("auth/")[1])||"internal-error";t.onError(Bt(this.auth,a))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let o=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&o}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Pk&&this.cachedEventUids.clear(),this.cachedEventUids.has(dg(e))}saveEventToCache(e){this.cachedEventUids.add(dg(e)),this.lastProcessedEventTime=Date.now()}};function dg(s){return[s.type,s.eventId,s.sessionId,s.tenantId].filter(e=>e).join("-")}function Zg({type:s,error:e}){return s==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Lk(s){switch(s.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Zg(s);default:return!1}}async function Mk(s,e={}){return je(s,"GET","/v1/projects",e)}var Uk=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Fk=/^https?/;async function $k(s){if(s.config.emulator)return;let{authorizedDomains:e}=await Mk(s);for(let t of e)try{if(Bk(t))return}catch{}vt(s,"unauthorized-domain")}function Bk(s){let e=_l(),{protocol:t,hostname:o}=new URL(e);if(s.startsWith("chrome-extension://")){let l=new URL(s);return l.hostname===""&&o===""?t==="chrome-extension:"&&s.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&l.hostname===o}if(!Fk.test(t))return!1;if(Uk.test(s))return o===s;let a=s.replace(/\./g,"\\.");return new RegExp("^(.+\\."+a+"|"+a+")$","i").test(o)}var jk=new ur(3e4,6e4);function fg(){let s=jt().___jsl;if(s!=null&&s.H){for(let e of Object.keys(s.H))if(s.H[e].r=s.H[e].r||[],s.H[e].L=s.H[e].L||[],s.H[e].r=[...s.H[e].L],s.CP)for(let t=0;t<s.CP.length;t++)s.CP[t]=null}}function Vk(s){return new Promise((e,t)=>{var o,a,u;function l(){fg(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{fg(),t(Bt(s,"network-request-failed"))},timeout:jk.get()})}if(!((a=(o=jt().gapi)===null||o===void 0?void 0:o.iframes)===null||a===void 0)&&a.Iframe)e(gapi.iframes.getContext());else if(!((u=jt().gapi)===null||u===void 0)&&u.load)l();else{let h=Mg("iframefcb");return jt()[h]=()=>{gapi.load?l():t(Bt(s,"network-request-failed"))},Lg(`https://apis.google.com/js/api.js?onload=${h}`).catch(d=>t(d))}}).catch(e=>{throw oa=null,e})}var oa=null;function qk(s){return oa=oa||Vk(s),oa}var zk=new ur(5e3,15e3),Hk="__/auth/iframe",Gk="emulator/auth/iframe",Kk={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Wk=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Qk(s){let e=s.config;M(e.authDomain,s,"auth-domain-config-required");let t=e.emulator?Ml(e,Gk):`https://${s.config.authDomain}/${Hk}`,o={apiKey:e.apiKey,appName:s.name,v:Ft},a=Wk.get(s.config.apiHost);a&&(o.eid=a);let u=s._getFrameworks();return u.length&&(o.fw=u.join(",")),`${t}?${Br(o).slice(1)}`}async function Jk(s){let e=await qk(s),t=jt().gapi;return M(t,s,"internal-error"),e.open({where:document.body,url:Qk(s),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Kk,dontclear:!0},o=>new Promise(async(a,u)=>{await o.restyle({setHideOnLeave:!1});let l=Bt(s,"network-request-failed"),h=jt().setTimeout(()=>{u(l)},zk.get());function d(){jt().clearTimeout(h),a(o)}o.ping(d).then(d,()=>{u(l)})}))}var Xk={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Yk=500,Zk=600,eA="_blank",tA="http://localhost",Aa=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};function nA(s,e,t,o=Yk,a=Zk){let u=Math.max((window.screen.availHeight-a)/2,0).toString(),l=Math.max((window.screen.availWidth-o)/2,0).toString(),h="",d=Object.assign(Object.assign({},Xk),{width:o.toString(),height:a.toString(),top:u,left:l}),f=xe().toLowerCase();t&&(h=Ag(f)?eA:t),kg(f)&&(e=e||tA,d.scrollbars="yes");let p=Object.entries(d).reduce((g,[y,w])=>`${g}${y}=${w},`,"");if(OS(f)&&h!=="_self")return rA(e||"",h),new Aa(null);let m=window.open(e||"",h,p);M(m,s,"popup-blocked");try{m.focus()}catch{}return new Aa(m)}function rA(s,e){let t=document.createElement("a");t.href=s,t.target=e;let o=document.createEvent("MouseEvent");o.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(o)}var iA="__/auth/handler",sA="emulator/auth/handler",oA=encodeURIComponent("fac");async function pg(s,e,t,o,a,u){M(s.config.authDomain,s,"auth-domain-config-required"),M(s.config.apiKey,s,"invalid-api-key");let l={apiKey:s.config.apiKey,appName:s.name,authType:t,redirectUrl:o,v:Ft,eventId:a};if(e instanceof is){e.setDefaultLanguage(s.languageCode),l.providerId=e.providerId||"",qm(e.getCustomParameters())||(l.customParameters=JSON.stringify(e.getCustomParameters()));for(let[p,m]of Object.entries(u||{}))l[p]=m}if(e instanceof On){let p=e.getScopes().filter(m=>m!=="");p.length>0&&(l.scopes=p.join(","))}s.tenantId&&(l.tid=s.tenantId);let h=l;for(let p of Object.keys(h))h[p]===void 0&&delete h[p];let d=await s._getAppCheckToken(),f=d?`#${oA}=${encodeURIComponent(d)}`:"";return`${aA(s)}?${Br(h).slice(1)}${f}`}function aA({config:s}){return s.emulator?Ml(s,sA):`https://${s.authDomain}/${iA}`}var bl="webStorageSupport",Nl=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Kl,this._completeRedirectFn=Dk,this._overrideRedirectResult=Ck}async _openPopup(e,t,o,a){var u;ln((u=this.eventManagers[e._key()])===null||u===void 0?void 0:u.manager,"_initialize() not called before _openPopup()");let l=await pg(e,t,o,_l(),a);return nA(e,l,Wl())}async _openRedirect(e,t,o,a){await this._originValidation(e);let u=await pg(e,t,o,_l(),a);return lk(u),new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:a,promise:u}=this.eventManagers[t];return a?Promise.resolve(a):(ln(u,"If manager is not set, promise should be"),u)}let o=this.initAndGetManager(e);return this.eventManagers[t]={promise:o},o.catch(()=>{delete this.eventManagers[t]}),o}async initAndGetManager(e){let t=await Jk(e),o=new Ol(e);return t.register("authEvent",a=>(M(a==null?void 0:a.authEvent,e,"invalid-auth-event"),{status:o.onEvent(a.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:o},this.iframes[e._key()]=t,o}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(bl,{type:bl},a=>{var u;let l=(u=a==null?void 0:a[0])===null||u===void 0?void 0:u[bl];l!==void 0&&t(!!l),vt(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=$k(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Ng()||Fl()||Da()}},ey=Nl,xa=class{constructor(e){this.factorId=e}_process(e,t,o){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,o);case"signin":return this._finalizeSignIn(e,t.credential);default:return $t("unexpected MultiFactorSessionType")}}},Dl=class s extends xa{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new s(e)}_finalizeEnroll(e,t,o){return rk(e,{idToken:t,displayName:o,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return bk(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},Ra=class{constructor(){}static assertion(e){return Dl._fromCredential(e)}};Ra.FACTOR_ID="phone";var Ca=class{static assertionForEnrollment(e,t){return Oa._fromSecret(e,t)}static assertionForSignIn(e,t){return Oa._fromEnrollmentId(e,t)}static async generateSecret(e){let t=e;M(typeof t.auth!="undefined","internal-error");let o=await ik(t.auth,{idToken:t.credential,totpEnrollmentInfo:{}});return Na._fromStartTotpMfaEnrollmentResponse(o,t.auth)}};Ca.FACTOR_ID="totp";var Oa=class s extends xa{constructor(e,t,o){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=o}static _fromSecret(e,t){return new s(t,void 0,e)}static _fromEnrollmentId(e,t){return new s(t,e)}async _finalizeEnroll(e,t,o){return M(typeof this.secret!="undefined",e,"argument-error"),sk(e,{idToken:t,displayName:o,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)})}async _finalizeSignIn(e,t){M(this.enrollmentId!==void 0&&this.otp!==void 0,e,"argument-error");let o={verificationCode:this.otp};return _k(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:o})}},Na=class s{constructor(e,t,o,a,u,l,h){this.sessionInfo=l,this.auth=h,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=o,this.codeIntervalSeconds=a,this.enrollmentCompletionDeadline=u}static _fromStartTotpMfaEnrollmentResponse(e,t){return new s(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,t)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){var o;let a=!1;return(ta(e)||ta(t))&&(a=!0),a&&(ta(e)&&(e=((o=this.auth.currentUser)===null||o===void 0?void 0:o.email)||"unknownuser"),ta(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}};function ta(s){return typeof s=="undefined"||(s==null?void 0:s.length)===0}var mg="@firebase/auth",gg="0.23.2";var Pl=class{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(o=>{e((o==null?void 0:o.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){M(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};function cA(s){switch(s){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function uA(s){Ut(new it("auth",(e,{options:t})=>{let o=e.getProvider("app").getImmediate(),a=e.getProvider("heartbeat"),u=e.getProvider("app-check-internal"),{apiKey:l,authDomain:h}=o.options;M(l&&!l.includes(":"),"invalid-api-key",{appName:o.name});let d={apiKey:l,authDomain:h,clientPlatform:s,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Dg(s)},f=new kl(o,a,u,d);return FS(f,t),f},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,o)=>{e.getProvider("auth-internal").initialize()})),Ut(new it("auth-internal",e=>{let t=pn(e.getProvider("auth").getImmediate());return(o=>new Pl(o))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),st(mg,gg,cA(s)),st(mg,gg,"esm2017")}var lA=5*60,hA=el("authIdTokenMaxAge")||lA,yg=null,dA=s=>async e=>{let t=e&&await e.getIdTokenResult(),o=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(o&&o>hA)return;let a=t==null?void 0:t.token;yg!==a&&(yg=a,await fetch(s,{method:a?"POST":"DELETE",headers:a?{Authorization:`Bearer ${a}`}:{}}))};function cs(s=qr()){let e=cr(s,"auth");if(e.isInitialized())return e.getImmediate();let t=Ug(s,{popupRedirectResolver:ey,persistence:[Xg,Kg,Kl]}),o=el("authTokenSyncURL");if(o){let u=dA(o);Gg(t,u,()=>u(t.currentUser)),Hg(t,l=>u(l))}let a=Yu("auth");return a&&Fg(t,`http://${a}`),t}uA("Browser");var fA=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Ct={},N,gh=gh||{},q=fA||self;function Qa(s){var e=typeof s;return e=e!="object"?e:s?Array.isArray(s)?"array":e:"null",e=="array"||e=="object"&&typeof s.length=="number"}function Es(s){var e=typeof s;return e=="object"&&s!=null||e=="function"}function pA(s){return Object.prototype.hasOwnProperty.call(s,Ql)&&s[Ql]||(s[Ql]=++mA)}var Ql="closure_uid_"+(1e9*Math.random()>>>0),mA=0;function gA(s,e,t){return s.call.apply(s.bind,arguments)}function yA(s,e,t){if(!s)throw Error();if(2<arguments.length){var o=Array.prototype.slice.call(arguments,2);return function(){var a=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(a,o),s.apply(e,a)}}return function(){return s.apply(e,arguments)}}function Ve(s,e,t){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?Ve=gA:Ve=yA,Ve.apply(null,arguments)}function La(s,e){var t=Array.prototype.slice.call(arguments,1);return function(){var o=t.slice();return o.push.apply(o,arguments),s.apply(this,o)}}function Ce(s,e){function t(){}t.prototype=e.prototype,s.$=e.prototype,s.prototype=new t,s.prototype.constructor=s,s.ac=function(o,a,u){for(var l=Array(arguments.length-2),h=2;h<arguments.length;h++)l[h-2]=arguments[h];return e.prototype[a].apply(o,l)}}function Pn(){this.s=this.s,this.o=this.o}var vA=0;Pn.prototype.s=!1;Pn.prototype.sa=function(){!this.s&&(this.s=!0,this.N(),vA!=0)&&pA(this)};Pn.prototype.N=function(){if(this.o)for(;this.o.length;)this.o.shift()()};var fy=Array.prototype.indexOf?function(s,e){return Array.prototype.indexOf.call(s,e,void 0)}:function(s,e){if(typeof s=="string")return typeof e!="string"||e.length!=1?-1:s.indexOf(e,0);for(let t=0;t<s.length;t++)if(t in s&&s[t]===e)return t;return-1};function yh(s){let e=s.length;if(0<e){let t=Array(e);for(let o=0;o<e;o++)t[o]=s[o];return t}return[]}function ty(s,e){for(let t=1;t<arguments.length;t++){let o=arguments[t];if(Qa(o)){let a=s.length||0,u=o.length||0;s.length=a+u;for(let l=0;l<u;l++)s[a+l]=o[l]}else s.push(o)}}function qe(s,e){this.type=s,this.g=this.target=e,this.defaultPrevented=!1}qe.prototype.h=function(){this.defaultPrevented=!0};var wA=function(){if(!q.addEventListener||!Object.defineProperty)return!1;var s=!1,e=Object.defineProperty({},"passive",{get:function(){s=!0}});try{q.addEventListener("test",()=>{},e),q.removeEventListener("test",()=>{},e)}catch{}return s}();function ps(s){return/^[\s\xa0]*$/.test(s)}function Ja(){var s=q.navigator;return s&&(s=s.userAgent)?s:""}function Vt(s){return Ja().indexOf(s)!=-1}function vh(s){return vh[" "](s),s}vh[" "]=function(){};function bA(s,e){var t=cx;return Object.prototype.hasOwnProperty.call(t,s)?t[s]:t[s]=e(s)}var _A=Vt("Opera"),Yr=Vt("Trident")||Vt("MSIE"),py=Vt("Edge"),eh=py||Yr,my=Vt("Gecko")&&!(Ja().toLowerCase().indexOf("webkit")!=-1&&!Vt("Edge"))&&!(Vt("Trident")||Vt("MSIE"))&&!Vt("Edge"),EA=Ja().toLowerCase().indexOf("webkit")!=-1&&!Vt("Edge");function gy(){var s=q.document;return s?s.documentMode:void 0}var th;e:{if(Ma="",Ua=function(){var s=Ja();if(my)return/rv:([^\);]+)(\)|;)/.exec(s);if(py)return/Edge\/([\d\.]+)/.exec(s);if(Yr)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(s);if(EA)return/WebKit\/(\S+)/.exec(s);if(_A)return/(?:Version)[ \/]?(\S+)/.exec(s)}(),Ua&&(Ma=Ua?Ua[1]:""),Yr&&(Fa=gy(),Fa!=null&&Fa>parseFloat(Ma))){th=String(Fa);break e}th=Ma}var Ma,Ua,Fa,nh;q.document&&Yr?(Jl=gy(),nh=Jl||parseInt(th,10)||void 0):nh=void 0;var Jl,IA=nh;function ms(s,e){if(qe.call(this,s?s.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,s){var t=this.type=s.type,o=s.changedTouches&&s.changedTouches.length?s.changedTouches[0]:null;if(this.target=s.target||s.srcElement,this.g=e,e=s.relatedTarget){if(my){e:{try{vh(e.nodeName);var a=!0;break e}catch{}a=!1}a||(e=null)}}else t=="mouseover"?e=s.fromElement:t=="mouseout"&&(e=s.toElement);this.relatedTarget=e,o?(this.clientX=o.clientX!==void 0?o.clientX:o.pageX,this.clientY=o.clientY!==void 0?o.clientY:o.pageY,this.screenX=o.screenX||0,this.screenY=o.screenY||0):(this.clientX=s.clientX!==void 0?s.clientX:s.pageX,this.clientY=s.clientY!==void 0?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.screenY||0),this.button=s.button,this.key=s.key||"",this.ctrlKey=s.ctrlKey,this.altKey=s.altKey,this.shiftKey=s.shiftKey,this.metaKey=s.metaKey,this.pointerId=s.pointerId||0,this.pointerType=typeof s.pointerType=="string"?s.pointerType:TA[s.pointerType]||"",this.state=s.state,this.i=s,s.defaultPrevented&&ms.$.h.call(this)}}Ce(ms,qe);var TA={2:"touch",3:"pen",4:"mouse"};ms.prototype.h=function(){ms.$.h.call(this);var s=this.i;s.preventDefault?s.preventDefault():s.returnValue=!1};var Is="closure_listenable_"+(1e6*Math.random()|0),SA=0;function kA(s,e,t,o,a){this.listener=s,this.proxy=null,this.src=e,this.type=t,this.capture=!!o,this.la=a,this.key=++SA,this.fa=this.ia=!1}function Xa(s){s.fa=!0,s.listener=null,s.proxy=null,s.src=null,s.la=null}function wh(s,e,t){for(let o in s)e.call(t,s[o],o,s)}function AA(s,e){for(let t in s)e.call(void 0,s[t],t,s)}function yy(s){let e={};for(let t in s)e[t]=s[t];return e}var ny="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function vy(s,e){let t,o;for(let a=1;a<arguments.length;a++){o=arguments[a];for(t in o)s[t]=o[t];for(let u=0;u<ny.length;u++)t=ny[u],Object.prototype.hasOwnProperty.call(o,t)&&(s[t]=o[t])}}function Ya(s){this.src=s,this.g={},this.h=0}Ya.prototype.add=function(s,e,t,o,a){var u=s.toString();s=this.g[u],s||(s=this.g[u]=[],this.h++);var l=ih(s,e,o,a);return-1<l?(e=s[l],t||(e.ia=!1)):(e=new kA(e,this.src,u,!!o,a),e.ia=t,s.push(e)),e};function rh(s,e){var t=e.type;if(t in s.g){var o=s.g[t],a=fy(o,e),u;(u=0<=a)&&Array.prototype.splice.call(o,a,1),u&&(Xa(e),s.g[t].length==0&&(delete s.g[t],s.h--))}}function ih(s,e,t,o){for(var a=0;a<s.length;++a){var u=s[a];if(!u.fa&&u.listener==e&&u.capture==!!t&&u.la==o)return a}return-1}var bh="closure_lm_"+(1e6*Math.random()|0),Xl={};function wy(s,e,t,o,a){if(o&&o.once)return _y(s,e,t,o,a);if(Array.isArray(e)){for(var u=0;u<e.length;u++)wy(s,e[u],t,o,a);return null}return t=Ih(t),s&&s[Is]?s.O(e,t,Es(o)?!!o.capture:!!o,a):by(s,e,t,!1,o,a)}function by(s,e,t,o,a,u){if(!e)throw Error("Invalid event type");var l=Es(a)?!!a.capture:!!a,h=Eh(s);if(h||(s[bh]=h=new Ya(s)),t=h.add(e,t,o,l,u),t.proxy)return t;if(o=xA(),t.proxy=o,o.src=s,o.listener=t,s.addEventListener)wA||(a=l),a===void 0&&(a=!1),s.addEventListener(e.toString(),o,a);else if(s.attachEvent)s.attachEvent(Iy(e.toString()),o);else if(s.addListener&&s.removeListener)s.addListener(o);else throw Error("addEventListener and attachEvent are unavailable.");return t}function xA(){function s(t){return e.call(s.src,s.listener,t)}let e=RA;return s}function _y(s,e,t,o,a){if(Array.isArray(e)){for(var u=0;u<e.length;u++)_y(s,e[u],t,o,a);return null}return t=Ih(t),s&&s[Is]?s.P(e,t,Es(o)?!!o.capture:!!o,a):by(s,e,t,!0,o,a)}function Ey(s,e,t,o,a){if(Array.isArray(e))for(var u=0;u<e.length;u++)Ey(s,e[u],t,o,a);else o=Es(o)?!!o.capture:!!o,t=Ih(t),s&&s[Is]?(s=s.i,e=String(e).toString(),e in s.g&&(u=s.g[e],t=ih(u,t,o,a),-1<t&&(Xa(u[t]),Array.prototype.splice.call(u,t,1),u.length==0&&(delete s.g[e],s.h--)))):s&&(s=Eh(s))&&(e=s.g[e.toString()],s=-1,e&&(s=ih(e,t,o,a)),(t=-1<s?e[s]:null)&&_h(t))}function _h(s){if(typeof s!="number"&&s&&!s.fa){var e=s.src;if(e&&e[Is])rh(e.i,s);else{var t=s.type,o=s.proxy;e.removeEventListener?e.removeEventListener(t,o,s.capture):e.detachEvent?e.detachEvent(Iy(t),o):e.addListener&&e.removeListener&&e.removeListener(o),(t=Eh(e))?(rh(t,s),t.h==0&&(t.src=null,e[bh]=null)):Xa(s)}}}function Iy(s){return s in Xl?Xl[s]:Xl[s]="on"+s}function RA(s,e){if(s.fa)s=!0;else{e=new ms(e,this);var t=s.listener,o=s.la||s.src;s.ia&&_h(s),s=t.call(o,e)}return s}function Eh(s){return s=s[bh],s instanceof Ya?s:null}var Yl="__closure_events_fn_"+(1e9*Math.random()>>>0);function Ih(s){return typeof s=="function"?s:(s[Yl]||(s[Yl]=function(e){return s.handleEvent(e)}),s[Yl])}function Re(){Pn.call(this),this.i=new Ya(this),this.S=this,this.J=null}Ce(Re,Pn);Re.prototype[Is]=!0;Re.prototype.removeEventListener=function(s,e,t,o){Ey(this,s,e,t,o)};function Me(s,e){var t,o=s.J;if(o)for(t=[];o;o=o.J)t.push(o);if(s=s.S,o=e.type||e,typeof e=="string")e=new qe(e,s);else if(e instanceof qe)e.target=e.target||s;else{var a=e;e=new qe(o,s),vy(e,a)}if(a=!0,t)for(var u=t.length-1;0<=u;u--){var l=e.g=t[u];a=$a(l,o,!0,e)&&a}if(l=e.g=s,a=$a(l,o,!0,e)&&a,a=$a(l,o,!1,e)&&a,t)for(u=0;u<t.length;u++)l=e.g=t[u],a=$a(l,o,!1,e)&&a}Re.prototype.N=function(){if(Re.$.N.call(this),this.i){var s=this.i,e;for(e in s.g){for(var t=s.g[e],o=0;o<t.length;o++)Xa(t[o]);delete s.g[e],s.h--}}this.J=null};Re.prototype.O=function(s,e,t,o){return this.i.add(String(s),e,!1,t,o)};Re.prototype.P=function(s,e,t,o){return this.i.add(String(s),e,!0,t,o)};function $a(s,e,t,o){if(e=s.i.g[String(e)],!e)return!0;e=e.concat();for(var a=!0,u=0;u<e.length;++u){var l=e[u];if(l&&!l.fa&&l.capture==t){var h=l.listener,d=l.la||l.src;l.ia&&rh(s.i,l),a=h.call(d,o)!==!1&&a}}return a&&!o.defaultPrevented}var Th=q.JSON.stringify,sh=class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}};function CA(){var s=Sh;let e=null;return s.g&&(e=s.g,s.g=s.g.next,s.g||(s.h=null),e.next=null),e}var oh=class{constructor(){this.h=this.g=null}add(e,t){let o=Ty.get();o.set(e,t),this.h?this.h.next=o:this.g=o,this.h=o}},Ty=new sh(()=>new ah,s=>s.reset()),ah=class{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}};function OA(s){var e=1;s=s.split(":");let t=[];for(;0<e&&s.length;)t.push(s.shift()),e--;return s.length&&t.push(s.join(":")),t}function NA(s){q.setTimeout(()=>{throw s},0)}var gs,ys=!1,Sh=new oh,Sy=()=>{let s=q.Promise.resolve(void 0);gs=()=>{s.then(DA)}},DA=()=>{for(var s;s=CA();){try{s.h.call(s.g)}catch(t){NA(t)}var e=Ty;e.j(s),100>e.h&&(e.h++,s.next=e.g,e.g=s)}ys=!1};function Za(s,e){Re.call(this),this.h=s||1,this.g=e||q,this.j=Ve(this.qb,this),this.l=Date.now()}Ce(Za,Re);N=Za.prototype;N.ga=!1;N.T=null;N.qb=function(){if(this.ga){var s=Date.now()-this.l;0<s&&s<.8*this.h?this.T=this.g.setTimeout(this.j,this.h-s):(this.T&&(this.g.clearTimeout(this.T),this.T=null),Me(this,"tick"),this.ga&&(kh(this),this.start()))}};N.start=function(){this.ga=!0,this.T||(this.T=this.g.setTimeout(this.j,this.h),this.l=Date.now())};function kh(s){s.ga=!1,s.T&&(s.g.clearTimeout(s.T),s.T=null)}N.N=function(){Za.$.N.call(this),kh(this),delete this.g};function Ah(s,e,t){if(typeof s=="function")t&&(s=Ve(s,t));else if(s&&typeof s.handleEvent=="function")s=Ve(s.handleEvent,s);else throw Error("Invalid listener argument");return 2147483647<Number(e)?-1:q.setTimeout(s,e||0)}function ky(s){s.g=Ah(()=>{s.g=null,s.i&&(s.i=!1,ky(s))},s.j);let e=s.h;s.h=null,s.m.apply(null,e)}var ch=class extends Pn{constructor(e,t){super(),this.m=e,this.j=t,this.h=null,this.i=!1,this.g=null}l(e){this.h=arguments,this.g?this.i=!0:ky(this)}N(){super.N(),this.g&&(q.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}};function vs(s){Pn.call(this),this.h=s,this.g={}}Ce(vs,Pn);var ry=[];function Ay(s,e,t,o){Array.isArray(t)||(t&&(ry[0]=t.toString()),t=ry);for(var a=0;a<t.length;a++){var u=wy(e,t[a],o||s.handleEvent,!1,s.h||s);if(!u)break;s.g[u.key]=u}}function xy(s){wh(s.g,function(e,t){this.g.hasOwnProperty(t)&&_h(e)},s),s.g={}}vs.prototype.N=function(){vs.$.N.call(this),xy(this)};vs.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};function ec(){this.g=!0}ec.prototype.Ea=function(){this.g=!1};function PA(s,e,t,o,a,u){s.info(function(){if(s.g)if(u)for(var l="",h=u.split("&"),d=0;d<h.length;d++){var f=h[d].split("=");if(1<f.length){var p=f[0];f=f[1];var m=p.split("_");l=2<=m.length&&m[1]=="type"?l+(p+"="+f+"&"):l+(p+"=redacted&")}}else l=null;else l=u;return"XMLHTTP REQ ("+o+") [attempt "+a+"]: "+e+`
`+t+`
`+l})}function LA(s,e,t,o,a,u,l){s.info(function(){return"XMLHTTP RESP ("+o+") [ attempt "+a+"]: "+e+`
`+t+`
`+u+" "+l})}function Jr(s,e,t,o){s.info(function(){return"XMLHTTP TEXT ("+e+"): "+UA(s,t)+(o?" "+o:"")})}function MA(s,e){s.info(function(){return"TIMEOUT: "+e})}ec.prototype.info=function(){};function UA(s,e){if(!s.g)return e;if(!e)return null;try{var t=JSON.parse(e);if(t){for(s=0;s<t.length;s++)if(Array.isArray(t[s])){var o=t[s];if(!(2>o.length)){var a=o[1];if(Array.isArray(a)&&!(1>a.length)){var u=a[0];if(u!="noop"&&u!="stop"&&u!="close")for(var l=1;l<a.length;l++)a[l]=""}}}}return Th(t)}catch{return e}}var yr={},iy=null;function tc(){return iy=iy||new Re}yr.Ta="serverreachability";function Ry(s){qe.call(this,yr.Ta,s)}Ce(Ry,qe);function ws(s){let e=tc();Me(e,new Ry(e))}yr.STAT_EVENT="statevent";function Cy(s,e){qe.call(this,yr.STAT_EVENT,s),this.stat=e}Ce(Cy,qe);function We(s){let e=tc();Me(e,new Cy(e,s))}yr.Ua="timingevent";function Oy(s,e){qe.call(this,yr.Ua,s),this.size=e}Ce(Oy,qe);function Ts(s,e){if(typeof s!="function")throw Error("Fn must not be null and must be a function");return q.setTimeout(function(){s()},e)}var nc={NO_ERROR:0,rb:1,Eb:2,Db:3,yb:4,Cb:5,Fb:6,Qa:7,TIMEOUT:8,Ib:9},Ny={wb:"complete",Sb:"success",Ra:"error",Qa:"abort",Kb:"ready",Lb:"readystatechange",TIMEOUT:"timeout",Gb:"incrementaldata",Jb:"progress",zb:"downloadprogress",$b:"uploadprogress"};function xh(){}xh.prototype.h=null;function sy(s){return s.h||(s.h=s.i())}function Dy(){}var Ss={OPEN:"a",vb:"b",Ra:"c",Hb:"d"};function Rh(){qe.call(this,"d")}Ce(Rh,qe);function Ch(){qe.call(this,"c")}Ce(Ch,qe);var uh;function rc(){}Ce(rc,xh);rc.prototype.g=function(){return new XMLHttpRequest};rc.prototype.i=function(){return{}};uh=new rc;function ks(s,e,t,o){this.l=s,this.j=e,this.m=t,this.W=o||1,this.U=new vs(this),this.P=FA,s=eh?125:void 0,this.V=new Za(s),this.I=null,this.i=!1,this.s=this.A=this.v=this.L=this.G=this.Y=this.B=null,this.F=[],this.g=null,this.C=0,this.o=this.u=null,this.ca=-1,this.J=!1,this.O=0,this.M=null,this.ba=this.K=this.aa=this.S=!1,this.h=new Py}function Py(){this.i=null,this.g="",this.h=!1}var FA=45e3,lh={},Va={};N=ks.prototype;N.setTimeout=function(s){this.P=s};function hh(s,e,t){s.L=1,s.v=sc(gn(e)),s.s=t,s.S=!0,Ly(s,null)}function Ly(s,e){s.G=Date.now(),As(s),s.A=gn(s.v);var t=s.A,o=s.W;Array.isArray(o)||(o=[String(o)]),qy(t.i,"t",o),s.C=0,t=s.l.J,s.h=new Py,s.g=lv(s.l,t?e:null,!s.s),0<s.O&&(s.M=new ch(Ve(s.Pa,s,s.g),s.O)),Ay(s.U,s.g,"readystatechange",s.nb),e=s.I?yy(s.I):{},s.s?(s.u||(s.u="POST"),e["Content-Type"]="application/x-www-form-urlencoded",s.g.ha(s.A,s.u,s.s,e)):(s.u="GET",s.g.ha(s.A,s.u,null,e)),ws(),PA(s.j,s.u,s.A,s.m,s.W,s.s)}N.nb=function(s){s=s.target;let e=this.M;e&&qt(s)==3?e.l():this.Pa(s)};N.Pa=function(s){try{if(s==this.g)e:{let p=qt(this.g);var e=this.g.Ia();let m=this.g.da();if(!(3>p)&&(p!=3||eh||this.g&&(this.h.h||this.g.ja()||uy(this.g)))){this.J||p!=4||e==7||(e==8||0>=m?ws(3):ws(2)),ic(this);var t=this.g.da();this.ca=t;t:if(My(this)){var o=uy(this.g);s="";var a=o.length,u=qt(this.g)==4;if(!this.h.i){if(typeof TextDecoder=="undefined"){pr(this),fs(this);var l="";break t}this.h.i=new q.TextDecoder}for(e=0;e<a;e++)this.h.h=!0,s+=this.h.i.decode(o[e],{stream:u&&e==a-1});o.splice(0,a),this.h.g+=s,this.C=0,l=this.h.g}else l=this.g.ja();if(this.i=t==200,LA(this.j,this.u,this.A,this.m,this.W,p,t),this.i){if(this.aa&&!this.K){t:{if(this.g){var h,d=this.g;if((h=d.g?d.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!ps(h)){var f=h;break t}}f=null}if(t=f)Jr(this.j,this.m,t,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,dh(this,t);else{this.i=!1,this.o=3,We(12),pr(this),fs(this);break e}}this.S?(Uy(this,p,l),eh&&this.i&&p==3&&(Ay(this.U,this.V,"tick",this.mb),this.V.start())):(Jr(this.j,this.m,l,null),dh(this,l)),p==4&&pr(this),this.i&&!this.J&&(p==4?ov(this.l,this):(this.i=!1,As(this)))}else sx(this.g),t==400&&0<l.indexOf("Unknown SID")?(this.o=3,We(12)):(this.o=0,We(13)),pr(this),fs(this)}}}catch{}finally{}};function My(s){return s.g?s.u=="GET"&&s.L!=2&&s.l.Ha:!1}function Uy(s,e,t){let o=!0,a;for(;!s.J&&s.C<t.length;)if(a=$A(s,t),a==Va){e==4&&(s.o=4,We(14),o=!1),Jr(s.j,s.m,null,"[Incomplete Response]");break}else if(a==lh){s.o=4,We(15),Jr(s.j,s.m,t,"[Invalid Chunk]"),o=!1;break}else Jr(s.j,s.m,a,null),dh(s,a);My(s)&&a!=Va&&a!=lh&&(s.h.g="",s.C=0),e!=4||t.length!=0||s.h.h||(s.o=1,We(16),o=!1),s.i=s.i&&o,o?0<t.length&&!s.ba&&(s.ba=!0,e=s.l,e.g==s&&e.ca&&!e.M&&(e.l.info("Great, no buffering proxy detected. Bytes received: "+t.length),Mh(e),e.M=!0,We(11))):(Jr(s.j,s.m,t,"[Invalid Chunked Response]"),pr(s),fs(s))}N.mb=function(){if(this.g){var s=qt(this.g),e=this.g.ja();this.C<e.length&&(ic(this),Uy(this,s,e),this.i&&s!=4&&As(this))}};function $A(s,e){var t=s.C,o=e.indexOf(`
`,t);return o==-1?Va:(t=Number(e.substring(t,o)),isNaN(t)?lh:(o+=1,o+t>e.length?Va:(e=e.slice(o,o+t),s.C=o+t,e)))}N.cancel=function(){this.J=!0,pr(this)};function As(s){s.Y=Date.now()+s.P,Fy(s,s.P)}function Fy(s,e){if(s.B!=null)throw Error("WatchDog timer not null");s.B=Ts(Ve(s.lb,s),e)}function ic(s){s.B&&(q.clearTimeout(s.B),s.B=null)}N.lb=function(){this.B=null;let s=Date.now();0<=s-this.Y?(MA(this.j,this.A),this.L!=2&&(ws(),We(17)),pr(this),this.o=2,fs(this)):Fy(this,this.Y-s)};function fs(s){s.l.H==0||s.J||ov(s.l,s)}function pr(s){ic(s);var e=s.M;e&&typeof e.sa=="function"&&e.sa(),s.M=null,kh(s.V),xy(s.U),s.g&&(e=s.g,s.g=null,e.abort(),e.sa())}function dh(s,e){try{var t=s.l;if(t.H!=0&&(t.g==s||fh(t.i,s))){if(!s.K&&fh(t.i,s)&&t.H==3){try{var o=t.Ja.g.parse(e)}catch{o=null}if(Array.isArray(o)&&o.length==3){var a=o;if(a[0]==0){e:if(!t.u){if(t.g)if(t.g.G+3e3<s.G)Ha(t),cc(t);else break e;Lh(t),We(18)}}else t.Fa=a[1],0<t.Fa-t.V&&37500>a[2]&&t.G&&t.A==0&&!t.v&&(t.v=Ts(Ve(t.ib,t),6e3));if(1>=Gy(t.i)&&t.oa){try{t.oa()}catch{}t.oa=void 0}}else mr(t,11)}else if((s.K||t.g==s)&&Ha(t),!ps(e))for(a=t.Ja.g.parse(e),e=0;e<a.length;e++){let f=a[e];if(t.V=f[0],f=f[1],t.H==2)if(f[0]=="c"){t.K=f[1],t.pa=f[2];let p=f[3];p!=null&&(t.ra=p,t.l.info("VER="+t.ra));let m=f[4];m!=null&&(t.Ga=m,t.l.info("SVER="+t.Ga));let g=f[5];g!=null&&typeof g=="number"&&0<g&&(o=1.5*g,t.L=o,t.l.info("backChannelRequestTimeoutMs_="+o)),o=t;let y=s.g;if(y){let w=y.g?y.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(w){var u=o.i;u.g||w.indexOf("spdy")==-1&&w.indexOf("quic")==-1&&w.indexOf("h2")==-1||(u.j=u.l,u.g=new Set,u.h&&(Oh(u,u.h),u.h=null))}if(o.F){let b=y.g?y.g.getResponseHeader("X-HTTP-Session-Id"):null;b&&(o.Da=b,le(o.I,o.F,b))}}t.H=3,t.h&&t.h.Ba(),t.ca&&(t.S=Date.now()-s.G,t.l.info("Handshake RTT: "+t.S+"ms")),o=t;var l=s;if(o.wa=uv(o,o.J?o.pa:null,o.Y),l.K){Ky(o.i,l);var h=l,d=o.L;d&&h.setTimeout(d),h.B&&(ic(h),As(h)),o.g=l}else iv(o);0<t.j.length&&uc(t)}else f[0]!="stop"&&f[0]!="close"||mr(t,7);else t.H==3&&(f[0]=="stop"||f[0]=="close"?f[0]=="stop"?mr(t,7):Ph(t):f[0]!="noop"&&t.h&&t.h.Aa(f),t.A=0)}}ws(4)}catch{}}function BA(s){if(s.Z&&typeof s.Z=="function")return s.Z();if(typeof Map!="undefined"&&s instanceof Map||typeof Set!="undefined"&&s instanceof Set)return Array.from(s.values());if(typeof s=="string")return s.split("");if(Qa(s)){for(var e=[],t=s.length,o=0;o<t;o++)e.push(s[o]);return e}e=[],t=0;for(o in s)e[t++]=s[o];return e}function jA(s){if(s.ta&&typeof s.ta=="function")return s.ta();if(!s.Z||typeof s.Z!="function"){if(typeof Map!="undefined"&&s instanceof Map)return Array.from(s.keys());if(!(typeof Set!="undefined"&&s instanceof Set)){if(Qa(s)||typeof s=="string"){var e=[];s=s.length;for(var t=0;t<s;t++)e.push(t);return e}e=[],t=0;for(let o in s)e[t++]=o;return e}}}function $y(s,e){if(s.forEach&&typeof s.forEach=="function")s.forEach(e,void 0);else if(Qa(s)||typeof s=="string")Array.prototype.forEach.call(s,e,void 0);else for(var t=jA(s),o=BA(s),a=o.length,u=0;u<a;u++)e.call(void 0,o[u],t&&t[u],s)}var By=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function VA(s,e){if(s){s=s.split("&");for(var t=0;t<s.length;t++){var o=s[t].indexOf("="),a=null;if(0<=o){var u=s[t].substring(0,o);a=s[t].substring(o+1)}else u=s[t];e(u,a?decodeURIComponent(a.replace(/\+/g," ")):"")}}}function gr(s){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,s instanceof gr){this.h=s.h,qa(this,s.j),this.s=s.s,this.g=s.g,za(this,s.m),this.l=s.l;var e=s.i,t=new bs;t.i=e.i,e.g&&(t.g=new Map(e.g),t.h=e.h),oy(this,t),this.o=s.o}else s&&(e=String(s).match(By))?(this.h=!1,qa(this,e[1]||"",!0),this.s=hs(e[2]||""),this.g=hs(e[3]||"",!0),za(this,e[4]),this.l=hs(e[5]||"",!0),oy(this,e[6]||"",!0),this.o=hs(e[7]||"")):(this.h=!1,this.i=new bs(null,this.h))}gr.prototype.toString=function(){var s=[],e=this.j;e&&s.push(ds(e,ay,!0),":");var t=this.g;return(t||e=="file")&&(s.push("//"),(e=this.s)&&s.push(ds(e,ay,!0),"@"),s.push(encodeURIComponent(String(t)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t=this.m,t!=null&&s.push(":",String(t))),(t=this.l)&&(this.g&&t.charAt(0)!="/"&&s.push("/"),s.push(ds(t,t.charAt(0)=="/"?HA:zA,!0))),(t=this.i.toString())&&s.push("?",t),(t=this.o)&&s.push("#",ds(t,KA)),s.join("")};function gn(s){return new gr(s)}function qa(s,e,t){s.j=t?hs(e,!0):e,s.j&&(s.j=s.j.replace(/:$/,""))}function za(s,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);s.m=e}else s.m=null}function oy(s,e,t){e instanceof bs?(s.i=e,WA(s.i,s.h)):(t||(e=ds(e,GA)),s.i=new bs(e,s.h))}function le(s,e,t){s.i.set(e,t)}function sc(s){return le(s,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),s}function hs(s,e){return s?e?decodeURI(s.replace(/%25/g,"%2525")):decodeURIComponent(s):""}function ds(s,e,t){return typeof s=="string"?(s=encodeURI(s).replace(e,qA),t&&(s=s.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),s):null}function qA(s){return s=s.charCodeAt(0),"%"+(s>>4&15).toString(16)+(s&15).toString(16)}var ay=/[#\/\?@]/g,zA=/[#\?:]/g,HA=/[#\?]/g,GA=/[#\?@]/g,KA=/#/g;function bs(s,e){this.h=this.g=null,this.i=s||null,this.j=!!e}function Ln(s){s.g||(s.g=new Map,s.h=0,s.i&&VA(s.i,function(e,t){s.add(decodeURIComponent(e.replace(/\+/g," ")),t)}))}N=bs.prototype;N.add=function(s,e){Ln(this),this.i=null,s=Zr(this,s);var t=this.g.get(s);return t||this.g.set(s,t=[]),t.push(e),this.h+=1,this};function jy(s,e){Ln(s),e=Zr(s,e),s.g.has(e)&&(s.i=null,s.h-=s.g.get(e).length,s.g.delete(e))}function Vy(s,e){return Ln(s),e=Zr(s,e),s.g.has(e)}N.forEach=function(s,e){Ln(this),this.g.forEach(function(t,o){t.forEach(function(a){s.call(e,a,o,this)},this)},this)};N.ta=function(){Ln(this);let s=Array.from(this.g.values()),e=Array.from(this.g.keys()),t=[];for(let o=0;o<e.length;o++){let a=s[o];for(let u=0;u<a.length;u++)t.push(e[o])}return t};N.Z=function(s){Ln(this);let e=[];if(typeof s=="string")Vy(this,s)&&(e=e.concat(this.g.get(Zr(this,s))));else{s=Array.from(this.g.values());for(let t=0;t<s.length;t++)e=e.concat(s[t])}return e};N.set=function(s,e){return Ln(this),this.i=null,s=Zr(this,s),Vy(this,s)&&(this.h-=this.g.get(s).length),this.g.set(s,[e]),this.h+=1,this};N.get=function(s,e){return s?(s=this.Z(s),0<s.length?String(s[0]):e):e};function qy(s,e,t){jy(s,e),0<t.length&&(s.i=null,s.g.set(Zr(s,e),yh(t)),s.h+=t.length)}N.toString=function(){if(this.i)return this.i;if(!this.g)return"";let s=[],e=Array.from(this.g.keys());for(var t=0;t<e.length;t++){var o=e[t];let u=encodeURIComponent(String(o)),l=this.Z(o);for(o=0;o<l.length;o++){var a=u;l[o]!==""&&(a+="="+encodeURIComponent(String(l[o]))),s.push(a)}}return this.i=s.join("&")};function Zr(s,e){return e=String(e),s.j&&(e=e.toLowerCase()),e}function WA(s,e){e&&!s.j&&(Ln(s),s.i=null,s.g.forEach(function(t,o){var a=o.toLowerCase();o!=a&&(jy(this,o),qy(this,a,t))},s)),s.j=e}var QA=class{constructor(s,e){this.g=s,this.map=e}};function zy(s){this.l=s||JA,q.PerformanceNavigationTiming?(s=q.performance.getEntriesByType("navigation"),s=0<s.length&&(s[0].nextHopProtocol=="hq"||s[0].nextHopProtocol=="h2")):s=!!(q.g&&q.g.Ka&&q.g.Ka()&&q.g.Ka().ec),this.j=s?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var JA=10;function Hy(s){return s.h?!0:s.g?s.g.size>=s.j:!1}function Gy(s){return s.h?1:s.g?s.g.size:0}function fh(s,e){return s.h?s.h==e:s.g?s.g.has(e):!1}function Oh(s,e){s.g?s.g.add(e):s.h=e}function Ky(s,e){s.h&&s.h==e?s.h=null:s.g&&s.g.has(e)&&s.g.delete(e)}zy.prototype.cancel=function(){if(this.i=Wy(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(let s of this.g.values())s.cancel();this.g.clear()}};function Wy(s){if(s.h!=null)return s.i.concat(s.h.F);if(s.g!=null&&s.g.size!==0){let e=s.i;for(let t of s.g.values())e=e.concat(t.F);return e}return yh(s.i)}var XA=class{stringify(s){return q.JSON.stringify(s,void 0)}parse(s){return q.JSON.parse(s,void 0)}};function YA(){this.g=new XA}function ZA(s,e,t){let o=t||"";try{$y(s,function(a,u){let l=a;Es(a)&&(l=Th(a)),e.push(o+u+"="+encodeURIComponent(l))})}catch(a){throw e.push(o+"type="+encodeURIComponent("_badmap")),a}}function ex(s,e){let t=new ec;if(q.Image){let o=new Image;o.onload=La(Ba,t,o,"TestLoadImage: loaded",!0,e),o.onerror=La(Ba,t,o,"TestLoadImage: error",!1,e),o.onabort=La(Ba,t,o,"TestLoadImage: abort",!1,e),o.ontimeout=La(Ba,t,o,"TestLoadImage: timeout",!1,e),q.setTimeout(function(){o.ontimeout&&o.ontimeout()},1e4),o.src=s}else e(!1)}function Ba(s,e,t,o,a){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,a(o)}catch{}}function xs(s){this.l=s.fc||null,this.j=s.ob||!1}Ce(xs,xh);xs.prototype.g=function(){return new oc(this.l,this.j)};xs.prototype.i=function(s){return function(){return s}}({});function oc(s,e){Re.call(this),this.F=s,this.u=e,this.m=void 0,this.readyState=Nh,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}Ce(oc,Re);var Nh=0;N=oc.prototype;N.open=function(s,e){if(this.readyState!=Nh)throw this.abort(),Error("Error reopening a connection");this.C=s,this.B=e,this.readyState=1,_s(this)};N.send=function(s){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;let e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};s&&(e.body=s),(this.F||q).fetch(new Request(this.B,e)).then(this.$a.bind(this),this.ka.bind(this))};N.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Rs(this)),this.readyState=Nh};N.$a=function(s){if(this.g&&(this.l=s,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=s.headers,this.readyState=2,_s(this)),this.g&&(this.readyState=3,_s(this),this.g)))if(this.responseType==="arraybuffer")s.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(typeof q.ReadableStream!="undefined"&&"body"in s){if(this.j=s.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;Qy(this)}else s.text().then(this.Za.bind(this),this.ka.bind(this))};function Qy(s){s.j.read().then(s.Xa.bind(s)).catch(s.ka.bind(s))}N.Xa=function(s){if(this.g){if(this.u&&s.value)this.response.push(s.value);else if(!this.u){var e=s.value?s.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!s.done}))&&(this.response=this.responseText+=e)}s.done?Rs(this):_s(this),this.readyState==3&&Qy(this)}};N.Za=function(s){this.g&&(this.response=this.responseText=s,Rs(this))};N.Ya=function(s){this.g&&(this.response=s,Rs(this))};N.ka=function(){this.g&&Rs(this)};function Rs(s){s.readyState=4,s.l=null,s.j=null,s.A=null,_s(s)}N.setRequestHeader=function(s,e){this.v.append(s,e)};N.getResponseHeader=function(s){return this.h&&this.h.get(s.toLowerCase())||""};N.getAllResponseHeaders=function(){if(!this.h)return"";let s=[],e=this.h.entries();for(var t=e.next();!t.done;)t=t.value,s.push(t[0]+": "+t[1]),t=e.next();return s.join(`\r
`)};function _s(s){s.onreadystatechange&&s.onreadystatechange.call(s)}Object.defineProperty(oc.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(s){this.m=s?"include":"same-origin"}});var tx=q.JSON.parse;function ge(s){Re.call(this),this.headers=new Map,this.u=s||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=Jy,this.L=this.M=!1}Ce(ge,Re);var Jy="",nx=/^https?$/i,rx=["POST","PUT"];N=ge.prototype;N.Oa=function(s){this.M=s};N.ha=function(s,e,t,o){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+s);e=e?e.toUpperCase():"GET",this.I=s,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():uh.g(),this.C=this.u?sy(this.u):sy(uh),this.g.onreadystatechange=Ve(this.La,this);try{this.G=!0,this.g.open(e,String(s),!0),this.G=!1}catch(u){cy(this,u);return}if(s=t||"",t=new Map(this.headers),o)if(Object.getPrototypeOf(o)===Object.prototype)for(var a in o)t.set(a,o[a]);else if(typeof o.keys=="function"&&typeof o.get=="function")for(let u of o.keys())t.set(u,o.get(u));else throw Error("Unknown input type for opt_headers: "+String(o));o=Array.from(t.keys()).find(u=>u.toLowerCase()=="content-type"),a=q.FormData&&s instanceof q.FormData,!(0<=fy(rx,e))||o||a||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(let[u,l]of t)this.g.setRequestHeader(u,l);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{Zy(this),0<this.B&&((this.L=ix(this.g))?(this.g.timeout=this.B,this.g.ontimeout=Ve(this.ua,this)):this.A=Ah(this.ua,this.B,this)),this.v=!0,this.g.send(s),this.v=!1}catch(u){cy(this,u)}};function ix(s){return Yr&&typeof s.timeout=="number"&&s.ontimeout!==void 0}N.ua=function(){typeof gh!="undefined"&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,Me(this,"timeout"),this.abort(8))};function cy(s,e){s.h=!1,s.g&&(s.l=!0,s.g.abort(),s.l=!1),s.j=e,s.m=5,Xy(s),ac(s)}function Xy(s){s.F||(s.F=!0,Me(s,"complete"),Me(s,"error"))}N.abort=function(s){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=s||7,Me(this,"complete"),Me(this,"abort"),ac(this))};N.N=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),ac(this,!0)),ge.$.N.call(this)};N.La=function(){this.s||(this.G||this.v||this.l?Yy(this):this.kb())};N.kb=function(){Yy(this)};function Yy(s){if(s.h&&typeof gh!="undefined"&&(!s.C[1]||qt(s)!=4||s.da()!=2)){if(s.v&&qt(s)==4)Ah(s.La,0,s);else if(Me(s,"readystatechange"),qt(s)==4){s.h=!1;try{let l=s.da();e:switch(l){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break e;default:e=!1}var t;if(!(t=e)){var o;if(o=l===0){var a=String(s.I).match(By)[1]||null;!a&&q.self&&q.self.location&&(a=q.self.location.protocol.slice(0,-1)),o=!nx.test(a?a.toLowerCase():"")}t=o}if(t)Me(s,"complete"),Me(s,"success");else{s.m=6;try{var u=2<qt(s)?s.g.statusText:""}catch{u=""}s.j=u+" ["+s.da()+"]",Xy(s)}}finally{ac(s)}}}}function ac(s,e){if(s.g){Zy(s);let t=s.g,o=s.C[0]?()=>{}:null;s.g=null,s.C=null,e||Me(s,"ready");try{t.onreadystatechange=o}catch{}}}function Zy(s){s.g&&s.L&&(s.g.ontimeout=null),s.A&&(q.clearTimeout(s.A),s.A=null)}N.isActive=function(){return!!this.g};function qt(s){return s.g?s.g.readyState:0}N.da=function(){try{return 2<qt(this)?this.g.status:-1}catch{return-1}};N.ja=function(){try{return this.g?this.g.responseText:""}catch{return""}};N.Wa=function(s){if(this.g){var e=this.g.responseText;return s&&e.indexOf(s)==0&&(e=e.substring(s.length)),tx(e)}};function uy(s){try{if(!s.g)return null;if("response"in s.g)return s.g.response;switch(s.K){case Jy:case"text":return s.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in s.g)return s.g.mozResponseArrayBuffer}return null}catch{return null}}function sx(s){let e={};s=(s.g&&2<=qt(s)&&s.g.getAllResponseHeaders()||"").split(`\r
`);for(let o=0;o<s.length;o++){if(ps(s[o]))continue;var t=OA(s[o]);let a=t[0];if(t=t[1],typeof t!="string")continue;t=t.trim();let u=e[a]||[];e[a]=u,u.push(t)}AA(e,function(o){return o.join(", ")})}N.Ia=function(){return this.m};N.Sa=function(){return typeof this.j=="string"?this.j:String(this.j)};function ev(s){let e="";return wh(s,function(t,o){e+=o,e+=":",e+=t,e+=`\r
`}),e}function Dh(s,e,t){e:{for(o in t){var o=!1;break e}o=!0}o||(t=ev(t),typeof s=="string"?t!=null&&encodeURIComponent(String(t)):le(s,e,t))}function us(s,e,t){return t&&t.internalChannelParams&&t.internalChannelParams[s]||e}function tv(s){this.Ga=0,this.j=[],this.l=new ec,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=us("failFast",!1,s),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=us("baseRetryDelayMs",5e3,s),this.hb=us("retryDelaySeedMs",1e4,s),this.eb=us("forwardChannelMaxRetries",2,s),this.xa=us("forwardChannelRequestTimeoutMs",2e4,s),this.va=s&&s.xmlHttpFactory||void 0,this.Ha=s&&s.dc||!1,this.L=void 0,this.J=s&&s.supportsCrossDomainXhr||!1,this.K="",this.i=new zy(s&&s.concurrentRequestLimit),this.Ja=new YA,this.P=s&&s.fastHandshake||!1,this.O=s&&s.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=s&&s.bc||!1,s&&s.Ea&&this.l.Ea(),s&&s.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&s&&s.detectBufferingProxy||!1,this.qa=void 0,s&&s.longPollingTimeout&&0<s.longPollingTimeout&&(this.qa=s.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}N=tv.prototype;N.ra=8;N.H=1;function Ph(s){if(nv(s),s.H==3){var e=s.W++,t=gn(s.I);if(le(t,"SID",s.K),le(t,"RID",e),le(t,"TYPE","terminate"),Cs(s,t),e=new ks(s,s.l,e),e.L=2,e.v=sc(gn(t)),t=!1,q.navigator&&q.navigator.sendBeacon)try{t=q.navigator.sendBeacon(e.v.toString(),"")}catch{}!t&&q.Image&&(new Image().src=e.v,t=!0),t||(e.g=lv(e.l,null),e.g.ha(e.v)),e.G=Date.now(),As(e)}cv(s)}function cc(s){s.g&&(Mh(s),s.g.cancel(),s.g=null)}function nv(s){cc(s),s.u&&(q.clearTimeout(s.u),s.u=null),Ha(s),s.i.cancel(),s.m&&(typeof s.m=="number"&&q.clearTimeout(s.m),s.m=null)}function uc(s){if(!Hy(s.i)&&!s.m){s.m=!0;var e=s.Na;gs||Sy(),ys||(gs(),ys=!0),Sh.add(e,s),s.C=0}}function ox(s,e){return Gy(s.i)>=s.i.j-(s.m?1:0)?!1:s.m?(s.j=e.F.concat(s.j),!0):s.H==1||s.H==2||s.C>=(s.cb?0:s.eb)?!1:(s.m=Ts(Ve(s.Na,s,e),av(s,s.C)),s.C++,!0)}N.Na=function(s){if(this.m)if(this.m=null,this.H==1){if(!s){this.W=Math.floor(1e5*Math.random()),s=this.W++;let a=new ks(this,this.l,s),u=this.s;if(this.U&&(u?(u=yy(u),vy(u,this.U)):u=this.U),this.o!==null||this.O||(a.I=u,u=null),this.P)e:{for(var e=0,t=0;t<this.j.length;t++){t:{var o=this.j[t];if("__data__"in o.map&&(o=o.map.__data__,typeof o=="string")){o=o.length;break t}o=void 0}if(o===void 0)break;if(e+=o,4096<e){e=t;break e}if(e===4096||t===this.j.length-1){e=t+1;break e}}e=1e3}else e=1e3;e=rv(this,a,e),t=gn(this.I),le(t,"RID",s),le(t,"CVER",22),this.F&&le(t,"X-HTTP-Session-Id",this.F),Cs(this,t),u&&(this.O?e="headers="+encodeURIComponent(String(ev(u)))+"&"+e:this.o&&Dh(t,this.o,u)),Oh(this.i,a),this.bb&&le(t,"TYPE","init"),this.P?(le(t,"$req",e),le(t,"SID","null"),a.aa=!0,hh(a,t,null)):hh(a,t,e),this.H=2}}else this.H==3&&(s?ly(this,s):this.j.length==0||Hy(this.i)||ly(this))};function ly(s,e){var t;e?t=e.m:t=s.W++;let o=gn(s.I);le(o,"SID",s.K),le(o,"RID",t),le(o,"AID",s.V),Cs(s,o),s.o&&s.s&&Dh(o,s.o,s.s),t=new ks(s,s.l,t,s.C+1),s.o===null&&(t.I=s.s),e&&(s.j=e.F.concat(s.j)),e=rv(s,t,1e3),t.setTimeout(Math.round(.5*s.xa)+Math.round(.5*s.xa*Math.random())),Oh(s.i,t),hh(t,o,e)}function Cs(s,e){s.na&&wh(s.na,function(t,o){le(e,o,t)}),s.h&&$y({},function(t,o){le(e,o,t)})}function rv(s,e,t){t=Math.min(s.j.length,t);var o=s.h?Ve(s.h.Va,s.h,s):null;e:{var a=s.j;let u=-1;for(;;){let l=["count="+t];u==-1?0<t?(u=a[0].g,l.push("ofs="+u)):u=0:l.push("ofs="+u);let h=!0;for(let d=0;d<t;d++){let f=a[d].g,p=a[d].map;if(f-=u,0>f)u=Math.max(0,a[d].g-100),h=!1;else try{ZA(p,l,"req"+f+"_")}catch{o&&o(p)}}if(h){o=l.join("&");break e}}}return s=s.j.splice(0,t),e.F=s,o}function iv(s){if(!s.g&&!s.u){s.ba=1;var e=s.Ma;gs||Sy(),ys||(gs(),ys=!0),Sh.add(e,s),s.A=0}}function Lh(s){return s.g||s.u||3<=s.A?!1:(s.ba++,s.u=Ts(Ve(s.Ma,s),av(s,s.A)),s.A++,!0)}N.Ma=function(){if(this.u=null,sv(this),this.ca&&!(this.M||this.g==null||0>=this.S)){var s=2*this.S;this.l.info("BP detection timer enabled: "+s),this.B=Ts(Ve(this.jb,this),s)}};N.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,We(10),cc(this),sv(this))};function Mh(s){s.B!=null&&(q.clearTimeout(s.B),s.B=null)}function sv(s){s.g=new ks(s,s.l,"rpc",s.ba),s.o===null&&(s.g.I=s.s),s.g.O=0;var e=gn(s.wa);le(e,"RID","rpc"),le(e,"SID",s.K),le(e,"AID",s.V),le(e,"CI",s.G?"0":"1"),!s.G&&s.qa&&le(e,"TO",s.qa),le(e,"TYPE","xmlhttp"),Cs(s,e),s.o&&s.s&&Dh(e,s.o,s.s),s.L&&s.g.setTimeout(s.L);var t=s.g;s=s.pa,t.L=1,t.v=sc(gn(e)),t.s=null,t.S=!0,Ly(t,s)}N.ib=function(){this.v!=null&&(this.v=null,cc(this),Lh(this),We(19))};function Ha(s){s.v!=null&&(q.clearTimeout(s.v),s.v=null)}function ov(s,e){var t=null;if(s.g==e){Ha(s),Mh(s),s.g=null;var o=2}else if(fh(s.i,e))t=e.F,Ky(s.i,e),o=1;else return;if(s.H!=0){if(e.i)if(o==1){t=e.s?e.s.length:0,e=Date.now()-e.G;var a=s.C;o=tc(),Me(o,new Oy(o,t)),uc(s)}else iv(s);else if(a=e.o,a==3||a==0&&0<e.ca||!(o==1&&ox(s,e)||o==2&&Lh(s)))switch(t&&0<t.length&&(e=s.i,e.i=e.i.concat(t)),a){case 1:mr(s,5);break;case 4:mr(s,10);break;case 3:mr(s,6);break;default:mr(s,2)}}}function av(s,e){let t=s.ab+Math.floor(Math.random()*s.hb);return s.isActive()||(t*=2),t*e}function mr(s,e){if(s.l.info("Error code "+e),e==2){var t=null;s.h&&(t=null);var o=Ve(s.pb,s);t||(t=new gr("//www.google.com/images/cleardot.gif"),q.location&&q.location.protocol=="http"||qa(t,"https"),sc(t)),ex(t.toString(),o)}else We(2);s.H=0,s.h&&s.h.za(e),cv(s),nv(s)}N.pb=function(s){s?(this.l.info("Successfully pinged google.com"),We(2)):(this.l.info("Failed to ping google.com"),We(1))};function cv(s){if(s.H=0,s.ma=[],s.h){let e=Wy(s.i);(e.length!=0||s.j.length!=0)&&(ty(s.ma,e),ty(s.ma,s.j),s.i.i.length=0,yh(s.j),s.j.length=0),s.h.ya()}}function uv(s,e,t){var o=t instanceof gr?gn(t):new gr(t);if(o.g!="")e&&(o.g=e+"."+o.g),za(o,o.m);else{var a=q.location;o=a.protocol,e=e?e+"."+a.hostname:a.hostname,a=+a.port;var u=new gr(null);o&&qa(u,o),e&&(u.g=e),a&&za(u,a),t&&(u.l=t),o=u}return t=s.F,e=s.Da,t&&e&&le(o,t,e),le(o,"VER",s.ra),Cs(s,o),o}function lv(s,e,t){if(e&&!s.J)throw Error("Can't create secondary domain capable XhrIo object.");return e=t&&s.Ha&&!s.va?new ge(new xs({ob:!0})):new ge(s.va),e.Oa(s.J),e}N.isActive=function(){return!!this.h&&this.h.isActive(this)};function hv(){}N=hv.prototype;N.Ba=function(){};N.Aa=function(){};N.za=function(){};N.ya=function(){};N.isActive=function(){return!0};N.Va=function(){};function Ga(){if(Yr&&!(10<=Number(IA)))throw Error("Environmental error: no available transport.")}Ga.prototype.g=function(s,e){return new ct(s,e)};function ct(s,e){Re.call(this),this.g=new tv(e),this.l=s,this.h=e&&e.messageUrlParams||null,s=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(s?s["X-Client-Protocol"]="webchannel":s={"X-Client-Protocol":"webchannel"}),this.g.s=s,s=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(s?s["X-WebChannel-Content-Type"]=e.messageContentType:s={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.Ca&&(s?s["X-WebChannel-Client-Profile"]=e.Ca:s={"X-WebChannel-Client-Profile":e.Ca}),this.g.U=s,(s=e&&e.cc)&&!ps(s)&&(this.g.o=s),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!ps(e)&&(this.g.F=e,s=this.h,s!==null&&e in s&&(s=this.h,e in s&&delete s[e])),this.j=new ei(this)}Ce(ct,Re);ct.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var s=this.g,e=this.l,t=this.h||void 0;We(0),s.Y=e,s.na=t||{},s.G=s.aa,s.I=uv(s,null,s.Y),uc(s)};ct.prototype.close=function(){Ph(this.g)};ct.prototype.u=function(s){var e=this.g;if(typeof s=="string"){var t={};t.__data__=s,s=t}else this.v&&(t={},t.__data__=Th(s),s=t);e.j.push(new QA(e.fb++,s)),e.H==3&&uc(e)};ct.prototype.N=function(){this.g.h=null,delete this.j,Ph(this.g),delete this.g,ct.$.N.call(this)};function dv(s){Rh.call(this),s.__headers__&&(this.headers=s.__headers__,this.statusCode=s.__status__,delete s.__headers__,delete s.__status__);var e=s.__sm__;if(e){e:{for(let t in e){s=t;break e}s=void 0}(this.i=s)&&(s=this.i,e=e!==null&&s in e?e[s]:void 0),this.data=e}else this.data=s}Ce(dv,Rh);function fv(){Ch.call(this),this.status=1}Ce(fv,Ch);function ei(s){this.g=s}Ce(ei,hv);ei.prototype.Ba=function(){Me(this.g,"a")};ei.prototype.Aa=function(s){Me(this.g,new dv(s))};ei.prototype.za=function(s){Me(this.g,new fv)};ei.prototype.ya=function(){Me(this.g,"b")};function ax(){this.blockSize=-1}function Rt(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}Ce(Rt,ax);Rt.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0};function Zl(s,e,t){t||(t=0);var o=Array(16);if(typeof e=="string")for(var a=0;16>a;++a)o[a]=e.charCodeAt(t++)|e.charCodeAt(t++)<<8|e.charCodeAt(t++)<<16|e.charCodeAt(t++)<<24;else for(a=0;16>a;++a)o[a]=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;e=s.g[0],t=s.g[1],a=s.g[2];var u=s.g[3],l=e+(u^t&(a^u))+o[0]+3614090360&4294967295;e=t+(l<<7&4294967295|l>>>25),l=u+(a^e&(t^a))+o[1]+3905402710&4294967295,u=e+(l<<12&4294967295|l>>>20),l=a+(t^u&(e^t))+o[2]+606105819&4294967295,a=u+(l<<17&4294967295|l>>>15),l=t+(e^a&(u^e))+o[3]+3250441966&4294967295,t=a+(l<<22&4294967295|l>>>10),l=e+(u^t&(a^u))+o[4]+4118548399&4294967295,e=t+(l<<7&4294967295|l>>>25),l=u+(a^e&(t^a))+o[5]+1200080426&4294967295,u=e+(l<<12&4294967295|l>>>20),l=a+(t^u&(e^t))+o[6]+2821735955&4294967295,a=u+(l<<17&4294967295|l>>>15),l=t+(e^a&(u^e))+o[7]+4249261313&4294967295,t=a+(l<<22&4294967295|l>>>10),l=e+(u^t&(a^u))+o[8]+1770035416&4294967295,e=t+(l<<7&4294967295|l>>>25),l=u+(a^e&(t^a))+o[9]+2336552879&4294967295,u=e+(l<<12&4294967295|l>>>20),l=a+(t^u&(e^t))+o[10]+4294925233&4294967295,a=u+(l<<17&4294967295|l>>>15),l=t+(e^a&(u^e))+o[11]+2304563134&4294967295,t=a+(l<<22&4294967295|l>>>10),l=e+(u^t&(a^u))+o[12]+1804603682&4294967295,e=t+(l<<7&4294967295|l>>>25),l=u+(a^e&(t^a))+o[13]+4254626195&4294967295,u=e+(l<<12&4294967295|l>>>20),l=a+(t^u&(e^t))+o[14]+2792965006&4294967295,a=u+(l<<17&4294967295|l>>>15),l=t+(e^a&(u^e))+o[15]+1236535329&4294967295,t=a+(l<<22&4294967295|l>>>10),l=e+(a^u&(t^a))+o[1]+4129170786&4294967295,e=t+(l<<5&4294967295|l>>>27),l=u+(t^a&(e^t))+o[6]+3225465664&4294967295,u=e+(l<<9&4294967295|l>>>23),l=a+(e^t&(u^e))+o[11]+643717713&4294967295,a=u+(l<<14&4294967295|l>>>18),l=t+(u^e&(a^u))+o[0]+3921069994&4294967295,t=a+(l<<20&4294967295|l>>>12),l=e+(a^u&(t^a))+o[5]+3593408605&4294967295,e=t+(l<<5&4294967295|l>>>27),l=u+(t^a&(e^t))+o[10]+38016083&4294967295,u=e+(l<<9&4294967295|l>>>23),l=a+(e^t&(u^e))+o[15]+3634488961&4294967295,a=u+(l<<14&4294967295|l>>>18),l=t+(u^e&(a^u))+o[4]+3889429448&4294967295,t=a+(l<<20&4294967295|l>>>12),l=e+(a^u&(t^a))+o[9]+568446438&4294967295,e=t+(l<<5&4294967295|l>>>27),l=u+(t^a&(e^t))+o[14]+3275163606&4294967295,u=e+(l<<9&4294967295|l>>>23),l=a+(e^t&(u^e))+o[3]+4107603335&4294967295,a=u+(l<<14&4294967295|l>>>18),l=t+(u^e&(a^u))+o[8]+1163531501&4294967295,t=a+(l<<20&4294967295|l>>>12),l=e+(a^u&(t^a))+o[13]+2850285829&4294967295,e=t+(l<<5&4294967295|l>>>27),l=u+(t^a&(e^t))+o[2]+4243563512&4294967295,u=e+(l<<9&4294967295|l>>>23),l=a+(e^t&(u^e))+o[7]+1735328473&4294967295,a=u+(l<<14&4294967295|l>>>18),l=t+(u^e&(a^u))+o[12]+2368359562&4294967295,t=a+(l<<20&4294967295|l>>>12),l=e+(t^a^u)+o[5]+4294588738&4294967295,e=t+(l<<4&4294967295|l>>>28),l=u+(e^t^a)+o[8]+2272392833&4294967295,u=e+(l<<11&4294967295|l>>>21),l=a+(u^e^t)+o[11]+1839030562&4294967295,a=u+(l<<16&4294967295|l>>>16),l=t+(a^u^e)+o[14]+4259657740&4294967295,t=a+(l<<23&4294967295|l>>>9),l=e+(t^a^u)+o[1]+2763975236&4294967295,e=t+(l<<4&4294967295|l>>>28),l=u+(e^t^a)+o[4]+1272893353&4294967295,u=e+(l<<11&4294967295|l>>>21),l=a+(u^e^t)+o[7]+4139469664&4294967295,a=u+(l<<16&4294967295|l>>>16),l=t+(a^u^e)+o[10]+3200236656&4294967295,t=a+(l<<23&4294967295|l>>>9),l=e+(t^a^u)+o[13]+681279174&4294967295,e=t+(l<<4&4294967295|l>>>28),l=u+(e^t^a)+o[0]+3936430074&4294967295,u=e+(l<<11&4294967295|l>>>21),l=a+(u^e^t)+o[3]+3572445317&4294967295,a=u+(l<<16&4294967295|l>>>16),l=t+(a^u^e)+o[6]+76029189&4294967295,t=a+(l<<23&4294967295|l>>>9),l=e+(t^a^u)+o[9]+3654602809&4294967295,e=t+(l<<4&4294967295|l>>>28),l=u+(e^t^a)+o[12]+3873151461&4294967295,u=e+(l<<11&4294967295|l>>>21),l=a+(u^e^t)+o[15]+530742520&4294967295,a=u+(l<<16&4294967295|l>>>16),l=t+(a^u^e)+o[2]+3299628645&4294967295,t=a+(l<<23&4294967295|l>>>9),l=e+(a^(t|~u))+o[0]+4096336452&4294967295,e=t+(l<<6&4294967295|l>>>26),l=u+(t^(e|~a))+o[7]+1126891415&4294967295,u=e+(l<<10&4294967295|l>>>22),l=a+(e^(u|~t))+o[14]+2878612391&4294967295,a=u+(l<<15&4294967295|l>>>17),l=t+(u^(a|~e))+o[5]+4237533241&4294967295,t=a+(l<<21&4294967295|l>>>11),l=e+(a^(t|~u))+o[12]+1700485571&4294967295,e=t+(l<<6&4294967295|l>>>26),l=u+(t^(e|~a))+o[3]+2399980690&4294967295,u=e+(l<<10&4294967295|l>>>22),l=a+(e^(u|~t))+o[10]+4293915773&4294967295,a=u+(l<<15&4294967295|l>>>17),l=t+(u^(a|~e))+o[1]+2240044497&4294967295,t=a+(l<<21&4294967295|l>>>11),l=e+(a^(t|~u))+o[8]+1873313359&4294967295,e=t+(l<<6&4294967295|l>>>26),l=u+(t^(e|~a))+o[15]+4264355552&4294967295,u=e+(l<<10&4294967295|l>>>22),l=a+(e^(u|~t))+o[6]+2734768916&4294967295,a=u+(l<<15&4294967295|l>>>17),l=t+(u^(a|~e))+o[13]+1309151649&4294967295,t=a+(l<<21&4294967295|l>>>11),l=e+(a^(t|~u))+o[4]+4149444226&4294967295,e=t+(l<<6&4294967295|l>>>26),l=u+(t^(e|~a))+o[11]+3174756917&4294967295,u=e+(l<<10&4294967295|l>>>22),l=a+(e^(u|~t))+o[2]+718787259&4294967295,a=u+(l<<15&4294967295|l>>>17),l=t+(u^(a|~e))+o[9]+3951481745&4294967295,s.g[0]=s.g[0]+e&4294967295,s.g[1]=s.g[1]+(a+(l<<21&4294967295|l>>>11))&4294967295,s.g[2]=s.g[2]+a&4294967295,s.g[3]=s.g[3]+u&4294967295}Rt.prototype.j=function(s,e){e===void 0&&(e=s.length);for(var t=e-this.blockSize,o=this.m,a=this.h,u=0;u<e;){if(a==0)for(;u<=t;)Zl(this,s,u),u+=this.blockSize;if(typeof s=="string"){for(;u<e;)if(o[a++]=s.charCodeAt(u++),a==this.blockSize){Zl(this,o),a=0;break}}else for(;u<e;)if(o[a++]=s[u++],a==this.blockSize){Zl(this,o),a=0;break}}this.h=a,this.i+=e};Rt.prototype.l=function(){var s=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);s[0]=128;for(var e=1;e<s.length-8;++e)s[e]=0;var t=8*this.i;for(e=s.length-8;e<s.length;++e)s[e]=t&255,t/=256;for(this.j(s),s=Array(16),e=t=0;4>e;++e)for(var o=0;32>o;o+=8)s[t++]=this.g[e]>>>o&255;return s};function ie(s,e){this.h=e;for(var t=[],o=!0,a=s.length-1;0<=a;a--){var u=s[a]|0;o&&u==e||(t[a]=u,o=!1)}this.g=t}var cx={};function Uh(s){return-128<=s&&128>s?bA(s,function(e){return new ie([e|0],0>e?-1:0)}):new ie([s|0],0>s?-1:0)}function zt(s){if(isNaN(s)||!isFinite(s))return Xr;if(0>s)return Le(zt(-s));for(var e=[],t=1,o=0;s>=t;o++)e[o]=s/t|0,t*=ph;return new ie(e,0)}function pv(s,e){if(s.length==0)throw Error("number format error: empty string");if(e=e||10,2>e||36<e)throw Error("radix out of range: "+e);if(s.charAt(0)=="-")return Le(pv(s.substring(1),e));if(0<=s.indexOf("-"))throw Error('number format error: interior "-" character');for(var t=zt(Math.pow(e,8)),o=Xr,a=0;a<s.length;a+=8){var u=Math.min(8,s.length-a),l=parseInt(s.substring(a,a+u),e);8>u?(u=zt(Math.pow(e,u)),o=o.R(u).add(zt(l))):(o=o.R(t),o=o.add(zt(l)))}return o}var ph=4294967296,Xr=Uh(0),mh=Uh(1),hy=Uh(16777216);N=ie.prototype;N.ea=function(){if(wt(this))return-Le(this).ea();for(var s=0,e=1,t=0;t<this.g.length;t++){var o=this.D(t);s+=(0<=o?o:ph+o)*e,e*=ph}return s};N.toString=function(s){if(s=s||10,2>s||36<s)throw Error("radix out of range: "+s);if(mn(this))return"0";if(wt(this))return"-"+Le(this).toString(s);for(var e=zt(Math.pow(s,6)),t=this,o="";;){var a=Wa(t,e).g;t=Ka(t,a.R(e));var u=((0<t.g.length?t.g[0]:t.h)>>>0).toString(s);if(t=a,mn(t))return u+o;for(;6>u.length;)u="0"+u;o=u+o}};N.D=function(s){return 0>s?0:s<this.g.length?this.g[s]:this.h};function mn(s){if(s.h!=0)return!1;for(var e=0;e<s.g.length;e++)if(s.g[e]!=0)return!1;return!0}function wt(s){return s.h==-1}N.X=function(s){return s=Ka(this,s),wt(s)?-1:mn(s)?0:1};function Le(s){for(var e=s.g.length,t=[],o=0;o<e;o++)t[o]=~s.g[o];return new ie(t,~s.h).add(mh)}N.abs=function(){return wt(this)?Le(this):this};N.add=function(s){for(var e=Math.max(this.g.length,s.g.length),t=[],o=0,a=0;a<=e;a++){var u=o+(this.D(a)&65535)+(s.D(a)&65535),l=(u>>>16)+(this.D(a)>>>16)+(s.D(a)>>>16);o=l>>>16,u&=65535,l&=65535,t[a]=l<<16|u}return new ie(t,t[t.length-1]&-2147483648?-1:0)};function Ka(s,e){return s.add(Le(e))}N.R=function(s){if(mn(this)||mn(s))return Xr;if(wt(this))return wt(s)?Le(this).R(Le(s)):Le(Le(this).R(s));if(wt(s))return Le(this.R(Le(s)));if(0>this.X(hy)&&0>s.X(hy))return zt(this.ea()*s.ea());for(var e=this.g.length+s.g.length,t=[],o=0;o<2*e;o++)t[o]=0;for(o=0;o<this.g.length;o++)for(var a=0;a<s.g.length;a++){var u=this.D(o)>>>16,l=this.D(o)&65535,h=s.D(a)>>>16,d=s.D(a)&65535;t[2*o+2*a]+=l*d,ja(t,2*o+2*a),t[2*o+2*a+1]+=u*d,ja(t,2*o+2*a+1),t[2*o+2*a+1]+=l*h,ja(t,2*o+2*a+1),t[2*o+2*a+2]+=u*h,ja(t,2*o+2*a+2)}for(o=0;o<e;o++)t[o]=t[2*o+1]<<16|t[2*o];for(o=e;o<2*e;o++)t[o]=0;return new ie(t,0)};function ja(s,e){for(;(s[e]&65535)!=s[e];)s[e+1]+=s[e]>>>16,s[e]&=65535,e++}function ls(s,e){this.g=s,this.h=e}function Wa(s,e){if(mn(e))throw Error("division by zero");if(mn(s))return new ls(Xr,Xr);if(wt(s))return e=Wa(Le(s),e),new ls(Le(e.g),Le(e.h));if(wt(e))return e=Wa(s,Le(e)),new ls(Le(e.g),e.h);if(30<s.g.length){if(wt(s)||wt(e))throw Error("slowDivide_ only works with positive integers.");for(var t=mh,o=e;0>=o.X(s);)t=dy(t),o=dy(o);var a=Qr(t,1),u=Qr(o,1);for(o=Qr(o,2),t=Qr(t,2);!mn(o);){var l=u.add(o);0>=l.X(s)&&(a=a.add(t),u=l),o=Qr(o,1),t=Qr(t,1)}return e=Ka(s,a.R(e)),new ls(a,e)}for(a=Xr;0<=s.X(e);){for(t=Math.max(1,Math.floor(s.ea()/e.ea())),o=Math.ceil(Math.log(t)/Math.LN2),o=48>=o?1:Math.pow(2,o-48),u=zt(t),l=u.R(e);wt(l)||0<l.X(s);)t-=o,u=zt(t),l=u.R(e);mn(u)&&(u=mh),a=a.add(u),s=Ka(s,l)}return new ls(a,s)}N.gb=function(s){return Wa(this,s).h};N.and=function(s){for(var e=Math.max(this.g.length,s.g.length),t=[],o=0;o<e;o++)t[o]=this.D(o)&s.D(o);return new ie(t,this.h&s.h)};N.or=function(s){for(var e=Math.max(this.g.length,s.g.length),t=[],o=0;o<e;o++)t[o]=this.D(o)|s.D(o);return new ie(t,this.h|s.h)};N.xor=function(s){for(var e=Math.max(this.g.length,s.g.length),t=[],o=0;o<e;o++)t[o]=this.D(o)^s.D(o);return new ie(t,this.h^s.h)};function dy(s){for(var e=s.g.length+1,t=[],o=0;o<e;o++)t[o]=s.D(o)<<1|s.D(o-1)>>>31;return new ie(t,s.h)}function Qr(s,e){var t=e>>5;e%=32;for(var o=s.g.length-t,a=[],u=0;u<o;u++)a[u]=0<e?s.D(u+t)>>>e|s.D(u+t+1)<<32-e:s.D(u+t);return new ie(a,s.h)}Ga.prototype.createWebChannel=Ga.prototype.g;ct.prototype.send=ct.prototype.u;ct.prototype.open=ct.prototype.m;ct.prototype.close=ct.prototype.close;nc.NO_ERROR=0;nc.TIMEOUT=8;nc.HTTP_ERROR=6;Ny.COMPLETE="complete";Dy.EventType=Ss;Ss.OPEN="a";Ss.CLOSE="b";Ss.ERROR="c";Ss.MESSAGE="d";Re.prototype.listen=Re.prototype.O;ge.prototype.listenOnce=ge.prototype.P;ge.prototype.getLastError=ge.prototype.Sa;ge.prototype.getLastErrorCode=ge.prototype.Ia;ge.prototype.getStatus=ge.prototype.da;ge.prototype.getResponseJson=ge.prototype.Wa;ge.prototype.getResponseText=ge.prototype.ja;ge.prototype.send=ge.prototype.ha;ge.prototype.setWithCredentials=ge.prototype.Oa;Rt.prototype.digest=Rt.prototype.l;Rt.prototype.reset=Rt.prototype.reset;Rt.prototype.update=Rt.prototype.j;ie.prototype.add=ie.prototype.add;ie.prototype.multiply=ie.prototype.R;ie.prototype.modulo=ie.prototype.gb;ie.prototype.compare=ie.prototype.X;ie.prototype.toNumber=ie.prototype.ea;ie.prototype.toString=ie.prototype.toString;ie.prototype.getBits=ie.prototype.D;ie.fromNumber=zt;ie.fromString=pv;var mv=Ct.createWebChannelTransport=function(){return new Ga},gv=Ct.getStatEventTarget=function(){return tc()},lc=Ct.ErrorCode=nc,yv=Ct.EventType=Ny,vv=Ct.Event=yr,Fh=Ct.Stat={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},wv=Ct.FetchXmlHttpFactory=xs,Os=Ct.WebChannel=Dy,bv=Ct.XhrIo=ge,_v=Ct.Md5=Rt,vr=Ct.Integer=ie;var Ev="@firebase/firestore";var Oe=class{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}};Oe.UNAUTHENTICATED=new Oe(null),Oe.GOOGLE_CREDENTIALS=new Oe("google-credentials-uid"),Oe.FIRST_PARTY=new Oe("first-party-uid"),Oe.MOCK_USER=new Oe("mock-user");var wi="9.23.0";var Er=new xn("@firebase/firestore");function Iv(){return Er.logLevel}function U(s,...e){if(Er.logLevel<=Y.DEBUG){let t=e.map(Ef);Er.debug(`Firestore (${wi}): ${s}`,...t)}}function vn(s,...e){if(Er.logLevel<=Y.ERROR){let t=e.map(Ef);Er.error(`Firestore (${wi}): ${s}`,...t)}}function ai(s,...e){if(Er.logLevel<=Y.WARN){let t=e.map(Ef);Er.warn(`Firestore (${wi}): ${s}`,...t)}}function Ef(s){if(typeof s=="string")return s;try{return e=s,JSON.stringify(e)}catch{return s}var e}function j(s="Unexpected state"){let e=`FIRESTORE (${wi}) INTERNAL ASSERTION FAILED: `+s;throw vn(e),new Error(e)}function he(s,e){s||j()}function G(s,e){return s}var S={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},D=class extends Ke{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}};var Ot=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};var gc=class{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}},qh=class{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Oe.UNAUTHENTICATED))}shutdown(){}},zh=class{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}},Hh=class{constructor(e){this.t=e,this.currentUser=Oe.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){let o=this.i,a=d=>this.i!==o?(o=this.i,t(d)):Promise.resolve(),u=new Ot;this.o=()=>{this.i++,this.currentUser=this.u(),u.resolve(),u=new Ot,e.enqueueRetryable(()=>a(this.currentUser))};let l=()=>{let d=u;e.enqueueRetryable(async()=>{await d.promise,await a(this.currentUser)})},h=d=>{U("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=d,this.auth.addAuthTokenListener(this.o),l()};this.t.onInit(d=>h(d)),setTimeout(()=>{if(!this.auth){let d=this.t.getImmediate({optional:!0});d?h(d):(U("FirebaseAuthCredentialsProvider","Auth not yet detected"),u.resolve(),u=new Ot)}},0),l()}getToken(){let e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(o=>this.i!==e?(U("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):o?(he(typeof o.accessToken=="string"),new gc(o.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){let e=this.auth&&this.auth.getUid();return he(e===null||typeof e=="string"),new Oe(e)}},Gh=class{constructor(e,t,o){this.h=e,this.l=t,this.m=o,this.type="FirstParty",this.user=Oe.FIRST_PARTY,this.g=new Map}p(){return this.m?this.m():null}get headers(){this.g.set("X-Goog-AuthUser",this.h);let e=this.p();return e&&this.g.set("Authorization",e),this.l&&this.g.set("X-Goog-Iam-Authorization-Token",this.l),this.g}},Kh=class{constructor(e,t,o){this.h=e,this.l=t,this.m=o}getToken(){return Promise.resolve(new Gh(this.h,this.l,this.m))}start(e,t){e.enqueueRetryable(()=>t(Oe.FIRST_PARTY))}shutdown(){}invalidateToken(){}},Wh=class{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}},Qh=class{constructor(e){this.I=e,this.forceRefresh=!1,this.appCheck=null,this.T=null}start(e,t){let o=u=>{u.error!=null&&U("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${u.error.message}`);let l=u.token!==this.T;return this.T=u.token,U("FirebaseAppCheckTokenProvider",`Received ${l?"new":"existing"} token.`),l?t(u.token):Promise.resolve()};this.o=u=>{e.enqueueRetryable(()=>o(u))};let a=u=>{U("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=u,this.appCheck.addTokenListener(this.o)};this.I.onInit(u=>a(u)),setTimeout(()=>{if(!this.appCheck){let u=this.I.getImmediate({optional:!0});u?a(u):U("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(he(typeof t.token=="string"),this.T=t.token,new Wh(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}};function ux(s){let e=typeof self!="undefined"&&(self.crypto||self.msCrypto),t=new Uint8Array(s);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let o=0;o<s;o++)t[o]=Math.floor(256*Math.random());return t}var yc=class{static A(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length,o="";for(;o.length<20;){let a=ux(40);for(let u=0;u<a.length;++u)o.length<20&&a[u]<t&&(o+=e.charAt(a[u]%e.length))}return o}};function ne(s,e){return s<e?-1:s>e?1:0}function ci(s,e,t){return s.length===e.length&&s.every((o,a)=>t(o,e[a]))}var Ue=class s{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new D(S.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new D(S.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new D(S.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new D(S.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return s.fromMillis(Date.now())}static fromDate(e){return s.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3),o=Math.floor(1e6*(e-1e3*t));return new s(t,o)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?ne(this.nanoseconds,e.nanoseconds):ne(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){let e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}};var H=class s{constructor(e){this.timestamp=e}static fromTimestamp(e){return new s(e)}static min(){return new s(new Ue(0,0))}static max(){return new s(new Ue(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}};var vc=class s{constructor(e,t,o){t===void 0?t=0:t>e.length&&j(),o===void 0?o=e.length-t:o>e.length-t&&j(),this.segments=e,this.offset=t,this.len=o}get length(){return this.len}isEqual(e){return s.comparator(this,e)===0}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof s?e.forEach(o=>{t.push(o)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,o=this.limit();t<o;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){let o=Math.min(e.length,t.length);for(let a=0;a<o;a++){let u=e.get(a),l=t.get(a);if(u<l)return-1;if(u>l)return 1}return e.length<t.length?-1:e.length>t.length?1:0}},pe=class s extends vc{construct(e,t,o){return new s(e,t,o)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){let t=[];for(let o of e){if(o.indexOf("//")>=0)throw new D(S.INVALID_ARGUMENT,`Invalid segment (${o}). Paths must not contain // in them.`);t.push(...o.split("/").filter(a=>a.length>0))}return new s(t)}static emptyPath(){return new s([])}},lx=/^[_a-zA-Z][_a-zA-Z0-9]*$/,Et=class s extends vc{construct(e,t,o){return new s(e,t,o)}static isValidIdentifier(e){return lx.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),s.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new s(["__name__"])}static fromServerFormat(e){let t=[],o="",a=0,u=()=>{if(o.length===0)throw new D(S.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(o),o=""},l=!1;for(;a<e.length;){let h=e[a];if(h==="\\"){if(a+1===e.length)throw new D(S.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let d=e[a+1];if(d!=="\\"&&d!=="."&&d!=="`")throw new D(S.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);o+=d,a+=2}else h==="`"?(l=!l,a++):h!=="."||l?(o+=h,a++):(u(),a++)}if(u(),l)throw new D(S.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new s(t)}static emptyPath(){return new s([])}};var B=class s{constructor(e){this.path=e}static fromPath(e){return new s(pe.fromString(e))}static fromName(e){return new s(pe.fromString(e).popFirst(5))}static empty(){return new s(pe.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&pe.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,t){return pe.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new s(new pe(e.slice()))}};var Jh=class{constructor(e,t,o,a){this.indexId=e,this.collectionGroup=t,this.fields=o,this.indexState=a}};Jh.UNKNOWN_ID=-1;function hx(s,e){let t=s.toTimestamp().seconds,o=s.toTimestamp().nanoseconds+1,a=H.fromTimestamp(o===1e9?new Ue(t+1,0):new Ue(t,o));return new Ir(a,B.empty(),e)}function dx(s){return new Ir(s.readTime,s.key,-1)}var Ir=class s{constructor(e,t,o){this.readTime=e,this.documentKey=t,this.largestBatchId=o}static min(){return new s(H.min(),B.empty(),-1)}static max(){return new s(H.max(),B.empty(),-1)}};function fx(s,e){let t=s.readTime.compareTo(e.readTime);return t!==0?t:(t=B.comparator(s.documentKey,e.documentKey),t!==0?t:ne(s.largestBatchId,e.largestBatchId))}var px="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",Xh=class{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}};async function Zs(s){if(s.code!==S.FAILED_PRECONDITION||s.message!==px)throw s;U("LocalStore","Unexpectedly lost primary lease")}var O=class s{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&j(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new s((o,a)=>{this.nextCallback=u=>{this.wrapSuccess(e,u).next(o,a)},this.catchCallback=u=>{this.wrapFailure(t,u).next(o,a)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{let t=e();return t instanceof s?t:s.resolve(t)}catch(t){return s.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):s.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):s.reject(t)}static resolve(e){return new s((t,o)=>{t(e)})}static reject(e){return new s((t,o)=>{o(e)})}static waitFor(e){return new s((t,o)=>{let a=0,u=0,l=!1;e.forEach(h=>{++a,h.next(()=>{++u,l&&u===a&&t()},d=>o(d))}),l=!0,u===a&&t()})}static or(e){let t=s.resolve(!1);for(let o of e)t=t.next(a=>a?s.resolve(a):o());return t}static forEach(e,t){let o=[];return e.forEach((a,u)=>{o.push(t.call(this,a,u))}),this.waitFor(o)}static mapArray(e,t){return new s((o,a)=>{let u=e.length,l=new Array(u),h=0;for(let d=0;d<u;d++){let f=d;t(e[f]).next(p=>{l[f]=p,++h,h===u&&o(l)},p=>a(p))}})}static doWhile(e,t){return new s((o,a)=>{let u=()=>{e()===!0?t().next(()=>{u()},a):o()};u()})}};function eo(s){return s.name==="IndexedDbTransactionError"}var Ms=class{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=o=>this.ot(o),this.ut=o=>t.writeSequenceNumber(o))}ot(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this.ut&&this.ut(e),e}};Ms.ct=-1;function Qc(s){return s==null}function Us(s){return s===0&&1/s==-1/0}function mx(s){return typeof s=="number"&&Number.isInteger(s)&&!Us(s)&&s<=Number.MAX_SAFE_INTEGER&&s>=Number.MIN_SAFE_INTEGER}var gx=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],fL=[...gx,"documentOverlays"],yx=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],vx=yx,pL=[...vx,"indexConfiguration","indexState","indexEntries"];function Tv(s){let e=0;for(let t in s)Object.prototype.hasOwnProperty.call(s,t)&&e++;return e}function xr(s,e){for(let t in s)Object.prototype.hasOwnProperty.call(s,t)&&e(t,s[t])}function Zv(s){for(let e in s)if(Object.prototype.hasOwnProperty.call(s,e))return!1;return!0}var ve=class s{constructor(e,t){this.comparator=e,this.root=t||Gt.EMPTY}insert(e,t){return new s(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Gt.BLACK,null,null))}remove(e){return new s(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Gt.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){let o=this.comparator(e,t.key);if(o===0)return t.value;o<0?t=t.left:o>0&&(t=t.right)}return null}indexOf(e){let t=0,o=this.root;for(;!o.isEmpty();){let a=this.comparator(e,o.key);if(a===0)return t+o.left.size;a<0?o=o.left:(t+=o.left.size+1,o=o.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,o)=>(e(t,o),!1))}toString(){let e=[];return this.inorderTraversal((t,o)=>(e.push(`${t}:${o}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new ri(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new ri(this.root,e,this.comparator,!1)}getReverseIterator(){return new ri(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new ri(this.root,e,this.comparator,!0)}},ri=class{constructor(e,t,o,a){this.isReverse=a,this.nodeStack=[];let u=1;for(;!e.isEmpty();)if(u=t?o(e.key,t):1,t&&a&&(u*=-1),u<0)e=this.isReverse?e.left:e.right;else{if(u===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;let e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}},Gt=class s{constructor(e,t,o,a,u){this.key=e,this.value=t,this.color=o!=null?o:s.RED,this.left=a!=null?a:s.EMPTY,this.right=u!=null?u:s.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,o,a,u){return new s(e!=null?e:this.key,t!=null?t:this.value,o!=null?o:this.color,a!=null?a:this.left,u!=null?u:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,o){let a=this,u=o(e,a.key);return a=u<0?a.copy(null,null,null,a.left.insert(e,t,o),null):u===0?a.copy(null,t,null,null,null):a.copy(null,null,null,null,a.right.insert(e,t,o)),a.fixUp()}removeMin(){if(this.left.isEmpty())return s.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let o,a=this;if(t(e,a.key)<0)a.left.isEmpty()||a.left.isRed()||a.left.left.isRed()||(a=a.moveRedLeft()),a=a.copy(null,null,null,a.left.remove(e,t),null);else{if(a.left.isRed()&&(a=a.rotateRight()),a.right.isEmpty()||a.right.isRed()||a.right.left.isRed()||(a=a.moveRedRight()),t(e,a.key)===0){if(a.right.isEmpty())return s.EMPTY;o=a.right.min(),a=a.copy(o.key,o.value,null,null,a.right.removeMin())}a=a.copy(null,null,null,null,a.right.remove(e,t))}return a.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){let e=this.copy(null,null,s.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,s.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){let e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw j();let e=this.left.check();if(e!==this.right.check())throw j();return e+(this.isRed()?0:1)}};Gt.EMPTY=null,Gt.RED=!0,Gt.BLACK=!1;Gt.EMPTY=new class{constructor(){this.size=0}get key(){throw j()}get value(){throw j()}get color(){throw j()}get left(){throw j()}get right(){throw j()}copy(s,e,t,o,a){return this}insert(s,e,t){return new Gt(s,e)}remove(s,e){return this}isEmpty(){return!0}inorderTraversal(s){return!1}reverseTraversal(s){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};var Qe=class s{constructor(e){this.comparator=e,this.data=new ve(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,o)=>(e(t),!1))}forEachInRange(e,t){let o=this.data.getIteratorFrom(e[0]);for(;o.hasNext();){let a=o.getNext();if(this.comparator(a.key,e[1])>=0)return;t(a.key)}}forEachWhile(e,t){let o;for(o=t!==void 0?this.data.getIteratorFrom(t):this.data.getIterator();o.hasNext();)if(!e(o.getNext().key))return}firstAfterOrEqual(e){let t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new wc(this.data.getIterator())}getIteratorFrom(e){return new wc(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(o=>{t=t.add(o)}),t}isEqual(e){if(!(e instanceof s)||this.size!==e.size)return!1;let t=this.data.getIterator(),o=e.data.getIterator();for(;t.hasNext();){let a=t.getNext().key,u=o.getNext().key;if(this.comparator(a,u)!==0)return!1}return!0}toArray(){let e=[];return this.forEach(t=>{e.push(t)}),e}toString(){let e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){let t=new s(this.comparator);return t.data=e,t}},wc=class{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}};var bt=class s{constructor(e){this.fields=e,e.sort(Et.comparator)}static empty(){return new s([])}unionWith(e){let t=new Qe(Et.comparator);for(let o of this.fields)t=t.add(o);for(let o of e)t=t.add(o);return new s(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return ci(this.fields,e.fields,(t,o)=>t.isEqual(o))}};var bc=class extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}};var Xe=class s{constructor(e){this.binaryString=e}static fromBase64String(e){let t=function(o){try{return atob(o)}catch(a){throw typeof DOMException!="undefined"&&a instanceof DOMException?new bc("Invalid base64 string: "+a):a}}(e);return new s(t)}static fromUint8Array(e){let t=function(o){let a="";for(let u=0;u<o.length;++u)a+=String.fromCharCode(o[u]);return a}(e);return new s(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){let t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return ne(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}};Xe.EMPTY_BYTE_STRING=new Xe("");var wx=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Fn(s){if(he(!!s),typeof s=="string"){let e=0,t=wx.exec(s);if(he(!!t),t[1]){let a=t[1];a=(a+"000000000").substr(0,9),e=Number(a)}let o=new Date(s);return{seconds:Math.floor(o.getTime()/1e3),nanos:e}}return{seconds:ye(s.seconds),nanos:ye(s.nanos)}}function ye(s){return typeof s=="number"?s:typeof s=="string"?Number(s):0}function $n(s){return typeof s=="string"?Xe.fromBase64String(s):Xe.fromUint8Array(s)}function If(s){var e,t;return((t=(((e=s==null?void 0:s.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||t===void 0?void 0:t.stringValue)==="server_timestamp"}function Tf(s){let e=s.mapValue.fields.__previous_value__;return If(e)?Tf(e):e}function Fs(s){let e=Fn(s.mapValue.fields.__local_write_time__.timestampValue);return new Ue(e.seconds,e.nanos)}var Yh=class{constructor(e,t,o,a,u,l,h,d,f){this.databaseId=e,this.appId=t,this.persistenceKey=o,this.host=a,this.ssl=u,this.forceLongPolling=l,this.autoDetectLongPolling=h,this.longPollingOptions=d,this.useFetchStreams=f}},_c=class s{constructor(e,t){this.projectId=e,this.database=t||"(default)"}static empty(){return new s("","")}get isDefaultDatabase(){return this.database==="(default)"}isEqual(e){return e instanceof s&&e.projectId===this.projectId&&e.database===this.database}};var hc={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function Tr(s){return"nullValue"in s?0:"booleanValue"in s?1:"integerValue"in s||"doubleValue"in s?2:"timestampValue"in s?3:"stringValue"in s?5:"bytesValue"in s?6:"referenceValue"in s?7:"geoPointValue"in s?8:"arrayValue"in s?9:"mapValue"in s?If(s)?4:ew(s)?9007199254740991:10:j()}function Wt(s,e){if(s===e)return!0;let t=Tr(s);if(t!==Tr(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return s.booleanValue===e.booleanValue;case 4:return Fs(s).isEqual(Fs(e));case 3:return function(o,a){if(typeof o.timestampValue=="string"&&typeof a.timestampValue=="string"&&o.timestampValue.length===a.timestampValue.length)return o.timestampValue===a.timestampValue;let u=Fn(o.timestampValue),l=Fn(a.timestampValue);return u.seconds===l.seconds&&u.nanos===l.nanos}(s,e);case 5:return s.stringValue===e.stringValue;case 6:return function(o,a){return $n(o.bytesValue).isEqual($n(a.bytesValue))}(s,e);case 7:return s.referenceValue===e.referenceValue;case 8:return function(o,a){return ye(o.geoPointValue.latitude)===ye(a.geoPointValue.latitude)&&ye(o.geoPointValue.longitude)===ye(a.geoPointValue.longitude)}(s,e);case 2:return function(o,a){if("integerValue"in o&&"integerValue"in a)return ye(o.integerValue)===ye(a.integerValue);if("doubleValue"in o&&"doubleValue"in a){let u=ye(o.doubleValue),l=ye(a.doubleValue);return u===l?Us(u)===Us(l):isNaN(u)&&isNaN(l)}return!1}(s,e);case 9:return ci(s.arrayValue.values||[],e.arrayValue.values||[],Wt);case 10:return function(o,a){let u=o.mapValue.fields||{},l=a.mapValue.fields||{};if(Tv(u)!==Tv(l))return!1;for(let h in u)if(u.hasOwnProperty(h)&&(l[h]===void 0||!Wt(u[h],l[h])))return!1;return!0}(s,e);default:return j()}}function $s(s,e){return(s.values||[]).find(t=>Wt(t,e))!==void 0}function ui(s,e){if(s===e)return 0;let t=Tr(s),o=Tr(e);if(t!==o)return ne(t,o);switch(t){case 0:case 9007199254740991:return 0;case 1:return ne(s.booleanValue,e.booleanValue);case 2:return function(a,u){let l=ye(a.integerValue||a.doubleValue),h=ye(u.integerValue||u.doubleValue);return l<h?-1:l>h?1:l===h?0:isNaN(l)?isNaN(h)?0:-1:1}(s,e);case 3:return Sv(s.timestampValue,e.timestampValue);case 4:return Sv(Fs(s),Fs(e));case 5:return ne(s.stringValue,e.stringValue);case 6:return function(a,u){let l=$n(a),h=$n(u);return l.compareTo(h)}(s.bytesValue,e.bytesValue);case 7:return function(a,u){let l=a.split("/"),h=u.split("/");for(let d=0;d<l.length&&d<h.length;d++){let f=ne(l[d],h[d]);if(f!==0)return f}return ne(l.length,h.length)}(s.referenceValue,e.referenceValue);case 8:return function(a,u){let l=ne(ye(a.latitude),ye(u.latitude));return l!==0?l:ne(ye(a.longitude),ye(u.longitude))}(s.geoPointValue,e.geoPointValue);case 9:return function(a,u){let l=a.values||[],h=u.values||[];for(let d=0;d<l.length&&d<h.length;++d){let f=ui(l[d],h[d]);if(f)return f}return ne(l.length,h.length)}(s.arrayValue,e.arrayValue);case 10:return function(a,u){if(a===hc.mapValue&&u===hc.mapValue)return 0;if(a===hc.mapValue)return 1;if(u===hc.mapValue)return-1;let l=a.fields||{},h=Object.keys(l),d=u.fields||{},f=Object.keys(d);h.sort(),f.sort();for(let p=0;p<h.length&&p<f.length;++p){let m=ne(h[p],f[p]);if(m!==0)return m;let g=ui(l[h[p]],d[f[p]]);if(g!==0)return g}return ne(h.length,f.length)}(s.mapValue,e.mapValue);default:throw j()}}function Sv(s,e){if(typeof s=="string"&&typeof e=="string"&&s.length===e.length)return ne(s,e);let t=Fn(s),o=Fn(e),a=ne(t.seconds,o.seconds);return a!==0?a:ne(t.nanos,o.nanos)}function li(s){return Zh(s)}function Zh(s){return"nullValue"in s?"null":"booleanValue"in s?""+s.booleanValue:"integerValue"in s?""+s.integerValue:"doubleValue"in s?""+s.doubleValue:"timestampValue"in s?function(o){let a=Fn(o);return`time(${a.seconds},${a.nanos})`}(s.timestampValue):"stringValue"in s?s.stringValue:"bytesValue"in s?$n(s.bytesValue).toBase64():"referenceValue"in s?(t=s.referenceValue,B.fromName(t).toString()):"geoPointValue"in s?`geo(${(e=s.geoPointValue).latitude},${e.longitude})`:"arrayValue"in s?function(o){let a="[",u=!0;for(let l of o.values||[])u?u=!1:a+=",",a+=Zh(l);return a+"]"}(s.arrayValue):"mapValue"in s?function(o){let a=Object.keys(o.fields||{}).sort(),u="{",l=!0;for(let h of a)l?l=!1:u+=",",u+=`${h}:${Zh(o.fields[h])}`;return u+"}"}(s.mapValue):j();var e,t}function kv(s,e){return{referenceValue:`projects/${s.projectId}/databases/${s.database}/documents/${e.path.canonicalString()}`}}function ed(s){return!!s&&"integerValue"in s}function Sf(s){return!!s&&"arrayValue"in s}function Av(s){return!!s&&"nullValue"in s}function xv(s){return!!s&&"doubleValue"in s&&isNaN(Number(s.doubleValue))}function pc(s){return!!s&&"mapValue"in s}function Ds(s){if(s.geoPointValue)return{geoPointValue:Object.assign({},s.geoPointValue)};if(s.timestampValue&&typeof s.timestampValue=="object")return{timestampValue:Object.assign({},s.timestampValue)};if(s.mapValue){let e={mapValue:{fields:{}}};return xr(s.mapValue.fields,(t,o)=>e.mapValue.fields[t]=Ds(o)),e}if(s.arrayValue){let e={arrayValue:{values:[]}};for(let t=0;t<(s.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=Ds(s.arrayValue.values[t]);return e}return Object.assign({},s)}function ew(s){return(((s.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}var ut=class s{constructor(e){this.value=e}static empty(){return new s({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let o=0;o<e.length-1;++o)if(t=(t.mapValue.fields||{})[e.get(o)],!pc(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Ds(t)}setAll(e){let t=Et.emptyPath(),o={},a=[];e.forEach((l,h)=>{if(!t.isImmediateParentOf(h)){let d=this.getFieldsMap(t);this.applyChanges(d,o,a),o={},a=[],t=h.popLast()}l?o[h.lastSegment()]=Ds(l):a.push(h.lastSegment())});let u=this.getFieldsMap(t);this.applyChanges(u,o,a)}delete(e){let t=this.field(e.popLast());pc(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Wt(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let o=0;o<e.length;++o){let a=t.mapValue.fields[e.get(o)];pc(a)&&a.mapValue.fields||(a={mapValue:{fields:{}}},t.mapValue.fields[e.get(o)]=a),t=a}return t.mapValue.fields}applyChanges(e,t,o){xr(t,(a,u)=>e[a]=u);for(let a of o)delete e[a]}clone(){return new s(Ds(this.value))}};function tw(s){let e=[];return xr(s.fields,(t,o)=>{let a=new Et([t]);if(pc(o)){let u=tw(o.mapValue).fields;if(u.length===0)e.push(a);else for(let l of u)e.push(a.child(l))}else e.push(a)}),new bt(e)}var Nt=class s{constructor(e,t,o,a,u,l,h){this.key=e,this.documentType=t,this.version=o,this.readTime=a,this.createTime=u,this.data=l,this.documentState=h}static newInvalidDocument(e){return new s(e,0,H.min(),H.min(),H.min(),ut.empty(),0)}static newFoundDocument(e,t,o,a){return new s(e,1,t,H.min(),o,a,0)}static newNoDocument(e,t){return new s(e,2,t,H.min(),H.min(),ut.empty(),0)}static newUnknownDocument(e,t){return new s(e,3,t,H.min(),H.min(),ut.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(H.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=ut.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=ut.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=H.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof s&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new s(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}};var hi=class{constructor(e,t){this.position=e,this.inclusive=t}};function Rv(s,e,t){let o=0;for(let a=0;a<s.position.length;a++){let u=e[a],l=s.position[a];if(u.field.isKeyField()?o=B.comparator(B.fromName(l.referenceValue),t.key):o=ui(l,t.data.field(u.field)),u.dir==="desc"&&(o*=-1),o!==0)break}return o}function Cv(s,e){if(s===null)return e===null;if(e===null||s.inclusive!==e.inclusive||s.position.length!==e.position.length)return!1;for(let t=0;t<s.position.length;t++)if(!Wt(s.position[t],e.position[t]))return!1;return!0}var Mn=class{constructor(e,t="asc"){this.field=e,this.dir=t}};function bx(s,e){return s.dir===e.dir&&s.field.isEqual(e.field)}var Ec=class{},Ee=class s extends Ec{constructor(e,t,o){super(),this.field=e,this.op=t,this.value=o}static create(e,t,o){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,o):new nd(e,t,o):t==="array-contains"?new sd(e,o):t==="in"?new od(e,o):t==="not-in"?new ad(e,o):t==="array-contains-any"?new cd(e,o):new s(e,t,o)}static createKeyFieldInFilter(e,t,o){return t==="in"?new rd(e,o):new id(e,o)}matches(e){let t=e.data.field(this.field);return this.op==="!="?t!==null&&this.matchesComparison(ui(t,this.value)):t!==null&&Tr(this.value)===Tr(t)&&this.matchesComparison(ui(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return j()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}getFirstInequalityField(){return this.isInequality()?this.field:null}},Dt=class s extends Ec{constructor(e,t){super(),this.filters=e,this.op=t,this.lt=null}static create(e,t){return new s(e,t)}matches(e){return nw(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.lt!==null||(this.lt=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.lt}getFilters(){return Object.assign([],this.filters)}getFirstInequalityField(){let e=this.ft(t=>t.isInequality());return e!==null?e.field:null}ft(e){for(let t of this.getFlattenedFilters())if(e(t))return t;return null}};function nw(s){return s.op==="and"}function rw(s){return _x(s)&&nw(s)}function _x(s){for(let e of s.filters)if(e instanceof Dt)return!1;return!0}function td(s){if(s instanceof Ee)return s.field.canonicalString()+s.op.toString()+li(s.value);if(rw(s))return s.filters.map(e=>td(e)).join(",");{let e=s.filters.map(t=>td(t)).join(",");return`${s.op}(${e})`}}function iw(s,e){return s instanceof Ee?function(t,o){return o instanceof Ee&&t.op===o.op&&t.field.isEqual(o.field)&&Wt(t.value,o.value)}(s,e):s instanceof Dt?function(t,o){return o instanceof Dt&&t.op===o.op&&t.filters.length===o.filters.length?t.filters.reduce((a,u,l)=>a&&iw(u,o.filters[l]),!0):!1}(s,e):void j()}function sw(s){return s instanceof Ee?function(e){return`${e.field.canonicalString()} ${e.op} ${li(e.value)}`}(s):s instanceof Dt?function(e){return e.op.toString()+" {"+e.getFilters().map(sw).join(" ,")+"}"}(s):"Filter"}var nd=class extends Ee{constructor(e,t,o){super(e,t,o),this.key=B.fromName(o.referenceValue)}matches(e){let t=B.comparator(e.key,this.key);return this.matchesComparison(t)}},rd=class extends Ee{constructor(e,t){super(e,"in",t),this.keys=ow("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}},id=class extends Ee{constructor(e,t){super(e,"not-in",t),this.keys=ow("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}};function ow(s,e){var t;return(((t=e.arrayValue)===null||t===void 0?void 0:t.values)||[]).map(o=>B.fromName(o.referenceValue))}var sd=class extends Ee{constructor(e,t){super(e,"array-contains",t)}matches(e){let t=e.data.field(this.field);return Sf(t)&&$s(t.arrayValue,this.value)}},od=class extends Ee{constructor(e,t){super(e,"in",t)}matches(e){let t=e.data.field(this.field);return t!==null&&$s(this.value.arrayValue,t)}},ad=class extends Ee{constructor(e,t){super(e,"not-in",t)}matches(e){if($s(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let t=e.data.field(this.field);return t!==null&&!$s(this.value.arrayValue,t)}},cd=class extends Ee{constructor(e,t){super(e,"array-contains-any",t)}matches(e){let t=e.data.field(this.field);return!(!Sf(t)||!t.arrayValue.values)&&t.arrayValue.values.some(o=>$s(this.value.arrayValue,o))}};var ud=class{constructor(e,t=null,o=[],a=[],u=null,l=null,h=null){this.path=e,this.collectionGroup=t,this.orderBy=o,this.filters=a,this.limit=u,this.startAt=l,this.endAt=h,this.dt=null}};function Ov(s,e=null,t=[],o=[],a=null,u=null,l=null){return new ud(s,e,t,o,a,u,l)}function kf(s){let e=G(s);if(e.dt===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(o=>td(o)).join(","),t+="|ob:",t+=e.orderBy.map(o=>function(a){return a.field.canonicalString()+a.dir}(o)).join(","),Qc(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(o=>li(o)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(o=>li(o)).join(",")),e.dt=t}return e.dt}function Af(s,e){if(s.limit!==e.limit||s.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<s.orderBy.length;t++)if(!bx(s.orderBy[t],e.orderBy[t]))return!1;if(s.filters.length!==e.filters.length)return!1;for(let t=0;t<s.filters.length;t++)if(!iw(s.filters[t],e.filters[t]))return!1;return s.collectionGroup===e.collectionGroup&&!!s.path.isEqual(e.path)&&!!Cv(s.startAt,e.startAt)&&Cv(s.endAt,e.endAt)}function ld(s){return B.isDocumentKey(s.path)&&s.collectionGroup===null&&s.filters.length===0}var Bn=class{constructor(e,t=null,o=[],a=[],u=null,l="F",h=null,d=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=o,this.filters=a,this.limit=u,this.limitType=l,this.startAt=h,this.endAt=d,this.wt=null,this._t=null,this.startAt,this.endAt}};function Ex(s,e,t,o,a,u,l,h){return new Bn(s,e,t,o,a,u,l,h)}function Jc(s){return new Bn(s)}function Nv(s){return s.filters.length===0&&s.limit===null&&s.startAt==null&&s.endAt==null&&(s.explicitOrderBy.length===0||s.explicitOrderBy.length===1&&s.explicitOrderBy[0].field.isKeyField())}function xf(s){return s.explicitOrderBy.length>0?s.explicitOrderBy[0].field:null}function Xc(s){for(let e of s.filters){let t=e.getFirstInequalityField();if(t!==null)return t}return null}function aw(s){return s.collectionGroup!==null}function ii(s){let e=G(s);if(e.wt===null){e.wt=[];let t=Xc(e),o=xf(e);if(t!==null&&o===null)t.isKeyField()||e.wt.push(new Mn(t)),e.wt.push(new Mn(Et.keyField(),"asc"));else{let a=!1;for(let u of e.explicitOrderBy)e.wt.push(u),u.field.isKeyField()&&(a=!0);if(!a){let u=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.wt.push(new Mn(Et.keyField(),u))}}}return e.wt}function wn(s){let e=G(s);if(!e._t)if(e.limitType==="F")e._t=Ov(e.path,e.collectionGroup,ii(e),e.filters,e.limit,e.startAt,e.endAt);else{let t=[];for(let u of ii(e)){let l=u.dir==="desc"?"asc":"desc";t.push(new Mn(u.field,l))}let o=e.endAt?new hi(e.endAt.position,e.endAt.inclusive):null,a=e.startAt?new hi(e.startAt.position,e.startAt.inclusive):null;e._t=Ov(e.path,e.collectionGroup,t,e.filters,e.limit,o,a)}return e._t}function hd(s,e){e.getFirstInequalityField(),Xc(s);let t=s.filters.concat([e]);return new Bn(s.path,s.collectionGroup,s.explicitOrderBy.slice(),t,s.limit,s.limitType,s.startAt,s.endAt)}function Ic(s,e,t){return new Bn(s.path,s.collectionGroup,s.explicitOrderBy.slice(),s.filters.slice(),e,t,s.startAt,s.endAt)}function Yc(s,e){return Af(wn(s),wn(e))&&s.limitType===e.limitType}function cw(s){return`${kf(wn(s))}|lt:${s.limitType}`}function dd(s){return`Query(target=${function(e){let t=e.path.canonicalString();return e.collectionGroup!==null&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map(o=>sw(o)).join(", ")}]`),Qc(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map(o=>function(a){return`${a.field.canonicalString()} (${a.dir})`}(o)).join(", ")}]`),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(o=>li(o)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(o=>li(o)).join(",")),`Target(${t})`}(wn(s))}; limitType=${s.limitType})`}function Zc(s,e){return e.isFoundDocument()&&function(t,o){let a=o.key.path;return t.collectionGroup!==null?o.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(a):B.isDocumentKey(t.path)?t.path.isEqual(a):t.path.isImmediateParentOf(a)}(s,e)&&function(t,o){for(let a of ii(t))if(!a.field.isKeyField()&&o.data.field(a.field)===null)return!1;return!0}(s,e)&&function(t,o){for(let a of t.filters)if(!a.matches(o))return!1;return!0}(s,e)&&function(t,o){return!(t.startAt&&!function(a,u,l){let h=Rv(a,u,l);return a.inclusive?h<=0:h<0}(t.startAt,ii(t),o)||t.endAt&&!function(a,u,l){let h=Rv(a,u,l);return a.inclusive?h>=0:h>0}(t.endAt,ii(t),o))}(s,e)}function Ix(s){return s.collectionGroup||(s.path.length%2==1?s.path.lastSegment():s.path.get(s.path.length-2))}function uw(s){return(e,t)=>{let o=!1;for(let a of ii(s)){let u=Tx(a,e,t);if(u!==0)return u;o=o||a.field.isKeyField()}return 0}}function Tx(s,e,t){let o=s.field.isKeyField()?B.comparator(e.key,t.key):function(a,u,l){let h=u.data.field(a),d=l.data.field(a);return h!==null&&d!==null?ui(h,d):j()}(s.field,e,t);switch(s.dir){case"asc":return o;case"desc":return-1*o;default:return j()}}var jn=class{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){let t=this.mapKeyFn(e),o=this.inner[t];if(o!==void 0){for(let[a,u]of o)if(this.equalsFn(a,e))return u}}has(e){return this.get(e)!==void 0}set(e,t){let o=this.mapKeyFn(e),a=this.inner[o];if(a===void 0)return this.inner[o]=[[e,t]],void this.innerSize++;for(let u=0;u<a.length;u++)if(this.equalsFn(a[u][0],e))return void(a[u]=[e,t]);a.push([e,t]),this.innerSize++}delete(e){let t=this.mapKeyFn(e),o=this.inner[t];if(o===void 0)return!1;for(let a=0;a<o.length;a++)if(this.equalsFn(o[a][0],e))return o.length===1?delete this.inner[t]:o.splice(a,1),this.innerSize--,!0;return!1}forEach(e){xr(this.inner,(t,o)=>{for(let[a,u]of o)e(a,u)})}isEmpty(){return Zv(this.inner)}size(){return this.innerSize}};var Sx=new ve(B.comparator);function bn(){return Sx}var lw=new ve(B.comparator);function Ns(...s){let e=lw;for(let t of s)e=e.insert(t.key,t);return e}function hw(s){let e=lw;return s.forEach((t,o)=>e=e.insert(t,o.overlayedDocument)),e}function wr(){return Ps()}function dw(){return Ps()}function Ps(){return new jn(s=>s.toString(),(s,e)=>s.isEqual(e))}var kx=new ve(B.comparator),Ax=new Qe(B.comparator);function Q(...s){let e=Ax;for(let t of s)e=e.add(t);return e}var xx=new Qe(ne);function Rx(){return xx}function fw(s,e){if(s.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Us(e)?"-0":e}}function pw(s){return{integerValue:""+s}}function Cx(s,e){return mx(e)?pw(e):fw(s,e)}var di=class{constructor(){this._=void 0}};function Ox(s,e,t){return s instanceof fi?function(o,a){let u={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:o.seconds,nanos:o.nanoseconds}}}};return a&&If(a)&&(a=Tf(a)),a&&(u.fields.__previous_value__=a),{mapValue:u}}(t,e):s instanceof Sr?gw(s,e):s instanceof kr?yw(s,e):function(o,a){let u=mw(o,a),l=Dv(u)+Dv(o.gt);return ed(u)&&ed(o.gt)?pw(l):fw(o.serializer,l)}(s,e)}function Nx(s,e,t){return s instanceof Sr?gw(s,e):s instanceof kr?yw(s,e):t}function mw(s,e){return s instanceof pi?ed(t=e)||function(o){return!!o&&"doubleValue"in o}(t)?e:{integerValue:0}:null;var t}var fi=class extends di{},Sr=class extends di{constructor(e){super(),this.elements=e}};function gw(s,e){let t=vw(e);for(let o of s.elements)t.some(a=>Wt(a,o))||t.push(o);return{arrayValue:{values:t}}}var kr=class extends di{constructor(e){super(),this.elements=e}};function yw(s,e){let t=vw(e);for(let o of s.elements)t=t.filter(a=>!Wt(a,o));return{arrayValue:{values:t}}}var pi=class extends di{constructor(e,t){super(),this.serializer=e,this.gt=t}};function Dv(s){return ye(s.integerValue||s.doubleValue)}function vw(s){return Sf(s)&&s.arrayValue.values?s.arrayValue.values.slice():[]}function Dx(s,e){return s.field.isEqual(e.field)&&function(t,o){return t instanceof Sr&&o instanceof Sr||t instanceof kr&&o instanceof kr?ci(t.elements,o.elements,Wt):t instanceof pi&&o instanceof pi?Wt(t.gt,o.gt):t instanceof fi&&o instanceof fi}(s.transform,e.transform)}var fd=class{constructor(e,t){this.version=e,this.transformResults=t}},yn=class s{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new s}static exists(e){return new s(void 0,e)}static updateTime(e){return new s(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}};function mc(s,e){return s.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(s.updateTime):s.exists===void 0||s.exists===e.isFoundDocument()}var mi=class{};function ww(s,e){if(!s.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return s.isNoDocument()?new Bs(s.key,yn.none()):new Ar(s.key,s.data,yn.none());{let t=s.data,o=ut.empty(),a=new Qe(Et.comparator);for(let u of e.fields)if(!a.has(u)){let l=t.field(u);l===null&&u.length>1&&(u=u.popLast(),l=t.field(u)),l===null?o.delete(u):o.set(u,l),a=a.add(u)}return new Qt(s.key,o,new bt(a.toArray()),yn.none())}}function Px(s,e,t){s instanceof Ar?function(o,a,u){let l=o.value.clone(),h=Lv(o.fieldTransforms,a,u.transformResults);l.setAll(h),a.convertToFoundDocument(u.version,l).setHasCommittedMutations()}(s,e,t):s instanceof Qt?function(o,a,u){if(!mc(o.precondition,a))return void a.convertToUnknownDocument(u.version);let l=Lv(o.fieldTransforms,a,u.transformResults),h=a.data;h.setAll(bw(o)),h.setAll(l),a.convertToFoundDocument(u.version,h).setHasCommittedMutations()}(s,e,t):function(o,a,u){a.convertToNoDocument(u.version).setHasCommittedMutations()}(0,e,t)}function Ls(s,e,t,o){return s instanceof Ar?function(a,u,l,h){if(!mc(a.precondition,u))return l;let d=a.value.clone(),f=Mv(a.fieldTransforms,h,u);return d.setAll(f),u.convertToFoundDocument(u.version,d).setHasLocalMutations(),null}(s,e,t,o):s instanceof Qt?function(a,u,l,h){if(!mc(a.precondition,u))return l;let d=Mv(a.fieldTransforms,h,u),f=u.data;return f.setAll(bw(a)),f.setAll(d),u.convertToFoundDocument(u.version,f).setHasLocalMutations(),l===null?null:l.unionWith(a.fieldMask.fields).unionWith(a.fieldTransforms.map(p=>p.field))}(s,e,t,o):function(a,u,l){return mc(a.precondition,u)?(u.convertToNoDocument(u.version).setHasLocalMutations(),null):l}(s,e,t)}function Lx(s,e){let t=null;for(let o of s.fieldTransforms){let a=e.data.field(o.field),u=mw(o.transform,a||null);u!=null&&(t===null&&(t=ut.empty()),t.set(o.field,u))}return t||null}function Pv(s,e){return s.type===e.type&&!!s.key.isEqual(e.key)&&!!s.precondition.isEqual(e.precondition)&&!!function(t,o){return t===void 0&&o===void 0||!(!t||!o)&&ci(t,o,(a,u)=>Dx(a,u))}(s.fieldTransforms,e.fieldTransforms)&&(s.type===0?s.value.isEqual(e.value):s.type!==1||s.data.isEqual(e.data)&&s.fieldMask.isEqual(e.fieldMask))}var Ar=class extends mi{constructor(e,t,o,a=[]){super(),this.key=e,this.value=t,this.precondition=o,this.fieldTransforms=a,this.type=0}getFieldMask(){return null}},Qt=class extends mi{constructor(e,t,o,a,u=[]){super(),this.key=e,this.data=t,this.fieldMask=o,this.precondition=a,this.fieldTransforms=u,this.type=1}getFieldMask(){return this.fieldMask}};function bw(s){let e=new Map;return s.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){let o=s.data.field(t);e.set(t,o)}}),e}function Lv(s,e,t){let o=new Map;he(s.length===t.length);for(let a=0;a<t.length;a++){let u=s[a],l=u.transform,h=e.data.field(u.field);o.set(u.field,Nx(l,h,t[a]))}return o}function Mv(s,e,t){let o=new Map;for(let a of s){let u=a.transform,l=t.data.field(a.field);o.set(a.field,Ox(u,l,e))}return o}var Bs=class extends mi{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}},pd=class extends mi{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}};var md=class{constructor(e,t,o,a){this.batchId=e,this.localWriteTime=t,this.baseMutations=o,this.mutations=a}applyToRemoteDocument(e,t){let o=t.mutationResults;for(let a=0;a<this.mutations.length;a++){let u=this.mutations[a];u.key.isEqual(e.key)&&Px(u,e,o[a])}}applyToLocalView(e,t){for(let o of this.baseMutations)o.key.isEqual(e.key)&&(t=Ls(o,e,t,this.localWriteTime));for(let o of this.mutations)o.key.isEqual(e.key)&&(t=Ls(o,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){let o=dw();return this.mutations.forEach(a=>{let u=e.get(a.key),l=u.overlayedDocument,h=this.applyToLocalView(l,u.mutatedFields);h=t.has(a.key)?null:h;let d=ww(l,h);d!==null&&o.set(a.key,d),l.isValidDocument()||l.convertToNoDocument(H.min())}),o}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),Q())}isEqual(e){return this.batchId===e.batchId&&ci(this.mutations,e.mutations,(t,o)=>Pv(t,o))&&ci(this.baseMutations,e.baseMutations,(t,o)=>Pv(t,o))}},gd=class s{constructor(e,t,o,a){this.batch=e,this.commitVersion=t,this.mutationResults=o,this.docVersions=a}static from(e,t,o){he(e.mutations.length===o.length);let a=kx,u=e.mutations;for(let l=0;l<u.length;l++)a=a.insert(u[l].key,o[l].version);return new s(e,t,o,a)}};var yd=class{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
      largestBatchId: ${this.largestBatchId},
      mutation: ${this.mutation.toString()}
    }`}};var vd=class{constructor(e,t){this.count=e,this.unchangedNames=t}};var be,Z;function Mx(s){switch(s){default:return j();case S.CANCELLED:case S.UNKNOWN:case S.DEADLINE_EXCEEDED:case S.RESOURCE_EXHAUSTED:case S.INTERNAL:case S.UNAVAILABLE:case S.UNAUTHENTICATED:return!1;case S.INVALID_ARGUMENT:case S.NOT_FOUND:case S.ALREADY_EXISTS:case S.PERMISSION_DENIED:case S.FAILED_PRECONDITION:case S.ABORTED:case S.OUT_OF_RANGE:case S.UNIMPLEMENTED:case S.DATA_LOSS:return!0}}function _w(s){if(s===void 0)return vn("GRPC error has no .code"),S.UNKNOWN;switch(s){case be.OK:return S.OK;case be.CANCELLED:return S.CANCELLED;case be.UNKNOWN:return S.UNKNOWN;case be.DEADLINE_EXCEEDED:return S.DEADLINE_EXCEEDED;case be.RESOURCE_EXHAUSTED:return S.RESOURCE_EXHAUSTED;case be.INTERNAL:return S.INTERNAL;case be.UNAVAILABLE:return S.UNAVAILABLE;case be.UNAUTHENTICATED:return S.UNAUTHENTICATED;case be.INVALID_ARGUMENT:return S.INVALID_ARGUMENT;case be.NOT_FOUND:return S.NOT_FOUND;case be.ALREADY_EXISTS:return S.ALREADY_EXISTS;case be.PERMISSION_DENIED:return S.PERMISSION_DENIED;case be.FAILED_PRECONDITION:return S.FAILED_PRECONDITION;case be.ABORTED:return S.ABORTED;case be.OUT_OF_RANGE:return S.OUT_OF_RANGE;case be.UNIMPLEMENTED:return S.UNIMPLEMENTED;case be.DATA_LOSS:return S.DATA_LOSS;default:return j()}}(Z=be||(be={}))[Z.OK=0]="OK",Z[Z.CANCELLED=1]="CANCELLED",Z[Z.UNKNOWN=2]="UNKNOWN",Z[Z.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Z[Z.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Z[Z.NOT_FOUND=5]="NOT_FOUND",Z[Z.ALREADY_EXISTS=6]="ALREADY_EXISTS",Z[Z.PERMISSION_DENIED=7]="PERMISSION_DENIED",Z[Z.UNAUTHENTICATED=16]="UNAUTHENTICATED",Z[Z.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Z[Z.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Z[Z.ABORTED=10]="ABORTED",Z[Z.OUT_OF_RANGE=11]="OUT_OF_RANGE",Z[Z.UNIMPLEMENTED=12]="UNIMPLEMENTED",Z[Z.INTERNAL=13]="INTERNAL",Z[Z.UNAVAILABLE=14]="UNAVAILABLE",Z[Z.DATA_LOSS=15]="DATA_LOSS";var wd=class s{constructor(){this.onExistenceFilterMismatchCallbacks=new Map}static get instance(){return dc}static getOrCreateInstance(){return dc===null&&(dc=new s),dc}onExistenceFilterMismatch(e){let t=Symbol();return this.onExistenceFilterMismatchCallbacks.set(t,e),()=>this.onExistenceFilterMismatchCallbacks.delete(t)}notifyOnExistenceFilterMismatch(e){this.onExistenceFilterMismatchCallbacks.forEach(t=>t(e))}},dc=null;function Ux(){return new TextEncoder}var Fx=new vr([4294967295,4294967295],0);function Uv(s){let e=Ux().encode(s),t=new _v;return t.update(e),new Uint8Array(t.digest())}function Fv(s){let e=new DataView(s.buffer),t=e.getUint32(0,!0),o=e.getUint32(4,!0),a=e.getUint32(8,!0),u=e.getUint32(12,!0);return[new vr([t,o],0),new vr([a,u],0)]}var bd=class s{constructor(e,t,o){if(this.bitmap=e,this.padding=t,this.hashCount=o,t<0||t>=8)throw new br(`Invalid padding: ${t}`);if(o<0)throw new br(`Invalid hash count: ${o}`);if(e.length>0&&this.hashCount===0)throw new br(`Invalid hash count: ${o}`);if(e.length===0&&t!==0)throw new br(`Invalid padding when bitmap length is 0: ${t}`);this.It=8*e.length-t,this.Tt=vr.fromNumber(this.It)}Et(e,t,o){let a=e.add(t.multiply(vr.fromNumber(o)));return a.compare(Fx)===1&&(a=new vr([a.getBits(0),a.getBits(1)],0)),a.modulo(this.Tt).toNumber()}At(e){return(this.bitmap[Math.floor(e/8)]&1<<e%8)!=0}vt(e){if(this.It===0)return!1;let t=Uv(e),[o,a]=Fv(t);for(let u=0;u<this.hashCount;u++){let l=this.Et(o,a,u);if(!this.At(l))return!1}return!0}static create(e,t,o){let a=e%8==0?0:8-e%8,u=new Uint8Array(Math.ceil(e/8)),l=new s(u,a,t);return o.forEach(h=>l.insert(h)),l}insert(e){if(this.It===0)return;let t=Uv(e),[o,a]=Fv(t);for(let u=0;u<this.hashCount;u++){let l=this.Et(o,a,u);this.Rt(l)}}Rt(e){let t=Math.floor(e/8),o=e%8;this.bitmap[t]|=1<<o}},br=class extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}};var Tc=class s{constructor(e,t,o,a,u){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=o,this.documentUpdates=a,this.resolvedLimboDocuments=u}static createSynthesizedRemoteEventForCurrentChange(e,t,o){let a=new Map;return a.set(e,js.createSynthesizedTargetChangeForCurrentChange(e,t,o)),new s(H.min(),a,new ve(ne),bn(),Q())}},js=class s{constructor(e,t,o,a,u){this.resumeToken=e,this.current=t,this.addedDocuments=o,this.modifiedDocuments=a,this.removedDocuments=u}static createSynthesizedTargetChangeForCurrentChange(e,t,o){return new s(o,t,Q(),Q(),Q())}};var si=class{constructor(e,t,o,a){this.Pt=e,this.removedTargetIds=t,this.key=o,this.bt=a}},Sc=class{constructor(e,t){this.targetId=e,this.Vt=t}},kc=class{constructor(e,t,o=Xe.EMPTY_BYTE_STRING,a=null){this.state=e,this.targetIds=t,this.resumeToken=o,this.cause=a}},Ac=class{constructor(){this.St=0,this.Dt=Bv(),this.Ct=Xe.EMPTY_BYTE_STRING,this.xt=!1,this.Nt=!0}get current(){return this.xt}get resumeToken(){return this.Ct}get kt(){return this.St!==0}get Mt(){return this.Nt}$t(e){e.approximateByteSize()>0&&(this.Nt=!0,this.Ct=e)}Ot(){let e=Q(),t=Q(),o=Q();return this.Dt.forEach((a,u)=>{switch(u){case 0:e=e.add(a);break;case 2:t=t.add(a);break;case 1:o=o.add(a);break;default:j()}}),new js(this.Ct,this.xt,e,t,o)}Ft(){this.Nt=!1,this.Dt=Bv()}Bt(e,t){this.Nt=!0,this.Dt=this.Dt.insert(e,t)}Lt(e){this.Nt=!0,this.Dt=this.Dt.remove(e)}qt(){this.St+=1}Ut(){this.St-=1}Kt(){this.Nt=!0,this.xt=!0}},_d=class{constructor(e){this.Gt=e,this.Qt=new Map,this.jt=bn(),this.zt=$v(),this.Wt=new ve(ne)}Ht(e){for(let t of e.Pt)e.bt&&e.bt.isFoundDocument()?this.Jt(t,e.bt):this.Yt(t,e.key,e.bt);for(let t of e.removedTargetIds)this.Yt(t,e.key,e.bt)}Xt(e){this.forEachTarget(e,t=>{let o=this.Zt(t);switch(e.state){case 0:this.te(t)&&o.$t(e.resumeToken);break;case 1:o.Ut(),o.kt||o.Ft(),o.$t(e.resumeToken);break;case 2:o.Ut(),o.kt||this.removeTarget(t);break;case 3:this.te(t)&&(o.Kt(),o.$t(e.resumeToken));break;case 4:this.te(t)&&(this.ee(t),o.$t(e.resumeToken));break;default:j()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Qt.forEach((o,a)=>{this.te(a)&&t(a)})}ne(e){var t;let o=e.targetId,a=e.Vt.count,u=this.se(o);if(u){let l=u.target;if(ld(l))if(a===0){let h=new B(l.path);this.Yt(o,h,Nt.newNoDocument(h,H.min()))}else he(a===1);else{let h=this.ie(o);if(h!==a){let d=this.re(e,h);if(d!==0){this.ee(o);let f=d===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Wt=this.Wt.insert(o,f)}(t=wd.instance)===null||t===void 0||t.notifyOnExistenceFilterMismatch(function(f,p,m){var g,y,w,b,E,k;let x={localCacheCount:p,existenceFilterCount:m.count},C=m.unchangedNames;return C&&(x.bloomFilter={applied:f===0,hashCount:(g=C==null?void 0:C.hashCount)!==null&&g!==void 0?g:0,bitmapLength:(b=(w=(y=C==null?void 0:C.bits)===null||y===void 0?void 0:y.bitmap)===null||w===void 0?void 0:w.length)!==null&&b!==void 0?b:0,padding:(k=(E=C==null?void 0:C.bits)===null||E===void 0?void 0:E.padding)!==null&&k!==void 0?k:0}),x}(d,h,e.Vt))}}}}re(e,t){let{unchangedNames:o,count:a}=e.Vt;if(!o||!o.bits)return 1;let{bits:{bitmap:u="",padding:l=0},hashCount:h=0}=o,d,f;try{d=$n(u).toUint8Array()}catch(p){if(p instanceof bc)return ai("Decoding the base64 bloom filter in existence filter failed ("+p.message+"); ignoring the bloom filter and falling back to full re-query."),1;throw p}try{f=new bd(d,l,h)}catch(p){return ai(p instanceof br?"BloomFilter error: ":"Applying bloom filter failed: ",p),1}return f.It===0?1:a!==t-this.oe(e.targetId,f)?2:0}oe(e,t){let o=this.Gt.getRemoteKeysForTarget(e),a=0;return o.forEach(u=>{let l=this.Gt.ue(),h=`projects/${l.projectId}/databases/${l.database}/documents/${u.path.canonicalString()}`;t.vt(h)||(this.Yt(e,u,null),a++)}),a}ce(e){let t=new Map;this.Qt.forEach((u,l)=>{let h=this.se(l);if(h){if(u.current&&ld(h.target)){let d=new B(h.target.path);this.jt.get(d)!==null||this.ae(l,d)||this.Yt(l,d,Nt.newNoDocument(d,e))}u.Mt&&(t.set(l,u.Ot()),u.Ft())}});let o=Q();this.zt.forEach((u,l)=>{let h=!0;l.forEachWhile(d=>{let f=this.se(d);return!f||f.purpose==="TargetPurposeLimboResolution"||(h=!1,!1)}),h&&(o=o.add(u))}),this.jt.forEach((u,l)=>l.setReadTime(e));let a=new Tc(e,t,this.Wt,this.jt,o);return this.jt=bn(),this.zt=$v(),this.Wt=new ve(ne),a}Jt(e,t){if(!this.te(e))return;let o=this.ae(e,t.key)?2:0;this.Zt(e).Bt(t.key,o),this.jt=this.jt.insert(t.key,t),this.zt=this.zt.insert(t.key,this.he(t.key).add(e))}Yt(e,t,o){if(!this.te(e))return;let a=this.Zt(e);this.ae(e,t)?a.Bt(t,1):a.Lt(t),this.zt=this.zt.insert(t,this.he(t).delete(e)),o&&(this.jt=this.jt.insert(t,o))}removeTarget(e){this.Qt.delete(e)}ie(e){let t=this.Zt(e).Ot();return this.Gt.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}qt(e){this.Zt(e).qt()}Zt(e){let t=this.Qt.get(e);return t||(t=new Ac,this.Qt.set(e,t)),t}he(e){let t=this.zt.get(e);return t||(t=new Qe(ne),this.zt=this.zt.insert(e,t)),t}te(e){let t=this.se(e)!==null;return t||U("WatchChangeAggregator","Detected inactive target",e),t}se(e){let t=this.Qt.get(e);return t&&t.kt?null:this.Gt.le(e)}ee(e){this.Qt.set(e,new Ac),this.Gt.getRemoteKeysForTarget(e).forEach(t=>{this.Yt(e,t,null)})}ae(e,t){return this.Gt.getRemoteKeysForTarget(e).has(t)}};function $v(){return new ve(B.comparator)}function Bv(){return new ve(B.comparator)}var $x={asc:"ASCENDING",desc:"DESCENDING"},Bx={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},jx={and:"AND",or:"OR"},Ed=class{constructor(e,t){this.databaseId=e,this.useProto3Json=t}};function Id(s,e){return s.useProto3Json||Qc(e)?e:{value:e}}function xc(s,e){return s.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Ew(s,e){return s.useProto3Json?e.toBase64():e.toUint8Array()}function Vx(s,e){return xc(s,e.toTimestamp())}function Kt(s){return he(!!s),H.fromTimestamp(function(e){let t=Fn(e);return new Ue(t.seconds,t.nanos)}(s))}function Rf(s,e){return function(t){return new pe(["projects",t.projectId,"databases",t.database])}(s).child("documents").child(e).canonicalString()}function Iw(s){let e=pe.fromString(s);return he(Aw(e)),e}function Td(s,e){return Rf(s.databaseId,e.path)}function $h(s,e){let t=Iw(e);if(t.get(1)!==s.databaseId.projectId)throw new D(S.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+s.databaseId.projectId);if(t.get(3)!==s.databaseId.database)throw new D(S.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+s.databaseId.database);return new B(Tw(t))}function Sd(s,e){return Rf(s.databaseId,e)}function qx(s){let e=Iw(s);return e.length===4?pe.emptyPath():Tw(e)}function kd(s){return new pe(["projects",s.databaseId.projectId,"databases",s.databaseId.database]).canonicalString()}function Tw(s){return he(s.length>4&&s.get(4)==="documents"),s.popFirst(5)}function jv(s,e,t){return{name:Td(s,e),fields:t.value.mapValue.fields}}function zx(s,e){let t;if("targetChange"in e){e.targetChange;let o=function(d){return d==="NO_CHANGE"?0:d==="ADD"?1:d==="REMOVE"?2:d==="CURRENT"?3:d==="RESET"?4:j()}(e.targetChange.targetChangeType||"NO_CHANGE"),a=e.targetChange.targetIds||[],u=function(d,f){return d.useProto3Json?(he(f===void 0||typeof f=="string"),Xe.fromBase64String(f||"")):(he(f===void 0||f instanceof Uint8Array),Xe.fromUint8Array(f||new Uint8Array))}(s,e.targetChange.resumeToken),l=e.targetChange.cause,h=l&&function(d){let f=d.code===void 0?S.UNKNOWN:_w(d.code);return new D(f,d.message||"")}(l);t=new kc(o,a,u,h||null)}else if("documentChange"in e){e.documentChange;let o=e.documentChange;o.document,o.document.name,o.document.updateTime;let a=$h(s,o.document.name),u=Kt(o.document.updateTime),l=o.document.createTime?Kt(o.document.createTime):H.min(),h=new ut({mapValue:{fields:o.document.fields}}),d=Nt.newFoundDocument(a,u,l,h),f=o.targetIds||[],p=o.removedTargetIds||[];t=new si(f,p,d.key,d)}else if("documentDelete"in e){e.documentDelete;let o=e.documentDelete;o.document;let a=$h(s,o.document),u=o.readTime?Kt(o.readTime):H.min(),l=Nt.newNoDocument(a,u),h=o.removedTargetIds||[];t=new si([],h,l.key,l)}else if("documentRemove"in e){e.documentRemove;let o=e.documentRemove;o.document;let a=$h(s,o.document),u=o.removedTargetIds||[];t=new si([],u,a,null)}else{if(!("filter"in e))return j();{e.filter;let o=e.filter;o.targetId;let{count:a=0,unchangedNames:u}=o,l=new vd(a,u),h=o.targetId;t=new Sc(h,l)}}return t}function Hx(s,e){let t;if(e instanceof Ar)t={update:jv(s,e.key,e.value)};else if(e instanceof Bs)t={delete:Td(s,e.key)};else if(e instanceof Qt)t={update:jv(s,e.key,e.data),updateMask:eR(e.fieldMask)};else{if(!(e instanceof pd))return j();t={verify:Td(s,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(o=>function(a,u){let l=u.transform;if(l instanceof fi)return{fieldPath:u.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(l instanceof Sr)return{fieldPath:u.field.canonicalString(),appendMissingElements:{values:l.elements}};if(l instanceof kr)return{fieldPath:u.field.canonicalString(),removeAllFromArray:{values:l.elements}};if(l instanceof pi)return{fieldPath:u.field.canonicalString(),increment:l.gt};throw j()}(0,o))),e.precondition.isNone||(t.currentDocument=function(o,a){return a.updateTime!==void 0?{updateTime:Vx(o,a.updateTime)}:a.exists!==void 0?{exists:a.exists}:j()}(s,e.precondition)),t}function Gx(s,e){return s&&s.length>0?(he(e!==void 0),s.map(t=>function(o,a){let u=o.updateTime?Kt(o.updateTime):Kt(a);return u.isEqual(H.min())&&(u=Kt(a)),new fd(u,o.transformResults||[])}(t,e))):[]}function Kx(s,e){return{documents:[Sd(s,e.path)]}}function Wx(s,e){let t={structuredQuery:{}},o=e.path;e.collectionGroup!==null?(t.parent=Sd(s,o),t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(t.parent=Sd(s,o.popLast()),t.structuredQuery.from=[{collectionId:o.lastSegment()}]);let a=function(d){if(d.length!==0)return kw(Dt.create(d,"and"))}(e.filters);a&&(t.structuredQuery.where=a);let u=function(d){if(d.length!==0)return d.map(f=>function(p){return{field:ti(p.field),direction:Xx(p.dir)}}(f))}(e.orderBy);u&&(t.structuredQuery.orderBy=u);let l=Id(s,e.limit);var h;return l!==null&&(t.structuredQuery.limit=l),e.startAt&&(t.structuredQuery.startAt={before:(h=e.startAt).inclusive,values:h.position}),e.endAt&&(t.structuredQuery.endAt=function(d){return{before:!d.inclusive,values:d.position}}(e.endAt)),t}function Qx(s){let e=qx(s.parent),t=s.structuredQuery,o=t.from?t.from.length:0,a=null;if(o>0){he(o===1);let p=t.from[0];p.allDescendants?a=p.collectionId:e=e.child(p.collectionId)}let u=[];t.where&&(u=function(p){let m=Sw(p);return m instanceof Dt&&rw(m)?m.getFilters():[m]}(t.where));let l=[];t.orderBy&&(l=t.orderBy.map(p=>function(m){return new Mn(ni(m.field),function(g){switch(g){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(m.direction))}(p)));let h=null;t.limit&&(h=function(p){let m;return m=typeof p=="object"?p.value:p,Qc(m)?null:m}(t.limit));let d=null;t.startAt&&(d=function(p){let m=!!p.before,g=p.values||[];return new hi(g,m)}(t.startAt));let f=null;return t.endAt&&(f=function(p){let m=!p.before,g=p.values||[];return new hi(g,m)}(t.endAt)),Ex(e,a,l,u,h,"F",d,f)}function Jx(s,e){let t=function(o){switch(o){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return j()}}(e.purpose);return t==null?null:{"goog-listen-tags":t}}function Sw(s){return s.unaryFilter!==void 0?function(e){switch(e.unaryFilter.op){case"IS_NAN":let t=ni(e.unaryFilter.field);return Ee.create(t,"==",{doubleValue:NaN});case"IS_NULL":let o=ni(e.unaryFilter.field);return Ee.create(o,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let a=ni(e.unaryFilter.field);return Ee.create(a,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let u=ni(e.unaryFilter.field);return Ee.create(u,"!=",{nullValue:"NULL_VALUE"});default:return j()}}(s):s.fieldFilter!==void 0?function(e){return Ee.create(ni(e.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return j()}}(e.fieldFilter.op),e.fieldFilter.value)}(s):s.compositeFilter!==void 0?function(e){return Dt.create(e.compositeFilter.filters.map(t=>Sw(t)),function(t){switch(t){case"AND":return"and";case"OR":return"or";default:return j()}}(e.compositeFilter.op))}(s):j()}function Xx(s){return $x[s]}function Yx(s){return Bx[s]}function Zx(s){return jx[s]}function ti(s){return{fieldPath:s.canonicalString()}}function ni(s){return Et.fromServerFormat(s.fieldPath)}function kw(s){return s instanceof Ee?function(e){if(e.op==="=="){if(xv(e.value))return{unaryFilter:{field:ti(e.field),op:"IS_NAN"}};if(Av(e.value))return{unaryFilter:{field:ti(e.field),op:"IS_NULL"}}}else if(e.op==="!="){if(xv(e.value))return{unaryFilter:{field:ti(e.field),op:"IS_NOT_NAN"}};if(Av(e.value))return{unaryFilter:{field:ti(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ti(e.field),op:Yx(e.op),value:e.value}}}(s):s instanceof Dt?function(e){let t=e.getFilters().map(o=>kw(o));return t.length===1?t[0]:{compositeFilter:{op:Zx(e.op),filters:t}}}(s):j()}function eR(s){let e=[];return s.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function Aw(s){return s.length>=4&&s.get(0)==="projects"&&s.get(2)==="databases"}var Vs=class s{constructor(e,t,o,a,u=H.min(),l=H.min(),h=Xe.EMPTY_BYTE_STRING,d=null){this.target=e,this.targetId=t,this.purpose=o,this.sequenceNumber=a,this.snapshotVersion=u,this.lastLimboFreeSnapshotVersion=l,this.resumeToken=h,this.expectedCount=d}withSequenceNumber(e){return new s(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new s(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new s(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new s(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}};var Ad=class{constructor(e){this.fe=e}};function tR(s){let e=Qx({parent:s.parent,structuredQuery:s.structuredQuery});return s.limitType==="LAST"?Ic(e,e.limit,"L"):e}var Rc=class{constructor(){}_e(e,t){this.me(e,t),t.ge()}me(e,t){if("nullValue"in e)this.ye(t,5);else if("booleanValue"in e)this.ye(t,10),t.pe(e.booleanValue?1:0);else if("integerValue"in e)this.ye(t,15),t.pe(ye(e.integerValue));else if("doubleValue"in e){let o=ye(e.doubleValue);isNaN(o)?this.ye(t,13):(this.ye(t,15),Us(o)?t.pe(0):t.pe(o))}else if("timestampValue"in e){let o=e.timestampValue;this.ye(t,20),typeof o=="string"?t.Ie(o):(t.Ie(`${o.seconds||""}`),t.pe(o.nanos||0))}else if("stringValue"in e)this.Te(e.stringValue,t),this.Ee(t);else if("bytesValue"in e)this.ye(t,30),t.Ae($n(e.bytesValue)),this.Ee(t);else if("referenceValue"in e)this.ve(e.referenceValue,t);else if("geoPointValue"in e){let o=e.geoPointValue;this.ye(t,45),t.pe(o.latitude||0),t.pe(o.longitude||0)}else"mapValue"in e?ew(e)?this.ye(t,Number.MAX_SAFE_INTEGER):(this.Re(e.mapValue,t),this.Ee(t)):"arrayValue"in e?(this.Pe(e.arrayValue,t),this.Ee(t)):j()}Te(e,t){this.ye(t,25),this.be(e,t)}be(e,t){t.Ie(e)}Re(e,t){let o=e.fields||{};this.ye(t,55);for(let a of Object.keys(o))this.Te(a,t),this.me(o[a],t)}Pe(e,t){let o=e.values||[];this.ye(t,50);for(let a of o)this.me(a,t)}ve(e,t){this.ye(t,37),B.fromName(e).path.forEach(o=>{this.ye(t,60),this.be(o,t)})}ye(e,t){e.pe(t)}Ee(e){e.pe(2)}};Rc.Ve=new Rc;var xd=class{constructor(){this.rn=new Rd}addToCollectionParentIndex(e,t){return this.rn.add(t),O.resolve()}getCollectionParents(e,t){return O.resolve(this.rn.getEntries(t))}addFieldIndex(e,t){return O.resolve()}deleteFieldIndex(e,t){return O.resolve()}getDocumentsMatchingTarget(e,t){return O.resolve(null)}getIndexType(e,t){return O.resolve(0)}getFieldIndexes(e,t){return O.resolve([])}getNextCollectionGroupToUpdate(e){return O.resolve(null)}getMinOffset(e,t){return O.resolve(Ir.min())}getMinOffsetFromCollectionGroup(e,t){return O.resolve(Ir.min())}updateCollectionGroup(e,t,o){return O.resolve()}updateIndexEntries(e,t){return O.resolve()}},Rd=class{constructor(){this.index={}}add(e){let t=e.lastSegment(),o=e.popLast(),a=this.index[t]||new Qe(pe.comparator),u=!a.has(o);return this.index[t]=a.add(o),u}has(e){let t=e.lastSegment(),o=e.popLast(),a=this.index[t];return a&&a.has(o)}getEntries(e){return(this.index[e]||new Qe(pe.comparator)).toArray()}};var mL=new Uint8Array(0);var Ht=class s{constructor(e,t,o){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=o}static withCacheSize(e){return new s(e,s.DEFAULT_COLLECTION_PERCENTILE,s.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}};Ht.DEFAULT_COLLECTION_PERCENTILE=10,Ht.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Ht.DEFAULT=new Ht(41943040,Ht.DEFAULT_COLLECTION_PERCENTILE,Ht.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Ht.DISABLED=new Ht(-1,0,0);var qs=class s{constructor(e){this.Nn=e}next(){return this.Nn+=2,this.Nn}static kn(){return new s(0)}static Mn(){return new s(-1)}};var Cd=class{constructor(){this.changes=new jn(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Nt.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let o=this.changes.get(t);return o!==void 0?O.resolve(o):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}};var Od=class{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}};var Nd=class{constructor(e,t,o,a){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=o,this.indexManager=a}getDocument(e,t){let o=null;return this.documentOverlayCache.getOverlay(e,t).next(a=>(o=a,this.remoteDocumentCache.getEntry(e,t))).next(a=>(o!==null&&Ls(o.mutation,a,bt.empty(),Ue.now()),a))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(o=>this.getLocalViewOfDocuments(e,o,Q()).next(()=>o))}getLocalViewOfDocuments(e,t,o=Q()){let a=wr();return this.populateOverlays(e,a,t).next(()=>this.computeViews(e,t,a,o).next(u=>{let l=Ns();return u.forEach((h,d)=>{l=l.insert(h,d.overlayedDocument)}),l}))}getOverlayedDocuments(e,t){let o=wr();return this.populateOverlays(e,o,t).next(()=>this.computeViews(e,t,o,Q()))}populateOverlays(e,t,o){let a=[];return o.forEach(u=>{t.has(u)||a.push(u)}),this.documentOverlayCache.getOverlays(e,a).next(u=>{u.forEach((l,h)=>{t.set(l,h)})})}computeViews(e,t,o,a){let u=bn(),l=Ps(),h=Ps();return t.forEach((d,f)=>{let p=o.get(f.key);a.has(f.key)&&(p===void 0||p.mutation instanceof Qt)?u=u.insert(f.key,f):p!==void 0?(l.set(f.key,p.mutation.getFieldMask()),Ls(p.mutation,f,p.mutation.getFieldMask(),Ue.now())):l.set(f.key,bt.empty())}),this.recalculateAndSaveOverlays(e,u).next(d=>(d.forEach((f,p)=>l.set(f,p)),t.forEach((f,p)=>{var m;return h.set(f,new Od(p,(m=l.get(f))!==null&&m!==void 0?m:null))}),h))}recalculateAndSaveOverlays(e,t){let o=Ps(),a=new ve((l,h)=>l-h),u=Q();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(l=>{for(let h of l)h.keys().forEach(d=>{let f=t.get(d);if(f===null)return;let p=o.get(d)||bt.empty();p=h.applyToLocalView(f,p),o.set(d,p);let m=(a.get(h.batchId)||Q()).add(d);a=a.insert(h.batchId,m)})}).next(()=>{let l=[],h=a.getReverseIterator();for(;h.hasNext();){let d=h.getNext(),f=d.key,p=d.value,m=dw();p.forEach(g=>{if(!u.has(g)){let y=ww(t.get(g),o.get(g));y!==null&&m.set(g,y),u=u.add(g)}}),l.push(this.documentOverlayCache.saveOverlays(e,f,m))}return O.waitFor(l)}).next(()=>o)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(o=>this.recalculateAndSaveOverlays(e,o))}getDocumentsMatchingQuery(e,t,o){return function(a){return B.isDocumentKey(a.path)&&a.collectionGroup===null&&a.filters.length===0}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):aw(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,o):this.getDocumentsMatchingCollectionQuery(e,t,o)}getNextDocuments(e,t,o,a){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,o,a).next(u=>{let l=a-u.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,o.largestBatchId,a-u.size):O.resolve(wr()),h=-1,d=u;return l.next(f=>O.forEach(f,(p,m)=>(h<m.largestBatchId&&(h=m.largestBatchId),u.get(p)?O.resolve():this.remoteDocumentCache.getEntry(e,p).next(g=>{d=d.insert(p,g)}))).next(()=>this.populateOverlays(e,f,u)).next(()=>this.computeViews(e,d,f,Q())).next(p=>({batchId:h,changes:hw(p)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new B(t)).next(o=>{let a=Ns();return o.isFoundDocument()&&(a=a.insert(o.key,o)),a})}getDocumentsMatchingCollectionGroupQuery(e,t,o){let a=t.collectionGroup,u=Ns();return this.indexManager.getCollectionParents(e,a).next(l=>O.forEach(l,h=>{let d=function(f,p){return new Bn(p,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(t,h.child(a));return this.getDocumentsMatchingCollectionQuery(e,d,o).next(f=>{f.forEach((p,m)=>{u=u.insert(p,m)})})}).next(()=>u))}getDocumentsMatchingCollectionQuery(e,t,o){let a;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,o.largestBatchId).next(u=>(a=u,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,o,a))).next(u=>{a.forEach((h,d)=>{let f=d.getKey();u.get(f)===null&&(u=u.insert(f,Nt.newInvalidDocument(f)))});let l=Ns();return u.forEach((h,d)=>{let f=a.get(h);f!==void 0&&Ls(f.mutation,d,bt.empty(),Ue.now()),Zc(t,d)&&(l=l.insert(h,d))}),l})}};var Dd=class{constructor(e){this.serializer=e,this.cs=new Map,this.hs=new Map}getBundleMetadata(e,t){return O.resolve(this.cs.get(t))}saveBundleMetadata(e,t){var o;return this.cs.set(t.id,{id:(o=t).id,version:o.version,createTime:Kt(o.createTime)}),O.resolve()}getNamedQuery(e,t){return O.resolve(this.hs.get(t))}saveNamedQuery(e,t){return this.hs.set(t.name,function(o){return{name:o.name,query:tR(o.bundledQuery),readTime:Kt(o.readTime)}}(t)),O.resolve()}};var Pd=class{constructor(){this.overlays=new ve(B.comparator),this.ls=new Map}getOverlay(e,t){return O.resolve(this.overlays.get(t))}getOverlays(e,t){let o=wr();return O.forEach(t,a=>this.getOverlay(e,a).next(u=>{u!==null&&o.set(a,u)})).next(()=>o)}saveOverlays(e,t,o){return o.forEach((a,u)=>{this.we(e,t,u)}),O.resolve()}removeOverlaysForBatchId(e,t,o){let a=this.ls.get(o);return a!==void 0&&(a.forEach(u=>this.overlays=this.overlays.remove(u)),this.ls.delete(o)),O.resolve()}getOverlaysForCollection(e,t,o){let a=wr(),u=t.length+1,l=new B(t.child("")),h=this.overlays.getIteratorFrom(l);for(;h.hasNext();){let d=h.getNext().value,f=d.getKey();if(!t.isPrefixOf(f.path))break;f.path.length===u&&d.largestBatchId>o&&a.set(d.getKey(),d)}return O.resolve(a)}getOverlaysForCollectionGroup(e,t,o,a){let u=new ve((f,p)=>f-p),l=this.overlays.getIterator();for(;l.hasNext();){let f=l.getNext().value;if(f.getKey().getCollectionGroup()===t&&f.largestBatchId>o){let p=u.get(f.largestBatchId);p===null&&(p=wr(),u=u.insert(f.largestBatchId,p)),p.set(f.getKey(),f)}}let h=wr(),d=u.getIterator();for(;d.hasNext()&&(d.getNext().value.forEach((f,p)=>h.set(f,p)),!(h.size()>=a)););return O.resolve(h)}we(e,t,o){let a=this.overlays.get(o.key);if(a!==null){let l=this.ls.get(a.largestBatchId).delete(o.key);this.ls.set(a.largestBatchId,l)}this.overlays=this.overlays.insert(o.key,new yd(t,o));let u=this.ls.get(t);u===void 0&&(u=Q(),this.ls.set(t,u)),this.ls.set(t,u.add(o.key))}};var zs=class{constructor(){this.fs=new Qe(_e.ds),this.ws=new Qe(_e._s)}isEmpty(){return this.fs.isEmpty()}addReference(e,t){let o=new _e(e,t);this.fs=this.fs.add(o),this.ws=this.ws.add(o)}gs(e,t){e.forEach(o=>this.addReference(o,t))}removeReference(e,t){this.ys(new _e(e,t))}ps(e,t){e.forEach(o=>this.removeReference(o,t))}Is(e){let t=new B(new pe([])),o=new _e(t,e),a=new _e(t,e+1),u=[];return this.ws.forEachInRange([o,a],l=>{this.ys(l),u.push(l.key)}),u}Ts(){this.fs.forEach(e=>this.ys(e))}ys(e){this.fs=this.fs.delete(e),this.ws=this.ws.delete(e)}Es(e){let t=new B(new pe([])),o=new _e(t,e),a=new _e(t,e+1),u=Q();return this.ws.forEachInRange([o,a],l=>{u=u.add(l.key)}),u}containsKey(e){let t=new _e(e,0),o=this.fs.firstAfterOrEqual(t);return o!==null&&e.isEqual(o.key)}},_e=class{constructor(e,t){this.key=e,this.As=t}static ds(e,t){return B.comparator(e.key,t.key)||ne(e.As,t.As)}static _s(e,t){return ne(e.As,t.As)||B.comparator(e.key,t.key)}};var Ld=class{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.vs=1,this.Rs=new Qe(_e.ds)}checkEmpty(e){return O.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,o,a){let u=this.vs;this.vs++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let l=new md(u,t,o,a);this.mutationQueue.push(l);for(let h of a)this.Rs=this.Rs.add(new _e(h.key,u)),this.indexManager.addToCollectionParentIndex(e,h.key.path.popLast());return O.resolve(l)}lookupMutationBatch(e,t){return O.resolve(this.Ps(t))}getNextMutationBatchAfterBatchId(e,t){let o=t+1,a=this.bs(o),u=a<0?0:a;return O.resolve(this.mutationQueue.length>u?this.mutationQueue[u]:null)}getHighestUnacknowledgedBatchId(){return O.resolve(this.mutationQueue.length===0?-1:this.vs-1)}getAllMutationBatches(e){return O.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let o=new _e(t,0),a=new _e(t,Number.POSITIVE_INFINITY),u=[];return this.Rs.forEachInRange([o,a],l=>{let h=this.Ps(l.As);u.push(h)}),O.resolve(u)}getAllMutationBatchesAffectingDocumentKeys(e,t){let o=new Qe(ne);return t.forEach(a=>{let u=new _e(a,0),l=new _e(a,Number.POSITIVE_INFINITY);this.Rs.forEachInRange([u,l],h=>{o=o.add(h.As)})}),O.resolve(this.Vs(o))}getAllMutationBatchesAffectingQuery(e,t){let o=t.path,a=o.length+1,u=o;B.isDocumentKey(u)||(u=u.child(""));let l=new _e(new B(u),0),h=new Qe(ne);return this.Rs.forEachWhile(d=>{let f=d.key.path;return!!o.isPrefixOf(f)&&(f.length===a&&(h=h.add(d.As)),!0)},l),O.resolve(this.Vs(h))}Vs(e){let t=[];return e.forEach(o=>{let a=this.Ps(o);a!==null&&t.push(a)}),t}removeMutationBatch(e,t){he(this.Ss(t.batchId,"removed")===0),this.mutationQueue.shift();let o=this.Rs;return O.forEach(t.mutations,a=>{let u=new _e(a.key,t.batchId);return o=o.delete(u),this.referenceDelegate.markPotentiallyOrphaned(e,a.key)}).next(()=>{this.Rs=o})}Cn(e){}containsKey(e,t){let o=new _e(t,0),a=this.Rs.firstAfterOrEqual(o);return O.resolve(t.isEqual(a&&a.key))}performConsistencyCheck(e){return this.mutationQueue.length,O.resolve()}Ss(e,t){return this.bs(e)}bs(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Ps(e){let t=this.bs(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}};var Md=class{constructor(e){this.Ds=e,this.docs=new ve(B.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){let o=t.key,a=this.docs.get(o),u=a?a.size:0,l=this.Ds(t);return this.docs=this.docs.insert(o,{document:t.mutableCopy(),size:l}),this.size+=l-u,this.indexManager.addToCollectionParentIndex(e,o.path.popLast())}removeEntry(e){let t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){let o=this.docs.get(t);return O.resolve(o?o.document.mutableCopy():Nt.newInvalidDocument(t))}getEntries(e,t){let o=bn();return t.forEach(a=>{let u=this.docs.get(a);o=o.insert(a,u?u.document.mutableCopy():Nt.newInvalidDocument(a))}),O.resolve(o)}getDocumentsMatchingQuery(e,t,o,a){let u=bn(),l=t.path,h=new B(l.child("")),d=this.docs.getIteratorFrom(h);for(;d.hasNext();){let{key:f,value:{document:p}}=d.getNext();if(!l.isPrefixOf(f.path))break;f.path.length>l.length+1||fx(dx(p),o)<=0||(a.has(p.key)||Zc(t,p))&&(u=u.insert(p.key,p.mutableCopy()))}return O.resolve(u)}getAllFromCollectionGroup(e,t,o,a){j()}Cs(e,t){return O.forEach(this.docs,o=>t(o))}newChangeBuffer(e){return new Ud(this)}getSize(e){return O.resolve(this.size)}},Ud=class extends Cd{constructor(e){super(),this.os=e}applyChanges(e){let t=[];return this.changes.forEach((o,a)=>{a.isValidDocument()?t.push(this.os.addEntry(e,a)):this.os.removeEntry(o)}),O.waitFor(t)}getFromCache(e,t){return this.os.getEntry(e,t)}getAllFromCache(e,t){return this.os.getEntries(e,t)}};var Fd=class{constructor(e){this.persistence=e,this.xs=new jn(t=>kf(t),Af),this.lastRemoteSnapshotVersion=H.min(),this.highestTargetId=0,this.Ns=0,this.ks=new zs,this.targetCount=0,this.Ms=qs.kn()}forEachTarget(e,t){return this.xs.forEach((o,a)=>t(a)),O.resolve()}getLastRemoteSnapshotVersion(e){return O.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return O.resolve(this.Ns)}allocateTargetId(e){return this.highestTargetId=this.Ms.next(),O.resolve(this.highestTargetId)}setTargetsMetadata(e,t,o){return o&&(this.lastRemoteSnapshotVersion=o),t>this.Ns&&(this.Ns=t),O.resolve()}Fn(e){this.xs.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this.Ms=new qs(t),this.highestTargetId=t),e.sequenceNumber>this.Ns&&(this.Ns=e.sequenceNumber)}addTargetData(e,t){return this.Fn(t),this.targetCount+=1,O.resolve()}updateTargetData(e,t){return this.Fn(t),O.resolve()}removeTargetData(e,t){return this.xs.delete(t.target),this.ks.Is(t.targetId),this.targetCount-=1,O.resolve()}removeTargets(e,t,o){let a=0,u=[];return this.xs.forEach((l,h)=>{h.sequenceNumber<=t&&o.get(h.targetId)===null&&(this.xs.delete(l),u.push(this.removeMatchingKeysForTargetId(e,h.targetId)),a++)}),O.waitFor(u).next(()=>a)}getTargetCount(e){return O.resolve(this.targetCount)}getTargetData(e,t){let o=this.xs.get(t)||null;return O.resolve(o)}addMatchingKeys(e,t,o){return this.ks.gs(t,o),O.resolve()}removeMatchingKeys(e,t,o){this.ks.ps(t,o);let a=this.persistence.referenceDelegate,u=[];return a&&t.forEach(l=>{u.push(a.markPotentiallyOrphaned(e,l))}),O.waitFor(u)}removeMatchingKeysForTargetId(e,t){return this.ks.Is(t),O.resolve()}getMatchingKeysForTargetId(e,t){let o=this.ks.Es(t);return O.resolve(o)}containsKey(e,t){return O.resolve(this.ks.containsKey(t))}};var $d=class{constructor(e,t){this.$s={},this.overlays={},this.Os=new Ms(0),this.Fs=!1,this.Fs=!0,this.referenceDelegate=e(this),this.Bs=new Fd(this),this.indexManager=new xd,this.remoteDocumentCache=function(o){return new Md(o)}(o=>this.referenceDelegate.Ls(o)),this.serializer=new Ad(t),this.qs=new Dd(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Fs=!1,Promise.resolve()}get started(){return this.Fs}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new Pd,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let o=this.$s[e.toKey()];return o||(o=new Ld(t,this.referenceDelegate),this.$s[e.toKey()]=o),o}getTargetCache(){return this.Bs}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.qs}runTransaction(e,t,o){U("MemoryPersistence","Starting transaction:",e);let a=new Bd(this.Os.next());return this.referenceDelegate.Us(),o(a).next(u=>this.referenceDelegate.Ks(a).next(()=>u)).toPromise().then(u=>(a.raiseOnCommittedEvent(),u))}Gs(e,t){return O.or(Object.values(this.$s).map(o=>()=>o.containsKey(e,t)))}},Bd=class extends Xh{constructor(e){super(),this.currentSequenceNumber=e}},jd=class s{constructor(e){this.persistence=e,this.Qs=new zs,this.js=null}static zs(e){return new s(e)}get Ws(){if(this.js)return this.js;throw j()}addReference(e,t,o){return this.Qs.addReference(o,t),this.Ws.delete(o.toString()),O.resolve()}removeReference(e,t,o){return this.Qs.removeReference(o,t),this.Ws.add(o.toString()),O.resolve()}markPotentiallyOrphaned(e,t){return this.Ws.add(t.toString()),O.resolve()}removeTarget(e,t){this.Qs.Is(t.targetId).forEach(a=>this.Ws.add(a.toString()));let o=this.persistence.getTargetCache();return o.getMatchingKeysForTargetId(e,t.targetId).next(a=>{a.forEach(u=>this.Ws.add(u.toString()))}).next(()=>o.removeTargetData(e,t))}Us(){this.js=new Set}Ks(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return O.forEach(this.Ws,o=>{let a=B.fromPath(o);return this.Hs(e,a).next(u=>{u||t.removeEntry(a,H.min())})}).next(()=>(this.js=null,t.apply(e)))}updateLimboDocument(e,t){return this.Hs(e,t).next(o=>{o?this.Ws.delete(t.toString()):this.Ws.add(t.toString())})}Ls(e){return 0}Hs(e,t){return O.or([()=>O.resolve(this.Qs.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Gs(e,t)])}};var Vd=class s{constructor(e,t,o,a){this.targetId=e,this.fromCache=t,this.Fi=o,this.Bi=a}static Li(e,t){let o=Q(),a=Q();for(let u of t.docChanges)switch(u.type){case 0:o=o.add(u.doc.key);break;case 1:a=a.add(u.doc.key)}return new s(e,t.fromCache,o,a)}};var qd=class{constructor(){this.qi=!1}initialize(e,t){this.Ui=e,this.indexManager=t,this.qi=!0}getDocumentsMatchingQuery(e,t,o,a){return this.Ki(e,t).next(u=>u||this.Gi(e,t,a,o)).next(u=>u||this.Qi(e,t))}Ki(e,t){if(Nv(t))return O.resolve(null);let o=wn(t);return this.indexManager.getIndexType(e,o).next(a=>a===0?null:(t.limit!==null&&a===1&&(t=Ic(t,null,"F"),o=wn(t)),this.indexManager.getDocumentsMatchingTarget(e,o).next(u=>{let l=Q(...u);return this.Ui.getDocuments(e,l).next(h=>this.indexManager.getMinOffset(e,o).next(d=>{let f=this.ji(t,h);return this.zi(t,f,l,d.readTime)?this.Ki(e,Ic(t,null,"F")):this.Wi(e,f,t,d)}))})))}Gi(e,t,o,a){return Nv(t)||a.isEqual(H.min())?this.Qi(e,t):this.Ui.getDocuments(e,o).next(u=>{let l=this.ji(t,u);return this.zi(t,l,o,a)?this.Qi(e,t):(Iv()<=Y.DEBUG&&U("QueryEngine","Re-using previous result from %s to execute query: %s",a.toString(),dd(t)),this.Wi(e,l,t,hx(a,-1)))})}ji(e,t){let o=new Qe(uw(e));return t.forEach((a,u)=>{Zc(e,u)&&(o=o.add(u))}),o}zi(e,t,o,a){if(e.limit===null)return!1;if(o.size!==t.size)return!0;let u=e.limitType==="F"?t.last():t.first();return!!u&&(u.hasPendingWrites||u.version.compareTo(a)>0)}Qi(e,t){return Iv()<=Y.DEBUG&&U("QueryEngine","Using full collection scan to execute query:",dd(t)),this.Ui.getDocumentsMatchingQuery(e,t,Ir.min())}Wi(e,t,o,a){return this.Ui.getDocumentsMatchingQuery(e,o,a).next(u=>(t.forEach(l=>{u=u.insert(l.key,l)}),u))}};var zd=class{constructor(e,t,o,a){this.persistence=e,this.Hi=t,this.serializer=a,this.Ji=new ve(ne),this.Yi=new jn(u=>kf(u),Af),this.Xi=new Map,this.Zi=e.getRemoteDocumentCache(),this.Bs=e.getTargetCache(),this.qs=e.getBundleCache(),this.tr(o)}tr(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Nd(this.Zi,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Zi.setIndexManager(this.indexManager),this.Hi.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ji))}};function nR(s,e,t,o){return new zd(s,e,t,o)}async function xw(s,e){let t=G(s);return await t.persistence.runTransaction("Handle user change","readonly",o=>{let a;return t.mutationQueue.getAllMutationBatches(o).next(u=>(a=u,t.tr(e),t.mutationQueue.getAllMutationBatches(o))).next(u=>{let l=[],h=[],d=Q();for(let f of a){l.push(f.batchId);for(let p of f.mutations)d=d.add(p.key)}for(let f of u){h.push(f.batchId);for(let p of f.mutations)d=d.add(p.key)}return t.localDocuments.getDocuments(o,d).next(f=>({er:f,removedBatchIds:l,addedBatchIds:h}))})})}function rR(s,e){let t=G(s);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",o=>{let a=e.batch.keys(),u=t.Zi.newChangeBuffer({trackRemovals:!0});return function(l,h,d,f){let p=d.batch,m=p.keys(),g=O.resolve();return m.forEach(y=>{g=g.next(()=>f.getEntry(h,y)).next(w=>{let b=d.docVersions.get(y);he(b!==null),w.version.compareTo(b)<0&&(p.applyToRemoteDocument(w,d),w.isValidDocument()&&(w.setReadTime(d.commitVersion),f.addEntry(w)))})}),g.next(()=>l.mutationQueue.removeMutationBatch(h,p))}(t,o,e,u).next(()=>u.apply(o)).next(()=>t.mutationQueue.performConsistencyCheck(o)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(o,a,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(o,function(l){let h=Q();for(let d=0;d<l.mutationResults.length;++d)l.mutationResults[d].transformResults.length>0&&(h=h.add(l.batch.mutations[d].key));return h}(e))).next(()=>t.localDocuments.getDocuments(o,a))})}function Rw(s){let e=G(s);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Bs.getLastRemoteSnapshotVersion(t))}function iR(s,e){let t=G(s),o=e.snapshotVersion,a=t.Ji;return t.persistence.runTransaction("Apply remote event","readwrite-primary",u=>{let l=t.Zi.newChangeBuffer({trackRemovals:!0});a=t.Ji;let h=[];e.targetChanges.forEach((p,m)=>{let g=a.get(m);if(!g)return;h.push(t.Bs.removeMatchingKeys(u,p.removedDocuments,m).next(()=>t.Bs.addMatchingKeys(u,p.addedDocuments,m)));let y=g.withSequenceNumber(u.currentSequenceNumber);e.targetMismatches.get(m)!==null?y=y.withResumeToken(Xe.EMPTY_BYTE_STRING,H.min()).withLastLimboFreeSnapshotVersion(H.min()):p.resumeToken.approximateByteSize()>0&&(y=y.withResumeToken(p.resumeToken,o)),a=a.insert(m,y),function(w,b,E){return w.resumeToken.approximateByteSize()===0||b.snapshotVersion.toMicroseconds()-w.snapshotVersion.toMicroseconds()>=3e8?!0:E.addedDocuments.size+E.modifiedDocuments.size+E.removedDocuments.size>0}(g,y,p)&&h.push(t.Bs.updateTargetData(u,y))});let d=bn(),f=Q();if(e.documentUpdates.forEach(p=>{e.resolvedLimboDocuments.has(p)&&h.push(t.persistence.referenceDelegate.updateLimboDocument(u,p))}),h.push(sR(u,l,e.documentUpdates).next(p=>{d=p.nr,f=p.sr})),!o.isEqual(H.min())){let p=t.Bs.getLastRemoteSnapshotVersion(u).next(m=>t.Bs.setTargetsMetadata(u,u.currentSequenceNumber,o));h.push(p)}return O.waitFor(h).next(()=>l.apply(u)).next(()=>t.localDocuments.getLocalViewOfDocuments(u,d,f)).next(()=>d)}).then(u=>(t.Ji=a,u))}function sR(s,e,t){let o=Q(),a=Q();return t.forEach(u=>o=o.add(u)),e.getEntries(s,o).next(u=>{let l=bn();return t.forEach((h,d)=>{let f=u.get(h);d.isFoundDocument()!==f.isFoundDocument()&&(a=a.add(h)),d.isNoDocument()&&d.version.isEqual(H.min())?(e.removeEntry(h,d.readTime),l=l.insert(h,d)):!f.isValidDocument()||d.version.compareTo(f.version)>0||d.version.compareTo(f.version)===0&&f.hasPendingWrites?(e.addEntry(d),l=l.insert(h,d)):U("LocalStore","Ignoring outdated watch update for ",h,". Current version:",f.version," Watch version:",d.version)}),{nr:l,sr:a}})}function oR(s,e){let t=G(s);return t.persistence.runTransaction("Get next mutation batch","readonly",o=>(e===void 0&&(e=-1),t.mutationQueue.getNextMutationBatchAfterBatchId(o,e)))}function aR(s,e){let t=G(s);return t.persistence.runTransaction("Allocate target","readwrite",o=>{let a;return t.Bs.getTargetData(o,e).next(u=>u?(a=u,O.resolve(a)):t.Bs.allocateTargetId(o).next(l=>(a=new Vs(e,l,"TargetPurposeListen",o.currentSequenceNumber),t.Bs.addTargetData(o,a).next(()=>a))))}).then(o=>{let a=t.Ji.get(o.targetId);return(a===null||o.snapshotVersion.compareTo(a.snapshotVersion)>0)&&(t.Ji=t.Ji.insert(o.targetId,o),t.Yi.set(e,o.targetId)),o})}async function Hd(s,e,t){let o=G(s),a=o.Ji.get(e),u=t?"readwrite":"readwrite-primary";try{t||await o.persistence.runTransaction("Release target",u,l=>o.persistence.referenceDelegate.removeTarget(l,a))}catch(l){if(!eo(l))throw l;U("LocalStore",`Failed to update sequence numbers for target ${e}: ${l}`)}o.Ji=o.Ji.remove(e),o.Yi.delete(a.target)}function Vv(s,e,t){let o=G(s),a=H.min(),u=Q();return o.persistence.runTransaction("Execute query","readonly",l=>function(h,d,f){let p=G(h),m=p.Yi.get(f);return m!==void 0?O.resolve(p.Ji.get(m)):p.Bs.getTargetData(d,f)}(o,l,wn(e)).next(h=>{if(h)return a=h.lastLimboFreeSnapshotVersion,o.Bs.getMatchingKeysForTargetId(l,h.targetId).next(d=>{u=d})}).next(()=>o.Hi.getDocumentsMatchingQuery(l,e,t?a:H.min(),t?u:Q())).next(h=>(cR(o,Ix(e),h),{documents:h,ir:u})))}function cR(s,e,t){let o=s.Xi.get(e)||H.min();t.forEach((a,u)=>{u.readTime.compareTo(o)>0&&(o=u.readTime)}),s.Xi.set(e,o)}var Cc=class{constructor(){this.activeTargetIds=Rx()}lr(e){this.activeTargetIds=this.activeTargetIds.add(e)}dr(e){this.activeTargetIds=this.activeTargetIds.delete(e)}hr(){let e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}};var Gd=class{constructor(){this.Hr=new Cc,this.Jr={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,o){}addLocalQueryTarget(e){return this.Hr.lr(e),this.Jr[e]||"not-current"}updateQueryState(e,t,o){this.Jr[e]=t}removeLocalQueryTarget(e){this.Hr.dr(e)}isLocalQueryTarget(e){return this.Hr.activeTargetIds.has(e)}clearQueryState(e){delete this.Jr[e]}getAllActiveQueryTargets(){return this.Hr.activeTargetIds}isActiveQueryTarget(e){return this.Hr.activeTargetIds.has(e)}start(){return this.Hr=new Cc,Promise.resolve()}handleUserChange(e,t,o){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}};var Kd=class{Yr(e){}shutdown(){}};var Oc=class{constructor(){this.Xr=()=>this.Zr(),this.eo=()=>this.no(),this.so=[],this.io()}Yr(e){this.so.push(e)}shutdown(){window.removeEventListener("online",this.Xr),window.removeEventListener("offline",this.eo)}io(){window.addEventListener("online",this.Xr),window.addEventListener("offline",this.eo)}Zr(){U("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(let e of this.so)e(0)}no(){U("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(let e of this.so)e(1)}static D(){return typeof window!="undefined"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}};var fc=null;function Bh(){return fc===null?fc=268435456+Math.round(2147483648*Math.random()):fc++,"0x"+fc.toString(16)}var uR={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};var Wd=class{constructor(e){this.ro=e.ro,this.oo=e.oo}uo(e){this.co=e}ao(e){this.ho=e}onMessage(e){this.lo=e}close(){this.oo()}send(e){this.ro(e)}fo(){this.co()}wo(e){this.ho(e)}_o(e){this.lo(e)}};var ze="WebChannelConnection",Qd=class extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;let t=e.ssl?"https":"http";this.mo=t+"://"+e.host,this.yo="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}get po(){return!1}Io(e,t,o,a,u){let l=Bh(),h=this.To(e,t);U("RestConnection",`Sending RPC '${e}' ${l}:`,h,o);let d={};return this.Eo(d,a,u),this.Ao(e,h,d,o).then(f=>(U("RestConnection",`Received RPC '${e}' ${l}: `,f),f),f=>{throw ai("RestConnection",`RPC '${e}' ${l} failed with error: `,f,"url: ",h,"request:",o),f})}vo(e,t,o,a,u,l){return this.Io(e,t,o,a,u)}Eo(e,t,o){e["X-Goog-Api-Client"]="gl-js/ fire/"+wi,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((a,u)=>e[u]=a),o&&o.headers.forEach((a,u)=>e[u]=a)}To(e,t){let o=uR[e];return`${this.mo}/v1/${t}:${o}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Ao(e,t,o,a){let u=Bh();return new Promise((l,h)=>{let d=new bv;d.setWithCredentials(!0),d.listenOnce(yv.COMPLETE,()=>{try{switch(d.getLastErrorCode()){case lc.NO_ERROR:let p=d.getResponseJson();U(ze,`XHR for RPC '${e}' ${u} received:`,JSON.stringify(p)),l(p);break;case lc.TIMEOUT:U(ze,`RPC '${e}' ${u} timed out`),h(new D(S.DEADLINE_EXCEEDED,"Request time out"));break;case lc.HTTP_ERROR:let m=d.getStatus();if(U(ze,`RPC '${e}' ${u} failed with status:`,m,"response text:",d.getResponseText()),m>0){let g=d.getResponseJson();Array.isArray(g)&&(g=g[0]);let y=g==null?void 0:g.error;if(y&&y.status&&y.message){let w=function(b){let E=b.toLowerCase().replace(/_/g,"-");return Object.values(S).indexOf(E)>=0?E:S.UNKNOWN}(y.status);h(new D(w,y.message))}else h(new D(S.UNKNOWN,"Server responded with status "+d.getStatus()))}else h(new D(S.UNAVAILABLE,"Connection failed."));break;default:j()}}finally{U(ze,`RPC '${e}' ${u} completed.`)}});let f=JSON.stringify(a);U(ze,`RPC '${e}' ${u} sending request:`,a),d.send(t,"POST",f,o,15)})}Ro(e,t,o){let a=Bh(),u=[this.mo,"/","google.firestore.v1.Firestore","/",e,"/channel"],l=mv(),h=gv(),d={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},f=this.longPollingOptions.timeoutSeconds;f!==void 0&&(d.longPollingTimeout=Math.round(1e3*f)),this.useFetchStreams&&(d.xmlHttpFactory=new wv({})),this.Eo(d.initMessageHeaders,t,o),d.encodeInitMessageHeaders=!0;let p=u.join("");U(ze,`Creating RPC '${e}' stream ${a}: ${p}`,d);let m=l.createWebChannel(p,d),g=!1,y=!1,w=new Wd({ro:E=>{y?U(ze,`Not sending because RPC '${e}' stream ${a} is closed:`,E):(g||(U(ze,`Opening RPC '${e}' stream ${a} transport.`),m.open(),g=!0),U(ze,`RPC '${e}' stream ${a} sending:`,E),m.send(E))},oo:()=>m.close()}),b=(E,k,x)=>{E.listen(k,C=>{try{x(C)}catch(P){setTimeout(()=>{throw P},0)}})};return b(m,Os.EventType.OPEN,()=>{y||U(ze,`RPC '${e}' stream ${a} transport opened.`)}),b(m,Os.EventType.CLOSE,()=>{y||(y=!0,U(ze,`RPC '${e}' stream ${a} transport closed`),w.wo())}),b(m,Os.EventType.ERROR,E=>{y||(y=!0,ai(ze,`RPC '${e}' stream ${a} transport errored:`,E),w.wo(new D(S.UNAVAILABLE,"The operation could not be completed")))}),b(m,Os.EventType.MESSAGE,E=>{var k;if(!y){let x=E.data[0];he(!!x);let C=x,P=C.error||((k=C[0])===null||k===void 0?void 0:k.error);if(P){U(ze,`RPC '${e}' stream ${a} received error:`,P);let K=P.status,ee=function(ce){let ft=be[ce];if(ft!==void 0)return _w(ft)}(K),Te=P.message;ee===void 0&&(ee=S.INTERNAL,Te="Unknown error status: "+K+" with message "+P.message),y=!0,w.wo(new D(ee,Te)),m.close()}else U(ze,`RPC '${e}' stream ${a} received:`,x),w._o(x)}}),b(h,vv.STAT_EVENT,E=>{E.stat===Fh.PROXY?U(ze,`RPC '${e}' stream ${a} detected buffering proxy`):E.stat===Fh.NOPROXY&&U(ze,`RPC '${e}' stream ${a} detected no buffering proxy`)}),setTimeout(()=>{w.fo()},0),w}};function jh(){return typeof document!="undefined"?document:null}function eu(s){return new Ed(s,!0)}var Nc=class{constructor(e,t,o=1e3,a=1.5,u=6e4){this.ii=e,this.timerId=t,this.Po=o,this.bo=a,this.Vo=u,this.So=0,this.Do=null,this.Co=Date.now(),this.reset()}reset(){this.So=0}xo(){this.So=this.Vo}No(e){this.cancel();let t=Math.floor(this.So+this.ko()),o=Math.max(0,Date.now()-this.Co),a=Math.max(0,t-o);a>0&&U("ExponentialBackoff",`Backing off for ${a} ms (base delay: ${this.So} ms, delay with jitter: ${t} ms, last attempt: ${o} ms ago)`),this.Do=this.ii.enqueueAfterDelay(this.timerId,a,()=>(this.Co=Date.now(),e())),this.So*=this.bo,this.So<this.Po&&(this.So=this.Po),this.So>this.Vo&&(this.So=this.Vo)}Mo(){this.Do!==null&&(this.Do.skipDelay(),this.Do=null)}cancel(){this.Do!==null&&(this.Do.cancel(),this.Do=null)}ko(){return(Math.random()-.5)*this.So}};var Dc=class{constructor(e,t,o,a,u,l,h,d){this.ii=e,this.$o=o,this.Oo=a,this.connection=u,this.authCredentialsProvider=l,this.appCheckCredentialsProvider=h,this.listener=d,this.state=0,this.Fo=0,this.Bo=null,this.Lo=null,this.stream=null,this.qo=new Nc(e,t)}Uo(){return this.state===1||this.state===5||this.Ko()}Ko(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.Go()}async stop(){this.Uo()&&await this.close(0)}Qo(){this.state=0,this.qo.reset()}jo(){this.Ko()&&this.Bo===null&&(this.Bo=this.ii.enqueueAfterDelay(this.$o,6e4,()=>this.zo()))}Wo(e){this.Ho(),this.stream.send(e)}async zo(){if(this.Ko())return this.close(0)}Ho(){this.Bo&&(this.Bo.cancel(),this.Bo=null)}Jo(){this.Lo&&(this.Lo.cancel(),this.Lo=null)}async close(e,t){this.Ho(),this.Jo(),this.qo.cancel(),this.Fo++,e!==4?this.qo.reset():t&&t.code===S.RESOURCE_EXHAUSTED?(vn(t.toString()),vn("Using maximum backoff delay to prevent overloading the backend."),this.qo.xo()):t&&t.code===S.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.Yo(),this.stream.close(),this.stream=null),this.state=e,await this.listener.ao(t)}Yo(){}auth(){this.state=1;let e=this.Xo(this.Fo),t=this.Fo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([o,a])=>{this.Fo===t&&this.Zo(o,a)},o=>{e(()=>{let a=new D(S.UNKNOWN,"Fetching auth token failed: "+o.message);return this.tu(a)})})}Zo(e,t){let o=this.Xo(this.Fo);this.stream=this.eu(e,t),this.stream.uo(()=>{o(()=>(this.state=2,this.Lo=this.ii.enqueueAfterDelay(this.Oo,1e4,()=>(this.Ko()&&(this.state=3),Promise.resolve())),this.listener.uo()))}),this.stream.ao(a=>{o(()=>this.tu(a))}),this.stream.onMessage(a=>{o(()=>this.onMessage(a))})}Go(){this.state=5,this.qo.No(async()=>{this.state=0,this.start()})}tu(e){return U("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}Xo(e){return t=>{this.ii.enqueueAndForget(()=>this.Fo===e?t():(U("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}},Jd=class extends Dc{constructor(e,t,o,a,u,l){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,o,a,l),this.serializer=u}eu(e,t){return this.connection.Ro("Listen",e,t)}onMessage(e){this.qo.reset();let t=zx(this.serializer,e),o=function(a){if(!("targetChange"in a))return H.min();let u=a.targetChange;return u.targetIds&&u.targetIds.length?H.min():u.readTime?Kt(u.readTime):H.min()}(e);return this.listener.nu(t,o)}su(e){let t={};t.database=kd(this.serializer),t.addTarget=function(a,u){let l,h=u.target;if(l=ld(h)?{documents:Kx(a,h)}:{query:Wx(a,h)},l.targetId=u.targetId,u.resumeToken.approximateByteSize()>0){l.resumeToken=Ew(a,u.resumeToken);let d=Id(a,u.expectedCount);d!==null&&(l.expectedCount=d)}else if(u.snapshotVersion.compareTo(H.min())>0){l.readTime=xc(a,u.snapshotVersion.toTimestamp());let d=Id(a,u.expectedCount);d!==null&&(l.expectedCount=d)}return l}(this.serializer,e);let o=Jx(this.serializer,e);o&&(t.labels=o),this.Wo(t)}iu(e){let t={};t.database=kd(this.serializer),t.removeTarget=e,this.Wo(t)}},Xd=class extends Dc{constructor(e,t,o,a,u,l){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,o,a,l),this.serializer=u,this.ru=!1}get ou(){return this.ru}start(){this.ru=!1,this.lastStreamToken=void 0,super.start()}Yo(){this.ru&&this.uu([])}eu(e,t){return this.connection.Ro("Write",e,t)}onMessage(e){if(he(!!e.streamToken),this.lastStreamToken=e.streamToken,this.ru){this.qo.reset();let t=Gx(e.writeResults,e.commitTime),o=Kt(e.commitTime);return this.listener.cu(o,t)}return he(!e.writeResults||e.writeResults.length===0),this.ru=!0,this.listener.au()}hu(){let e={};e.database=kd(this.serializer),this.Wo(e)}uu(e){let t={streamToken:this.lastStreamToken,writes:e.map(o=>Hx(this.serializer,o))};this.Wo(t)}};var Yd=class extends class{}{constructor(e,t,o,a){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=o,this.serializer=a,this.lu=!1}fu(){if(this.lu)throw new D(S.FAILED_PRECONDITION,"The client has already been terminated.")}Io(e,t,o){return this.fu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([a,u])=>this.connection.Io(e,t,o,a,u)).catch(a=>{throw a.name==="FirebaseError"?(a.code===S.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),a):new D(S.UNKNOWN,a.toString())})}vo(e,t,o,a){return this.fu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([u,l])=>this.connection.vo(e,t,o,u,l,a)).catch(u=>{throw u.name==="FirebaseError"?(u.code===S.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),u):new D(S.UNKNOWN,u.toString())})}terminate(){this.lu=!0}};var Zd=class{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.wu=0,this._u=null,this.mu=!0}gu(){this.wu===0&&(this.yu("Unknown"),this._u=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._u=null,this.pu("Backend didn't respond within 10 seconds."),this.yu("Offline"),Promise.resolve())))}Iu(e){this.state==="Online"?this.yu("Unknown"):(this.wu++,this.wu>=1&&(this.Tu(),this.pu(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.yu("Offline")))}set(e){this.Tu(),this.wu=0,e==="Online"&&(this.mu=!1),this.yu(e)}yu(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}pu(e){let t=`Could not reach Cloud Firestore backend. ${e}
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.mu?(vn(t),this.mu=!1):U("OnlineStateTracker",t)}Tu(){this._u!==null&&(this._u.cancel(),this._u=null)}};var ef=class{constructor(e,t,o,a,u){this.localStore=e,this.datastore=t,this.asyncQueue=o,this.remoteSyncer={},this.Eu=[],this.Au=new Map,this.vu=new Set,this.Ru=[],this.Pu=u,this.Pu.Yr(l=>{o.enqueueAndForget(async()=>{Rr(this)&&(U("RemoteStore","Restarting streams for network reachability change."),await async function(h){let d=G(h);d.vu.add(4),await to(d),d.bu.set("Unknown"),d.vu.delete(4),await tu(d)}(this))})}),this.bu=new Zd(o,a)}};async function tu(s){if(Rr(s))for(let e of s.Ru)await e(!0)}async function to(s){for(let e of s.Ru)await e(!1)}function Cw(s,e){let t=G(s);t.Au.has(e.targetId)||(t.Au.set(e.targetId,e),Nf(t)?Of(t):bi(t).Ko()&&Cf(t,e))}function Ow(s,e){let t=G(s),o=bi(t);t.Au.delete(e),o.Ko()&&Nw(t,e),t.Au.size===0&&(o.Ko()?o.jo():Rr(t)&&t.bu.set("Unknown"))}function Cf(s,e){if(s.Vu.qt(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(H.min())>0){let t=s.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}bi(s).su(e)}function Nw(s,e){s.Vu.qt(e),bi(s).iu(e)}function Of(s){s.Vu=new _d({getRemoteKeysForTarget:e=>s.remoteSyncer.getRemoteKeysForTarget(e),le:e=>s.Au.get(e)||null,ue:()=>s.datastore.serializer.databaseId}),bi(s).start(),s.bu.gu()}function Nf(s){return Rr(s)&&!bi(s).Uo()&&s.Au.size>0}function Rr(s){return G(s).vu.size===0}function Dw(s){s.Vu=void 0}async function lR(s){s.Au.forEach((e,t)=>{Cf(s,e)})}async function hR(s,e){Dw(s),Nf(s)?(s.bu.Iu(e),Of(s)):s.bu.set("Unknown")}async function dR(s,e,t){if(s.bu.set("Online"),e instanceof kc&&e.state===2&&e.cause)try{await async function(o,a){let u=a.cause;for(let l of a.targetIds)o.Au.has(l)&&(await o.remoteSyncer.rejectListen(l,u),o.Au.delete(l),o.Vu.removeTarget(l))}(s,e)}catch(o){U("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),o),await Pc(s,o)}else if(e instanceof si?s.Vu.Ht(e):e instanceof Sc?s.Vu.ne(e):s.Vu.Xt(e),!t.isEqual(H.min()))try{let o=await Rw(s.localStore);t.compareTo(o)>=0&&await function(a,u){let l=a.Vu.ce(u);return l.targetChanges.forEach((h,d)=>{if(h.resumeToken.approximateByteSize()>0){let f=a.Au.get(d);f&&a.Au.set(d,f.withResumeToken(h.resumeToken,u))}}),l.targetMismatches.forEach((h,d)=>{let f=a.Au.get(h);if(!f)return;a.Au.set(h,f.withResumeToken(Xe.EMPTY_BYTE_STRING,f.snapshotVersion)),Nw(a,h);let p=new Vs(f.target,h,d,f.sequenceNumber);Cf(a,p)}),a.remoteSyncer.applyRemoteEvent(l)}(s,t)}catch(o){U("RemoteStore","Failed to raise snapshot:",o),await Pc(s,o)}}async function Pc(s,e,t){if(!eo(e))throw e;s.vu.add(1),await to(s),s.bu.set("Offline"),t||(t=()=>Rw(s.localStore)),s.asyncQueue.enqueueRetryable(async()=>{U("RemoteStore","Retrying IndexedDB access"),await t(),s.vu.delete(1),await tu(s)})}function Pw(s,e){return e().catch(t=>Pc(s,t,e))}async function nu(s){let e=G(s),t=Vn(e),o=e.Eu.length>0?e.Eu[e.Eu.length-1].batchId:-1;for(;fR(e);)try{let a=await oR(e.localStore,o);if(a===null){e.Eu.length===0&&t.jo();break}o=a.batchId,pR(e,a)}catch(a){await Pc(e,a)}Lw(e)&&Mw(e)}function fR(s){return Rr(s)&&s.Eu.length<10}function pR(s,e){s.Eu.push(e);let t=Vn(s);t.Ko()&&t.ou&&t.uu(e.mutations)}function Lw(s){return Rr(s)&&!Vn(s).Uo()&&s.Eu.length>0}function Mw(s){Vn(s).start()}async function mR(s){Vn(s).hu()}async function gR(s){let e=Vn(s);for(let t of s.Eu)e.uu(t.mutations)}async function yR(s,e,t){let o=s.Eu.shift(),a=gd.from(o,e,t);await Pw(s,()=>s.remoteSyncer.applySuccessfulWrite(a)),await nu(s)}async function vR(s,e){e&&Vn(s).ou&&await async function(t,o){if(a=o.code,Mx(a)&&a!==S.ABORTED){let u=t.Eu.shift();Vn(t).Qo(),await Pw(t,()=>t.remoteSyncer.rejectFailedWrite(u.batchId,o)),await nu(t)}var a}(s,e),Lw(s)&&Mw(s)}async function qv(s,e){let t=G(s);t.asyncQueue.verifyOperationInProgress(),U("RemoteStore","RemoteStore received new credentials");let o=Rr(t);t.vu.add(3),await to(t),o&&t.bu.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.vu.delete(3),await tu(t)}async function wR(s,e){let t=G(s);e?(t.vu.delete(2),await tu(t)):e||(t.vu.add(2),await to(t),t.bu.set("Unknown"))}function bi(s){return s.Su||(s.Su=function(e,t,o){let a=G(e);return a.fu(),new Jd(t,a.connection,a.authCredentials,a.appCheckCredentials,a.serializer,o)}(s.datastore,s.asyncQueue,{uo:lR.bind(null,s),ao:hR.bind(null,s),nu:dR.bind(null,s)}),s.Ru.push(async e=>{e?(s.Su.Qo(),Nf(s)?Of(s):s.bu.set("Unknown")):(await s.Su.stop(),Dw(s))})),s.Su}function Vn(s){return s.Du||(s.Du=function(e,t,o){let a=G(e);return a.fu(),new Xd(t,a.connection,a.authCredentials,a.appCheckCredentials,a.serializer,o)}(s.datastore,s.asyncQueue,{uo:mR.bind(null,s),ao:vR.bind(null,s),au:gR.bind(null,s),cu:yR.bind(null,s)}),s.Ru.push(async e=>{e?(s.Du.Qo(),await nu(s)):(await s.Du.stop(),s.Eu.length>0&&(U("RemoteStore",`Stopping write stream with ${s.Eu.length} pending writes`),s.Eu=[]))})),s.Du}var tf=class s{constructor(e,t,o,a,u){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=o,this.op=a,this.removalCallback=u,this.deferred=new Ot,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(l=>{})}static createAndSchedule(e,t,o,a,u){let l=Date.now()+o,h=new s(e,t,l,a,u);return h.start(o),h}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new D(S.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}};function Df(s,e){if(vn("AsyncQueue",`${e}: ${s}`),eo(s))return new D(S.UNAVAILABLE,`${e}: ${s}`);throw s}var Lc=class s{constructor(e){this.comparator=e?(t,o)=>e(t,o)||B.comparator(t.key,o.key):(t,o)=>B.comparator(t.key,o.key),this.keyedMap=Ns(),this.sortedSet=new ve(this.comparator)}static emptySet(e){return new s(e.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){let t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,o)=>(e(t),!1))}add(e){let t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){let t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof s)||this.size!==e.size)return!1;let t=this.sortedSet.getIterator(),o=e.sortedSet.getIterator();for(;t.hasNext();){let a=t.getNext().key,u=o.getNext().key;if(!a.isEqual(u))return!1}return!0}toString(){let e=[];return this.forEach(t=>{e.push(t.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
  `+e.join(`  
`)+`
)`}copy(e,t){let o=new s;return o.comparator=this.comparator,o.keyedMap=e,o.sortedSet=t,o}};var Mc=class{constructor(){this.Cu=new ve(B.comparator)}track(e){let t=e.doc.key,o=this.Cu.get(t);o?e.type!==0&&o.type===3?this.Cu=this.Cu.insert(t,e):e.type===3&&o.type!==1?this.Cu=this.Cu.insert(t,{type:o.type,doc:e.doc}):e.type===2&&o.type===2?this.Cu=this.Cu.insert(t,{type:2,doc:e.doc}):e.type===2&&o.type===0?this.Cu=this.Cu.insert(t,{type:0,doc:e.doc}):e.type===1&&o.type===0?this.Cu=this.Cu.remove(t):e.type===1&&o.type===2?this.Cu=this.Cu.insert(t,{type:1,doc:o.doc}):e.type===0&&o.type===1?this.Cu=this.Cu.insert(t,{type:2,doc:e.doc}):j():this.Cu=this.Cu.insert(t,e)}xu(){let e=[];return this.Cu.inorderTraversal((t,o)=>{e.push(o)}),e}},gi=class s{constructor(e,t,o,a,u,l,h,d,f){this.query=e,this.docs=t,this.oldDocs=o,this.docChanges=a,this.mutatedKeys=u,this.fromCache=l,this.syncStateChanged=h,this.excludesMetadataChanges=d,this.hasCachedResults=f}static fromInitialDocuments(e,t,o,a,u){let l=[];return t.forEach(h=>{l.push({type:0,doc:h})}),new s(e,t,Lc.emptySet(t),l,o,a,!0,!1,u)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Yc(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;let t=this.docChanges,o=e.docChanges;if(t.length!==o.length)return!1;for(let a=0;a<t.length;a++)if(t[a].type!==o[a].type||!t[a].doc.isEqual(o[a].doc))return!1;return!0}};var nf=class{constructor(){this.Nu=void 0,this.listeners=[]}},rf=class{constructor(){this.queries=new jn(e=>cw(e),Yc),this.onlineState="Unknown",this.ku=new Set}};async function Pf(s,e){let t=G(s),o=e.query,a=!1,u=t.queries.get(o);if(u||(a=!0,u=new nf),a)try{u.Nu=await t.onListen(o)}catch(l){let h=Df(l,`Initialization of query '${dd(e.query)}' failed`);return void e.onError(h)}t.queries.set(o,u),u.listeners.push(e),e.Mu(t.onlineState),u.Nu&&e.$u(u.Nu)&&Mf(t)}async function Lf(s,e){let t=G(s),o=e.query,a=!1,u=t.queries.get(o);if(u){let l=u.listeners.indexOf(e);l>=0&&(u.listeners.splice(l,1),a=u.listeners.length===0)}if(a)return t.queries.delete(o),t.onUnlisten(o)}function bR(s,e){let t=G(s),o=!1;for(let a of e){let u=a.query,l=t.queries.get(u);if(l){for(let h of l.listeners)h.$u(a)&&(o=!0);l.Nu=a}}o&&Mf(t)}function _R(s,e,t){let o=G(s),a=o.queries.get(e);if(a)for(let u of a.listeners)u.onError(t);o.queries.delete(e)}function Mf(s){s.ku.forEach(e=>{e.next()})}var Hs=class{constructor(e,t,o){this.query=e,this.Ou=t,this.Fu=!1,this.Bu=null,this.onlineState="Unknown",this.options=o||{}}$u(e){if(!this.options.includeMetadataChanges){let o=[];for(let a of e.docChanges)a.type!==3&&o.push(a);e=new gi(e.query,e.docs,e.oldDocs,o,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Fu?this.Lu(e)&&(this.Ou.next(e),t=!0):this.qu(e,this.onlineState)&&(this.Uu(e),t=!0),this.Bu=e,t}onError(e){this.Ou.error(e)}Mu(e){this.onlineState=e;let t=!1;return this.Bu&&!this.Fu&&this.qu(this.Bu,e)&&(this.Uu(this.Bu),t=!0),t}qu(e,t){if(!e.fromCache)return!0;let o=t!=="Offline";return(!this.options.Ku||!o)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}Lu(e){if(e.docChanges.length>0)return!0;let t=this.Bu&&this.Bu.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}Uu(e){e=gi.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Fu=!0,this.Ou.next(e)}};var Uc=class{constructor(e){this.key=e}},Fc=class{constructor(e){this.key=e}},sf=class{constructor(e,t){this.query=e,this.Yu=t,this.Xu=null,this.hasCachedResults=!1,this.current=!1,this.Zu=Q(),this.mutatedKeys=Q(),this.tc=uw(e),this.ec=new Lc(this.tc)}get nc(){return this.Yu}sc(e,t){let o=t?t.ic:new Mc,a=t?t.ec:this.ec,u=t?t.mutatedKeys:this.mutatedKeys,l=a,h=!1,d=this.query.limitType==="F"&&a.size===this.query.limit?a.last():null,f=this.query.limitType==="L"&&a.size===this.query.limit?a.first():null;if(e.inorderTraversal((p,m)=>{let g=a.get(p),y=Zc(this.query,m)?m:null,w=!!g&&this.mutatedKeys.has(g.key),b=!!y&&(y.hasLocalMutations||this.mutatedKeys.has(y.key)&&y.hasCommittedMutations),E=!1;g&&y?g.data.isEqual(y.data)?w!==b&&(o.track({type:3,doc:y}),E=!0):this.rc(g,y)||(o.track({type:2,doc:y}),E=!0,(d&&this.tc(y,d)>0||f&&this.tc(y,f)<0)&&(h=!0)):!g&&y?(o.track({type:0,doc:y}),E=!0):g&&!y&&(o.track({type:1,doc:g}),E=!0,(d||f)&&(h=!0)),E&&(y?(l=l.add(y),u=b?u.add(p):u.delete(p)):(l=l.delete(p),u=u.delete(p)))}),this.query.limit!==null)for(;l.size>this.query.limit;){let p=this.query.limitType==="F"?l.last():l.first();l=l.delete(p.key),u=u.delete(p.key),o.track({type:1,doc:p})}return{ec:l,ic:o,zi:h,mutatedKeys:u}}rc(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,o){let a=this.ec;this.ec=e.ec,this.mutatedKeys=e.mutatedKeys;let u=e.ic.xu();u.sort((f,p)=>function(m,g){let y=w=>{switch(w){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return j()}};return y(m)-y(g)}(f.type,p.type)||this.tc(f.doc,p.doc)),this.oc(o);let l=t?this.uc():[],h=this.Zu.size===0&&this.current?1:0,d=h!==this.Xu;return this.Xu=h,u.length!==0||d?{snapshot:new gi(this.query,e.ec,a,u,e.mutatedKeys,h===0,d,!1,!!o&&o.resumeToken.approximateByteSize()>0),cc:l}:{cc:l}}Mu(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({ec:this.ec,ic:new Mc,mutatedKeys:this.mutatedKeys,zi:!1},!1)):{cc:[]}}ac(e){return!this.Yu.has(e)&&!!this.ec.has(e)&&!this.ec.get(e).hasLocalMutations}oc(e){e&&(e.addedDocuments.forEach(t=>this.Yu=this.Yu.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.Yu=this.Yu.delete(t)),this.current=e.current)}uc(){if(!this.current)return[];let e=this.Zu;this.Zu=Q(),this.ec.forEach(o=>{this.ac(o.key)&&(this.Zu=this.Zu.add(o.key))});let t=[];return e.forEach(o=>{this.Zu.has(o)||t.push(new Fc(o))}),this.Zu.forEach(o=>{e.has(o)||t.push(new Uc(o))}),t}hc(e){this.Yu=e.ir,this.Zu=Q();let t=this.sc(e.documents);return this.applyChanges(t,!0)}lc(){return gi.fromInitialDocuments(this.query,this.ec,this.mutatedKeys,this.Xu===0,this.hasCachedResults)}},of=class{constructor(e,t,o){this.query=e,this.targetId=t,this.view=o}},af=class{constructor(e){this.key=e,this.fc=!1}},cf=class{constructor(e,t,o,a,u,l){this.localStore=e,this.remoteStore=t,this.eventManager=o,this.sharedClientState=a,this.currentUser=u,this.maxConcurrentLimboResolutions=l,this.dc={},this.wc=new jn(h=>cw(h),Yc),this._c=new Map,this.mc=new Set,this.gc=new ve(B.comparator),this.yc=new Map,this.Ic=new zs,this.Tc={},this.Ec=new Map,this.Ac=qs.Mn(),this.onlineState="Unknown",this.vc=void 0}get isPrimaryClient(){return this.vc===!0}};async function ER(s,e){let t=NR(s),o,a,u=t.wc.get(e);if(u)o=u.targetId,t.sharedClientState.addLocalQueryTarget(o),a=u.view.lc();else{let l=await aR(t.localStore,wn(e)),h=t.sharedClientState.addLocalQueryTarget(l.targetId);o=l.targetId,a=await IR(t,e,o,h==="current",l.resumeToken),t.isPrimaryClient&&Cw(t.remoteStore,l)}return a}async function IR(s,e,t,o,a){s.Rc=(m,g,y)=>async function(w,b,E,k){let x=b.view.sc(E);x.zi&&(x=await Vv(w.localStore,b.query,!1).then(({documents:K})=>b.view.sc(K,x)));let C=k&&k.targetChanges.get(b.targetId),P=b.view.applyChanges(x,w.isPrimaryClient,C);return Hv(w,b.targetId,P.cc),P.snapshot}(s,m,g,y);let u=await Vv(s.localStore,e,!0),l=new sf(e,u.ir),h=l.sc(u.documents),d=js.createSynthesizedTargetChangeForCurrentChange(t,o&&s.onlineState!=="Offline",a),f=l.applyChanges(h,s.isPrimaryClient,d);Hv(s,t,f.cc);let p=new of(e,t,l);return s.wc.set(e,p),s._c.has(t)?s._c.get(t).push(e):s._c.set(t,[e]),f.snapshot}async function TR(s,e){let t=G(s),o=t.wc.get(e),a=t._c.get(o.targetId);if(a.length>1)return t._c.set(o.targetId,a.filter(u=>!Yc(u,e))),void t.wc.delete(e);t.isPrimaryClient?(t.sharedClientState.removeLocalQueryTarget(o.targetId),t.sharedClientState.isActiveQueryTarget(o.targetId)||await Hd(t.localStore,o.targetId,!1).then(()=>{t.sharedClientState.clearQueryState(o.targetId),Ow(t.remoteStore,o.targetId),uf(t,o.targetId)}).catch(Zs)):(uf(t,o.targetId),await Hd(t.localStore,o.targetId,!0))}async function SR(s,e,t){let o=DR(s);try{let a=await function(u,l){let h=G(u),d=Ue.now(),f=l.reduce((g,y)=>g.add(y.key),Q()),p,m;return h.persistence.runTransaction("Locally write mutations","readwrite",g=>{let y=bn(),w=Q();return h.Zi.getEntries(g,f).next(b=>{y=b,y.forEach((E,k)=>{k.isValidDocument()||(w=w.add(E))})}).next(()=>h.localDocuments.getOverlayedDocuments(g,y)).next(b=>{p=b;let E=[];for(let k of l){let x=Lx(k,p.get(k.key).overlayedDocument);x!=null&&E.push(new Qt(k.key,x,tw(x.value.mapValue),yn.exists(!0)))}return h.mutationQueue.addMutationBatch(g,d,E,l)}).next(b=>{m=b;let E=b.applyToLocalDocumentSet(p,w);return h.documentOverlayCache.saveOverlays(g,b.batchId,E)})}).then(()=>({batchId:m.batchId,changes:hw(p)}))}(o.localStore,e);o.sharedClientState.addPendingMutation(a.batchId),function(u,l,h){let d=u.Tc[u.currentUser.toKey()];d||(d=new ve(ne)),d=d.insert(l,h),u.Tc[u.currentUser.toKey()]=d}(o,a.batchId,t),await no(o,a.changes),await nu(o.remoteStore)}catch(a){let u=Df(a,"Failed to persist write");t.reject(u)}}async function Uw(s,e){let t=G(s);try{let o=await iR(t.localStore,e);e.targetChanges.forEach((a,u)=>{let l=t.yc.get(u);l&&(he(a.addedDocuments.size+a.modifiedDocuments.size+a.removedDocuments.size<=1),a.addedDocuments.size>0?l.fc=!0:a.modifiedDocuments.size>0?he(l.fc):a.removedDocuments.size>0&&(he(l.fc),l.fc=!1))}),await no(t,o,e)}catch(o){await Zs(o)}}function zv(s,e,t){let o=G(s);if(o.isPrimaryClient&&t===0||!o.isPrimaryClient&&t===1){let a=[];o.wc.forEach((u,l)=>{let h=l.view.Mu(e);h.snapshot&&a.push(h.snapshot)}),function(u,l){let h=G(u);h.onlineState=l;let d=!1;h.queries.forEach((f,p)=>{for(let m of p.listeners)m.Mu(l)&&(d=!0)}),d&&Mf(h)}(o.eventManager,e),a.length&&o.dc.nu(a),o.onlineState=e,o.isPrimaryClient&&o.sharedClientState.setOnlineState(e)}}async function kR(s,e,t){let o=G(s);o.sharedClientState.updateQueryState(e,"rejected",t);let a=o.yc.get(e),u=a&&a.key;if(u){let l=new ve(B.comparator);l=l.insert(u,Nt.newNoDocument(u,H.min()));let h=Q().add(u),d=new Tc(H.min(),new Map,new ve(ne),l,h);await Uw(o,d),o.gc=o.gc.remove(u),o.yc.delete(e),Uf(o)}else await Hd(o.localStore,e,!1).then(()=>uf(o,e,t)).catch(Zs)}async function AR(s,e){let t=G(s),o=e.batch.batchId;try{let a=await rR(t.localStore,e);$w(t,o,null),Fw(t,o),t.sharedClientState.updateMutationState(o,"acknowledged"),await no(t,a)}catch(a){await Zs(a)}}async function xR(s,e,t){let o=G(s);try{let a=await function(u,l){let h=G(u);return h.persistence.runTransaction("Reject batch","readwrite-primary",d=>{let f;return h.mutationQueue.lookupMutationBatch(d,l).next(p=>(he(p!==null),f=p.keys(),h.mutationQueue.removeMutationBatch(d,p))).next(()=>h.mutationQueue.performConsistencyCheck(d)).next(()=>h.documentOverlayCache.removeOverlaysForBatchId(d,f,l)).next(()=>h.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(d,f)).next(()=>h.localDocuments.getDocuments(d,f))})}(o.localStore,e);$w(o,e,t),Fw(o,e),o.sharedClientState.updateMutationState(e,"rejected",t),await no(o,a)}catch(a){await Zs(a)}}function Fw(s,e){(s.Ec.get(e)||[]).forEach(t=>{t.resolve()}),s.Ec.delete(e)}function $w(s,e,t){let o=G(s),a=o.Tc[o.currentUser.toKey()];if(a){let u=a.get(e);u&&(t?u.reject(t):u.resolve(),a=a.remove(e)),o.Tc[o.currentUser.toKey()]=a}}function uf(s,e,t=null){s.sharedClientState.removeLocalQueryTarget(e);for(let o of s._c.get(e))s.wc.delete(o),t&&s.dc.Pc(o,t);s._c.delete(e),s.isPrimaryClient&&s.Ic.Is(e).forEach(o=>{s.Ic.containsKey(o)||Bw(s,o)})}function Bw(s,e){s.mc.delete(e.path.canonicalString());let t=s.gc.get(e);t!==null&&(Ow(s.remoteStore,t),s.gc=s.gc.remove(e),s.yc.delete(t),Uf(s))}function Hv(s,e,t){for(let o of t)o instanceof Uc?(s.Ic.addReference(o.key,e),RR(s,o)):o instanceof Fc?(U("SyncEngine","Document no longer in limbo: "+o.key),s.Ic.removeReference(o.key,e),s.Ic.containsKey(o.key)||Bw(s,o.key)):j()}function RR(s,e){let t=e.key,o=t.path.canonicalString();s.gc.get(t)||s.mc.has(o)||(U("SyncEngine","New document in limbo: "+t),s.mc.add(o),Uf(s))}function Uf(s){for(;s.mc.size>0&&s.gc.size<s.maxConcurrentLimboResolutions;){let e=s.mc.values().next().value;s.mc.delete(e);let t=new B(pe.fromString(e)),o=s.Ac.next();s.yc.set(o,new af(t)),s.gc=s.gc.insert(t,o),Cw(s.remoteStore,new Vs(wn(Jc(t.path)),o,"TargetPurposeLimboResolution",Ms.ct))}}async function no(s,e,t){let o=G(s),a=[],u=[],l=[];o.wc.isEmpty()||(o.wc.forEach((h,d)=>{l.push(o.Rc(d,e,t).then(f=>{if((f||t)&&o.isPrimaryClient&&o.sharedClientState.updateQueryState(d.targetId,f!=null&&f.fromCache?"not-current":"current"),f){a.push(f);let p=Vd.Li(d.targetId,f);u.push(p)}}))}),await Promise.all(l),o.dc.nu(a),await async function(h,d){let f=G(h);try{await f.persistence.runTransaction("notifyLocalViewChanges","readwrite",p=>O.forEach(d,m=>O.forEach(m.Fi,g=>f.persistence.referenceDelegate.addReference(p,m.targetId,g)).next(()=>O.forEach(m.Bi,g=>f.persistence.referenceDelegate.removeReference(p,m.targetId,g)))))}catch(p){if(!eo(p))throw p;U("LocalStore","Failed to update sequence numbers: "+p)}for(let p of d){let m=p.targetId;if(!p.fromCache){let g=f.Ji.get(m),y=g.snapshotVersion,w=g.withLastLimboFreeSnapshotVersion(y);f.Ji=f.Ji.insert(m,w)}}}(o.localStore,u))}async function CR(s,e){let t=G(s);if(!t.currentUser.isEqual(e)){U("SyncEngine","User change. New user:",e.toKey());let o=await xw(t.localStore,e);t.currentUser=e,function(a,u){a.Ec.forEach(l=>{l.forEach(h=>{h.reject(new D(S.CANCELLED,u))})}),a.Ec.clear()}(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,o.removedBatchIds,o.addedBatchIds),await no(t,o.er)}}function OR(s,e){let t=G(s),o=t.yc.get(e);if(o&&o.fc)return Q().add(o.key);{let a=Q(),u=t._c.get(e);if(!u)return a;for(let l of u){let h=t.wc.get(l);a=a.unionWith(h.view.nc)}return a}}function NR(s){let e=G(s);return e.remoteStore.remoteSyncer.applyRemoteEvent=Uw.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=OR.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=kR.bind(null,e),e.dc.nu=bR.bind(null,e.eventManager),e.dc.Pc=_R.bind(null,e.eventManager),e}function DR(s){let e=G(s);return e.remoteStore.remoteSyncer.applySuccessfulWrite=AR.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=xR.bind(null,e),e}var $c=class{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=eu(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,t){return null}createIndexBackfillerScheduler(e,t){return null}createLocalStore(e){return nR(this.persistence,new qd,e.initialUser,this.serializer)}createPersistence(e){return new $d(jd.zs,this.serializer)}createSharedClientState(e){return new Gd}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}};var lf=class{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=o=>zv(this.syncEngine,o,1),this.remoteStore.remoteSyncer.handleCredentialChange=CR.bind(null,this.syncEngine),await wR(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new rf}createDatastore(e){let t=eu(e.databaseInfo.databaseId),o=(a=e.databaseInfo,new Qd(a));var a;return function(u,l,h,d){return new Yd(u,l,h,d)}(e.authCredentials,e.appCheckCredentials,o,t)}createRemoteStore(e){return t=this.localStore,o=this.datastore,a=e.asyncQueue,u=h=>zv(this.syncEngine,h,0),l=Oc.D()?new Oc:new Kd,new ef(t,o,a,u,l);var t,o,a,u,l}createSyncEngine(e,t){return function(o,a,u,l,h,d,f){let p=new cf(o,a,u,l,h,d);return f&&(p.vc=!0),p}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}terminate(){return async function(e){let t=G(e);U("RemoteStore","RemoteStore shutting down."),t.vu.add(5),await to(t),t.Pu.shutdown(),t.bu.set("Unknown")}(this.remoteStore)}};var Gs=class{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Sc(this.observer.next,e)}error(e){this.observer.error?this.Sc(this.observer.error,e):vn("Uncaught Error in snapshot listener:",e.toString())}Dc(){this.muted=!0}Sc(e,t){this.muted||setTimeout(()=>{this.muted||e(t)},0)}};var hf=class{constructor(e,t,o,a){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=o,this.databaseInfo=a,this.user=Oe.UNAUTHENTICATED,this.clientId=yc.A(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(o,async u=>{U("FirestoreClient","Received user=",u.uid),await this.authCredentialListener(u),this.user=u}),this.appCheckCredentials.start(o,u=>(U("FirestoreClient","Received new app check token=",u),this.appCheckCredentialListener(u,this.user)))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new D(S.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();let e=new Ot;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){let o=Df(t,"Failed to shutdown persistence");e.reject(o)}}),e.promise}};async function Vh(s,e){s.asyncQueue.verifyOperationInProgress(),U("FirestoreClient","Initializing OfflineComponentProvider");let t=await s.getConfiguration();await e.initialize(t);let o=t.initialUser;s.setCredentialChangeListener(async a=>{o.isEqual(a)||(await xw(e.localStore,a),o=a)}),e.persistence.setDatabaseDeletedListener(()=>s.terminate()),s._offlineComponents=e}async function Gv(s,e){s.asyncQueue.verifyOperationInProgress();let t=await LR(s);U("FirestoreClient","Initializing OnlineComponentProvider");let o=await s.getConfiguration();await e.initialize(t,o),s.setCredentialChangeListener(a=>qv(e.remoteStore,a)),s.setAppCheckTokenChangeListener((a,u)=>qv(e.remoteStore,u)),s._onlineComponents=e}function PR(s){return s.name==="FirebaseError"?s.code===S.FAILED_PRECONDITION||s.code===S.UNIMPLEMENTED:!(typeof DOMException!="undefined"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11}async function LR(s){if(!s._offlineComponents)if(s._uninitializedComponentsProvider){U("FirestoreClient","Using user provided OfflineComponentProvider");try{await Vh(s,s._uninitializedComponentsProvider._offline)}catch(e){let t=e;if(!PR(t))throw t;ai("Error using user provided cache. Falling back to memory cache: "+t),await Vh(s,new $c)}}else U("FirestoreClient","Using default OfflineComponentProvider"),await Vh(s,new $c);return s._offlineComponents}async function jw(s){return s._onlineComponents||(s._uninitializedComponentsProvider?(U("FirestoreClient","Using user provided OnlineComponentProvider"),await Gv(s,s._uninitializedComponentsProvider._online)):(U("FirestoreClient","Using default OnlineComponentProvider"),await Gv(s,new lf))),s._onlineComponents}function MR(s){return jw(s).then(e=>e.syncEngine)}async function Bc(s){let e=await jw(s),t=e.eventManager;return t.onListen=ER.bind(null,e.syncEngine),t.onUnlisten=TR.bind(null,e.syncEngine),t}function UR(s,e,t={}){let o=new Ot;return s.asyncQueue.enqueueAndForget(async()=>function(a,u,l,h,d){let f=new Gs({next:m=>{u.enqueueAndForget(()=>Lf(a,p));let g=m.docs.has(l);!g&&m.fromCache?d.reject(new D(S.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&m.fromCache&&h&&h.source==="server"?d.reject(new D(S.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):d.resolve(m)},error:m=>d.reject(m)}),p=new Hs(Jc(l.path),f,{includeMetadataChanges:!0,Ku:!0});return Pf(a,p)}(await Bc(s),s.asyncQueue,e,t,o)),o.promise}function FR(s,e,t={}){let o=new Ot;return s.asyncQueue.enqueueAndForget(async()=>function(a,u,l,h,d){let f=new Gs({next:m=>{u.enqueueAndForget(()=>Lf(a,p)),m.fromCache&&h.source==="server"?d.reject(new D(S.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):d.resolve(m)},error:m=>d.reject(m)}),p=new Hs(l,f,{includeMetadataChanges:!0,Ku:!0});return Pf(a,p)}(await Bc(s),s.asyncQueue,e,t,o)),o.promise}function Vw(s){let e={};return s.timeoutSeconds!==void 0&&(e.timeoutSeconds=s.timeoutSeconds),e}var Kv=new Map;function qw(s,e,t){if(!t)throw new D(S.INVALID_ARGUMENT,`Function ${s}() cannot be called with an empty ${e}.`)}function $R(s,e,t,o){if(e===!0&&o===!0)throw new D(S.INVALID_ARGUMENT,`${s} and ${t} cannot be used together.`)}function Wv(s){if(!B.isDocumentKey(s))throw new D(S.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${s} has ${s.length}.`)}function Qv(s){if(B.isDocumentKey(s))throw new D(S.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${s} has ${s.length}.`)}function ru(s){if(s===void 0)return"undefined";if(s===null)return"null";if(typeof s=="string")return s.length>20&&(s=`${s.substring(0,20)}...`),JSON.stringify(s);if(typeof s=="number"||typeof s=="boolean")return""+s;if(typeof s=="object"){if(s instanceof Array)return"an array";{let e=function(t){return t.constructor?t.constructor.name:null}(s);return e?`a custom ${e} object`:"an object"}}return typeof s=="function"?"a function":j()}function _t(s,e){if("_delegate"in s&&(s=s._delegate),!(s instanceof e)){if(e.name===s.constructor.name)throw new D(S.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let t=ru(s);throw new D(S.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return s}function BR(s,e){if(e<=0)throw new D(S.INVALID_ARGUMENT,`Function ${s}() requires a positive number, but it was: ${e}.`)}var jc=class{constructor(e){var t,o;if(e.host===void 0){if(e.ssl!==void 0)throw new D(S.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(t=e.ssl)===null||t===void 0||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.cache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new D(S.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}$R("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=Vw((o=e.experimentalLongPollingOptions)!==null&&o!==void 0?o:{}),function(a){if(a.timeoutSeconds!==void 0){if(isNaN(a.timeoutSeconds))throw new D(S.INVALID_ARGUMENT,`invalid long polling timeout: ${a.timeoutSeconds} (must not be NaN)`);if(a.timeoutSeconds<5)throw new D(S.INVALID_ARGUMENT,`invalid long polling timeout: ${a.timeoutSeconds} (minimum allowed value is 5)`);if(a.timeoutSeconds>30)throw new D(S.INVALID_ARGUMENT,`invalid long polling timeout: ${a.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(t=this.experimentalLongPollingOptions,o=e.experimentalLongPollingOptions,t.timeoutSeconds===o.timeoutSeconds)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams;var t,o}},yi=class{constructor(e,t,o,a){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=o,this._app=a,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new jc({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new D(S.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!==void 0}_setSettings(e){if(this._settingsFrozen)throw new D(S.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new jc(e),e.credentials!==void 0&&(this._authCredentials=function(t){if(!t)return new qh;switch(t.type){case"firstParty":return new Kh(t.sessionIndex||"0",t.iamToken||null,t.authTokenFactory||null);case"provider":return t.client;default:throw new D(S.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){let t=Kv.get(e);t&&(U("ComponentProvider","Removing Datastore"),Kv.delete(e),t.terminate())}(this),Promise.resolve()}};function jR(s,e,t,o={}){var a;let u=(s=_t(s,yi))._getSettings(),l=`${e}:${t}`;if(u.host!=="firestore.googleapis.com"&&u.host!==l&&ai("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),s._setSettings(Object.assign(Object.assign({},u),{host:l,ssl:!1})),o.mockUserToken){let h,d;if(typeof o.mockUserToken=="string")h=o.mockUserToken,d=Oe.MOCK_USER;else{h=Jo(o.mockUserToken,(a=s._app)===null||a===void 0?void 0:a.options.projectId);let f=o.mockUserToken.sub||o.mockUserToken.user_id;if(!f)throw new D(S.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");d=new Oe(f)}s._authCredentials=new zh(new gc(h,d))}}var Je=class s{constructor(e,t,o){this.converter=t,this._key=o,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Un(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new s(this.firestore,e,this._key)}},_n=class s{constructor(e,t,o){this.converter=t,this._query=o,this.type="query",this.firestore=e}withConverter(e){return new s(this.firestore,e,this._query)}},Un=class s extends _n{constructor(e,t,o){super(e,t,Jc(o)),this._path=o,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){let e=this._path.popLast();return e.isEmpty()?null:new Je(this.firestore,null,new B(e))}withConverter(e){return new s(this.firestore,e,this._path)}};function iu(s,e,...t){if(s=re(s),qw("collection","path",e),s instanceof yi){let o=pe.fromString(e,...t);return Qv(o),new Un(s,null,o)}{if(!(s instanceof Je||s instanceof Un))throw new D(S.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let o=s._path.child(pe.fromString(e,...t));return Qv(o),new Un(s.firestore,null,o)}}function ro(s,e,...t){if(s=re(s),arguments.length===1&&(e=yc.A()),qw("doc","path",e),s instanceof yi){let o=pe.fromString(e,...t);return Wv(o),new Je(s,null,new B(o))}{if(!(s instanceof Je||s instanceof Un))throw new D(S.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let o=s._path.child(pe.fromString(e,...t));return Wv(o),new Je(s.firestore,s instanceof Un?s.converter:null,new B(o))}}var df=class{constructor(){this.Gc=Promise.resolve(),this.Qc=[],this.jc=!1,this.zc=[],this.Wc=null,this.Hc=!1,this.Jc=!1,this.Yc=[],this.qo=new Nc(this,"async_queue_retry"),this.Xc=()=>{let t=jh();t&&U("AsyncQueue","Visibility state changed to "+t.visibilityState),this.qo.Mo()};let e=jh();e&&typeof e.addEventListener=="function"&&e.addEventListener("visibilitychange",this.Xc)}get isShuttingDown(){return this.jc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Zc(),this.ta(e)}enterRestrictedMode(e){if(!this.jc){this.jc=!0,this.Jc=e||!1;let t=jh();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Xc)}}enqueue(e){if(this.Zc(),this.jc)return new Promise(()=>{});let t=new Ot;return this.ta(()=>this.jc&&this.Jc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Qc.push(e),this.ea()))}async ea(){if(this.Qc.length!==0){try{await this.Qc[0](),this.Qc.shift(),this.qo.reset()}catch(e){if(!eo(e))throw e;U("AsyncQueue","Operation failed with retryable error: "+e)}this.Qc.length>0&&this.qo.No(()=>this.ea())}}ta(e){let t=this.Gc.then(()=>(this.Hc=!0,e().catch(o=>{this.Wc=o,this.Hc=!1;let a=function(u){let l=u.message||"";return u.stack&&(l=u.stack.includes(u.message)?u.stack:u.message+`
`+u.stack),l}(o);throw vn("INTERNAL UNHANDLED ERROR: ",a),o}).then(o=>(this.Hc=!1,o))));return this.Gc=t,t}enqueueAfterDelay(e,t,o){this.Zc(),this.Yc.indexOf(e)>-1&&(t=0);let a=tf.createAndSchedule(this,e,t,o,u=>this.na(u));return this.zc.push(a),a}Zc(){this.Wc&&j()}verifyOperationInProgress(){}async sa(){let e;do e=this.Gc,await e;while(e!==this.Gc)}ia(e){for(let t of this.zc)if(t.timerId===e)return!0;return!1}ra(e){return this.sa().then(()=>{this.zc.sort((t,o)=>t.targetTimeMs-o.targetTimeMs);for(let t of this.zc)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.sa()})}oa(e){this.Yc.push(e)}na(e){let t=this.zc.indexOf(e);this.zc.splice(t,1)}};function Jv(s){return function(e,t){if(typeof e!="object"||e===null)return!1;let o=e;for(let a of t)if(a in o&&typeof o[a]=="function")return!0;return!1}(s,["next","error","complete"])}var Jt=class extends yi{constructor(e,t,o,a){super(e,t,o,a),this.type="firestore",this._queue=new df,this._persistenceKey=(a==null?void 0:a.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||Hw(this),this._firestoreClient.terminate()}};function zw(s,e){let t=typeof s=="object"?s:qr(),o=typeof s=="string"?s:e||"(default)",a=cr(t,"firestore").getImmediate({identifier:o});if(!a._initialized){let u=Qo("firestore");u&&jR(a,...u)}return a}function su(s){return s._firestoreClient||Hw(s),s._firestoreClient.verifyNotTerminated(),s._firestoreClient}function Hw(s){var e,t,o;let a=s._freezeSettings(),u=function(l,h,d,f){return new Yh(l,h,d,f.host,f.ssl,f.experimentalForceLongPolling,f.experimentalAutoDetectLongPolling,Vw(f.experimentalLongPollingOptions),f.useFetchStreams)}(s._databaseId,((e=s._app)===null||e===void 0?void 0:e.options.appId)||"",s._persistenceKey,a);s._firestoreClient=new hf(s._authCredentials,s._appCheckCredentials,s._queue,u),!((t=a.cache)===null||t===void 0)&&t._offlineComponentProvider&&(!((o=a.cache)===null||o===void 0)&&o._onlineComponentProvider)&&(s._firestoreClient._uninitializedComponentsProvider={_offlineKind:a.cache.kind,_offline:a.cache._offlineComponentProvider,_online:a.cache._onlineComponentProvider})}var Ks=class s{constructor(e){this._byteString=e}static fromBase64String(e){try{return new s(Xe.fromBase64String(e))}catch(t){throw new D(S.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new s(Xe.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}};var vi=class{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new D(S.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Et(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}};var Ws=class{constructor(e){this._methodName=e}};var Qs=class{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new D(S.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new D(S.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return ne(this._lat,e._lat)||ne(this._long,e._long)}};var VR=/^__.*__$/,ff=class{constructor(e,t,o){this.data=e,this.fieldMask=t,this.fieldTransforms=o}toMutation(e,t){return this.fieldMask!==null?new Qt(e,this.data,this.fieldMask,t,this.fieldTransforms):new Ar(e,this.data,t,this.fieldTransforms)}},Vc=class{constructor(e,t,o){this.data=e,this.fieldMask=t,this.fieldTransforms=o}toMutation(e,t){return new Qt(e,this.data,this.fieldMask,t,this.fieldTransforms)}};function Gw(s){switch(s){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw j()}}var pf=class s{constructor(e,t,o,a,u,l){this.settings=e,this.databaseId=t,this.serializer=o,this.ignoreUndefinedProperties=a,u===void 0&&this.ua(),this.fieldTransforms=u||[],this.fieldMask=l||[]}get path(){return this.settings.path}get ca(){return this.settings.ca}aa(e){return new s(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}ha(e){var t;let o=(t=this.path)===null||t===void 0?void 0:t.child(e),a=this.aa({path:o,la:!1});return a.fa(e),a}da(e){var t;let o=(t=this.path)===null||t===void 0?void 0:t.child(e),a=this.aa({path:o,la:!1});return a.ua(),a}wa(e){return this.aa({path:void 0,la:!0})}_a(e){return zc(e,this.settings.methodName,this.settings.ma||!1,this.path,this.settings.ga)}contains(e){return this.fieldMask.find(t=>e.isPrefixOf(t))!==void 0||this.fieldTransforms.find(t=>e.isPrefixOf(t.field))!==void 0}ua(){if(this.path)for(let e=0;e<this.path.length;e++)this.fa(this.path.get(e))}fa(e){if(e.length===0)throw this._a("Document fields must not be empty");if(Gw(this.ca)&&VR.test(e))throw this._a('Document fields cannot begin and end with "__"')}},mf=class{constructor(e,t,o){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=o||eu(e)}ya(e,t,o,a=!1){return new pf({ca:e,methodName:t,ga:o,path:Et.emptyPath(),la:!1,ma:a},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}};function Ff(s){let e=s._freezeSettings(),t=eu(s._databaseId);return new mf(s._databaseId,!!e.ignoreUndefinedProperties,t)}function qR(s,e,t,o,a,u={}){let l=s.ya(u.merge||u.mergeFields?2:0,e,t,a);$f("Data must be an object, but it was:",l,o);let h=Kw(o,l),d,f;if(u.merge)d=new bt(l.fieldMask),f=l.fieldTransforms;else if(u.mergeFields){let p=[];for(let m of u.mergeFields){let g=gf(e,m,t);if(!l.contains(g))throw new D(S.INVALID_ARGUMENT,`Field '${g}' is specified in your field mask but missing from your input data.`);Qw(p,g)||p.push(g)}d=new bt(p),f=l.fieldTransforms.filter(m=>d.covers(m.field))}else d=null,f=l.fieldTransforms;return new ff(new ut(h),d,f)}var qc=class s extends Ws{_toFieldTransform(e){if(e.ca!==2)throw e.ca===1?e._a(`${this._methodName}() can only appear at the top level of your update data`):e._a(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof s}};function zR(s,e,t,o){let a=s.ya(1,e,t);$f("Data must be an object, but it was:",a,o);let u=[],l=ut.empty();xr(o,(d,f)=>{let p=Bf(e,d,t);f=re(f);let m=a.da(p);if(f instanceof qc)u.push(p);else{let g=io(f,m);g!=null&&(u.push(p),l.set(p,g))}});let h=new bt(u);return new Vc(l,h,a.fieldTransforms)}function HR(s,e,t,o,a,u){let l=s.ya(1,e,t),h=[gf(e,o,t)],d=[a];if(u.length%2!=0)throw new D(S.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let g=0;g<u.length;g+=2)h.push(gf(e,u[g])),d.push(u[g+1]);let f=[],p=ut.empty();for(let g=h.length-1;g>=0;--g)if(!Qw(f,h[g])){let y=h[g],w=d[g];w=re(w);let b=l.da(y);if(w instanceof qc)f.push(y);else{let E=io(w,b);E!=null&&(f.push(y),p.set(y,E))}}let m=new bt(f);return new Vc(p,m,l.fieldTransforms)}function GR(s,e,t,o=!1){return io(t,s.ya(o?4:3,e))}function io(s,e){if(Ww(s=re(s)))return $f("Unsupported field value:",e,s),Kw(s,e);if(s instanceof Ws)return function(t,o){if(!Gw(o.ca))throw o._a(`${t._methodName}() can only be used with update() and set()`);if(!o.path)throw o._a(`${t._methodName}() is not currently supported inside arrays`);let a=t._toFieldTransform(o);a&&o.fieldTransforms.push(a)}(s,e),null;if(s===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),s instanceof Array){if(e.settings.la&&e.ca!==4)throw e._a("Nested arrays are not supported");return function(t,o){let a=[],u=0;for(let l of t){let h=io(l,o.wa(u));h==null&&(h={nullValue:"NULL_VALUE"}),a.push(h),u++}return{arrayValue:{values:a}}}(s,e)}return function(t,o){if((t=re(t))===null)return{nullValue:"NULL_VALUE"};if(typeof t=="number")return Cx(o.serializer,t);if(typeof t=="boolean")return{booleanValue:t};if(typeof t=="string")return{stringValue:t};if(t instanceof Date){let a=Ue.fromDate(t);return{timestampValue:xc(o.serializer,a)}}if(t instanceof Ue){let a=new Ue(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:xc(o.serializer,a)}}if(t instanceof Qs)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Ks)return{bytesValue:Ew(o.serializer,t._byteString)};if(t instanceof Je){let a=o.databaseId,u=t.firestore._databaseId;if(!u.isEqual(a))throw o._a(`Document reference is for database ${u.projectId}/${u.database} but should be for database ${a.projectId}/${a.database}`);return{referenceValue:Rf(t.firestore._databaseId||o.databaseId,t._key.path)}}throw o._a(`Unsupported field value: ${ru(t)}`)}(s,e)}function Kw(s,e){let t={};return Zv(s)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):xr(s,(o,a)=>{let u=io(a,e.ha(o));u!=null&&(t[o]=u)}),{mapValue:{fields:t}}}function Ww(s){return!(typeof s!="object"||s===null||s instanceof Array||s instanceof Date||s instanceof Ue||s instanceof Qs||s instanceof Ks||s instanceof Je||s instanceof Ws)}function $f(s,e,t){if(!Ww(t)||!function(o){return typeof o=="object"&&o!==null&&(Object.getPrototypeOf(o)===Object.prototype||Object.getPrototypeOf(o)===null)}(t)){let o=ru(t);throw o==="an object"?e._a(s+" a custom object"):e._a(s+" "+o)}}function gf(s,e,t){if((e=re(e))instanceof vi)return e._internalPath;if(typeof e=="string")return Bf(s,e);throw zc("Field path arguments must be of type string or ",s,!1,void 0,t)}var KR=new RegExp("[~\\*/\\[\\]]");function Bf(s,e,t){if(e.search(KR)>=0)throw zc(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,s,!1,void 0,t);try{return new vi(...e.split("."))._internalPath}catch{throw zc(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,s,!1,void 0,t)}}function zc(s,e,t,o,a){let u=o&&!o.isEmpty(),l=a!==void 0,h=`Function ${e}() called with invalid data`;t&&(h+=" (via `toFirestore()`)"),h+=". ";let d="";return(u||l)&&(d+=" (found",u&&(d+=` in field ${o}`),l&&(d+=` in document ${a}`),d+=")"),new D(S.INVALID_ARGUMENT,h+s+d)}function Qw(s,e){return s.some(t=>t.isEqual(e))}var Hc=class{constructor(e,t,o,a,u){this._firestore=e,this._userDataWriter=t,this._key=o,this._document=a,this._converter=u}get id(){return this._key.path.lastSegment()}get ref(){return new Je(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){let e=new yf(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){let t=this._document.data.field(ou("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}},yf=class extends Hc{data(){return super.data()}};function ou(s,e){return typeof e=="string"?Bf(s,e):e instanceof vi?e._internalPath:e._delegate._internalPath}function Jw(s){if(s.limitType==="L"&&s.explicitOrderBy.length===0)throw new D(S.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Js=class{},Xs=class extends Js{};function jf(s,e,...t){let o=[];e instanceof Js&&o.push(e),o=o.concat(t),function(a){let u=a.filter(h=>h instanceof vf).length,l=a.filter(h=>h instanceof Gc).length;if(u>1||u>0&&l>0)throw new D(S.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(o);for(let a of o)s=a._apply(s);return s}var Gc=class s extends Xs{constructor(e,t,o){super(),this._field=e,this._op=t,this._value=o,this.type="where"}static _create(e,t,o){return new s(e,t,o)}_apply(e){let t=this._parse(e);return eb(e._query,t),new _n(e.firestore,e.converter,hd(e._query,t))}_parse(e){let t=Ff(e.firestore);return function(a,u,l,h,d,f,p){let m;if(d.isKeyField()){if(f==="array-contains"||f==="array-contains-any")throw new D(S.INVALID_ARGUMENT,`Invalid Query. You can't perform '${f}' queries on documentId().`);if(f==="in"||f==="not-in"){Yv(p,f);let g=[];for(let y of p)g.push(Xv(h,a,y));m={arrayValue:{values:g}}}else m=Xv(h,a,p)}else f!=="in"&&f!=="not-in"&&f!=="array-contains-any"||Yv(p,f),m=GR(l,u,p,f==="in"||f==="not-in");return Ee.create(d,f,m)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}};function Xw(s,e,t){let o=e,a=ou("where",s);return Gc._create(a,o,t)}var vf=class s extends Js{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new s(e,t)}_parse(e){let t=this._queryConstraints.map(o=>o._parse(e)).filter(o=>o.getFilters().length>0);return t.length===1?t[0]:Dt.create(t,this._getOperator())}_apply(e){let t=this._parse(e);return t.getFilters().length===0?e:(function(o,a){let u=o,l=a.getFlattenedFilters();for(let h of l)eb(u,h),u=hd(u,h)}(e._query,t),new _n(e.firestore,e.converter,hd(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}};var wf=class s extends Xs{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new s(e,t)}_apply(e){let t=function(o,a,u){if(o.startAt!==null)throw new D(S.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(o.endAt!==null)throw new D(S.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");let l=new Mn(a,u);return function(h,d){if(xf(h)===null){let f=Xc(h);f!==null&&tb(h,f,d.field)}}(o,l),l}(e._query,this._field,this._direction);return new _n(e.firestore,e.converter,function(o,a){let u=o.explicitOrderBy.concat([a]);return new Bn(o.path,o.collectionGroup,u,o.filters.slice(),o.limit,o.limitType,o.startAt,o.endAt)}(e._query,t))}};function Yw(s,e="asc"){let t=e,o=ou("orderBy",s);return wf._create(o,t)}var bf=class s extends Xs{constructor(e,t,o){super(),this.type=e,this._limit=t,this._limitType=o}static _create(e,t,o){return new s(e,t,o)}_apply(e){return new _n(e.firestore,e.converter,Ic(e._query,this._limit,this._limitType))}};function Zw(s){return BR("limit",s),bf._create("limit",s,"F")}function Xv(s,e,t){if(typeof(t=re(t))=="string"){if(t==="")throw new D(S.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!aw(e)&&t.indexOf("/")!==-1)throw new D(S.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);let o=e.path.child(pe.fromString(t));if(!B.isDocumentKey(o))throw new D(S.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${o}' is not because it has an odd number of segments (${o.length}).`);return kv(s,new B(o))}if(t instanceof Je)return kv(s,t._key);throw new D(S.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${ru(t)}.`)}function Yv(s,e){if(!Array.isArray(s)||s.length===0)throw new D(S.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function eb(s,e){if(e.isInequality()){let o=Xc(s),a=e.field;if(o!==null&&!o.isEqual(a))throw new D(S.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${o.toString()}' and '${a.toString()}'`);let u=xf(s);u!==null&&tb(s,a,u)}let t=function(o,a){for(let u of o)for(let l of u.getFlattenedFilters())if(a.indexOf(l.op)>=0)return l.op;return null}(s.filters,function(o){switch(o){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(t!==null)throw t===e.op?new D(S.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new D(S.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}function tb(s,e,t){if(!t.isEqual(e))throw new D(S.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${t.toString()}' instead.`)}var _f=class{convertValue(e,t="none"){switch(Tr(e)){case 0:return null;case 1:return e.booleanValue;case 2:return ye(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes($n(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw j()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){let o={};return xr(e,(a,u)=>{o[a]=this.convertValue(u,t)}),o}convertGeoPoint(e){return new Qs(ye(e.latitude),ye(e.longitude))}convertArray(e,t){return(e.values||[]).map(o=>this.convertValue(o,t))}convertServerTimestamp(e,t){switch(t){case"previous":let o=Tf(e);return o==null?null:this.convertValue(o,t);case"estimate":return this.convertTimestamp(Fs(e));default:return null}}convertTimestamp(e){let t=Fn(e);return new Ue(t.seconds,t.nanos)}convertDocumentKey(e,t){let o=pe.fromString(e);he(Aw(o));let a=new _c(o.get(1),o.get(3)),u=new B(o.popFirst(5));return a.isEqual(t)||vn(`Document ${u} contains a document reference within a different database (${a.projectId}/${a.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),u}};function WR(s,e,t){let o;return o=s?t&&(t.merge||t.mergeFields)?s.toFirestore(e,t):s.toFirestore(e):e,o}var _r=class{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}},Kc=class extends Hc{constructor(e,t,o,a,u,l){super(e,t,o,a,l),this._firestore=e,this._firestoreImpl=e,this.metadata=u}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let t=new oi(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){let o=this._document.data.field(ou("DocumentSnapshot.get",e));if(o!==null)return this._userDataWriter.convertValue(o,t.serverTimestamps)}}},oi=class extends Kc{data(e={}){return super.data(e)}},Wc=class{constructor(e,t,o,a){this._firestore=e,this._userDataWriter=t,this._snapshot=a,this.metadata=new _r(a.hasPendingWrites,a.fromCache),this.query=o}get docs(){let e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(o=>{e.call(t,new oi(this._firestore,this._userDataWriter,o.key,o,new _r(this._snapshot.mutatedKeys.has(o.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new D(S.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(o,a){if(o._snapshot.oldDocs.isEmpty()){let u=0;return o._snapshot.docChanges.map(l=>{let h=new oi(o._firestore,o._userDataWriter,l.doc.key,l.doc,new _r(o._snapshot.mutatedKeys.has(l.doc.key),o._snapshot.fromCache),o.query.converter);return l.doc,{type:"added",doc:h,oldIndex:-1,newIndex:u++}})}{let u=o._snapshot.oldDocs;return o._snapshot.docChanges.filter(l=>a||l.type!==3).map(l=>{let h=new oi(o._firestore,o._userDataWriter,l.doc.key,l.doc,new _r(o._snapshot.mutatedKeys.has(l.doc.key),o._snapshot.fromCache),o.query.converter),d=-1,f=-1;return l.type!==0&&(d=u.indexOf(l.doc.key),u=u.delete(l.doc.key)),l.type!==1&&(u=u.add(l.doc),f=u.indexOf(l.doc.key)),{type:QR(l.type),doc:h,oldIndex:d,newIndex:f}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}};function QR(s){switch(s){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return j()}}function Vf(s){s=_t(s,Je);let e=_t(s.firestore,Jt);return UR(su(e),s._key).then(t=>ab(e,s,t))}var Ys=class extends _f{constructor(e){super(),this.firestore=e}convertBytes(e){return new Ks(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new Je(this.firestore,null,t)}};function nb(s){s=_t(s,_n);let e=_t(s.firestore,Jt),t=su(e),o=new Ys(e);return Jw(s._query),FR(t,s._query).then(a=>new Wc(e,o,s,a))}function rb(s,e,t,...o){s=_t(s,Je);let a=_t(s.firestore,Jt),u=Ff(a),l;return l=typeof(e=re(e))=="string"||e instanceof vi?HR(u,"updateDoc",s._key,e,t,o):zR(u,"updateDoc",s._key,e),qf(a,[l.toMutation(s._key,yn.exists(!0))])}function ib(s){return qf(_t(s.firestore,Jt),[new Bs(s._key,yn.none())])}function sb(s,e){let t=_t(s.firestore,Jt),o=ro(s),a=WR(s.converter,e);return qf(t,[qR(Ff(s.firestore),"addDoc",o._key,a,s.converter!==null,{}).toMutation(o._key,yn.exists(!1))]).then(()=>o)}function ob(s,...e){var t,o,a;s=re(s);let u={includeMetadataChanges:!1},l=0;typeof e[l]!="object"||Jv(e[l])||(u=e[l],l++);let h={includeMetadataChanges:u.includeMetadataChanges};if(Jv(e[l])){let m=e[l];e[l]=(t=m.next)===null||t===void 0?void 0:t.bind(m),e[l+1]=(o=m.error)===null||o===void 0?void 0:o.bind(m),e[l+2]=(a=m.complete)===null||a===void 0?void 0:a.bind(m)}let d,f,p;if(s instanceof Je)f=_t(s.firestore,Jt),p=Jc(s._key.path),d={next:m=>{e[l]&&e[l](ab(f,s,m))},error:e[l+1],complete:e[l+2]};else{let m=_t(s,_n);f=_t(m.firestore,Jt),p=m._query;let g=new Ys(f);d={next:y=>{e[l]&&e[l](new Wc(f,g,m,y))},error:e[l+1],complete:e[l+2]},Jw(s._query)}return function(m,g,y,w){let b=new Gs(w),E=new Hs(g,b,y);return m.asyncQueue.enqueueAndForget(async()=>Pf(await Bc(m),E)),()=>{b.Dc(),m.asyncQueue.enqueueAndForget(async()=>Lf(await Bc(m),E))}}(su(f),p,h,d)}function qf(s,e){return function(t,o){let a=new Ot;return t.asyncQueue.enqueueAndForget(async()=>SR(await MR(t),o,a)),a.promise}(su(s),e)}function ab(s,e,t){let o=t.docs.get(e._key),a=new Ys(s);return new Kc(s,a,e._key,o,new _r(t.hasPendingWrites,t.fromCache),e.converter)}(function(s,e=!0){(function(t){wi=t})(Ft),Ut(new it("firestore",(t,{instanceIdentifier:o,options:a})=>{let u=t.getProvider("app").getImmediate(),l=new Jt(new Hh(t.getProvider("auth-internal")),new Qh(t.getProvider("app-check-internal")),function(h,d){if(!Object.prototype.hasOwnProperty.apply(h.options,["projectId"]))throw new D(S.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new _c(h.options.projectId,d)}(u,o),u);return a=Object.assign({useFetchStreams:e},a),l._setSettings(a),l},"PUBLIC").setMultipleInstances(!0)),st(Ev,"3.13.0",s),st(Ev,"3.13.0","esm2017")})();var JR=s=>e=>`${s}__${e}`,J=s=>s==null,Pt=s=>J(s)||typeof s=="string"&&(s==null?void 0:s.length)<1;var cb=s=>(e,t)=>JR(e)(s(t));var zf=s=>new Promise((e,t)=>Hl(s,o=>{o?e({status:200,data:o==null?void 0:o.toJSON()}):t({status:401,data:void 0})})),Hf=s=>async e=>{try{return await $l(s,e),{status:200,data:void 0}}catch(t){return{status:403,data:t}}},ub=s=>async(e,t)=>{try{return await Bl(s,e,t),{status:200,data:void 0}}catch(o){return{status:403,data:o}}},lb=s=>async e=>{let t=s.currentUser;if(!t)return{status:401,data:{error:"user not logged in"}};try{return await zl(t,e),{status:200,data:void 0}}catch(o){return{status:403,data:o}}},hb=s=>async(e,t)=>{try{let{user:o}=await jl(s,e,t);if(!o.emailVerified)try{await ql(o)}catch(a){return{status:500,data:a}}return{status:200,data:o.toJSON()}}catch(o){return{status:403,data:o}}},db=s=>async()=>{try{return await Gl(s),{status:200,data:{}}}catch(e){return{status:403,data:e}}},fb=s=>async(e,t)=>{try{return{status:200,data:(await Vl(s,e,t)).user.toJSON()}}catch(o){return{status:403,data:o}}},pb=s=>async(e=[])=>{let t=new Nn;e.forEach(o=>t.addScope(o)),t.setCustomParameters({display:"popup"});try{let o=await Wr(s,t),a=Nn.credentialFromResult(o);return{status:200,data:{user:o.user.toJSON(),credentials:{...a==null?void 0:a.toJSON()}}}}catch(o){return{status:403,data:o}}},mb=s=>async(e=[])=>{let t=new dn;e.forEach(o=>t.addScope(o)),t.setCustomParameters({display:"popup"});try{let o=await Wr(s,t),a=dn.credentialFromResult(o);return{status:200,data:{user:o.user.toJSON(),credentials:{...a==null?void 0:a.toJSON()}}}}catch(o){return{status:403,data:{error:o,gooogleError:dn.credentialFromError(o)}}}},gb=s=>async(e=[])=>{let t=new fn;e.forEach(o=>t.addScope(o)),t.setCustomParameters({display:"popup"});try{let o=await Wr(s,t),a=fn.credentialFromResult(o);return{status:200,data:{user:o.user.toJSON(),credentials:{...a==null?void 0:a.toJSON()}}}}catch(o){return{status:403,data:{error:o,twitterError:fn.credentialFromError(o)}}}},yb=s=>async(e=[])=>{let t=new dr("apple.com");e.forEach(o=>t.addScope(o));try{let o=await Wr(s,t),a=dr.credentialFromResult(o);return{status:200,data:{user:o.user.toJSON(),credentials:{...a==null?void 0:a.toJSON()}}}}catch(o){return{status:403,data:{error:o,twitterError:dr.credentialFromError(o)}}}};var Gf=s=>{let e=Object.keys(s).filter(t=>{var o;return typeof s[t]=="object"&&"type"in s[t]&&((o=s[t])==null?void 0:o.type)==="document"});return{hasDocRef:e.length>0,keys:e}},wb=async(s,e)=>{let t={...e},{keys:o,hasDocRef:a}=Gf(s);if(!a)return t;for(let u of o){let l=s[u],h=await Vf(l);h.exists()&&(t[u]={...h.data(),docId:h.id})}return t},vb=async s=>{let e=[];for(let t of s){let o=t.data(),{hasDocRef:a}=Gf(o),u={...o,docId:t.id};if(!a)e.push(u);else{let l=await wb(o,u);e.push(l)}}return e},so={},bb=s=>{if(console.log("Unsubscribing from firebase subscription",so),!(s in so))throw{status:301,data:{error:`Subscription reference not found for request id: ${s}`}};let e=so[s];try{e(),delete so[s];let t=A.configuration.requests.find(o=>o.id===s);return T[`r.${t.number}.$.isRequesting`].set(!1),T[`r.${t.number}.$.hasRequested`].set(!0),{status:200,data:{refId:s}}}catch(t){throw{status:500,data:t}}},Kf=(s,e,t=!1)=>async(o,a=[],u=[],l)=>{let h=[];for(let[p,m,g]of a){let y=g===void 0?null:g;h.push(Xw(p,m,y))}if(!["<","<=","!=","not-in",">",">="].some(p=>a.findIndex(([,g])=>g===p)>-1))for(let[p,m]of u)h.push(Yw(p,m));J(l)||h.push(Zw(l));let f;h.length===0?f=jf(iu(s,o)):f=jf(iu(s,o),...h),t&&(so[e.id]=ob(f,p=>{T[`r.${e.number}.$.isRequesting`].set(!0),T[`r.${e.number}.$.hasRequested`].set(!!T[`r.${e.number}.$.hasRequested`].value);let m=T[`r.${e.number}.$.hasRequested`].value;T[`r.${e.number}.d`].set({}),vb(p.docs).then(g=>T[`r.${e.number}.d`].set(g)).catch(g=>{T[`r.${e.number}.d`].set(m),T[`r.${e.number}.$.isRequesting`].set(!1),T[`r.${e.number}.$.hasRequested`].set(!0),console.groupCollapsed("firebase subscription"),console.warn(g),console.groupEnd()})}));try{let p=await nb(f);return{status:t?100:200,data:await vb(p.docs)}}catch(p){return{status:500,data:p}}},_b=s=>async e=>{try{let t=ro(s,e),o=await Vf(t);if(o.exists()){let a=o.data(),{hasDocRef:u}=Gf(a);return u?{status:200,data:await wb(a,{...a,docId:o.id})}:{status:200,data:{...a,docId:o.id}}}return{status:404,data:void 0}}catch(t){return{status:500,data:t}}},Eb=s=>async(e,t)=>{try{return{status:200,data:{docId:(await sb(iu(s,e),{...t})).id}}}catch(o){return{status:500,data:o}}},Ib=s=>async(e,t,o)=>{try{return await rb(ro(s,e,t),o),{status:200,data:void 0}}catch(a){return{status:500,data:a}}},Tb=s=>async(e,t)=>{try{return await ib(ro(s,e,t)),{status:200,data:void 0}}catch(o){return{status:500,data:o}}};var Xt=s=>e=>`${s}__${e}`,au=s=>e=>`${s}__${e}`,XR=s=>{let e=Yi({appId:s.appId,apiKey:s.apiKey,projectId:s.projectId,storageBucket:`${s.projectId}.appspot.com`,authDomain:`${s.projectId}.firebaseapp.com`,databaseURL:`https://${s.projectId}.firebaseio.com`},s.id),t=zw(e);return{app:e,db:t}},YR=async(s,e,t,o=!1)=>{var p,m;let a=au("firebase"),u=s[a("collection")],l=s[a("firestore-method")];if(l==="unsubscribe")return bb(s[a("request-list")]);if(l!=="get-list"){let g=I(s[a("document-id")],t).value;return _b(e)(`${u}/${g}`)}let h=[];for(let g of(p=s==null?void 0:s.filtering)!=null?p:[]){let{value:y}=I(g[Xt("filtering")(a("value"))],t);h.push([g[Xt("filtering")(a("field"))],g[Xt("filtering")(a("condition"))],y])}let d=[];for(let g of(m=s==null?void 0:s.sorting)!=null?m:[])d.push([g[Xt("sorting")(a("field"))],g[Xt("sorting")(a("order"))]]);let f;return typeof s[a("limit")]=="number"&&(f=+s[a("limit")]),J(f)?Kf(e,s,o)(s[a("collection")],h,d):Kf(e,s,o)(s[a("collection")],h,d,f)},ZR=async(s,e,t)=>{let o=au("firebase"),a=s[o("firestore-method")]==="create",u=s[o("firestore-method")]==="update";function l(){var m,g;let d={},f=(m=s["generic-fields"])!=null?m:[],p=(g=s["map-type-fields"])!=null?g:[];for(let y of f!=null?f:[]){let w=Xt("generic-fields")(o("field-key")),b=Xt("generic-fields")(o("field-value")),E=I(y[b],t).value;typeof y[w]=="string"&&(y[w].length<1||(d[y[w]]=E))}if(!J(s[o("geo-field-key")])){let y=s[o("geo-field-key")],w=I(s[o("geo-lat")],t).value,b=I(s[o("geo-long")],t).value;typeof y=="string"&&y.length>0&&(d[y]=[w,b])}if(!J(s[o("map-field-key")]))for(let y of p!=null?p:[]){let w=Xt("map-type-fields")(o("field-key")),b=Xt("map-type-fields")(o("field-value")),E=I(y[b],t).value;typeof y[w]=="string"&&(y[w].length<1||(d[y[w]]=E))}return d}if(a)return Eb(e)(s[o("collection")],l());let h=I(s[o("document-id")],t).value;return u?Ib(e)(s[o("collection")],h,l()):Tb(e)(s[o("collection")],h)},Wf=(s,e,t)=>{let o=[];return e[t].forEach(u=>{o.push(u[Xt(t)(s("oauth-scope"))])}),o};async function Qf(s,e,t,o=!1){let a=(s==null?void 0:s.type)==="data-in",u=s[au("firebase")("method")]==="firestore",{app:l,db:h}=XR({id:e.id,appId:e["app-id"],apiKey:e["api-key"],projectId:e["project-id"]});if(u&&a)return YR(s,h,t,o);if(u&&!a)return ZR(s,h,t);if(!u&&a)return zf(cs(l));if(!u&&!a){let d=au("firebase"),f=cs(l);switch(s[d("auth-method")]){case"request-reset-pwd":let p=I(s[d("user-email")],t).value;return Pt(p)?Hf(f)():Hf(f)(p);case"update-user-email":return lb(f)(I(s[d("update-email")],t).value);case"confirm-password-reset":return ub(f)(I(s[d("oob-code")],t).value,I(s[d("new-password")],t).value);case"sign-out":return db(f)();case"sign-up":return hb(f)(I(s[d("new-email")],t).value,I(s[d("new-password")],t).value);case"sign-in-email-pwd":return fb(f)(I(s[d("email")],t).value,I(s[d("password")],t).value);case"sign-in-google":return mb(f)(Wf(d,s,"google"));case"sign-in-twitter":return gb(f)();case"sign-in-facebook":return pb(f)(Wf(d,s,"fb"));case"sign-in-apple":return yb(f)(Wf(d,s,"apple"));default:return{status:400,data:"Unknown request"}}}return zf(cs(l))}var lt=on(uo(),1);var nE=s=>e=>`${s}__${e}`,Tp=async({projectId:s,dbId:e,environment:t,appId:o,pageSize:a},u={})=>{try{let l=await lt.default.post(`${te.serverUrl}v2/request/notion/query-database?projectId=${s}&databaseId=${e}&env=${t}&appId=${o}`,{...u,page_size:a});return{status:l==null?void 0:l.status,data:l==null?void 0:l.data}}catch(l){return lt.default.isAxiosError(l)?{status:l.status,data:l==null?void 0:l.toJSON()}:{status:500,data:void 0}}},SO=async(s,e)=>{var g;let t=nE("notion"),{appId:o}=s,a=xt(),u=A.configuration.type,l=s[t("database")];if(s[t("method")]==="get")try{let y=await lt.default.get(`${te.serverUrl}v2/request/notion/retrieve-database?projectId=${a}&databaseId=${l}&env=${u}&appId=${o}`);return{status:y==null?void 0:y.status,data:y==null?void 0:y.data}}catch(y){return lt.default.isAxiosError(y)?{status:y.status,data:y==null?void 0:y.toJSON()}:{status:500,data:void 0}}let d=s[t("filter-type")],{data:f}=await lt.default.get(`${te.serverUrl}v2/request/notion/load-db-props?projectId=${a}&databaseId=${l}&env=${u}&appId=${o}`),p={projectId:a,dbId:l,environment:u,appId:o},m={};if(d==="property"){let y=s["notion__single-db-property"],w;for(let{type:C,name:P}of f)P===y&&(w=C);f.forEach(({type:C,name:P})=>{if(P===y){w=C;return}});let b=s["notion__single-filter-condition"],E=s["notion__single-filter-value"],k=s["notion__max-records"],x=[{property:s["notion__sorting-db-property"],direction:s["notion__sorting-order"]}];return Tp({projectId:a,dbId:l,environment:u,appId:o,pageSize:k},{filter:{property:y,[w]:{[b]:I(E,e).value}},sorts:x})}if(d==="combined"){let y=[];((g=s["combined-filtering"])!=null?g:[]).forEach(x=>{let C=x["combined-filtering__notion__db-property"],P;f.forEach(({type:Te,name:ce})=>{if(ce===C){P=Te;return}});let K=s["combined-filtering__notion__condition"],ee=x["combined-filtering__notion__value"];y.push({property:C,[P]:{[K]:I(ee,e).value}})});let w=s["notion__combined-filter-options"],b=s["notion__max-records"],E={[w]:y},k=[{property:s["notion__sorting-db-property"],direction:s["notion__sorting-order"]}];return Tp({projectId:a,dbId:l,environment:u,appId:o,pageSize:b},{filter:E,sorts:k})}if(d==="property"){let y=s[t("single-db-property")],w;for(let{type:b,name:E}of f)E===y&&(w=b);m.filter={property:s[t("single-db-property")],[w]:{[s[t("single-filter-condition")]]:I(s[t("single-filter-value")],e).value}}}return Tp(p,m)},kO=async(s,e)=>{let t=nE("notion"),{appId:o}=s,a=xt(),u=A.configuration.type,l=s[t("database")],h=s[t("method")],{data:d}=await lt.default.get(`${te.serverUrl}v2/request/notion/load-db-props?projectId=${a}&databaseId=${l}&env=${u}&appId=${o}`),f=d.filter(m=>["formula","multi_select","created_time","last_edited_by","relation","created_by","files","last_edited_time","people","unique_id"].findIndex(y=>y===m.type)<0),p={};if(f.forEach(m=>{let g=I(s[`notion__dynamic__${m.name}`],e),y={};switch(m.type){case"title":{y=[{text:{content:g.value||""}}];break}case"select":case"status":{let{_meta:{[m.type]:{options:w}}}=m,b=w.find(({id:E})=>E===g.value);b&&(y={id:b.id,name:b.name});break}case"rich_text":{y=[{type:"text",text:{content:typeof g.value=="string"?g.value:String(g.value||"")}}];break}case"checkbox":{y=typeof g.value=="boolean"?g.value:!!g.value;break}case"number":{y=typeof g.value=="number"?g.value:Number(g.value);break}case"phone_number":case"email":{y=typeof g.value=="string"?g.value:String(g.value||"");break}case"multi_select":{let{_meta:{multi_select:{options:w}}}=m;Array.isArray(g.value)&&(y=g.value.map(b=>{let E=w.find(({id:k})=>k===b);if(E)return{id:E.id,name:E.name}}).filter(b=>!!b));break}default:{y={content:g.value};break}}p[m.name]={[m.type]:y}}),h==="create")try{let m=await lt.default.post(`${te.serverUrl}v2/request/notion/create-page?projectId=${a}&env=${u}&appId=${o}`,{parent:{type:"database_id",database_id:l},properties:p});return{status:m==null?void 0:m.status,data:m==null?void 0:m.data}}catch(m){return lt.default.isAxiosError(m)?{status:m.status,data:m==null?void 0:m.toJSON()}:{status:500,data:void 0}}if(h==="update")try{let m=await lt.default.post(`${te.serverUrl}v2/request/notion/update-page?projectId=${a}&env=${u}&appId=${o}`,{page_id:I(s[t("record-id")],e).value,properties:p});return{status:m==null?void 0:m.status,data:m==null?void 0:m.data}}catch(m){return lt.default.isAxiosError(m)?{status:m.status,data:m==null?void 0:m.toJSON()}:{status:500,data:void 0}}try{let m=await lt.default.post(`${te.serverUrl}v2/request/notion/delete-page?projectId=${a}&env=${u}&appId=${o}`,{page_id:I(s[t("record-id")],e).value,archived:!0});return{status:m==null?void 0:m.status,data:m==null?void 0:m.data}}catch(m){return lt.default.isAxiosError(m)?{status:m.status,data:m==null?void 0:m.toJSON()}:{status:500,data:void 0}}};async function Sp(s,e,t){return(s==null?void 0:s.type)==="data-in"?SO(s,t):kO(s,t)}var kp=on(uo(),1);var rE=s=>e=>`${s}__${e}`,He=class He{constructor(e,t,o){this.baseUrl=e;this.appType=t;this.request=o}getId(e){return rE(this.appType)(e)}run(e){return this.fetchRequest(this.request[this.getId("method")],e)}async sendToBackend(e,t){let o=new URL(`${te.serverUrl}v2/request/rest`);o.searchParams.append("projectId",e.project),o.searchParams.append("env",e.env),o.searchParams.append("appId",e.appId),o.searchParams.append("configurationId",e.configurationId),o.searchParams.append("requestId",e.requestId);let a=this.run(t),u=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a),referrerPolicy:"origin"}),l=await u.json();return{status:u.status,data:l}}fetchRequest(e,t){let o=this.sanitizeUrl(this.request[this.getId("endpoint")],t),[a,u]=this.hasAuth(t),l={...this.hasHeaders()?this.sanitizeRequestTokens(He.httpHeadersGroupId,t):{},...a?u:{}};return{baseURL:this.baseUrl,url:o,method:e,headers:l,data:this.hasHttpBody()?this.sanitizeRequestTokens(He.httpBodyGroupId,t):void 0,params:this.hasQS()?this.sanitizeRequestTokens(He.qsGroupId,t):void 0}}sanitizeUrl(e,t){let o=["Array","Object","Undefined","Null","Unknown"],{type:a,value:u}=I(e,t);return o.findIndex(l=>l===a)>-1?encodeURIComponent(e):`${u}`}hasQS(){let e=He.qsGroupId;return(this.request[e]||[]).length>0}hasHeaders(){let e=He.httpHeadersGroupId;return(this.request[e]||[]).length>0}hasHttpBody(){let e=He.httpBodyGroupId;return(this.request[e]||[]).length>0}hasAuth(e){let t=this.request[this.getId("auth-type")];if(!t)return[!1,null];let o=I(this.request[this.getId("auth-token")],e).value;if(t==="bearer")return[!Pt(t)&&!Pt(o),{Authorization:`Bearer ${o}`}]}sanitizeRequestTokens(e,t){var u;let o=["Undefined","Null","Unknown"],a={};for(let l of(u=this.request[e])!=null?u:[]){let h=l[He.getGroupFieldId(e,"field-key",this.appType)],d=l[He.getGroupFieldId(e,"field-value",this.appType)],{type:f,value:p}=I(d,t);o.findIndex(m=>m===f)<0&&(a[h]=p)}return a}};St(He,"qsGroupId","query-strings"),St(He,"httpBodyGroupId","http-body"),St(He,"httpHeadersGroupId","http-headers"),St(He,"hasPrivateInformation",(e,t,o)=>{let a=e[t];if(J(a))return!1;for(let u of a)if(u[He.getGroupFieldId(t,"is-item-private",o)])return!0;return!1}),St(He,"getGroupFieldId",(e,t,o)=>{let a=rE(o);return cb(a)(e,t)});var Cr=He;async function Ap(s,e,t){let o=new Cr(e==null?void 0:e.baseUrl,e==null?void 0:e.type,s),a=s[o.getId("perform-server-request")],u=Cr.hasPrivateInformation(s,Cr.httpBodyGroupId,e==null?void 0:e.type),l=Cr.hasPrivateInformation(s,Cr.httpHeadersGroupId,e==null?void 0:e.type),h=u||l,d;try{return!J(a)&&a||h?d=await o.sendToBackend({appId:s.appId,requestId:s.id,env:A.configuration.type,configurationId:A.configuration.id,project:xt()}):d=await(0,kp.default)(o.run(t)),{status:d==null?void 0:d.status,data:d==null?void 0:d.data}}catch(f){if(kp.default.isAxiosError(f)){let{status:p,message:m}=f==null?void 0:f.toJSON();return{status:p,data:{...f.response.data}}}throw f}}var lo=on(uo(),1);var iE=[{name:"Afghanistan",code:"AF"},{name:"\xC5land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D'Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:"Korea, Democratic People'S Republic of",code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:"Lao People'S Democratic Republic",code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia and Montenegro",code:"CS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}];var xO=s=>e=>`${s}__${e}`,RO=s=>e=>`${s}__${e}`,Ne=RO("stripe"),CO=(s,e)=>{if(s[Ne("variable-checkout")]==="n"){let h=s.products,d=[];return h.forEach(f=>{let p=xO("products"),m=f[p(Ne("price"))],g=f[p(Ne("quantity"))],y=f[p(Ne("taxes"))];d.push({price:I(m,e).value,quantity:I(g,e).value,taxes:I(y,e).value})}),d}let o=[],a=s[Ne("price")],u=s[Ne("quantity")],l=s[Ne("taxes")];return o.push({price:I(a,e).value,quantity:I(u,e).value,taxes:I(l,e).value}),o},OO=(s,e)=>{let t=s[Ne("checkout-type")],o=s[Ne("checkout-payment-method")],a=s[Ne("checkout-success")],u=s[Ne("checkout-cancel")],l=s[Ne("customer-email")],h=s[Ne("customer-id")],d=s[Ne("allowed-countries")]||iE.map(({name:g,code:y})=>y),f=s[Ne("collect-billing-address")],p=s["checkout-settings-metadata"];J(p)&&(p=[]);let m={};return p.forEach(g=>{let y="checkout-settings-metadata__stripe__field-key",w="checkout-settings-metadata__stripe__field-value",b=g[y];J(b)||typeof b!="string"||(b==null?void 0:b.length)<1||(m={...m,[g[y]]:I(g[w],e).value})}),{paymentMethod:o,successCallbackUrl:a,cancelCallbackUrl:u,customerEmail:I(l,e).value,stripeCustomerId:I(h,e).value,collectBillingAddress:f,checkoutMetadataSettings:m,allowCountries:d,checkoutType:t}};async function xp(s,e,t){var f,p;let{appId:o}=s,a=xt(),u=A.configuration.type;if(s[Ne("request-type")]==="open-checkout")try{let m=await lo.default.post(`${te.serverUrl}v2/request/stripe/open-checkout?projectId=${a}&env=${u}&appId=${o}`,{productOptions:CO(s,t),checkoutSettings:OO(s,t)});return{status:m==null?void 0:m.status,data:m==null?void 0:m.data}}catch(m){return console.error(m),lo.default.isAxiosError(m)?{status:(f=m==null?void 0:m.response)==null?void 0:f.status,data:{message:m.response.data.error,details:{...m.response}}}:{status:500,data:void 0}}let h=s[Ne("stripe-customer-id")],d=s[Ne("return-url")];try{let m=await lo.default.post(`${te.serverUrl}v2/request/stripe/open-customer-portal?projectId=${a}&env=${u}&appId=${o}`,{stripeCustomerId:I(h,t).value,returnUrl:d});return{status:m==null?void 0:m.status,data:m==null?void 0:m.data}}catch(m){return console.error(m),lo.default.isAxiosError(m)?{status:(p=m==null?void 0:m.response)==null?void 0:p.status,data:{message:m.response.data.error,details:{...m.response}}}:{status:500,data:void 0}}}var sE=s=>async()=>{try{let{error:e}=await s.auth.signOut();return J(e)?{status:200,data:void 0}:{status:500,data:e}}catch(e){return{status:403,data:e}}},oE=s=>async(e,t,o)=>{try{let{data:a,error:u}=await s.auth.api.resetPasswordForEmail(e,{redirectTo:t,captchaToken:o});return J(u)?{status:200,data:a}:{status:500,data:u}}catch(a){return{status:500,data:a}}},aE=s=>async(e,t)=>{try{let{user:o,session:a,error:u}=await s.auth.signIn({email:e,password:t});return J(u)?{status:200,data:{user:o,session:a}}:{status:500,data:u}}catch(o){return{status:500,data:o}}},cE=s=>async(e,t,o,a,u,l)=>{try{let{user:h,session:d,error:f}=await s.auth.signUp({email:e,password:t,phone:o},{data:a!=null?a:void 0,redirectTo:u,captchaToken:l});return J(f)?{status:200,data:{user:h,session:d}}:{status:500,data:f}}catch(h){return{status:500,data:h}}},ho=s=>async(e,t=[])=>{try{let{user:o,session:a,error:u}=await s.auth.signIn({provider:e},{scopes:t.join(" ")});return J(u)?{status:200,data:{user:o,session:a}}:{status:500,data:u}}catch(o){return{status:500,data:o}}},uE=s=>{try{let e=s.auth.user();return J(e)?{status:401,data:new Error("User not logged in")}:{status:200,data:e}}catch(e){return{status:500,data:e}}},lE=s=>async(e,t,o,a)=>{let u={};e&&(u.email=e),t&&(u.password=t),o&&(u.phone=o),a&&(u.data=a);try{let{user:l,error:h}=await s.auth.update(u);return J(h)?{status:200,data:l}:{status:500,data:h}}catch(l){return{status:500,data:l}}};var hE="1.35.7";var Rp={"X-Client-Info":`supabase-js/${hE}`},dE="supabase.auth.token";function fE(s){return s.replace(/\/$/,"")}var pE=()=>typeof window!="undefined";var mE="1.24.0";var gE="http://localhost:9999";var yE={"X-Client-Info":`gotrue-js/${mE}`},fo=10,In={ERROR_MESSAGE:"Request Failed",MAX_RETRIES:10,RETRY_INTERVAL:2},Si="supabase.auth.token",vE={name:"sb",lifetime:60*60*8,domain:"",path:"/",sameSite:"lax"};var po=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},NO=s=>s.msg||s.message||s.error_description||s.error||JSON.stringify(s),DO=(s,e)=>{if(!(s!=null&&s.status))return e({message:In.ERROR_MESSAGE});if(typeof s.json!="function")return e(s);s.json().then(t=>e({message:NO(t),status:(s==null?void 0:s.status)||500}))},PO=(s,e,t)=>{let o={method:s,headers:(e==null?void 0:e.headers)||{}};return s==="GET"||(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),o.body=JSON.stringify(t)),o};function gu(s,e,t,o,a){return po(this,void 0,void 0,function*(){return new Promise((u,l)=>{s(t,PO(e,o,a)).then(h=>{if(!h.ok)throw h;return o!=null&&o.noResolveJson?u:h.json()}).then(h=>u(h)).catch(h=>DO(h,l))})})}function yu(s,e,t){return po(this,void 0,void 0,function*(){return gu(s,"GET",e,t)})}function Ge(s,e,t,o){return po(this,void 0,void 0,function*(){return gu(s,"POST",e,o,t)})}function Cp(s,e,t,o){return po(this,void 0,void 0,function*(){return gu(s,"PUT",e,o,t)})}function wE(s,e,t,o){return po(this,void 0,void 0,function*(){return gu(s,"DELETE",e,o,t)})}function LO(s,e,t){let o=t||{},a=encodeURIComponent,u=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;if(typeof a!="function")throw new TypeError("option encode is invalid");if(!u.test(s))throw new TypeError("argument name is invalid");let l=a(e);if(l&&!u.test(l))throw new TypeError("argument val is invalid");let h=s+"="+l;if(o.maxAge!=null){let d=o.maxAge-0;if(isNaN(d)||!isFinite(d))throw new TypeError("option maxAge is invalid");h+="; Max-Age="+Math.floor(d)}if(o.domain){if(!u.test(o.domain))throw new TypeError("option domain is invalid");h+="; Domain="+o.domain}if(o.path){if(!u.test(o.path))throw new TypeError("option path is invalid");h+="; Path="+o.path}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");h+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(h+="; HttpOnly"),o.secure&&(h+="; Secure"),o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case"lax":h+="; SameSite=Lax";break;case"strict":h+="; SameSite=Strict";break;case"none":h+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return h}function MO(s){if(!s||!s.headers||!s.headers.host)throw new Error('The "host" request header is not available');let e=s.headers.host.indexOf(":")>-1&&s.headers.host.split(":")[0]||s.headers.host;return!(["localhost","127.0.0.1"].indexOf(e)>-1||e.endsWith(".local"))}function UO(s,e){var t,o,a;return LO(s.name,s.value,{maxAge:s.maxAge,expires:new Date(Date.now()+s.maxAge*1e3),httpOnly:!0,secure:e,path:(t=s.path)!==null&&t!==void 0?t:"/",domain:(o=s.domain)!==null&&o!==void 0?o:"",sameSite:(a=s.sameSite)!==null&&a!==void 0?a:"lax"})}function vu(s,e,t){let o=t.map(u=>UO(u,MO(s))),a=e.getHeader("Set-Cookie");return a&&(a instanceof Array?Array.prototype.push.apply(o,a):typeof a=="string"&&o.push(a)),o}function mo(s,e,t){e.setHeader("Set-Cookie",vu(s,e,t))}var _u=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})};function Tn(s){return Math.round(Date.now()/1e3)+s}function _E(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(s){let e=Math.random()*16|0;return(s=="x"?e:e&3|8).toString(16)})}var Yt=()=>typeof window!="undefined";function Zt(s,e){var t;e||(e=((t=window==null?void 0:window.location)===null||t===void 0?void 0:t.href)||""),s=s.replace(/[\[\]]/g,"\\$&");let o=new RegExp("[?&#]"+s+"(=([^&#]*)|&|#|$)"),a=o.exec(e);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null}var EE=s=>{let e;return s?e=s:typeof fetch=="undefined"?e=(...t)=>_u(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(()=>on(go()))).fetch(...t)}):e=fetch,(...t)=>e(...t)},IE=(s,e,t)=>_u(void 0,void 0,void 0,function*(){Yt()&&(yield s==null?void 0:s.setItem(e,JSON.stringify(t)))}),TE=(s,e)=>_u(void 0,void 0,void 0,function*(){let t=Yt()&&(yield s==null?void 0:s.getItem(e));if(!t)return null;try{return JSON.parse(t)}catch{return t}}),SE=(s,e)=>{let t=Yt()&&(s==null?void 0:s.getItem(e));if(!t||typeof t!="string")return null;try{return JSON.parse(t)}catch{return t}},kE=(s,e)=>_u(void 0,void 0,void 0,function*(){Yt()&&(yield s==null?void 0:s.removeItem(e))});var we=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},Ai=class{constructor({url:e="",headers:t={},cookieOptions:o,fetch:a}){this.url=e,this.headers=t,this.cookieOptions=Object.assign(Object.assign({},vE),o),this.fetch=EE(a)}_createRequestHeaders(e){let t=Object.assign({},this.headers);return t.Authorization=`Bearer ${e}`,t}cookieName(){var e;return(e=this.cookieOptions.name)!==null&&e!==void 0?e:""}getUrlForProvider(e,t){let o=[`provider=${encodeURIComponent(e)}`];if(t!=null&&t.redirectTo&&o.push(`redirect_to=${encodeURIComponent(t.redirectTo)}`),t!=null&&t.scopes&&o.push(`scopes=${encodeURIComponent(t.scopes)}`),t!=null&&t.queryParams){let a=new URLSearchParams(t.queryParams);o.push(`${a}`)}return`${this.url}/authorize?${o.join("&")}`}signUpWithEmail(e,t,o={}){return we(this,void 0,void 0,function*(){try{let a=Object.assign({},this.headers),u="";o.redirectTo&&(u="?redirect_to="+encodeURIComponent(o.redirectTo));let l=yield Ge(this.fetch,`${this.url}/signup${u}`,{email:e,password:t,data:o.data,gotrue_meta_security:{captcha_token:o.captchaToken}},{headers:a}),h=Object.assign({},l);return h.expires_in&&(h.expires_at=Tn(l.expires_in)),{data:h,error:null}}catch(a){return{data:null,error:a}}})}signInWithEmail(e,t,o={}){return we(this,void 0,void 0,function*(){try{let a=Object.assign({},this.headers),u="?grant_type=password";o.redirectTo&&(u+="&redirect_to="+encodeURIComponent(o.redirectTo));let l=yield Ge(this.fetch,`${this.url}/token${u}`,{email:e,password:t,gotrue_meta_security:{captcha_token:o.captchaToken}},{headers:a}),h=Object.assign({},l);return h.expires_in&&(h.expires_at=Tn(l.expires_in)),{data:h,error:null}}catch(a){return{data:null,error:a}}})}signUpWithPhone(e,t,o={}){return we(this,void 0,void 0,function*(){try{let a=Object.assign({},this.headers),u=yield Ge(this.fetch,`${this.url}/signup`,{phone:e,password:t,data:o.data,gotrue_meta_security:{captcha_token:o.captchaToken}},{headers:a}),l=Object.assign({},u);return l.expires_in&&(l.expires_at=Tn(u.expires_in)),{data:l,error:null}}catch(a){return{data:null,error:a}}})}signInWithPhone(e,t,o={}){return we(this,void 0,void 0,function*(){try{let a=Object.assign({},this.headers),l=yield Ge(this.fetch,`${this.url}/token?grant_type=password`,{phone:e,password:t,gotrue_meta_security:{captcha_token:o.captchaToken}},{headers:a}),h=Object.assign({},l);return h.expires_in&&(h.expires_at=Tn(l.expires_in)),{data:h,error:null}}catch(a){return{data:null,error:a}}})}signInWithOpenIDConnect({id_token:e,nonce:t,client_id:o,issuer:a,provider:u}){return we(this,void 0,void 0,function*(){try{let l=Object.assign({},this.headers),d=yield Ge(this.fetch,`${this.url}/token?grant_type=id_token`,{id_token:e,nonce:t,client_id:o,issuer:a,provider:u},{headers:l}),f=Object.assign({},d);return f.expires_in&&(f.expires_at=Tn(d.expires_in)),{data:f,error:null}}catch(l){return{data:null,error:l}}})}sendMagicLinkEmail(e,t={}){var o;return we(this,void 0,void 0,function*(){try{let a=Object.assign({},this.headers),u="";t.redirectTo&&(u+="?redirect_to="+encodeURIComponent(t.redirectTo));let l=(o=t.shouldCreateUser)!==null&&o!==void 0?o:!0;return{data:yield Ge(this.fetch,`${this.url}/otp${u}`,{email:e,create_user:l,gotrue_meta_security:{captcha_token:t.captchaToken}},{headers:a}),error:null}}catch(a){return{data:null,error:a}}})}sendMobileOTP(e,t={}){var o;return we(this,void 0,void 0,function*(){try{let a=(o=t.shouldCreateUser)!==null&&o!==void 0?o:!0,u=Object.assign({},this.headers);return{data:yield Ge(this.fetch,`${this.url}/otp`,{phone:e,create_user:a,gotrue_meta_security:{captcha_token:t.captchaToken}},{headers:u}),error:null}}catch(a){return{data:null,error:a}}})}signOut(e){return we(this,void 0,void 0,function*(){try{return yield Ge(this.fetch,`${this.url}/logout`,{},{headers:this._createRequestHeaders(e),noResolveJson:!0}),{error:null}}catch(t){return{error:t}}})}verifyMobileOTP(e,t,o={}){return we(this,void 0,void 0,function*(){try{let a=Object.assign({},this.headers),u=yield Ge(this.fetch,`${this.url}/verify`,{phone:e,token:t,type:"sms",redirect_to:o.redirectTo},{headers:a}),l=Object.assign({},u);return l.expires_in&&(l.expires_at=Tn(u.expires_in)),{data:l,error:null}}catch(a){return{data:null,error:a}}})}verifyOTP({email:e,phone:t,token:o,type:a="sms"},u={}){return we(this,void 0,void 0,function*(){try{let l=Object.assign({},this.headers),h=yield Ge(this.fetch,`${this.url}/verify`,{email:e,phone:t,token:o,type:a,redirect_to:u.redirectTo},{headers:l}),d=Object.assign({},h);return d.expires_in&&(d.expires_at=Tn(h.expires_in)),{data:d,error:null}}catch(l){return{data:null,error:l}}})}inviteUserByEmail(e,t={}){return we(this,void 0,void 0,function*(){try{let o=Object.assign({},this.headers),a="";return t.redirectTo&&(a+="?redirect_to="+encodeURIComponent(t.redirectTo)),{data:yield Ge(this.fetch,`${this.url}/invite${a}`,{email:e,data:t.data},{headers:o}),error:null}}catch(o){return{data:null,error:o}}})}resetPasswordForEmail(e,t={}){return we(this,void 0,void 0,function*(){try{let o=Object.assign({},this.headers),a="";return t.redirectTo&&(a+="?redirect_to="+encodeURIComponent(t.redirectTo)),{data:yield Ge(this.fetch,`${this.url}/recover${a}`,{email:e,gotrue_meta_security:{captcha_token:t.captchaToken}},{headers:o}),error:null}}catch(o){return{data:null,error:o}}})}refreshAccessToken(e){return we(this,void 0,void 0,function*(){try{let t=yield Ge(this.fetch,`${this.url}/token?grant_type=refresh_token`,{refresh_token:e},{headers:this.headers}),o=Object.assign({},t);return o.expires_in&&(o.expires_at=Tn(t.expires_in)),{data:o,error:null}}catch(t){return{data:null,error:t}}})}setAuthCookie(e,t){e.method!=="POST"&&(t.setHeader("Allow","POST"),t.status(405).end("Method Not Allowed"));let{event:o,session:a}=e.body;if(!o)throw new Error("Auth event missing!");if(o==="SIGNED_IN"){if(!a)throw new Error("Auth session missing!");mo(e,t,[{key:"access-token",value:a.access_token},{key:"refresh-token",value:a.refresh_token}].map(u=>{var l;return{name:`${this.cookieName()}-${u.key}`,value:u.value,domain:this.cookieOptions.domain,maxAge:(l=this.cookieOptions.lifetime)!==null&&l!==void 0?l:0,path:this.cookieOptions.path,sameSite:this.cookieOptions.sameSite}}))}o==="SIGNED_OUT"&&mo(e,t,["access-token","refresh-token"].map(u=>({name:`${this.cookieName()}-${u}`,value:"",maxAge:-1}))),t.status(200).json({})}deleteAuthCookie(e,t,{redirectTo:o="/"}){return mo(e,t,["access-token","refresh-token"].map(a=>({name:`${this.cookieName()}-${a}`,value:"",maxAge:-1}))),t.redirect(307,o)}getAuthCookieString(e,t){e.method!=="POST"&&(t.setHeader("Allow","POST"),t.status(405).end("Method Not Allowed"));let{event:o,session:a}=e.body;if(!o)throw new Error("Auth event missing!");if(o==="SIGNED_IN"){if(!a)throw new Error("Auth session missing!");return vu(e,t,[{key:"access-token",value:a.access_token},{key:"refresh-token",value:a.refresh_token}].map(u=>{var l;return{name:`${this.cookieName()}-${u.key}`,value:u.value,domain:this.cookieOptions.domain,maxAge:(l=this.cookieOptions.lifetime)!==null&&l!==void 0?l:0,path:this.cookieOptions.path,sameSite:this.cookieOptions.sameSite}}))}return o==="SIGNED_OUT"?vu(e,t,["access-token","refresh-token"].map(u=>({name:`${this.cookieName()}-${u}`,value:"",maxAge:-1}))):t.getHeader("Set-Cookie")}generateLink(e,t,o={}){return we(this,void 0,void 0,function*(){try{return{data:yield Ge(this.fetch,`${this.url}/admin/generate_link`,{type:e,email:t,password:o.password,data:o.data,redirect_to:o.redirectTo},{headers:this.headers}),error:null}}catch(a){return{data:null,error:a}}})}createUser(e){return we(this,void 0,void 0,function*(){try{let t=yield Ge(this.fetch,`${this.url}/admin/users`,e,{headers:this.headers});return{user:t,data:t,error:null}}catch(t){return{user:null,data:null,error:t}}})}listUsers(){return we(this,void 0,void 0,function*(){try{return{data:(yield yu(this.fetch,`${this.url}/admin/users`,{headers:this.headers})).users,error:null}}catch(e){return{data:null,error:e}}})}getUserById(e){return we(this,void 0,void 0,function*(){try{return{data:yield yu(this.fetch,`${this.url}/admin/users/${e}`,{headers:this.headers}),error:null}}catch(t){return{data:null,error:t}}})}getUserByCookie(e,t){return we(this,void 0,void 0,function*(){try{if(!e.cookies)throw new Error("Not able to parse cookies! When using Express make sure the cookie-parser middleware is in use!");let o=e.cookies[`${this.cookieName()}-access-token`],a=e.cookies[`${this.cookieName()}-refresh-token`];if(!o)throw new Error("No cookie found!");let{user:u,error:l}=yield this.getUser(o);if(l){if(!a)throw new Error("No refresh_token cookie found!");if(!t)throw new Error("You need to pass the res object to automatically refresh the session!");let{data:h,error:d}=yield this.refreshAccessToken(a);if(d)throw d;if(h)return mo(e,t,[{key:"access-token",value:h.access_token},{key:"refresh-token",value:h.refresh_token}].map(f=>{var p;return{name:`${this.cookieName()}-${f.key}`,value:f.value,domain:this.cookieOptions.domain,maxAge:(p=this.cookieOptions.lifetime)!==null&&p!==void 0?p:0,path:this.cookieOptions.path,sameSite:this.cookieOptions.sameSite}})),{token:h.access_token,user:h.user,data:h.user,error:null}}return{token:o,user:u,data:u,error:null}}catch(o){return{token:null,user:null,data:null,error:o}}})}updateUserById(e,t){return we(this,void 0,void 0,function*(){try{let o=yield Cp(this.fetch,`${this.url}/admin/users/${e}`,t,{headers:this.headers});return{user:o,data:o,error:null}}catch(o){return{user:null,data:null,error:o}}})}deleteUser(e){return we(this,void 0,void 0,function*(){try{let t=yield wE(this.fetch,`${this.url}/admin/users/${e}`,{},{headers:this.headers});return{user:t,data:t,error:null}}catch(t){return{user:null,data:null,error:t}}})}getUser(e){return we(this,void 0,void 0,function*(){try{let t=yield yu(this.fetch,`${this.url}/user`,{headers:this._createRequestHeaders(e)});return{user:t,data:t,error:null}}catch(t){return{user:null,data:null,error:t}}})}updateUser(e,t){return we(this,void 0,void 0,function*(){try{let o=yield Cp(this.fetch,`${this.url}/user`,t,{headers:this._createRequestHeaders(e)});return{user:o,data:o,error:null}}catch(o){return{user:null,data:null,error:o}}})}};function AE(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self!="undefined"&&(self.globalThis=self)}}var et=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})};AE();var FO={url:gE,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,multiTab:!0,headers:yE},$O=s=>{try{return atob(s.replace(/[-]/g,"+").replace(/[_]/g,"/"))}catch(e){if(e instanceof ReferenceError)return Buffer.from(s,"base64").toString("utf-8");throw e}},xi=class{constructor(e){this.stateChangeEmitters=new Map,this.networkRetries=0;let t=Object.assign(Object.assign({},FO),e);this.currentUser=null,this.currentSession=null,this.autoRefreshToken=t.autoRefreshToken,this.persistSession=t.persistSession,this.multiTab=t.multiTab,this.localStorage=t.localStorage||globalThis.localStorage,this.api=new Ai({url:t.url,headers:t.headers,cookieOptions:t.cookieOptions,fetch:t.fetch}),this._recoverSession(),this._recoverAndRefresh(),this._listenForMultiTabEvents(),this._handleVisibilityChange(),t.detectSessionInUrl&&Yt()&&Zt("access_token")&&this.getSessionFromUrl({storeSession:!0}).then(({error:o})=>{if(o)throw new Error("Error getting session from URL.")})}signUp({email:e,password:t,phone:o},a={}){return et(this,void 0,void 0,function*(){try{this._removeSession();let{data:u,error:l}=o&&t?yield this.api.signUpWithPhone(o,t,{data:a.data,captchaToken:a.captchaToken}):yield this.api.signUpWithEmail(e,t,{redirectTo:a.redirectTo,data:a.data,captchaToken:a.captchaToken});if(l)throw l;if(!u)throw"An error occurred on sign up.";let h=null,d=null;return u.access_token&&(h=u,d=h.user,this._saveSession(h),this._notifyAllSubscribers("SIGNED_IN")),u.id&&(d=u),{user:d,session:h,error:null}}catch(u){return{user:null,session:null,error:u}}})}signIn({email:e,phone:t,password:o,refreshToken:a,provider:u,oidc:l},h={}){return et(this,void 0,void 0,function*(){try{if(this._removeSession(),e&&!o){let{error:d}=yield this.api.sendMagicLinkEmail(e,{redirectTo:h.redirectTo,shouldCreateUser:h.shouldCreateUser,captchaToken:h.captchaToken});return{user:null,session:null,error:d}}if(e&&o)return this._handleEmailSignIn(e,o,{redirectTo:h.redirectTo,captchaToken:h.captchaToken});if(t&&!o){let{error:d}=yield this.api.sendMobileOTP(t,{shouldCreateUser:h.shouldCreateUser,captchaToken:h.captchaToken});return{user:null,session:null,error:d}}if(t&&o)return this._handlePhoneSignIn(t,o);if(a){let{error:d}=yield this._callRefreshToken(a);if(d)throw d;return{user:this.currentUser,session:this.currentSession,error:null}}if(u)return this._handleProviderSignIn(u,{redirectTo:h.redirectTo,scopes:h.scopes,queryParams:h.queryParams});if(l)return this._handleOpenIDConnectSignIn(l);throw new Error("You must provide either an email, phone number, a third-party provider or OpenID Connect.")}catch(d){return{user:null,session:null,error:d}}})}verifyOTP(e,t={}){return et(this,void 0,void 0,function*(){try{this._removeSession();let{data:o,error:a}=yield this.api.verifyOTP(e,t);if(a)throw a;if(!o)throw"An error occurred on token verification.";let u=null,l=null;return o.access_token&&(u=o,l=u.user,this._saveSession(u),this._notifyAllSubscribers("SIGNED_IN")),o.id&&(l=o),{user:l,session:u,error:null}}catch(o){return{user:null,session:null,error:o}}})}user(){return this.currentUser}session(){return this.currentSession}refreshSession(){var e;return et(this,void 0,void 0,function*(){try{if(!(!((e=this.currentSession)===null||e===void 0)&&e.access_token))throw new Error("Not logged in.");let{error:t}=yield this._callRefreshToken();if(t)throw t;return{data:this.currentSession,user:this.currentUser,error:null}}catch(t){return{data:null,user:null,error:t}}})}update(e){var t;return et(this,void 0,void 0,function*(){try{if(!(!((t=this.currentSession)===null||t===void 0)&&t.access_token))throw new Error("Not logged in.");let{user:o,error:a}=yield this.api.updateUser(this.currentSession.access_token,e);if(a)throw a;if(!o)throw Error("Invalid user data.");let u=Object.assign(Object.assign({},this.currentSession),{user:o});return this._saveSession(u),this._notifyAllSubscribers("USER_UPDATED"),{data:o,user:o,error:null}}catch(o){return{data:null,user:null,error:o}}})}setSession(e){return et(this,void 0,void 0,function*(){let t;if(typeof e=="string"){let o=e,{data:a,error:u}=yield this.api.refreshAccessToken(o);if(u)return{session:null,error:u};t=a}else{let o=Math.round(Date.now()/1e3),{refresh_token:a,access_token:u}=e,l=0,h=0,d=u.split(".");if(d.length!==3)throw new Error("access_token is not a proper JWT");let f=$O(d[1]),p;try{p=JSON.parse(f)}catch{throw new Error("access_token is not a proper JWT, invalid JSON in body")}if(typeof p=="object"&&p&&typeof p.exp=="number")l=p.exp,h=o-p.exp;else throw new Error("access_token is not a proper JWT, missing exp claim");if(o>l){let{data:m,error:g}=yield this.api.refreshAccessToken(a);if(g)return{session:null,error:g};t=m}else{let{user:m,error:g}=yield this.api.getUser(u);if(g)throw g;t={access_token:u,expires_in:h,expires_at:l,refresh_token:a,token_type:"bearer",user:m}}}try{return this._saveSession(t),this._notifyAllSubscribers("SIGNED_IN"),{session:t,error:null}}catch(o){return{error:o,session:null}}})}setAuth(e){return this.currentSession=Object.assign(Object.assign({},this.currentSession),{access_token:e,token_type:"bearer",user:this.user()}),this._notifyAllSubscribers("TOKEN_REFRESHED"),this.currentSession}getSessionFromUrl(e){return et(this,void 0,void 0,function*(){try{if(!Yt())throw new Error("No browser detected.");let t=Zt("error_description");if(t)throw new Error(t);let o=Zt("provider_token"),a=Zt("provider_refresh_token"),u=Zt("access_token");if(!u)throw new Error("No access_token detected.");let l=Zt("expires_in");if(!l)throw new Error("No expires_in detected.");let h=Zt("refresh_token");if(!h)throw new Error("No refresh_token detected.");let d=Zt("token_type");if(!d)throw new Error("No token_type detected.");let p=Math.round(Date.now()/1e3)+parseInt(l),{user:m,error:g}=yield this.api.getUser(u);if(g)throw g;let y={provider_token:o,provider_refresh_token:a,access_token:u,expires_in:parseInt(l),expires_at:p,refresh_token:h,token_type:d,user:m};if(e!=null&&e.storeSession){this._saveSession(y);let w=Zt("type");this._notifyAllSubscribers("SIGNED_IN"),w==="recovery"&&this._notifyAllSubscribers("PASSWORD_RECOVERY")}return window.location.hash="",{data:y,error:null}}catch(t){return{data:null,error:t}}})}signOut(){var e;return et(this,void 0,void 0,function*(){let t=(e=this.currentSession)===null||e===void 0?void 0:e.access_token;if(this._removeSession(),this._notifyAllSubscribers("SIGNED_OUT"),t){let{error:o}=yield this.api.signOut(t);if(o)return{error:o}}return{error:null}})}onAuthStateChange(e){try{let t=_E(),o={id:t,callback:e,unsubscribe:()=>{this.stateChangeEmitters.delete(t)}};return this.stateChangeEmitters.set(t,o),{data:o,error:null}}catch(t){return{data:null,error:t}}}_handleEmailSignIn(e,t,o={}){var a,u;return et(this,void 0,void 0,function*(){try{let{data:l,error:h}=yield this.api.signInWithEmail(e,t,{redirectTo:o.redirectTo,captchaToken:o.captchaToken});return h||!l?{data:null,user:null,session:null,error:h}:((!((a=l==null?void 0:l.user)===null||a===void 0)&&a.confirmed_at||!((u=l==null?void 0:l.user)===null||u===void 0)&&u.email_confirmed_at)&&(this._saveSession(l),this._notifyAllSubscribers("SIGNED_IN")),{data:l,user:l.user,session:l,error:null})}catch(l){return{data:null,user:null,session:null,error:l}}})}_handlePhoneSignIn(e,t,o={}){var a;return et(this,void 0,void 0,function*(){try{let{data:u,error:l}=yield this.api.signInWithPhone(e,t,o);return l||!u?{data:null,user:null,session:null,error:l}:(!((a=u==null?void 0:u.user)===null||a===void 0)&&a.phone_confirmed_at&&(this._saveSession(u),this._notifyAllSubscribers("SIGNED_IN")),{data:u,user:u.user,session:u,error:null})}catch(u){return{data:null,user:null,session:null,error:u}}})}_handleProviderSignIn(e,t={}){let o=this.api.getUrlForProvider(e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});try{return Yt()&&(window.location.href=o),{provider:e,url:o,data:null,session:null,user:null,error:null}}catch(a){return o?{provider:e,url:o,data:null,session:null,user:null,error:null}:{data:null,user:null,session:null,error:a}}}_handleOpenIDConnectSignIn({id_token:e,nonce:t,client_id:o,issuer:a,provider:u}){return et(this,void 0,void 0,function*(){if(e&&t&&(o&&a||u))try{let{data:l,error:h}=yield this.api.signInWithOpenIDConnect({id_token:e,nonce:t,client_id:o,issuer:a,provider:u});return h||!l?{user:null,session:null,error:h}:(this._saveSession(l),this._notifyAllSubscribers("SIGNED_IN"),{user:l.user,session:l,error:null})}catch(l){return{user:null,session:null,error:l}}throw new Error("You must provide a OpenID Connect provider with your id token and nonce.")})}_recoverSession(){try{let e=SE(this.localStorage,Si);if(!e)return null;let{currentSession:t,expiresAt:o}=e,a=Math.round(Date.now()/1e3);o>=a+fo&&(t!=null&&t.user)&&(this._saveSession(t),this._notifyAllSubscribers("SIGNED_IN"))}catch(e){console.log("error",e)}}_recoverAndRefresh(){return et(this,void 0,void 0,function*(){try{let e=yield TE(this.localStorage,Si);if(!e)return null;let{currentSession:t,expiresAt:o}=e,a=Math.round(Date.now()/1e3);if(o<a+fo)if(this.autoRefreshToken&&t.refresh_token){this.networkRetries++;let{error:u}=yield this._callRefreshToken(t.refresh_token);if(u){if(console.log(u.message),u.message===In.ERROR_MESSAGE&&this.networkRetries<In.MAX_RETRIES){this.refreshTokenTimer&&clearTimeout(this.refreshTokenTimer),this.refreshTokenTimer=setTimeout(()=>this._recoverAndRefresh(),Math.pow(In.RETRY_INTERVAL,this.networkRetries)*100);return}yield this._removeSession()}this.networkRetries=0}else this._removeSession();else t?(this._saveSession(t),this._notifyAllSubscribers("SIGNED_IN")):(console.log("Current session is missing data."),this._removeSession())}catch(e){return console.error(e),null}})}_callRefreshToken(e){var t;return e===void 0&&(e=(t=this.currentSession)===null||t===void 0?void 0:t.refresh_token),et(this,void 0,void 0,function*(){try{if(!e)throw new Error("No current session.");let{data:o,error:a}=yield this.api.refreshAccessToken(e);if(a)throw a;if(!o)throw Error("Invalid session data.");return this._saveSession(o),this._notifyAllSubscribers("TOKEN_REFRESHED"),this._notifyAllSubscribers("SIGNED_IN"),{data:o,error:null}}catch(o){return{data:null,error:o}}})}_notifyAllSubscribers(e){this.stateChangeEmitters.forEach(t=>t.callback(e,this.currentSession))}_saveSession(e){this.currentSession=e,this.currentUser=e.user;let t=e.expires_at;if(t){let o=Math.round(Date.now()/1e3),a=t-o,u=a>fo?fo:.5;this._startAutoRefreshToken((a-u)*1e3)}this.persistSession&&e.expires_at&&this._persistSession(this.currentSession)}_persistSession(e){let t={currentSession:e,expiresAt:e.expires_at};IE(this.localStorage,Si,t)}_removeSession(){return et(this,void 0,void 0,function*(){this.currentSession=null,this.currentUser=null,this.refreshTokenTimer&&clearTimeout(this.refreshTokenTimer),kE(this.localStorage,Si)})}_startAutoRefreshToken(e){this.refreshTokenTimer&&clearTimeout(this.refreshTokenTimer),!(e<=0||!this.autoRefreshToken)&&(this.refreshTokenTimer=setTimeout(()=>et(this,void 0,void 0,function*(){this.networkRetries++;let{error:t}=yield this._callRefreshToken();t||(this.networkRetries=0),(t==null?void 0:t.message)===In.ERROR_MESSAGE&&this.networkRetries<In.MAX_RETRIES&&this._startAutoRefreshToken(Math.pow(In.RETRY_INTERVAL,this.networkRetries)*100)}),e),typeof this.refreshTokenTimer.unref=="function"&&this.refreshTokenTimer.unref())}_listenForMultiTabEvents(){if(!this.multiTab||!Yt()||!(window!=null&&window.addEventListener))return!1;try{window==null||window.addEventListener("storage",e=>{var t;if(e.key===Si){let o=JSON.parse(String(e.newValue));!((t=o==null?void 0:o.currentSession)===null||t===void 0)&&t.access_token?(this._saveSession(o.currentSession),this._notifyAllSubscribers("SIGNED_IN")):(this._removeSession(),this._notifyAllSubscribers("SIGNED_OUT"))}})}catch(e){console.error("_listenForMultiTabEvents",e)}}_handleVisibilityChange(){if(!this.multiTab||!Yt()||!(window!=null&&window.addEventListener))return!1;try{window==null||window.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this._recoverAndRefresh()})}catch(e){console.error("_handleVisibilityChange",e)}}};var Eu=class extends xi{constructor(e){super(e)}};var xE=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},Sn=class{constructor(e){Object.assign(this,e);let t;e.fetch?t=e.fetch:typeof fetch=="undefined"?t=(...o)=>xE(this,void 0,void 0,function*(){return yield(yield Promise.resolve().then(()=>on(go()))).fetch(...o)}):t=fetch,this.fetch=(...o)=>t(...o),this.shouldThrowOnError=e.shouldThrowOnError||!1,this.allowEmpty=e.allowEmpty||!1}throwOnError(e){return e==null&&(e=!0),this.shouldThrowOnError=e,this}then(e,t){typeof this.schema=="undefined"||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let o=this.fetch(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(a=>xE(this,void 0,void 0,function*(){var u,l,h,d;let f=null,p=null,m=null,g=a.status,y=a.statusText;if(a.ok){let b=(u=this.headers.Prefer)===null||u===void 0?void 0:u.split(",").includes("return=minimal");if(this.method!=="HEAD"&&!b){let x=yield a.text();x&&(this.headers.Accept==="text/csv"?p=x:p=JSON.parse(x))}let E=(l=this.headers.Prefer)===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),k=(h=a.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");E&&k&&k.length>1&&(m=parseInt(k[1]))}else{let b=yield a.text();try{f=JSON.parse(b)}catch{f={message:b}}if(f&&this.allowEmpty&&(!((d=f==null?void 0:f.details)===null||d===void 0)&&d.includes("Results contain 0 rows"))&&(f=null,g=200,y="OK"),f&&this.shouldThrowOnError)throw f}return{error:f,data:p,count:m,status:g,statusText:y,body:p}}));return this.shouldThrowOnError||(o=o.catch(a=>({error:{message:`FetchError: ${a.message}`,details:"",hint:"",code:a.code||""},data:null,body:null,count:null,status:400,statusText:"Bad Request"}))),o.then(e,t)}};var yo=class extends Sn{select(e="*"){let t=!1,o=e.split("").map(a=>/\s/.test(a)&&!t?"":(a==='"'&&(t=!t),a)).join("");return this.url.searchParams.set("select",o),this}order(e,{ascending:t=!0,nullsFirst:o=!1,foreignTable:a}={}){let u=typeof a=="undefined"?"order":`${a}.order`,l=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${l?`${l},`:""}${e}.${t?"asc":"desc"}.${o?"nullsfirst":"nullslast"}`),this}limit(e,{foreignTable:t}={}){let o=typeof t=="undefined"?"limit":`${t}.limit`;return this.url.searchParams.set(o,`${e}`),this}range(e,t,{foreignTable:o}={}){let a=typeof o=="undefined"?"offset":`${o}.offset`,u=typeof o=="undefined"?"limit":`${o}.limit`;return this.url.searchParams.set(a,`${e}`),this.url.searchParams.set(u,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.headers.Accept="application/vnd.pgrst.object+json",this.allowEmpty=!0,this}csv(){return this.headers.Accept="text/csv",this}};var It=class extends yo{constructor(){super(...arguments),this.cs=this.contains,this.cd=this.containedBy,this.sl=this.rangeLt,this.sr=this.rangeGt,this.nxl=this.rangeGte,this.nxr=this.rangeLte,this.adj=this.rangeAdjacent,this.ov=this.overlaps}not(e,t,o){return this.url.searchParams.append(`${e}`,`not.${t}.${o}`),this}or(e,{foreignTable:t}={}){let o=typeof t=="undefined"?"or":`${t}.or`;return this.url.searchParams.append(o,`(${e})`),this}eq(e,t){return this.url.searchParams.append(`${e}`,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(`${e}`,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(`${e}`,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(`${e}`,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(`${e}`,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(`${e}`,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(`${e}`,`like.${t}`),this}ilike(e,t){return this.url.searchParams.append(`${e}`,`ilike.${t}`),this}is(e,t){return this.url.searchParams.append(`${e}`,`is.${t}`),this}in(e,t){let o=t.map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(`${e}`,`in.(${o})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(`${e}`,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(`${e}`,`cs.{${t.join(",")}}`):this.url.searchParams.append(`${e}`,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(`${e}`,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(`${e}`,`cd.{${t.join(",")}}`):this.url.searchParams.append(`${e}`,`cd.${JSON.stringify(t)}`),this}rangeLt(e,t){return this.url.searchParams.append(`${e}`,`sl.${t}`),this}rangeGt(e,t){return this.url.searchParams.append(`${e}`,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(`${e}`,`nxl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(`${e}`,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(`${e}`,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(`${e}`,`ov.${t}`):this.url.searchParams.append(`${e}`,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:o,type:a=null}={}){let u="";a==="plain"?u="pl":a==="phrase"?u="ph":a==="websearch"&&(u="w");let l=o===void 0?"":`(${o})`;return this.url.searchParams.append(`${e}`,`${u}fts${l}.${t}`),this}fts(e,t,{config:o}={}){let a=typeof o=="undefined"?"":`(${o})`;return this.url.searchParams.append(`${e}`,`fts${a}.${t}`),this}plfts(e,t,{config:o}={}){let a=typeof o=="undefined"?"":`(${o})`;return this.url.searchParams.append(`${e}`,`plfts${a}.${t}`),this}phfts(e,t,{config:o}={}){let a=typeof o=="undefined"?"":`(${o})`;return this.url.searchParams.append(`${e}`,`phfts${a}.${t}`),this}wfts(e,t,{config:o}={}){let a=typeof o=="undefined"?"":`(${o})`;return this.url.searchParams.append(`${e}`,`wfts${a}.${t}`),this}filter(e,t,o){return this.url.searchParams.append(`${e}`,`${t}.${o}`),this}match(e){return Object.keys(e).forEach(t=>{this.url.searchParams.append(`${t}`,`eq.${e[t]}`)}),this}};var Qn=class extends Sn{constructor(e,{headers:t={},schema:o,fetch:a,shouldThrowOnError:u}={}){super({fetch:a,shouldThrowOnError:u}),this.url=new URL(e),this.headers=Object.assign({},t),this.schema=o}select(e="*",{head:t=!1,count:o=null}={}){this.method="GET";let a=!1,u=e.split("").map(l=>/\s/.test(l)&&!a?"":(l==='"'&&(a=!a),l)).join("");return this.url.searchParams.set("select",u),o&&(this.headers.Prefer=`count=${o}`),t&&(this.method="HEAD"),new It(this)}insert(e,{upsert:t=!1,onConflict:o,returning:a="representation",count:u=null}={}){this.method="POST";let l=[`return=${a}`];if(t&&l.push("resolution=merge-duplicates"),t&&o!==void 0&&this.url.searchParams.set("on_conflict",o),this.body=e,u&&l.push(`count=${u}`),this.headers.Prefer&&l.unshift(this.headers.Prefer),this.headers.Prefer=l.join(","),Array.isArray(e)){let h=e.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(h.length>0){let d=[...new Set(h)].map(f=>`"${f}"`);this.url.searchParams.set("columns",d.join(","))}}return new It(this)}upsert(e,{onConflict:t,returning:o="representation",count:a=null,ignoreDuplicates:u=!1}={}){this.method="POST";let l=[`resolution=${u?"ignore":"merge"}-duplicates`,`return=${o}`];return t!==void 0&&this.url.searchParams.set("on_conflict",t),this.body=e,a&&l.push(`count=${a}`),this.headers.Prefer&&l.unshift(this.headers.Prefer),this.headers.Prefer=l.join(","),new It(this)}update(e,{returning:t="representation",count:o=null}={}){this.method="PATCH";let a=[`return=${t}`];return this.body=e,o&&a.push(`count=${o}`),this.headers.Prefer&&a.unshift(this.headers.Prefer),this.headers.Prefer=a.join(","),new It(this)}delete({returning:e="representation",count:t=null}={}){this.method="DELETE";let o=[`return=${e}`];return t&&o.push(`count=${t}`),this.headers.Prefer&&o.unshift(this.headers.Prefer),this.headers.Prefer=o.join(","),new It(this)}};var vo=class extends Sn{constructor(e,{headers:t={},schema:o,fetch:a,shouldThrowOnError:u}={}){super({fetch:a,shouldThrowOnError:u}),this.url=new URL(e),this.headers=Object.assign({},t),this.schema=o}rpc(e,{head:t=!1,count:o=null}={}){return t?(this.method="HEAD",e&&Object.entries(e).forEach(([a,u])=>{this.url.searchParams.append(a,u)})):(this.method="POST",this.body=e),o&&(this.headers.Prefer!==void 0?this.headers.Prefer+=`,count=${o}`:this.headers.Prefer=`count=${o}`),new It(this)}};var RE="0.37.4";var CE={"X-Client-Info":`postgrest-js/${RE}`};var Ri=class{constructor(e,{headers:t={},schema:o,fetch:a,throwOnError:u}={}){this.url=e,this.headers=Object.assign(Object.assign({},CE),t),this.schema=o,this.fetch=a,this.shouldThrowOnError=u}auth(e){return this.headers.Authorization=`Bearer ${e}`,this}from(e){let t=`${this.url}/${e}`;return new Qn(t,{headers:this.headers,schema:this.schema,fetch:this.fetch,shouldThrowOnError:this.shouldThrowOnError})}rpc(e,t,{head:o=!1,count:a=null}={}){let u=`${this.url}/rpc/${e}`;return new vo(u,{headers:this.headers,schema:this.schema,fetch:this.fetch,shouldThrowOnError:this.shouldThrowOnError}).rpc(t,{head:o,count:a})}};var wo={};AI(wo,{PostgresTypes:()=>ae,convertCell:()=>Np,convertChangeData:()=>BO,convertColumn:()=>OE,toArray:()=>LE,toBoolean:()=>NE,toJson:()=>PE,toNumber:()=>DE,toTimestampString:()=>ME});var ae;(function(s){s.abstime="abstime",s.bool="bool",s.date="date",s.daterange="daterange",s.float4="float4",s.float8="float8",s.int2="int2",s.int4="int4",s.int4range="int4range",s.int8="int8",s.int8range="int8range",s.json="json",s.jsonb="jsonb",s.money="money",s.numeric="numeric",s.oid="oid",s.reltime="reltime",s.text="text",s.time="time",s.timestamp="timestamp",s.timestamptz="timestamptz",s.timetz="timetz",s.tsrange="tsrange",s.tstzrange="tstzrange"})(ae||(ae={}));var BO=(s,e,t={})=>{var o;let a=(o=t.skipTypes)!==null&&o!==void 0?o:[];return Object.keys(e).reduce((u,l)=>(u[l]=OE(l,s,e,a),u),{})},OE=(s,e,t,o)=>{let a=e.find(h=>h.name===s),u=a==null?void 0:a.type,l=t[s];return u&&!o.includes(u)?Np(u,l):Op(l)},Np=(s,e)=>{if(s.charAt(0)==="_"){let t=s.slice(1,s.length);return LE(e,t)}switch(s){case ae.bool:return NE(e);case ae.float4:case ae.float8:case ae.int2:case ae.int4:case ae.int8:case ae.numeric:case ae.oid:return DE(e);case ae.json:case ae.jsonb:return PE(e);case ae.timestamp:return ME(e);case ae.abstime:case ae.date:case ae.daterange:case ae.int4range:case ae.int8range:case ae.money:case ae.reltime:case ae.text:case ae.time:case ae.timestamptz:case ae.timetz:case ae.tsrange:case ae.tstzrange:return Op(e);default:return Op(e)}},Op=s=>s,NE=s=>{switch(s){case"t":return!0;case"f":return!1;default:return s}},DE=s=>{if(typeof s=="string"){let e=parseFloat(s);if(!Number.isNaN(e))return e}return s},PE=s=>{if(typeof s=="string")try{return JSON.parse(s)}catch(e){return console.log(`JSON parse error: ${e}`),s}return s},LE=(s,e)=>{if(typeof s!="string")return s;let t=s.length-1,o=s[t];if(s[0]==="{"&&o==="}"){let u,l=s.slice(1,t);try{u=JSON.parse("["+l+"]")}catch{u=l?l.split(","):[]}return u.map(h=>Np(e,h))}return s},ME=s=>typeof s=="string"?s.replace(" ","T"):s;var JE=on(HE());var GE="1.7.5";var KE={"X-Client-Info":`realtime-js/${GE}`},WE="1.0.0",Tu=1e4,QE=1e3,Ci;(function(s){s[s.connecting=0]="connecting",s[s.open=1]="open",s[s.closing=2]="closing",s[s.closed=3]="closed"})(Ci||(Ci={}));var tt;(function(s){s.closed="closed",s.errored="errored",s.joined="joined",s.joining="joining",s.leaving="leaving"})(tt||(tt={}));var ht;(function(s){s.close="phx_close",s.error="phx_error",s.join="phx_join",s.reply="phx_reply",s.leave="phx_leave",s.access_token="access_token"})(ht||(ht={}));var Iu;(function(s){s.websocket="websocket"})(Iu||(Iu={}));var Jn;(function(s){s.Connecting="connecting",s.Open="open",s.Closing="closing",s.Closed="closed"})(Jn||(Jn={}));var Nr=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var _o=class{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){let t=new DataView(e),o=new TextDecoder;return this._decodeBroadcast(e,t,o)}_decodeBroadcast(e,t,o){let a=t.getUint8(1),u=t.getUint8(2),l=this.HEADER_LENGTH+2,h=o.decode(e.slice(l,l+a));l=l+a;let d=o.decode(e.slice(l,l+u));l=l+u;let f=JSON.parse(o.decode(e.slice(l,e.byteLength)));return{ref:null,topic:h,event:d,payload:f}}};var Dr=class{constructor(e,t,o={},a=Tu){this.channel=e,this.event=t,this.payload=o,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel.joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var o;return this._hasReceived(e)&&t((o=this.receivedResp)===null||o===void 0?void 0:o.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref);let e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel.on(this.refEvent,e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel.trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(o=>o.status===e).forEach(o=>o.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}};var Oi=class{constructor(e,t={},o){this.topic=e,this.params=t,this.socket=o,this.bindings=[],this.state=tt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.timeout=this.socket.timeout,this.joinPush=new Dr(this,ht.join,this.params,this.timeout),this.rejoinTimer=new Nr(()=>this.rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=tt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=tt.closed,this.socket.remove(this)}),this.onError(a=>{this.isLeaving()||this.isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=tt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this.isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=tt.errored,this.rejoinTimer.scheduleTimeout())}),this.on(ht.reply,(a,u)=>{this.trigger(this.replyEventName(u),a)})}rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this.rejoin()}subscribe(e=this.timeout){if(this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";return this.joinedOnce=!0,this.rejoin(e),this.joinPush}onClose(e){this.on(ht.close,e)}onError(e){this.on(ht.error,t=>e(t))}on(e,t){this.bindings.push({event:e,callback:t})}off(e){this.bindings=this.bindings.filter(t=>t.event!==e)}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,o=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new Dr(this,e,t,o);return this.canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=tt.leaving;let t=()=>{this.socket.log("channel",`leave ${this.topic}`),this.trigger(ht.close,"leave",this.joinRef())};this.joinPush.destroy();let o=new Dr(this,ht.leave,{},e);return o.receive("ok",()=>t()).receive("timeout",()=>t()),o.send(),this.canPush()||o.trigger("ok",{}),o}onMessage(e,t,o){return t}isMember(e){return this.topic===e}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=tt.joining,this.joinPush.resend(e))}trigger(e,t,o){let{close:a,error:u,leave:l,join:h}=ht;if(o&&[a,u,l,h].indexOf(e)>=0&&o!==this.joinRef())return;let f=this.onMessage(e,t,o);if(t&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";this.bindings.filter(p=>p.event==="*"?e===(t==null?void 0:t.type):p.event===e).map(p=>p.callback(f,o))}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===tt.closed}isErrored(){return this.state===tt.errored}isJoined(){return this.state===tt.joined}isJoining(){return this.state===tt.joining}isLeaving(){return this.state===tt.leaving}};var qO=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},zO=()=>{},Ni=class{constructor(e,t){this.accessToken=null,this.channels=[],this.endPoint="",this.headers=KE,this.params={},this.timeout=Tu,this.transport=JE.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.longpollerTimeout=2e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=zO,this.conn=null,this.sendBuffer=[],this.serializer=new _o,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.endPoint=`${e}/${Iu.websocket}`,t!=null&&t.params&&(this.params=t.params),t!=null&&t.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t!=null&&t.timeout&&(this.timeout=t.timeout),t!=null&&t.logger&&(this.logger=t.logger),t!=null&&t.transport&&(this.transport=t.transport),t!=null&&t.heartbeatIntervalMs&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs),t!=null&&t.longpollerTimeout&&(this.longpollerTimeout=t.longpollerTimeout),this.reconnectAfterMs=t!=null&&t.reconnectAfterMs?t.reconnectAfterMs:o=>[1e3,2e3,5e3,1e4][o-1]||1e4,this.encode=t!=null&&t.encode?t.encode:(o,a)=>a(JSON.stringify(o)),this.decode=t!=null&&t.decode?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new Nr(()=>qO(this,void 0,void 0,function*(){yield this.disconnect(),this.connect()}),this.reconnectAfterMs)}connect(){this.conn||(this.conn=new this.transport(this.endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e)))}disconnect(e,t){return new Promise((o,a)=>{try{this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,t||""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset()),o({error:null,data:!0})}catch(u){o({error:u,data:!1})}})}log(e,t,o){this.logger(e,t,o)}onOpen(e){this.stateChangeCallbacks.open.push(e)}onClose(e){this.stateChangeCallbacks.close.push(e)}onError(e){this.stateChangeCallbacks.error.push(e)}onMessage(e){this.stateChangeCallbacks.message.push(e)}connectionState(){switch(this.conn&&this.conn.readyState){case Ci.connecting:return Jn.Connecting;case Ci.open:return Jn.Open;case Ci.closing:return Jn.Closing;default:return Jn.Closed}}isConnected(){return this.connectionState()===Jn.Open}remove(e){this.channels=this.channels.filter(t=>t.joinRef()!==e.joinRef())}channel(e,t={}){let o=new Oi(e,t,this);return this.channels.push(o),o}push(e){let{topic:t,event:o,payload:a,ref:u}=e,l=()=>{this.encode(e,h=>{var d;(d=this.conn)===null||d===void 0||d.send(h)})};this.log("push",`${t} ${o} (${u})`,a),this.isConnected()?l():this.sendBuffer.push(l)}onConnMessage(e){this.decode(e.data,t=>{let{topic:o,event:a,payload:u,ref:l}=t;(l&&l===this.pendingHeartbeatRef||a===(u==null?void 0:u.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${u.status||""} ${o} ${a} ${l&&"("+l+")"||""}`,u),this.channels.filter(h=>h.isMember(o)).forEach(h=>h.trigger(a,u,l)),this.stateChangeCallbacks.message.forEach(h=>h(t))})}endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:WE}))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}setAuth(e){this.accessToken=e,this.channels.forEach(t=>{e&&t.updateJoinPayload({user_token:e}),t.joinedOnce&&t.isJoined()&&t.push(ht.access_token,{access_token:e})})}leaveOpenTopic(e){let t=this.channels.find(o=>o.topic===e&&(o.isJoined()||o.isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_onConnOpen(){this.log("transport",`connected to ${this.endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e.trigger(ht.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;let o=e.match(/\?/)?"&":"?",a=new URLSearchParams(t);return`${e}${o}${a}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(QE,"hearbeat timeout");return}this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}};var Su=class{constructor(e,t,o,a){let u={},l=a==="*"?`realtime:${o}`:`realtime:${o}:${a}`,h=t.Authorization.split(" ")[1];h&&(u.user_token=h),this.subscription=e.channel(l,u)}getPayloadRecords(e){let t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=wo.convertChangeData(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=wo.convertChangeData(e.columns,e.old_record)),t}on(e,t){return this.subscription.on(e,o=>{let a={schema:o.schema,table:o.table,commit_timestamp:o.commit_timestamp,eventType:o.type,new:{},old:{},errors:o.errors};a=Object.assign(Object.assign({},a),this.getPayloadRecords(o)),t(a)}),this}subscribe(e=()=>{}){return this.subscription.onError(t=>e("SUBSCRIPTION_ERROR",t)),this.subscription.onClose(()=>e("CLOSED")),this.subscription.subscribe().receive("ok",()=>e("SUBSCRIBED")).receive("error",t=>e("SUBSCRIPTION_ERROR",t)).receive("timeout",()=>e("RETRYING_AFTER_TIMEOUT")),this.subscription}};var ku=class extends Qn{constructor(e,{headers:t={},schema:o,realtime:a,table:u,fetch:l,shouldThrowOnError:h}){super(e,{headers:t,schema:o,fetch:l,shouldThrowOnError:h}),this._subscription=null,this._realtime=a,this._headers=t,this._schema=o,this._table=u}on(e,t){return this._realtime.isConnected()||this._realtime.connect(),this._subscription||(this._subscription=new Su(this._realtime,this._headers,this._schema,this._table)),this._subscription.on(e,t)}};var XE="1.7.3";var YE={"X-Client-Info":`storage-js/${XE}`};var Eo=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},HO=s=>s.msg||s.message||s.error_description||s.error||JSON.stringify(s),GO=(s,e)=>{if(typeof s.json!="function")return e(s);s.json().then(t=>e({message:HO(t),status:(s==null?void 0:s.status)||500}))},KO=(s,e,t,o)=>{let a={method:s,headers:(e==null?void 0:e.headers)||{}};return s==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),a.body=JSON.stringify(o),Object.assign(Object.assign({},a),t))};function Au(s,e,t,o,a,u){return Eo(this,void 0,void 0,function*(){return new Promise((l,h)=>{s(t,KO(e,o,a,u)).then(d=>{if(!d.ok)throw d;return o!=null&&o.noResolveJson?l(d):d.json()}).then(d=>l(d)).catch(d=>GO(d,h))})})}function Io(s,e,t,o){return Eo(this,void 0,void 0,function*(){return Au(s,"GET",e,t,o)})}function kn(s,e,t,o,a){return Eo(this,void 0,void 0,function*(){return Au(s,"POST",e,o,a,t)})}function ZE(s,e,t,o,a){return Eo(this,void 0,void 0,function*(){return Au(s,"PUT",e,o,a,t)})}function xu(s,e,t,o,a){return Eo(this,void 0,void 0,function*(){return Au(s,"DELETE",e,o,a,t)})}var WO=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},Ru=s=>{let e;return s?e=s:typeof fetch=="undefined"?e=(...t)=>WO(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(()=>on(go()))).fetch(...t)}):e=fetch,(...t)=>e(...t)};var Di=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},Cu=class{constructor(e,t={},o){this.url=e,this.headers=Object.assign(Object.assign({},YE),t),this.fetch=Ru(o)}listBuckets(){return Di(this,void 0,void 0,function*(){try{return{data:yield Io(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){return{data:null,error:e}}})}getBucket(e){return Di(this,void 0,void 0,function*(){try{return{data:yield Io(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){return{data:null,error:t}}})}createBucket(e,t={public:!1}){return Di(this,void 0,void 0,function*(){try{return{data:(yield kn(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public},{headers:this.headers})).name,error:null}}catch(o){return{data:null,error:o}}})}updateBucket(e,t){return Di(this,void 0,void 0,function*(){try{return{data:yield ZE(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public},{headers:this.headers}),error:null}}catch(o){return{data:null,error:o}}})}emptyBucket(e){return Di(this,void 0,void 0,function*(){try{return{data:yield kn(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){return{data:null,error:t}}})}deleteBucket(e){return Di(this,void 0,void 0,function*(){try{return{data:yield xu(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){return{data:null,error:t}}})}};var en=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},QO={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},JO={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Ou=class{constructor(e,t={},o,a){this.url=e,this.headers=t,this.bucketId=o,this.fetch=Ru(a)}uploadOrUpdate(e,t,o,a){return en(this,void 0,void 0,function*(){try{let u,l=Object.assign(Object.assign({},JO),a),h=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(l.upsert)});typeof Blob!="undefined"&&o instanceof Blob?(u=new FormData,u.append("cacheControl",l.cacheControl),u.append("",o)):typeof FormData!="undefined"&&o instanceof FormData?(u=o,u.append("cacheControl",l.cacheControl)):(u=o,h["cache-control"]=`max-age=${l.cacheControl}`,h["content-type"]=l.contentType);let d=this._removeEmptyFolders(t),f=this._getFinalPath(d),p=yield this.fetch(`${this.url}/object/${f}`,{method:e,body:u,headers:h});return p.ok?{data:{Key:f},error:null}:{data:null,error:yield p.json()}}catch(u){return{data:null,error:u}}})}upload(e,t,o){return en(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,o)})}update(e,t,o){return en(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,o)})}move(e,t){return en(this,void 0,void 0,function*(){try{return{data:yield kn(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers}),error:null}}catch(o){return{data:null,error:o}}})}copy(e,t){return en(this,void 0,void 0,function*(){try{return{data:yield kn(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers}),error:null}}catch(o){return{data:null,error:o}}})}createSignedUrl(e,t){return en(this,void 0,void 0,function*(){try{let o=this._getFinalPath(e),a=yield kn(this.fetch,`${this.url}/object/sign/${o}`,{expiresIn:t},{headers:this.headers}),u=`${this.url}${a.signedURL}`;return a={signedURL:u},{data:a,error:null,signedURL:u}}catch(o){return{data:null,error:o,signedURL:null}}})}createSignedUrls(e,t){return en(this,void 0,void 0,function*(){try{return{data:(yield kn(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers})).map(a=>Object.assign(Object.assign({},a),{signedURL:a.signedURL?`${this.url}${a.signedURL}`:null})),error:null}}catch(o){return{data:null,error:o}}})}download(e){return en(this,void 0,void 0,function*(){try{let t=this._getFinalPath(e);return{data:yield(yield Io(this.fetch,`${this.url}/object/${t}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(t){return{data:null,error:t}}})}getPublicUrl(e){try{let t=this._getFinalPath(e),o=`${this.url}/object/public/${t}`;return{data:{publicURL:o},error:null,publicURL:o}}catch(t){return{data:null,error:t,publicURL:null}}}remove(e){return en(this,void 0,void 0,function*(){try{return{data:yield xu(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){return{data:null,error:t}}})}list(e,t,o){return en(this,void 0,void 0,function*(){try{let a=Object.assign(Object.assign(Object.assign({},QO),t),{prefix:e||""});return{data:yield kn(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},o),error:null}}catch(a){return{data:null,error:a}}})}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}};var Pi=class extends Cu{constructor(e,t={},o){super(e,t,o)}from(e){return new Ou(this.url,this.headers,e,this.fetch)}};var XO=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},e0=s=>{let e;return s?e=s:typeof fetch=="undefined"?e=(...t)=>XO(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(()=>on(go()))).fetch(...t)}):e=fetch,(...t)=>e(...t)};var YO=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},Nu=class{constructor(e,{headers:t={},customFetch:o}={}){this.url=e,this.headers=t,this.fetch=e0(o)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t){return YO(this,void 0,void 0,function*(){try{let{headers:o,body:a}=t!=null?t:{},u=yield this.fetch(`${this.url}/${e}`,{method:"POST",headers:Object.assign({},this.headers,o),body:a}),l=u.headers.get("x-relay-error");if(l&&l==="true")return{data:null,error:new Error(yield u.text())};let h,{responseType:d}=t!=null?t:{};return!d||d==="json"?h=yield u.json():d==="arrayBuffer"?h=yield u.arrayBuffer():d==="blob"?h=yield u.blob():h=yield u.text(),{data:h,error:null}}catch(o){return{data:null,error:o}}})}};var Dp=function(s,e,t,o){function a(u){return u instanceof t?u:new t(function(l){l(u)})}return new(t||(t=Promise))(function(u,l){function h(p){try{f(o.next(p))}catch(m){l(m)}}function d(p){try{f(o.throw(p))}catch(m){l(m)}}function f(p){p.done?u(p.value):a(p.value).then(h,d)}f((o=o.apply(s,e||[])).next())})},ZO={schema:"public",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,multiTab:!0,headers:Rp},To=class{constructor(e,t,o){if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");let a=fE(e),u=Object.assign(Object.assign({},ZO),o);if(this.restUrl=`${a}/rest/v1`,this.realtimeUrl=`${a}/realtime/v1`.replace("http","ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,a.match(/(supabase\.co)|(supabase\.in)/)){let h=a.split(".");this.functionsUrl=`${h[0]}.functions.${h[1]}.${h[2]}`}else this.functionsUrl=`${a}/functions/v1`;this.schema=u.schema,this.multiTab=u.multiTab,this.fetch=u.fetch,this.headers=Object.assign(Object.assign({},Rp),o==null?void 0:o.headers),this.shouldThrowOnError=u.shouldThrowOnError||!1,this.auth=this._initSupabaseAuthClient(u),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},u.realtime)),this._listenForAuthEvents(),this._listenForMultiTabEvents()}get functions(){return new Nu(this.functionsUrl,{headers:this._getAuthHeaders(),customFetch:this.fetch})}get storage(){return new Pi(this.storageUrl,this._getAuthHeaders(),this.fetch)}from(e){let t=`${this.restUrl}/${e}`;return new ku(t,{headers:this._getAuthHeaders(),schema:this.schema,realtime:this.realtime,table:e,fetch:this.fetch,shouldThrowOnError:this.shouldThrowOnError})}rpc(e,t,{head:o=!1,count:a=null}={}){return this._initPostgRESTClient().rpc(e,t,{head:o,count:a})}removeAllSubscriptions(){return Dp(this,void 0,void 0,function*(){let e=this.getSubscriptions().slice(),t=e.map(a=>this.removeSubscription(a));return(yield Promise.all(t)).map(({error:a},u)=>({data:{subscription:e[u]},error:a}))})}removeSubscription(e){return Dp(this,void 0,void 0,function*(){let{error:t}=yield this._closeSubscription(e),o=this.getSubscriptions(),a=o.filter(u=>u.isJoined()).length;return o.length===0&&(yield this.realtime.disconnect()),{data:{openSubscriptions:a},error:t}})}_closeSubscription(e){return Dp(this,void 0,void 0,function*(){let t=null;if(!e.isClosed()){let{error:o}=yield this._unsubscribeSubscription(e);t=o}return this.realtime.remove(e),{error:t}})}_unsubscribeSubscription(e){return new Promise(t=>{e.unsubscribe().receive("ok",()=>t({error:null})).receive("error",o=>t({error:o})).receive("timeout",()=>t({error:new Error("timed out")}))})}getSubscriptions(){return this.realtime.channels}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:o,localStorage:a,headers:u,fetch:l,cookieOptions:h,multiTab:d}){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Eu({url:this.authUrl,headers:Object.assign(Object.assign({},u),f),autoRefreshToken:e,persistSession:t,detectSessionInUrl:o,localStorage:a,fetch:l,cookieOptions:h,multiTab:d})}_initRealtimeClient(e){return new Ni(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign(Object.assign({},e==null?void 0:e.params),{apikey:this.supabaseKey})}))}_initPostgRESTClient(){return new Ri(this.restUrl,{headers:this._getAuthHeaders(),schema:this.schema,fetch:this.fetch,throwOnError:this.shouldThrowOnError})}_getAuthHeaders(){var e,t;let o=Object.assign({},this.headers),a=(t=(e=this.auth.session())===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:this.supabaseKey;return o.apikey=this.supabaseKey,o.Authorization=o.Authorization||`Bearer ${a}`,o}_listenForMultiTabEvents(){if(!this.multiTab||!pE()||!(window!=null&&window.addEventListener))return null;try{return window==null?void 0:window.addEventListener("storage",e=>{var t,o,a;if(e.key===dE){let u=JSON.parse(String(e.newValue)),l=(o=(t=u==null?void 0:u.currentSession)===null||t===void 0?void 0:t.access_token)!==null&&o!==void 0?o:void 0,h=(a=this.auth.session())===null||a===void 0?void 0:a.access_token;l?!h&&l?this._handleTokenChanged("SIGNED_IN",l,"STORAGE"):h!==l&&this._handleTokenChanged("TOKEN_REFRESHED",l,"STORAGE"):this._handleTokenChanged("SIGNED_OUT",l,"STORAGE")}})}catch(e){return console.error("_listenForMultiTabEvents",e),null}}_listenForAuthEvents(){let{data:e}=this.auth.onAuthStateChange((t,o)=>{this._handleTokenChanged(t,o==null?void 0:o.access_token,"CLIENT")});return e}_handleTokenChanged(e,t,o){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==t?(this.realtime.setAuth(t),o=="STORAGE"&&this.auth.setAuth(t),this.changedAccessToken=t):(e==="SIGNED_OUT"||e==="USER_DELETED")&&(this.realtime.setAuth(this.supabaseKey),o=="STORAGE"&&this.auth.signOut())}};var Du=(s,e,t)=>new To(s,e,t);var t0={fulltextsearch:{tsquery:"fts",plainto:"plfts",phraseto:"phfts",websearch:"wfts"},contains:"cs",contained:"cd",overlap:"ov",_converter:s=>{switch(s){case"contains":return"cs";case"textSearch":return"fts";default:return s}}};var Li=new Map,Mi=(s,e)=>Du(s,e),n0=s=>{let e=s.type==="data-in",t=s["supabase__api-tool"]==="db",o=s["supabase__db-table"];if(!(e&&t&&!J(o)))throw new Error("Request does not support supabase subscription");return u=>{Li.set(s==null?void 0:s.id,u.from(o).on("INSERT",({new:l})=>{T[`r.${s.number}.$.isRequesting`].set(!0),T[`r.${s.number}.$.hasRequested`].set(!!T[`r.${s.number}.$.hasRequested`].value);let h=[...T[`r.${s.number}.d`].value];T[`r.${s.number}.d`].set([...h,l]),T[`r.${s.number}.$.isRequesting`].set(!1),T[`r.${s.number}.$.hasRequested`].set(!!T[`r.${s.number}.$.hasRequested`].value)}).on("UPDATE",({new:l,old:h})=>{T[`r.${s.number}.$.isRequesting`].set(!0),T[`r.${s.number}.$.hasRequested`].set(!!T[`r.${s.number}.$.hasRequested`].value);let d=[...T[`r.${s.number}.d`].value];T[`r.${s.number}.d`].set([...d.map(f=>(f==null?void 0:f.id)===(h==null?void 0:h.id)?l:f)]),T[`r.${s.number}.$.isRequesting`].set(!1),T[`r.${s.number}.$.hasRequested`].set(!!T[`r.${s.number}.$.hasRequested`].value)}).on("DELETE",({old:l})=>{T[`r.${s.number}.$.isRequesting`].set(!0),T[`r.${s.number}.$.hasRequested`].set(!!T[`r.${s.number}.$.hasRequested`].value);let h=[...T[`r.${s.number}.d`].value];T[`r.${s.number}.d`].set([...h.filter(({id:d})=>d!==(l==null?void 0:l.id))]),T[`r.${s.number}.$.isRequesting`].set(!1),T[`r.${s.number}.$.hasRequested`].set(!!T[`r.${s.number}.$.hasRequested`].value)}).subscribe())}},r0=(s,e)=>async()=>{if(!Li.has(e))throw{status:301,data:{error:`Subscription reference not found for request id: ${e}`}};let t=Li.get(e);try{let{error:o}=await s.removeSubscription(t);if(Li.delete(e),!J(o))throw console.warn(o),{status:500,data:o};let a=A.configuration.requests.find(({id:u})=>u===e);return T[`r.${a.number}.$.isRequesting`].set(!1),T[`r.${a.number}.$.hasRequested`].set(!0),{status:200,data:{refId:e}}}catch(o){throw{status:500,data:o}}},i0=s=>async e=>{var a,u,l;let o=s.from(e.table).select("*");if(e!=null&&e.hasFilter){let h=[];((a=e.filters)!=null?a:[]).forEach(({column:d,condition:f,value:p,criteria:m})=>{switch(m){case"or":h.push(d+"."+t0._converter(f)+"."+p);break;case"and":o=o[f](d,p);break}}),h.length>0&&(o=o.or(h.join(",")))}e.hasSorting&&(o=o.order((u=e.sorting)==null?void 0:u.column,{ascending:((l=e.sorting)==null?void 0:l.order)==="ascending"})),e.limit&&(o=o.limit(e.limit));try{let{data:h,error:d}=await o;return J(d)?{status:200,data:h}:{status:500,data:d}}catch(h){return{status:503,data:h}}},s0=s=>async e=>{var o,a;let t=s.from(e.table).select().match({[(o=e==null?void 0:e.updatingColumn)==null?void 0:o.column]:(a=e==null?void 0:e.updatingColumn)==null?void 0:a.value}).limit(1).maybeSingle();try{let{data:u,error:l}=await t;return J(l)?{status:200,data:u}:{status:500,data:l}}catch(u){return{status:500,data:u}}},o0=s=>async({table:e},t)=>{let o=s.from(e).insert([t]);try{let{data:a,error:u}=await o;return J(u)?{status:200,data:a}:{status:500,data:u}}catch(a){return{status:500,data:a}}},a0=s=>async(e,t)=>{var a,u;let o=s.from(e.table).update({...t}).match({[(a=e==null?void 0:e.updatingColumn)==null?void 0:a.column]:(u=e==null?void 0:e.updatingColumn)==null?void 0:u.value});try{let{data:l,error:h}=await o;return J(h)?{status:200,data:l}:{status:500,data:h}}catch(l){return{status:500,data:l}}},c0=s=>async e=>{var o,a;let t=s.from(e.table).delete().match({[(o=e==null?void 0:e.updatingColumn)==null?void 0:o.column]:(a=e==null?void 0:e.updatingColumn)==null?void 0:a.value});try{let{data:u,error:l}=await t;return J(l)?{status:200,data:u}:{status:500,data:l}}catch(u){return{status:500,data:u}}};var Tt=s=>e=>`${s}__${e}`,eN=s=>e=>`${s}__${e}`,z=eN("supabase"),tN=(s,e,t)=>{let o=e[z("db-method")];if(o==="unsubscribe")return r0(s,e[z("request-list")])();if(o!=="get-list")return s0(s)({table:e[z("db-table")],updatingColumn:{column:e[z("db-table-column")],value:I(e[z("db-column-value")],t).value}});let a=[];(e["db-filter"]||[]).forEach(d=>{let f=d[Tt("db-filter")(z("criteria"))],p=d[Tt("db-filter")(z("condition"))],m=I(d[Tt("db-filter")(z("value"))],t).value;a.push({criteria:f!=null?f:"and",column:d[Tt("db-filter")(z("column"))],condition:p,value:p==="textSearch"?`\`${m}\``:m})});let l={column:e[z("sorting-db-column")],order:e[z("sorting-order")]},h=!Pt(l==null?void 0:l.column)&&!Pt(l==null?void 0:l.order);return i0(s)({sorting:{column:l==null?void 0:l.column,order:l==null?void 0:l.order},table:e[z("db-table")],limit:+e[z("limit")],filters:a,hasSorting:h,hasFilter:a.length>0})},nN=(s,e,t)=>{let o=e[z("query-method")];if(o==="delete")return c0(s)({table:e[z("db-table")],updatingColumn:{column:"id",value:I(e[z("record-id")],t).value}});let a=e[`db-op-${o}`],u={};for(let h of a){let d=h[Tt(`db-op-${o}`)(z("record-column"))],{value:f}=I(h[Tt(`db-op-${o}`)(z("record-value"))],t);u[d]=f}return o==="create"?o0(s)({table:e[z("db-table")]},u):a0(s)({table:e[z("db-table")],updatingColumn:{column:"id",value:I(e[z("record-id")],t).value}},u)},u0=(s,e)=>{let t=s["user-profile"];if(J(t))return{};let o={};if(t.forEach(a=>{let u=a[Tt("user-profile")(z("key"))],l=a[Tt("user-profile")(z("value"))];o[u]=I(l,e).value}),Object.keys(o).length!==0)return o},rN=(s,e)=>{let t=s["edge-function-body"],o=new FormData;return J(t)||t.forEach(a=>{let u=a[Tt("edge-function-body")(z("key"))],l=a[Tt("edge-function-body")(z("value"))],h=I(l,e).value;o.append(u,h)}),o},iN=(s,e)=>{let t=s["edge-function-headers"];if(J(t))return{};let o={};return t.forEach(a=>{let u=a[Tt("edge-function-headers")(z("key"))],l=a[Tt("edge-function-headers")(z("value"))];o[u]=I(l,e).value}),o};async function l0(s,e,t,o=!1){var f;let a=s.type==="data-in",u=s[z("api-tool")],l=u==="db",h=u==="auth",d=u==="edge-function";if(l&&a){let p=Mi(e["api-url"],e["api-key"]),m=await tN(p,s,t);if(o&&!Li.has(s.id))try{n0(s)(p),m.status=100}catch(g){console.groupCollapsed("Supabase realtime"),console.warn(g.message),console.groupEnd()}return m}if(l&&!a)return nN(Mi(e["api-url"],e["api-key"]),s,t);if(h&&!a){let p=Mi(e["api-url"],e["api-key"]);switch(s[z("auth-method")]){case"reset-password":return oE(p)(I(s[z("reset-email")]||s[z("email")],t).value,I(s[z("redirect-to")],t).value,I(s[z("captcha-token")],t).value);case"update-user":return lE(p)(I(s[z("email")],t).value,I(s[z("password")],t).value,I(s[z("phonenumber")],t).value,u0(s,t));case"sign-out":return sE(p)();case"sign-up":return cE(p)(I(s[z("email")],t).value,I(s[z("password")],t).value,I(s[z("phonenumber")],t).value,u0(s,t),I(s[z("redirect-to")],t).value,I(s[z("captcha-token")],t).value);case"sign-in-with-email":return aE(p)(I(s[z("email")],t).value,I(s[z("password")],t).value);case"sign-in-with-google":return ho(p)("google");case"sign-in-with-twitter":return ho(p)("twitter");case"sign-in-with-facebook":return ho(p)("facebook");case"sign-in-with-apple":return ho(p)("apple");default:return{status:400,data:"Unknown request"}}}if(h&&a)return uE(Mi(e["api-url"],e["api-key"]));if(d){let p=Mi(e["api-url"],e["api-key"]);try{let{data:m,error:g}=await p.functions.invoke(s[z("edge-function-name")],{body:rN(s,t),headers:iN(s,t),responseType:(f=s["edge-function-response-type"])!=null?f:"json"});return Pt(g)?m:{status:500,data:g}}catch(m){return console.groupCollapsed("Supabase edge function"),console.warn(m.message),console.groupEnd(),{status:500,data:m}}}return{status:500,data:{message:"Unidetified api tool used",apiTool:u}}}var Kp=on(uo(),1);var v0="firebasestorage.googleapis.com",w0="storageBucket",sN=2*60*1e3,oN=10*60*1e3,aN=1e3;var me=class s extends Ke{constructor(e,t,o=0){super(Pp(e),`Firebase Storage: ${t} (${Pp(e)})`),this.status_=o,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,s.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Pp(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
${this.customData.serverResponse}`:this.message=this._baseMessage}},de;(function(s){s.UNKNOWN="unknown",s.OBJECT_NOT_FOUND="object-not-found",s.BUCKET_NOT_FOUND="bucket-not-found",s.PROJECT_NOT_FOUND="project-not-found",s.QUOTA_EXCEEDED="quota-exceeded",s.UNAUTHENTICATED="unauthenticated",s.UNAUTHORIZED="unauthorized",s.UNAUTHORIZED_APP="unauthorized-app",s.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",s.INVALID_CHECKSUM="invalid-checksum",s.CANCELED="canceled",s.INVALID_EVENT_NAME="invalid-event-name",s.INVALID_URL="invalid-url",s.INVALID_DEFAULT_BUCKET="invalid-default-bucket",s.NO_DEFAULT_BUCKET="no-default-bucket",s.CANNOT_SLICE_BLOB="cannot-slice-blob",s.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",s.NO_DOWNLOAD_URL="no-download-url",s.INVALID_ARGUMENT="invalid-argument",s.INVALID_ARGUMENT_COUNT="invalid-argument-count",s.APP_DELETED="app-deleted",s.INVALID_ROOT_OPERATION="invalid-root-operation",s.INVALID_FORMAT="invalid-format",s.INTERNAL_ERROR="internal-error",s.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(de||(de={}));function Pp(s){return"storage/"+s}function qp(){let s="An unknown error occurred, please check the error payload for server response.";return new me(de.UNKNOWN,s)}function cN(s){return new me(de.OBJECT_NOT_FOUND,"Object '"+s+"' does not exist.")}function uN(s){return new me(de.QUOTA_EXCEEDED,"Quota for bucket '"+s+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function lN(){let s="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new me(de.UNAUTHENTICATED,s)}function hN(){return new me(de.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function dN(s){return new me(de.UNAUTHORIZED,"User does not have permission to access '"+s+"'.")}function b0(){return new me(de.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function _0(){return new me(de.CANCELED,"User canceled the upload/download.")}function fN(s){return new me(de.INVALID_URL,"Invalid URL '"+s+"'.")}function pN(s){return new me(de.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+s+"'.")}function mN(){return new me(de.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+w0+"' property when initializing the app?")}function E0(){return new me(de.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function gN(){return new me(de.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function yN(){return new me(de.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function vN(s){return new me(de.UNSUPPORTED_ENVIRONMENT,`${s} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function Mp(s){return new me(de.INVALID_ARGUMENT,s)}function I0(){return new me(de.APP_DELETED,"The Firebase app was deleted.")}function wN(s){return new me(de.INVALID_ROOT_OPERATION,"The operation '"+s+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function ko(s,e){return new me(de.INVALID_FORMAT,"String does not match format '"+s+"': "+e)}function So(s){throw new me(de.INTERNAL_ERROR,"Internal error: "+s)}var Lt=class s{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){let e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let o;try{o=s.makeFromUrl(e,t)}catch{return new s(e,"")}if(o.path==="")return o;throw pN(e)}static makeFromUrl(e,t){let o=null,a="([A-Za-z0-9.\\-_]+)";function u(P){P.path.charAt(P.path.length-1)==="/"&&(P.path_=P.path_.slice(0,-1))}let l="(/(.*))?$",h=new RegExp("^gs://"+a+l,"i"),d={bucket:1,path:3};function f(P){P.path_=decodeURIComponent(P.path)}let p="v[A-Za-z0-9_]+",m=t.replace(/[.]/g,"\\."),g="(/([^?#]*).*)?$",y=new RegExp(`^https?://${m}/${p}/b/${a}/o${g}`,"i"),w={bucket:1,path:3},b=t===v0?"(?:storage.googleapis.com|storage.cloud.google.com)":t,E="([^?#]*)",k=new RegExp(`^https?://${b}/${a}/${E}`,"i"),C=[{regex:h,indices:d,postModify:u},{regex:y,indices:w,postModify:f},{regex:k,indices:{bucket:1,path:2},postModify:f}];for(let P=0;P<C.length;P++){let K=C[P],ee=K.regex.exec(e);if(ee){let Te=ee[K.indices.bucket],ce=ee[K.indices.path];ce||(ce=""),o=new s(Te,ce),K.postModify(o);break}}if(o==null)throw fN(e);return o}},Up=class{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}};function bN(s,e,t){let o=1,a=null,u=null,l=!1,h=0;function d(){return h===2}let f=!1;function p(...E){f||(f=!0,e.apply(null,E))}function m(E){a=setTimeout(()=>{a=null,s(y,d())},E)}function g(){u&&clearTimeout(u)}function y(E,...k){if(f){g();return}if(E){g(),p.call(null,E,...k);return}if(d()||l){g(),p.call(null,E,...k);return}o<64&&(o*=2);let C;h===1?(h=2,C=0):C=(o+Math.random())*1e3,m(C)}let w=!1;function b(E){w||(w=!0,g(),!f&&(a!==null?(E||(h=2),clearTimeout(a),m(0)):E||(h=1)))}return m(0),u=setTimeout(()=>{l=!0,b(!0)},t),b}function _N(s){s(!1)}function EN(s){return s!==void 0}function IN(s){return typeof s=="function"}function TN(s){return typeof s=="object"&&!Array.isArray(s)}function Uu(s){return typeof s=="string"||s instanceof String}function h0(s){return zp()&&s instanceof Blob}function zp(){return typeof Blob!="undefined"&&!Fm()}function d0(s,e,t,o){if(o<e)throw Mp(`Invalid value for '${s}'. Expected ${e} or greater.`);if(o>t)throw Mp(`Invalid value for '${s}'. Expected ${t} or less.`)}function Ro(s,e,t){let o=e;return t==null&&(o=`https://${e}`),`${t}://${o}/v0${s}`}function T0(s){let e=encodeURIComponent,t="?";for(let o in s)if(s.hasOwnProperty(o)){let a=e(o)+"="+e(s[o]);t=t+a+"&"}return t=t.slice(0,-1),t}var Pr;(function(s){s[s.NO_ERROR=0]="NO_ERROR",s[s.NETWORK_ERROR=1]="NETWORK_ERROR",s[s.ABORT=2]="ABORT"})(Pr||(Pr={}));function S0(s,e){let t=s>=500&&s<600,a=[408,429].indexOf(s)!==-1,u=e.indexOf(s)!==-1;return t||a||u}var Fp=class{constructor(e,t,o,a,u,l,h,d,f,p,m,g=!0){this.url_=e,this.method_=t,this.headers_=o,this.body_=a,this.successCodes_=u,this.additionalRetryCodes_=l,this.callback_=h,this.errorCallback_=d,this.timeout_=f,this.progressCallback_=p,this.connectionFactory_=m,this.retry=g,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((y,w)=>{this.resolve_=y,this.reject_=w,this.start_()})}start_(){let e=(o,a)=>{if(a){o(!1,new $i(!1,null,!0));return}let u=this.connectionFactory_();this.pendingConnection_=u;let l=h=>{let d=h.loaded,f=h.lengthComputable?h.total:-1;this.progressCallback_!==null&&this.progressCallback_(d,f)};this.progressCallback_!==null&&u.addUploadProgressListener(l),u.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&u.removeUploadProgressListener(l),this.pendingConnection_=null;let h=u.getErrorCode()===Pr.NO_ERROR,d=u.getStatus();if(!h||S0(d,this.additionalRetryCodes_)&&this.retry){let p=u.getErrorCode()===Pr.ABORT;o(!1,new $i(!1,null,p));return}let f=this.successCodes_.indexOf(d)!==-1;o(!0,new $i(f,u))})},t=(o,a)=>{let u=this.resolve_,l=this.reject_,h=a.connection;if(a.wasSuccessCode)try{let d=this.callback_(h,h.getResponse());EN(d)?u(d):u()}catch(d){l(d)}else if(h!==null){let d=qp();d.serverResponse=h.getErrorText(),this.errorCallback_?l(this.errorCallback_(h,d)):l(d)}else if(a.canceled){let d=this.appDelete_?I0():_0();l(d)}else{let d=b0();l(d)}};this.canceled_?t(!1,new $i(!1,null,!0)):this.backoffId_=bN(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&_N(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}},$i=class{constructor(e,t,o){this.wasSuccessCode=e,this.connection=t,this.canceled=!!o}};function SN(s,e){e!==null&&e.length>0&&(s.Authorization="Firebase "+e)}function kN(s,e){s["X-Firebase-Storage-Version"]="webjs/"+(e!=null?e:"AppManager")}function AN(s,e){e&&(s["X-Firebase-GMPID"]=e)}function xN(s,e){e!==null&&(s["X-Firebase-AppCheck"]=e)}function RN(s,e,t,o,a,u,l=!0){let h=T0(s.urlParams),d=s.url+h,f=Object.assign({},s.headers);return AN(f,e),SN(f,t),kN(f,u),xN(f,o),new Fp(d,s.method,f,s.body,s.successCodes,s.additionalRetryCodes,s.handler,s.errorHandler,s.timeout,s.progressCallback,a,l)}function CN(){return typeof BlobBuilder!="undefined"?BlobBuilder:typeof WebKitBlobBuilder!="undefined"?WebKitBlobBuilder:void 0}function ON(...s){let e=CN();if(e!==void 0){let t=new e;for(let o=0;o<s.length;o++)t.append(s[o]);return t.getBlob()}else{if(zp())return new Blob(s);throw new me(de.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function NN(s,e,t){return s.webkitSlice?s.webkitSlice(e,t):s.mozSlice?s.mozSlice(e,t):s.slice?s.slice(e,t):null}function DN(s){if(typeof atob=="undefined")throw vN("base-64");return atob(s)}var tn={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},Ao=class{constructor(e,t){this.data=e,this.contentType=t||null}};function PN(s,e){switch(s){case tn.RAW:return new Ao(k0(e));case tn.BASE64:case tn.BASE64URL:return new Ao(A0(s,e));case tn.DATA_URL:return new Ao(MN(e),UN(e))}throw qp()}function k0(s){let e=[];for(let t=0;t<s.length;t++){let o=s.charCodeAt(t);if(o<=127)e.push(o);else if(o<=2047)e.push(192|o>>6,128|o&63);else if((o&64512)===55296)if(!(t<s.length-1&&(s.charCodeAt(t+1)&64512)===56320))e.push(239,191,189);else{let u=o,l=s.charCodeAt(++t);o=65536|(u&1023)<<10|l&1023,e.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}else(o&64512)===56320?e.push(239,191,189):e.push(224|o>>12,128|o>>6&63,128|o&63)}return new Uint8Array(e)}function LN(s){let e;try{e=decodeURIComponent(s)}catch{throw ko(tn.DATA_URL,"Malformed data URL.")}return k0(e)}function A0(s,e){switch(s){case tn.BASE64:{let a=e.indexOf("-")!==-1,u=e.indexOf("_")!==-1;if(a||u)throw ko(s,"Invalid character '"+(a?"-":"_")+"' found: is it base64url encoded?");break}case tn.BASE64URL:{let a=e.indexOf("+")!==-1,u=e.indexOf("/")!==-1;if(a||u)throw ko(s,"Invalid character '"+(a?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let t;try{t=DN(e)}catch(a){throw a.message.includes("polyfill")?a:ko(s,"Invalid character found")}let o=new Uint8Array(t.length);for(let a=0;a<t.length;a++)o[a]=t.charCodeAt(a);return o}var Lu=class{constructor(e){this.base64=!1,this.contentType=null;let t=e.match(/^data:([^,]+)?,/);if(t===null)throw ko(tn.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");let o=t[1]||null;o!=null&&(this.base64=FN(o,";base64"),this.contentType=this.base64?o.substring(0,o.length-7):o),this.rest=e.substring(e.indexOf(",")+1)}};function MN(s){let e=new Lu(s);return e.base64?A0(tn.BASE64,e.rest):LN(e.rest)}function UN(s){return new Lu(s).contentType}function FN(s,e){return s.length>=e.length?s.substring(s.length-e.length)===e:!1}var Mu=class s{constructor(e,t){let o=0,a="";h0(e)?(this.data_=e,o=e.size,a=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),o=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),o=e.length),this.size_=o,this.type_=a}size(){return this.size_}type(){return this.type_}slice(e,t){if(h0(this.data_)){let o=this.data_,a=NN(o,e,t);return a===null?null:new s(a)}else{let o=new Uint8Array(this.data_.buffer,e,t-e);return new s(o,!0)}}static getBlob(...e){if(zp()){let t=e.map(o=>o instanceof s?o.data_:o);return new s(ON.apply(null,t))}else{let t=e.map(l=>Uu(l)?PN(tn.RAW,l).data:l.data_),o=0;t.forEach(l=>{o+=l.byteLength});let a=new Uint8Array(o),u=0;return t.forEach(l=>{for(let h=0;h<l.length;h++)a[u++]=l[h]}),new s(a,!0)}}uploadData(){return this.data_}};function x0(s){let e;try{e=JSON.parse(s)}catch{return null}return TN(e)?e:null}function $N(s){if(s.length===0)return null;let e=s.lastIndexOf("/");return e===-1?"":s.slice(0,e)}function BN(s,e){let t=e.split("/").filter(o=>o.length>0).join("/");return s.length===0?t:s+"/"+t}function R0(s){let e=s.lastIndexOf("/",s.length-2);return e===-1?s:s.slice(e+1)}function jN(s,e){return e}var Fe=class{constructor(e,t,o,a){this.server=e,this.local=t||e,this.writable=!!o,this.xform=a||jN}},Pu=null;function VN(s){return!Uu(s)||s.length<2?s:R0(s)}function C0(){if(Pu)return Pu;let s=[];s.push(new Fe("bucket")),s.push(new Fe("generation")),s.push(new Fe("metageneration")),s.push(new Fe("name","fullPath",!0));function e(u,l){return VN(l)}let t=new Fe("name");t.xform=e,s.push(t);function o(u,l){return l!==void 0?Number(l):l}let a=new Fe("size");return a.xform=o,s.push(a),s.push(new Fe("timeCreated")),s.push(new Fe("updated")),s.push(new Fe("md5Hash",null,!0)),s.push(new Fe("cacheControl",null,!0)),s.push(new Fe("contentDisposition",null,!0)),s.push(new Fe("contentEncoding",null,!0)),s.push(new Fe("contentLanguage",null,!0)),s.push(new Fe("contentType",null,!0)),s.push(new Fe("metadata","customMetadata",!0)),Pu=s,Pu}function qN(s,e){function t(){let o=s.bucket,a=s.fullPath,u=new Lt(o,a);return e._makeStorageReference(u)}Object.defineProperty(s,"ref",{get:t})}function zN(s,e,t){let o={};o.type="file";let a=t.length;for(let u=0;u<a;u++){let l=t[u];o[l.local]=l.xform(o,e[l.server])}return qN(o,s),o}function O0(s,e,t){let o=x0(e);return o===null?null:zN(s,o,t)}function HN(s,e,t,o){let a=x0(e);if(a===null||!Uu(a.downloadTokens))return null;let u=a.downloadTokens;if(u.length===0)return null;let l=encodeURIComponent;return u.split(",").map(f=>{let p=s.bucket,m=s.fullPath,g="/b/"+l(p)+"/o/"+l(m),y=Ro(g,t,o),w=T0({alt:"media",token:f});return y+w})[0]}function N0(s,e){let t={},o=e.length;for(let a=0;a<o;a++){let u=e[a];u.writable&&(t[u.server]=s[u.local])}return JSON.stringify(t)}var Xn=class{constructor(e,t,o,a){this.url=e,this.method=t,this.handler=o,this.timeout=a,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}};function An(s){if(!s)throw qp()}function Hp(s,e){function t(o,a){let u=O0(s,a,e);return An(u!==null),u}return t}function GN(s,e){function t(o,a){let u=O0(s,a,e);return An(u!==null),HN(u,a,s.host,s._protocol)}return t}function Co(s){function e(t,o){let a;return t.getStatus()===401?t.getErrorText().includes("Firebase App Check token is invalid")?a=hN():a=lN():t.getStatus()===402?a=uN(s.bucket):t.getStatus()===403?a=dN(s.path):a=o,a.status=t.getStatus(),a.serverResponse=o.serverResponse,a}return e}function D0(s){let e=Co(s);function t(o,a){let u=e(o,a);return o.getStatus()===404&&(u=cN(s.path)),u.serverResponse=a.serverResponse,u}return t}function KN(s,e,t){let o=e.fullServerUrl(),a=Ro(o,s.host,s._protocol),u="GET",l=s.maxOperationRetryTime,h=new Xn(a,u,Hp(s,t),l);return h.errorHandler=D0(e),h}function WN(s,e,t){let o=e.fullServerUrl(),a=Ro(o,s.host,s._protocol),u="GET",l=s.maxOperationRetryTime,h=new Xn(a,u,GN(s,t),l);return h.errorHandler=D0(e),h}function QN(s,e){return s&&s.contentType||e&&e.type()||"application/octet-stream"}function P0(s,e,t){let o=Object.assign({},t);return o.fullPath=s.path,o.size=e.size(),o.contentType||(o.contentType=QN(null,e)),o}function JN(s,e,t,o,a){let u=e.bucketOnlyServerUrl(),l={"X-Goog-Upload-Protocol":"multipart"};function h(){let C="";for(let P=0;P<2;P++)C=C+Math.random().toString().slice(2);return C}let d=h();l["Content-Type"]="multipart/related; boundary="+d;let f=P0(e,o,a),p=N0(f,t),m="--"+d+`\r
Content-Type: application/json; charset=utf-8\r
\r
`+p+`\r
--`+d+`\r
Content-Type: `+f.contentType+`\r
\r
`,g=`\r
--`+d+"--",y=Mu.getBlob(m,o,g);if(y===null)throw E0();let w={name:f.fullPath},b=Ro(u,s.host,s._protocol),E="POST",k=s.maxUploadRetryTime,x=new Xn(b,E,Hp(s,t),k);return x.urlParams=w,x.headers=l,x.body=y.uploadData(),x.errorHandler=Co(e),x}var Bi=class{constructor(e,t,o,a){this.current=e,this.total=t,this.finalized=!!o,this.metadata=a||null}};function Gp(s,e){let t=null;try{t=s.getResponseHeader("X-Goog-Upload-Status")}catch{An(!1)}return An(!!t&&(e||["active"]).indexOf(t)!==-1),t}function XN(s,e,t,o,a){let u=e.bucketOnlyServerUrl(),l=P0(e,o,a),h={name:l.fullPath},d=Ro(u,s.host,s._protocol),f="POST",p={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${o.size()}`,"X-Goog-Upload-Header-Content-Type":l.contentType,"Content-Type":"application/json; charset=utf-8"},m=N0(l,t),g=s.maxUploadRetryTime;function y(b){Gp(b);let E;try{E=b.getResponseHeader("X-Goog-Upload-URL")}catch{An(!1)}return An(Uu(E)),E}let w=new Xn(d,f,y,g);return w.urlParams=h,w.headers=p,w.body=m,w.errorHandler=Co(e),w}function YN(s,e,t,o){let a={"X-Goog-Upload-Command":"query"};function u(f){let p=Gp(f,["active","final"]),m=null;try{m=f.getResponseHeader("X-Goog-Upload-Size-Received")}catch{An(!1)}m||An(!1);let g=Number(m);return An(!isNaN(g)),new Bi(g,o.size(),p==="final")}let l="POST",h=s.maxUploadRetryTime,d=new Xn(t,l,u,h);return d.headers=a,d.errorHandler=Co(e),d}var f0=256*1024;function ZN(s,e,t,o,a,u,l,h){let d=new Bi(0,0);if(l?(d.current=l.current,d.total=l.total):(d.current=0,d.total=o.size()),o.size()!==d.total)throw gN();let f=d.total-d.current,p=f;a>0&&(p=Math.min(p,a));let m=d.current,g=m+p,y="";p===0?y="finalize":f===p?y="upload, finalize":y="upload";let w={"X-Goog-Upload-Command":y,"X-Goog-Upload-Offset":`${d.current}`},b=o.slice(m,g);if(b===null)throw E0();function E(P,K){let ee=Gp(P,["active","final"]),Te=d.current+p,ce=o.size(),ft;return ee==="final"?ft=Hp(e,u)(P,K):ft=null,new Bi(Te,ce,ee==="final",ft)}let k="POST",x=e.maxUploadRetryTime,C=new Xn(t,k,E,x);return C.headers=w,C.body=b.uploadData(),C.progressCallback=h||null,C.errorHandler=Co(s),C}var ot={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function Lp(s){switch(s){case"running":case"pausing":case"canceling":return ot.RUNNING;case"paused":return ot.PAUSED;case"success":return ot.SUCCESS;case"canceled":return ot.CANCELED;case"error":return ot.ERROR;default:return ot.ERROR}}var $p=class{constructor(e,t,o){if(IN(e)||t!=null||o!=null)this.next=e,this.error=t!=null?t:void 0,this.complete=o!=null?o:void 0;else{let u=e;this.next=u.next,this.error=u.error,this.complete=u.complete}}};function Ui(s){return(...e)=>{Promise.resolve().then(()=>s(...e))}}var p0=null,Bp=class{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=Pr.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=Pr.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=Pr.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,o,a){if(this.sent_)throw So("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),a!==void 0)for(let u in a)a.hasOwnProperty(u)&&this.xhr_.setRequestHeader(u,a[u].toString());return o!==void 0?this.xhr_.send(o):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw So("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw So("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw So("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw So("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}},jp=class extends Bp{initXhr(){this.xhr_.responseType="text"}};function Fi(){return p0?p0():new jp}var Vp=class{constructor(e,t,o=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=o,this._mappings=C0(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=a=>{if(this._request=void 0,this._chunkMultiplier=1,a._codeEquals(de.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{let u=this.isExponentialBackoffExpired();if(S0(a.status,[]))if(u)a=b0();else{this.sleepTime=Math.max(this.sleepTime*2,aN),this._needToFetchStatus=!0,this.completeTransitions_();return}this._error=a,this._transition("error")}},this._metadataErrorHandler=a=>{this._request=void 0,a._codeEquals(de.CANCELED)?this.completeTransitions_():(this._error=a,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((a,u)=>{this._resolve=a,this._reject=u,this._start()}),this._promise.then(null,()=>{})}isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}_makeProgressCallback(){let e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>256*1024}_start(){this._state==="running"&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,o])=>{switch(this._state){case"running":e(t,o);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused");break}})}_createResumable(){this._resolveToken((e,t)=>{let o=XN(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),a=this._ref.storage._makeRequest(o,Fi,e,t);this._request=a,a.getPromise().then(u=>{this._request=void 0,this._uploadUrl=u,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){let e=this._uploadUrl;this._resolveToken((t,o)=>{let a=YN(this._ref.storage,this._ref._location,e,this._blob),u=this._ref.storage._makeRequest(a,Fi,t,o);this._request=u,u.getPromise().then(l=>{l=l,this._request=void 0,this._updateProgress(l.current),this._needToFetchStatus=!1,l.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){let e=f0*this._chunkMultiplier,t=new Bi(this._transferred,this._blob.size()),o=this._uploadUrl;this._resolveToken((a,u)=>{let l;try{l=ZN(this._ref._location,this._ref.storage,o,this._blob,e,this._mappings,t,this._makeProgressCallback())}catch(d){this._error=d,this._transition("error");return}let h=this._ref.storage._makeRequest(l,Fi,a,u,!1);this._request=h,h.getPromise().then(d=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(d.current),d.finalized?(this._metadata=d.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){f0*this._chunkMultiplier*2<32*1024*1024&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{let o=KN(this._ref.storage,this._ref._location,this._mappings),a=this._ref.storage._makeRequest(o,Fi,e,t);this._request=a,a.getPromise().then(u=>{this._request=void 0,this._metadata=u,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{let o=JN(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),a=this._ref.storage._makeRequest(o,Fi,e,t);this._request=a,a.getPromise().then(u=>{this._request=void 0,this._metadata=u,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){let t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,this._request!==void 0?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":let t=this._state==="paused";this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=_0(),this._state=e,this._notifyObservers();break;case"error":this._state=e,this._notifyObservers();break;case"success":this._state=e,this._notifyObservers();break}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}}get snapshot(){let e=Lp(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,o,a){let u=new $p(t||void 0,o||void 0,a||void 0);return this._addObserver(u),()=>{this._removeObserver(u)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){let t=this._observers.indexOf(e);t!==-1&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(t=>{this._notifyObserver(t)})}_finishPromise(){if(this._resolve!==void 0){let e=!0;switch(Lp(this._state)){case ot.SUCCESS:Ui(this._resolve.bind(null,this.snapshot))();break;case ot.CANCELED:case ot.ERROR:let t=this._reject;Ui(t.bind(null,this._error))();break;default:e=!1;break}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(Lp(this._state)){case ot.RUNNING:case ot.PAUSED:e.next&&Ui(e.next.bind(e,this.snapshot))();break;case ot.SUCCESS:e.complete&&Ui(e.complete.bind(e))();break;case ot.CANCELED:case ot.ERROR:e.error&&Ui(e.error.bind(e,this._error))();break;default:e.error&&Ui(e.error.bind(e,this._error))()}}resume(){let e=this._state==="paused"||this._state==="pausing";return e&&this._transition("running"),e}pause(){let e=this._state==="running";return e&&this._transition("pausing"),e}cancel(){let e=this._state==="running"||this._state==="pausing";return e&&this._transition("canceling"),e}};var ji=class s{constructor(e,t){this._service=e,t instanceof Lt?this._location=t:this._location=Lt.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new s(e,t)}get root(){let e=new Lt(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return R0(this._location.path)}get storage(){return this._service}get parent(){let e=$N(this._location.path);if(e===null)return null;let t=new Lt(this._location.bucket,e);return new s(this._service,t)}_throwIfRoot(e){if(this._location.path==="")throw wN(e)}};function eD(s,e,t){return s._throwIfRoot("uploadBytesResumable"),new Vp(s,new Mu(e),t)}function tD(s){s._throwIfRoot("getDownloadURL");let e=WN(s.storage,s._location,C0());return s.storage.makeRequestWithTokens(e,Fi).then(t=>{if(t===null)throw yN();return t})}function nD(s,e){let t=BN(s._location.path,e),o=new Lt(s._location.bucket,t);return new ji(s.storage,o)}function rD(s){return/^[A-Za-z]+:\/\//.test(s)}function iD(s,e){return new ji(s,e)}function L0(s,e){if(s instanceof xo){let t=s;if(t._bucket==null)throw mN();let o=new ji(t,t._bucket);return e!=null?L0(o,e):o}else return e!==void 0?nD(s,e):s}function sD(s,e){if(e&&rD(e)){if(s instanceof xo)return iD(s,e);throw Mp("To use ref(service, url), the first argument must be a Storage instance.")}else return L0(s,e)}function m0(s,e){let t=e==null?void 0:e[w0];return t==null?null:Lt.makeFromBucketSpec(t,s)}function oD(s,e,t,o={}){s.host=`${e}:${t}`,s._protocol="http";let{mockUserToken:a}=o;a&&(s._overrideAuthToken=typeof a=="string"?a:Jo(a,s.app.options.projectId))}var xo=class{constructor(e,t,o,a,u){this.app=e,this._authProvider=t,this._appCheckProvider=o,this._url=a,this._firebaseVersion=u,this._bucket=null,this._host=v0,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=sN,this._maxUploadRetryTime=oN,this._requests=new Set,a!=null?this._bucket=Lt.makeFromBucketSpec(a,this._host):this._bucket=m0(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Lt.makeFromBucketSpec(this._url,e):this._bucket=m0(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){d0("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){d0("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let e=this._authProvider.getImmediate({optional:!0});if(e){let t=await e.getToken();if(t!==null)return t.accessToken}return null}async _getAppCheckToken(){let e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new ji(this,e)}_makeRequest(e,t,o,a,u=!0){if(this._deleted)return new Up(I0());{let l=RN(e,this._appId,o,a,t,this._firebaseVersion,u);return this._requests.add(l),l.getPromise().then(()=>this._requests.delete(l),()=>this._requests.delete(l)),l}}async makeRequestWithTokens(e,t){let[o,a]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,o,a).getPromise()}},g0="@firebase/storage",y0="0.11.2";var M0="storage";function U0(s,e,t){return s=re(s),eD(s,e,t)}function F0(s){return s=re(s),tD(s)}function $0(s,e){return s=re(s),sD(s,e)}function B0(s=qr(),e){s=re(s);let o=cr(s,M0).getImmediate({identifier:e}),a=Qo("storage");return a&&aD(o,...a),o}function aD(s,e,t,o={}){oD(s,e,t,o)}function cD(s,{instanceIdentifier:e}){let t=s.getProvider("app").getImmediate(),o=s.getProvider("auth-internal"),a=s.getProvider("app-check-internal");return new xo(t,o,a,e,Ft)}function uD(){Ut(new it(M0,cD,"PUBLIC").setMultipleInstances(!0)),st(g0,y0,""),st(g0,y0,"esm2017")}uD();var lD=s=>e=>`${s}__${e}`,at=lD("upload"),Fu=s=>{var u;let e=s.file,o=(u=A.elements[e][0])==null?void 0:u.files;if(!o)throw new Error("No file(s) selected.");let a=[];console.groupCollapsed("File upload logs...");for(let l=0;l<o.length;l++){let h=o.item(l);a.push(h),console.log(`File (${h.name}) has been staged for uploading...`)}if(console.groupEnd(),a.length===0)throw new Error("No file(s) selected.");return a},hD=async(s,{project:e,id:t,key:o,path:a})=>{let u=()=>Yi({apiKey:o,appId:t,projectId:e,storageBucket:`${e}.appspot.com`});if(Pt(a))throw new Error("Storage path is not set.");let l=p=>new Promise((m,g)=>{let y=U0($0(B0(u()),`${a}/${p.name}`),p);y.on("state_changed",w=>{let b=w.bytesTransferred/w.totalBytes*100;switch(w.state){case"paused":T[`r.${s.number}.d`].set({message:"Uploading paused!",fileUrl:"",uploadProgress:b}),T[`r.${s.number}.$.statusCode`].set(void 0),T[`r.${s.number}.$.status`].set("");break;case"running":T[`r.${s.number}.d`].set({message:"Uploading...",fileUrl:"",uploadProgress:b}),T[`r.${s.number}.$.statusCode`].set(void 0),T[`r.${s.number}.$.status`].set("");break}},w=>{g({status:500,data:w})},()=>{F0(y.snapshot.ref).then(w=>{m({status:200,data:w})}).catch(w=>{g({status:500,data:(w==null?void 0:w.message)||"Unknown error while uploading file request."})})})}),h=Fu(s),d=[];for(let p of h)d.push(await l(p));let f=d.reduce((p,m)=>(m.status===500?(p.status=500,p.data.push(m)):(p.data.findIndex(y=>y.status===500)<0&&(p.status=200),p.data.push(m)),p),{status:0,data:[]});return f.data.length===1?{status:f.status,data:f.data[0]}:f},dD=async(s,{url:e,key:t,bucket:o,path:a})=>{let u=Du(e,t,{autoRefreshToken:!1,detectSessionInUrl:!0,persistSession:!1,shouldThrowOnError:!1}),l=new FormData;(Fu(s)||[]).forEach(m=>l.append("file",m));let h=async m=>{let g=`${a}/${m.name}`;try{let{error:y}=await u.storage.from(o).upload(g,m);if(!J(y))return{status:500,data:y.message}}catch(y){return{status:500,data:(y==null?void 0:y.message)||"Unknown error while uploading file request."}}try{let{data:y,error:w}=u.storage.from(o).getPublicUrl(g);return J(w)?{status:200,data:y.publicURL}:{status:500,data:w.message}}catch(y){return{status:500,data:(y==null?void 0:y.message)||"Unknown error while uploading file request."}}},d=Fu(s),f=[];for(let m of d)f.push(await h(m));let p=f.reduce((m,g)=>g.status===500?(m.status=500,m.data.push(g),m):(m.data.findIndex(w=>w.status===500)<0&&(m.status=200),m.data.push(g),m),{status:0,data:[]});return p.data.length===1?{status:p.status,data:p.data[0]}:p},j0=async(s,{url:e,body:t,headers:o={},maxSize:a=20})=>{var d;let u=new FormData,l=Fu(s)||[];for(let f of l){if(a&&(f==null?void 0:f.size)>a*1e3*1e3){console.error(new Error(`File (${f.name}) size is too large. Maximum size is ${a}MB.`));continue}let p=s[at("file-key")]||"file";u.append(p,f)}t&&Object.keys(t).length>0&&Object.keys(t).forEach(f=>{u.append(f,t[f])});let h=Kp.default.post(e,u,{headers:o,onUploadProgress:function(f){let p=Math.round(f.loaded/f.total*100);T[`r.${s.number}.d`].set({message:"Uploading...",fileUrl:"",uploadProgress:p}),T[`r.${s.number}.$.statusCode`].set(void 0),T[`r.${s.number}.$.status`].set("")}});try{let f=await h;return{status:f==null?void 0:f.status,data:(d=f==null?void 0:f.data.fileUrl)!=null?d:f==null?void 0:f.data}}catch(f){if(Kp.default.isAxiosError(f)){let{response:p}=f;return{status:p==null?void 0:p.status,data:p==null?void 0:p.data}}return{status:500,data:f}}};async function Wp(s,e,t){var d,f,p,m,g,y,w;let o=s[at("upload-app-method")],a=s[at("storage-path")],u=s[at("use-app-resource")],l=s[at("app-resource")],h;if(u==="yes"&&l&&(h=(d=A.configuration.apps)==null?void 0:d.find(b=>b.id===l),!h))return console.error("App resource not found"),{status:404,data:void 0};switch(o){case"firebase":return hD(s,{id:(f=s[at("app-id")])!=null?f:h["app-Id"],key:(p=s[at("api-key")])!=null?p:h["api-key"],project:(m=s[at("project-id")])!=null?m:h["project-id"],path:String(I(a,t).value)});case"supabase":return dD(s,{url:(g=s[at("api-url")])!=null?g:h["api-url"],key:(y=s[at("api-key")])!=null?y:h["api-key"],bucket:s[at("bucket-name")],path:String(I(a,t).value)});case"wized":return j0(s,{url:`${te.serverUrl}v2/upload`,body:s[at("http-body")],maxSize:20});case"xano":case"rest":let b;return h!=null&&h.baseUrl&&(b=new URL(h==null?void 0:h.baseUrl,(w=s[at("endpoint")])!=null?w:"/").href),j0(s,{url:b!=null?b:s[at("api-url")],body:(E=>{let k={};return E&&E.forEach(x=>{let C=x["http-body__upload__field-key"],{value:P}=I(x["http-body__upload__field-value"],t);k[C]=P}),k})(s["http-body"]),headers:(E=>{let k={};return E&&E.forEach(x=>{let C=x["http-headers__upload__field-key"],{value:P}=I(x["http-headers__upload__field-value"],t);k[C]=P}),k})(s["http-headers"])})}}function fD(s){switch(s){case"airtable":return Ku;case"notion":return Sp;case"firebase":return Qf;case"supabase":return l0;case"canonic":case"zapier":case"make":case"rest":case"xano":return Ap;case"upload":return Wp;case"stripe":return xp;default:throw new Error("\u26A0 App type invalid or not supported any more. Please check the selected app for the request.")}}function pD(s,e,t,o,a,u){T[`r.${s==null?void 0:s.number}.d`].set(typeof e.data=="boolean"||typeof e.data=="string"||typeof e.data=="number"?{value:e.data}:e.data),T[`r.${s==null?void 0:s.number}.$.isRequesting`].set(e.status===100),T[`r.${s==null?void 0:s.number}.$.hasRequested`].set(e.status===100?T[`r.${s==null?void 0:s.number}.$.hasRequested`].value:!0),T[`r.${s==null?void 0:s.number}.$.statusCode`].set(e.status),T[`r.${s==null?void 0:s.number}.$.status`].set(dm(e==null?void 0:e.status)),Am({requestId:s==null?void 0:s.id,timestamp:Date.now(),duration:o-t,messages:a}),gD(s,u),rr._store._requestCallbacks[s==null?void 0:s.id]&&Object.keys(rr._store._requestCallbacks[s==null?void 0:s.id]).forEach(l=>{rr._store._requestCallbacks[s==null?void 0:s.id][l](e)})}async function mD(s,e,t,o,a=!1){var d,f,p,m;let u=Date.now(),l=[],h;T[`r.${s.number}.d`].set({}),T[`r.${s.number}.$.isRequesting`].set(!0),T[`r.${s.number}.$.hasRequested`].set(!!T[`r.${s.number}.$.hasRequested`].value),T[`r.${s.number}.$.statusCode`].set(void 0),T[`r.${s.number}.$.status`].set("");try{let g=fD(e==null?void 0:e.type);g&&(h=await g.apply(void 0,[s,e,t,a])),l.push({message:(h==null?void 0:h.status)>=200&&(h==null?void 0:h.status)<=299?"\u2705 Request executed successfully":(h==null?void 0:h.status)===100?"\u2705 Subscribed to changes in database":`\u274C Error during request execution (Status: ${(d=h==null?void 0:h.status)!=null?d:503})`,isAlert:!((h==null?void 0:h.status)===200||(h==null?void 0:h.status)===100)})}catch(g){console.error(`Error during request execution: ${s.name}`,g),h={status:(f=g==null?void 0:g.status)!=null?f:500,data:(p=g==null?void 0:g.data)!=null?p:void 0},l.push({message:"\u274C Execution failed",isAlert:!0}),l.push({message:(m=g==null?void 0:g.error)!=null?m:g==null?void 0:g.message,isAlert:!0})}return pD.apply(void 0,[s,h,u,Date.now(),l,o]),h}async function pt(s,e,t){var u,l,h;let o=(l=(u=A.configuration)==null?void 0:u.requests)==null?void 0:l.find(d=>d.id===s);if(!o)return console.error(`Request could not be found. Request id: ${s}`,"Please check your request settings. If problem persists, please contact our support."),{status:404,data:void 0};let a=(h=A.configuration.apps)==null?void 0:h.find(d=>d.id===o.appId);return a?await mD(o,a,e,t,o[`${a.type}__subscribe-to-stream`]):(console.error(`App connected to request (${o.name}) could not be found.`,"Please check that the app for the request is correctly setup and has not been deleted."),{status:404,data:void 0})}var gD=(s,e)=>{A.cloakElements.forEach(o=>{if(o.requestNames.includes(s.name)){if(o.custom)o.element.removeAttribute("wized-cloak-custom");else{let a=o.element.getAttribute("wized-cloak-opacity");o.element.style.opacity=a}A.cloakElements=A.cloakElements.filter(a=>JSON.stringify(a)!==JSON.stringify(o))}});let t=s.after;!t||t.length===0||t.forEach(o=>{var a,u,l,h;if(o.action==="perform-request"){if(o["has-condition"]&&!I(o.condition).value)return;let d=o.request;Array.isArray(e)||(e=[]),(!e.includes(d)||s.id!==d)&&(e.push(d),pt(d,void 0,e))}if(o.action==="set-cookie"){if(o["has-condition"]&&!I(o.condition).value)return;let d=(a=A.configuration.cookies)==null?void 0:a.find(p=>p.id===o.cookie);if(!d)return;let{value:f}=I(o.value);nt("wized_"+d.name,f,Mr(d.lifetime)),(u=T["c."+d.name])==null||u.set(f)}if(o.action==="set-variable"){if(o["has-condition"]&&!I(o.condition).value)return;let d=(l=A.configuration.variables)==null?void 0:l.find(p=>p.id===o.variable);if(!d)return;let{value:f}=I(o.value);(h=T["v."+d.name])==null||h.set(f)}if(o.action==="navigate-to"){if(o["has-condition"]&&!I(o.condition).value)return;let d=I(o.url).value;!o.openInNewTab&&d&&typeof d=="string"?yt(d):d&&typeof d=="string"&&yt(d,!0)}})};var yD=["w-el","wized"],V0=(s,e,t)=>{nn(e,o=>{let a=Y0(o).join("-")||"0";if(o.getAttribute(`w-el-onclick-${t}-${a}`)===`${e.id}-${t}-${a}`)return;o.setAttribute(`w-el-onclick-${t}-${a}`,`${e.id}-${t}-${a}`);let u=mt();o.addEventListener("click",l=>{Ae(u)&&Oo(l,e,s)})})},q0=(s,e,t)=>{nn(e,o=>{let a=Y0(o).join("-")||"0";if(o.getAttribute(`w-el-onchange-${t}-${a}`)!==`${e.id}-${t}-${a}`){if(o.setAttribute(`w-el-onchange-${t}-${a}`,`${e.id}-${t}-${a}`),o.type!=="radio"&&o.type!=="checkbox")if(s.onInput){let u=mt();o.addEventListener("input",l=>{Ae(u)&&Oo(l,e,s)})}else{let u=mt();o.addEventListener("change",l=>{Ae(u)&&Oo(l,e,s)})}else if(o.type==="radio"){let u=document.querySelectorAll(`input[name=${o.getAttribute("name")}]`);Array.from(u).forEach(l=>{let h=mt();l.addEventListener("change",d=>{Ae(h)&&Oo(d,e,s)})})}else if(o.type==="checkbox"){let u=mt();o.addEventListener("change",l=>{Ae(u)&&Oo(l,e,s)})}}})},Oo=(s,e,t)=>{var o,a,u,l;if(s.preventDefault(),t.action==="set-cookie"){if(t.hasCondition&&!I(t.condition,s.target).value)return;let h=(o=A.configuration.cookies)==null?void 0:o.find(f=>f.id===t.cookie);if(!h)return;let{value:d}=I(t.value,s.target);nt("wized_"+h.name,d,Mr(h.lifetime)),(a=T["c."+h.name])==null||a.set(d)}if(t.action==="set-variable"){if(t.hasCondition&&!I(t.condition,s.target).value)return;let h=(u=A.configuration.variables)==null?void 0:u.find(f=>f.id===t.variable);if(!h)return;let{value:d}=I(t.value,s.target);(l=T["v."+h.name])==null||l.set(d)}if(t.action==="perform-request"){if(t.hasCondition&&!I(t.condition,s.target).value)return;let h=t.request;pt(h,s.target)}if(t.action==="navigate-to"){if(t.hasCondition&&!I(t.condition,s.target).value)return;let h=I(t.url,s.target).value;t.openInNewTab?h&&typeof h=="string"&&yt(String(h),!0):h&&typeof h=="string"&&yt(String(h))}},z0=(s,e)=>{nn(e,t=>{let{paths:o,value:a}=I(s.value,t);o.forEach(u=>{var l;Be(u,(l=T[u])==null?void 0:l.value,{type:"action",id:e.id})}),t.getAttribute("w-el-visibility")||t.setAttribute("w-el-visibility",getComputedStyle(t).display||""),a?t.style.display=(t.getAttribute("w-el-visibility")==="none"?"block":t.getAttribute("w-el-visibility"))||"block":t.style.display="none"})},H0=(s,e)=>{nn(e,t=>{let{paths:o,value:a}=I(s.value,t);o.forEach(u=>{var l;Be(u,(l=T[u])==null?void 0:l.value,{type:"action",id:e.id})}),t.getAttribute("w-el-style-"+s.style)||t.setAttribute("w-el-style-"+s.style,getComputedStyle(t)[s.style]||""),t.style[s.style]=a})},G0=(s,e)=>{nn(e,t=>{let{paths:o,value:a}=I(s.value,t);if(o.forEach(u=>{var l;Be(u,(l=T[u])==null?void 0:l.value,{type:"action",id:e.id})}),t.getAttribute("w-el-class")||t.setAttribute("w-el-class",t.className||""),a&&s.type==="add-class"){let u=t.getAttribute("w-el-class")+" "+a;t.className=u}else if(a&&s.type==="remove-class"){let u=t.getAttribute("w-el-class").replace(a,"");t.className=u}})},K0=(s,e)=>{nn(e,t=>{let{value:o,paths:a}=I(s.value,t);a.forEach(u=>{var l;Be(u,(l=T[u])==null?void 0:l.value,{type:"action",id:e.id})}),t.getAttribute("w-el-text")||t.setAttribute("w-el-text",t.innerHTML||""),s.type==="text"?t.textContent=o:s.type==="html"?t.innerHTML=o:o&&s.type==="markdown"&&(t.innerHTML=F.parse(String(o)))})},W0=(s,e)=>{nn(e,t=>{var l;let{paths:o,value:a}=I(s.value,t);if(o.forEach(h=>{var d;Be(h,(d=T[h])==null?void 0:d.value,{type:"action",id:e.id})}),t.tagName!=="INPUT"&&t.tagName!=="SELECT"&&t.tagName!=="TEXTAREA")return;let u;if(t.type==="radio"?u=(l=document.querySelector(`input[name=${t.getAttribute("name")}]:checked`))==null?void 0:l.value:t.type==="checkbox"?u=t.checked:u=t.value,t.getAttribute("w-el-value")||t.setAttribute("w-el-value",u||""),t.type==="radio"){document.querySelector(`input[name=${t.getAttribute("name")}][value=${a}]`).checked=!0;let h=new Event("change");t.dispatchEvent(h)}else if(t.type==="checkbox"){t.checked=!!a;let h=new Event("change");t.dispatchEvent(h)}else{t.value=a;let h=new Event("input");t.dispatchEvent(h)}})},Q0=(s,e)=>{nn(e,t=>{var h;let{paths:o,value:a}=I(s.value,t);o.forEach(d=>{var f;Be(d,(f=T[d])==null?void 0:f.value,{type:"action",id:e.id})}),t.getAttribute("w-el-link")||t.setAttribute("w-el-link",t.href||"");let u=new URL(t.href),l=(h=A.configuration.parameters.find(d=>d.id===s.parameter))==null?void 0:h.name;u.searchParams.set(l,String(a)),t.href=u.href})},J0=(s,e)=>{nn(e,t=>{let o=I(s.key,t);o.paths.forEach(h=>{var d;Be(h,(d=T[h])==null?void 0:d.value,{type:"action",id:e.id})});let a=o.value,u=I(s.value,t);u.paths.forEach(h=>{var d;Be(h,(d=T[h])==null?void 0:d.value,{type:"action",id:e.id})});let{value:l}=u;t.getAttribute("w-el-"+a)||t.setAttribute("w-el-"+a,t.getAttribute(a)||""),a==="href"?t.setAttribute(a,Wi(String(l))):t.setAttribute(a,l)})},X0=(s,e)=>{nn(e,t=>{var h;if(t.getAttribute("w-list-clone")==="true")return;let{paths:o,value:a}=I(s.value,t);o.forEach(d=>{var f;Be(d,(f=T[d])==null?void 0:f.value,{type:"action",id:e.id})}),Array.isArray(a)||(a=[]);let u=(h=A.configuration.variables.find(d=>d.id===s["index-variable"]))==null?void 0:h.name;if(t.getAttribute("w-el-list-display")||t.setAttribute("w-el-list-display",getComputedStyle(t).display||""),!a||a.length===0){t.style.display="none";return}t.style.display=t.getAttribute("w-el-list-display"),t.setAttribute("w-list-index-variable",u),t.setAttribute("w-list-index-value",0);let l;a.forEach((d,f)=>{if(f>0){let p=t.cloneNode(!0);p.setAttribute("w-list-index-value",f.toString()),p.setAttribute("w-list-clone","true"),l?l.after(p):t.after(p),l=p}}),yD.forEach(d=>{let f=t.parentElement.querySelectorAll(`input[${d}]`),p=t.parentElement.querySelectorAll(`textarea[${d}]`),m=t.parentElement.querySelectorAll(`select[${d}]`),g=[...Array.from(f),...Array.from(p),...Array.from(m)];for(let w of g){let b=w.getAttribute(d);if(w.closest('[w-list-clone="true"]'))continue;let E=T[`i.${b}`].value;Array.isArray(E)||T[`i.${b}`].set([E])}let y=g.filter(w=>w.closest('[w-list-clone="true"]')||w.hasAttribute("w-list-clone"));zu(y,d)})})};var nn=(s,e)=>{let{attributes:t}=s;t.filter(o=>A.elements[o.name]||Array.isArray(A.elements[o.name])).forEach(o=>{try{A.elements[o.name].forEach(e)}catch(a){console.error(a)}})},Y0=s=>{let e=[],t=s.parentElement;for(;t;)t.getAttribute("w-list-index-value")&&e.push(t.getAttribute("w-list-index-value")),t=t.parentElement;return e};var Z0=(s,e,t)=>{rn(e,o=>{o.removeAttribute(`w-el-onclick-${t}`),o.removeEventListener("click",a=>{No(a,e,s)})})},eI=(s,e,t)=>{rn(e,o=>{if(o.removeAttribute(`w-el-onchange-${t}`),o.type!=="radio"&&o.type!=="checkbox")s.onInput?o.removeEventListener("input",a=>{No(a,e,s)}):o.removeEventListener("change",a=>{No(a,e,s)});else if(o.type==="radio"){let a=document.querySelectorAll(`input[name=${o.getAttribute("name")}]`);Array.from(a).forEach(u=>{u.removeEventListener("change",l=>{No(l,e,s)})})}else o.type==="checkbox"&&o.removeEventListener("change",a=>{No(a,e,s)})})},No=(s,e,t)=>{var o,a,u,l;if(t.action==="set-cookie"){if(t.hasCondition&&!I(t.condition,s.target).value)return;let h=(o=A.configuration.cookies)==null?void 0:o.find(f=>f.id===t.cookie);if(!h)return;let{value:d}=I(t.value,s.target);nt("wized_"+h.name,d,Mr(h.lifetime)),(a=dt["c."+h.name])==null||a.set(d)}if(t.action==="set-variable"){if(t.hasCondition&&!I(t.condition,s.target).value)return;let h=(u=A.configuration.variables)==null?void 0:u.find(f=>f.id===t.variable);if(!h)return;let{value:d}=I(t.value,s.target);(l=dt["v."+h.name])==null||l.set(d)}if(t.action==="perform-request"){if(t.hasCondition&&!I(t.condition,s.target).value)return;let h=t.request}if(t.action==="navigate-to"){if(t.hasCondition&&!I(t.condition,s.target).value)return;let h=I(t.url,s.target).value;t.openInNewTab?h&&typeof h=="string"&&yt(h,!0):h&&typeof h=="string"&&yt(h)}},tI=(s,e)=>{rn(e,t=>{let o=t.getAttribute("w-el-visibility");o&&(t.style.display=o,t.removeAttribute("w-el-visibility"))})},nI=(s,e)=>{rn(e,t=>{let o=t.getAttribute("w-el-style-"+s.style);o&&(t.style[s.style]=o,t.removeAttribute("w-el-style-"+s.style))})},rI=(s,e)=>{rn(e,t=>{let o=t.getAttribute("w-el-class");o&&(t.className=o,t.removeAttribute("w-el-class"))})},iI=(s,e)=>{rn(e,t=>{let o=t.getAttribute("w-el-text");o&&(t.innerHTML=o,t.removeAttribute("w-el-text"))})},sI=(s,e)=>{rn(e,t=>{if(t.tagName!=="INPUT"&&t.tagName!=="SELECT"&&t.tagName!=="TEXTAREA")return;let o=t.getAttribute("w-el-value");o&&(t.type==="radio"?document.querySelector(`input[name=${t.getAttribute("name")}][value=${o}]`).checked=!0:t.type==="checkbox"?t.checked=!!o:t.value=o,t.removeAttribute("w-el-value"))})},oI=(s,e)=>{rn(e,t=>{let o=t.getAttribute("w-el-link");o&&(t.href=o,t.removeAttribute("w-el-link"))})},aI=(s,e)=>{rn(e,t=>{let o=I(s.key,t).value,a=t.getAttribute("w-el-"+o);a&&(t.setAttribute(o,a),t.removeAttribute("w-el-"+o))})},cI=(s,e)=>{rn(e,t=>{if(t.getAttribute("w-list-clone")==="true"){t.remove();return}let o=t.getAttribute("w-el-list-display");o&&(t.style.display=o),t.removeAttribute("w-el-list-display"),t.removeAttribute("w-list-index-variable"),t.removeAttribute("w-list-index-value")})};var rn=(s,e)=>{let{attributes:t=[]}=s;t.forEach(o=>{!A.elements[o.name]||A.elements[o.name].length===0||A.elements[o.name].forEach(e)})};var uI=s=>{let{actions:e}=s;if(!e)return;let t=!1;e.sort((o,a)=>o.setting==="list"?-1:a.setting==="list"?1:0).forEach((o,a)=>{if(!o)return;let{setting:u}=o;if(u){switch(u){case"on-click":V0(o,s,a);break;case"on-change":q0(o,s,a);break;case"visibility":z0(o,s);break;case"style":H0(o,s);break;case"class":G0(o,s);break;case"text":K0(o,s);break;case"value":W0(o,s);break;case"list":X0(o,s),t=!0;break;case"parameter":Q0(o,s);break;case"attribute":J0(o,s);break}t&&zi()}})},hI=s=>{let e=[];s.forEach(o=>{var a;(a=o==null?void 0:o.actions)==null||a.forEach(u=>{u.setting==="list"&&e.push(o)})}),e==null||e.forEach(o=>uI(o)),s.filter(o=>!e.find(a=>a.id===o.id)).forEach(o=>uI(o)),bD()},dI=()=>{let{actions:s}=A.configuration;if(!s)return;let e=[],t=[];for(let o of s){if(!fI(o.attributes))continue;(o.actions||[]).some(l=>l.setting==="list")?e.push(o):t.push(o)}_D(e,(o,a)=>{let u=(o.attributes||[]).flatMap(({name:f})=>Array.from(A.elements[f]||[])),l=(a.attributes||[]).flatMap(({name:f})=>Array.from(A.elements[f]||[]));return u.some(f=>l.some(p=>p.contains(f)))?1:l.some(f=>u.some(p=>p.contains(f)))?-1:0}),hI([...e,...t])},lI=s=>{let{actions:e}=s;e.sort((t,o)=>t.setting==="list"?-1:o.setting==="list"?1:0).forEach((t,o)=>{let{setting:a}=t;if(a)switch(a){case"on-click":Z0(t,s,o);break;case"on-change":eI(t,s,o);break;case"visibility":tI(t,s);break;case"style":nI(t,s);break;case"class":rI(t,s);break;case"text":iI(t,s);break;case"value":sI(t,s);break;case"list":cI(t,s);break;case"parameter":oI(t,s);break;case"attribute":aI(t,s);break}})},vD=s=>{console.time("Wized: re-render");let e=[];s.forEach(t=>{let o=A.configuration.actions.find(a=>a.id===t);o&&fI(o.attributes)&&e.push(o)}),wD(e),zi(),hI(e),console.timeEnd("Wized: re-render")},wD=s=>{let e=[];s.forEach(o=>{o.actions.forEach(a=>{a.setting==="list"&&e.push(o)})}),e.forEach(o=>{lI(o)}),s.filter(o=>!e.find(a=>a.id===o.id)).forEach(o=>{lI(o)})},sn={actionBuffer:[],timeout:null,add:async s=>new Promise((e,t)=>{sn.actionBuffer=[...sn.actionBuffer,...s].filter((o,a,u)=>u.indexOf(o)===a),sn.timeout?e(void 0):sn.timeout=setTimeout(()=>{sn.execute(),sn.timeout=null,e(void 0)},25)}),execute:()=>{vD(sn.actionBuffer),sn.actionBuffer=[]}},fI=(s=[])=>{let e=!1;return s.forEach(t=>{var o;(A.elements[t.name]||((o=A.elements[t.name])==null?void 0:o.length)>0)&&(e=!0)}),e},bD=()=>{try{window.fsAttributes&&window.fsAttributes.push(["cmsfilter",s=>{s==null||s.forEach(e=>{if(!e)return;e.storeFiltersData();let{listInstance:t}=e;t&&(t.items=[],t.addItems([...t.list.children]))})}])}catch(s){console.log(s)}},_D=(s,e)=>{let t=s.length;for(let o=0;o<t-1;o++){let a=o;for(let u=o+1;u<t;u++)e(s[u],s[a])<0&&(a=u);if(a!==o){let u=s[o];s[o]=s[a],s[a]=u}}return s};var rt=class{constructor(e,t){St(this,"path");St(this,"value");this.path=e,this.set(t)}async set(e){this.value=e,km(this.path,e);let t=dt[this.path];if(t&&(t.value!==e||typeof t.value=="object"&&typeof e=="object"&&JSON.stringify(t.value)!==JSON.stringify(e))){for(let a of Object.keys(t.callbacks))t.callbacks[a]();let o=[];for(let a of A.configuration.actions)a.actions&&a.actions.forEach(u=>{(u.setting==="on-click"||u.setting==="on-change")&&o.push(a.id)});await sn.add([...t.actions,...o]),t.value=e}}},T={},A={configuration:{id:"",projectId:"",showBranding:!0,type:"development",createdTimestamp:0,updatedTimestamp:0},elements:{},notFoundAttributes:[],cloakElements:[]},dt={},Be=(s,e,t)=>{dt[s]||(dt[s]={value:e,actions:[],callbacks:{}}),t.type==="callback"&&(dt[s].callbacks[t.id]=t.callback),t.type==="action"&&(dt[s].actions.includes(t.id)||dt[s].actions.push(t.id))};function pI(){let{auth:s}=A.configuration;if(!s)return;let e=s["access-control"];!e||e.length===0||e.forEach(t=>{let{attribute:o,condition:a,fallback:u}=t;if(!o||!a||!u||!A.elements[o]||A.elements[o].length===0)return;if(!I(a).value){let d=I(u).value;console.warn(`Access control condition (${a}) failed. Redirecting to: ${d}`),yt(String(d));return}let{paths:l}=I(a),h=kt();l.forEach(d=>{var f;Be(d,(f=T[d])==null?void 0:f.value,{type:"callback",id:h,callback:()=>{setTimeout(()=>{if(!I(a).value){let p=I(u).value;yt(String(p)),console.warn(`Access control condition (${a}) failed. Redirecting to: ${p}`),delete dt[d].callbacks[h]}},10)}})})})}function mI(){let{requests:s}=A.configuration;!s||s.length===0||s.forEach(e=>{if(!e.trigger)return;let t=[];e.trigger.forEach((o,a)=>{if(o["trigger-type"]==="attribute-present"){if(o["has-condition"]&&o.condition&&!I(o.condition).value)return;let u=o["trigger-attribute-present"];if(!u||!A.elements[u]||A.elements[u].length===0)return;t.push(pt(e.id))}if(o["trigger-type"]==="condition"){if(I(o.condition).value){t.push(pt(e.id));return}let{paths:u}=I(o.condition),l=kt(),h=!1;u.forEach(d=>{var f;Be(d,(f=T[d])==null?void 0:f.value,{type:"callback",id:l,callback:()=>{h||I(o.condition).value&&(h=!0,pt(e.id),u.forEach(p=>{delete dt[p].callbacks[l]}))}})})}}),t.length>0&&Promise.all(t).then(async()=>{Object.keys(rr._store._requestInitalCallbacks).forEach(o=>{let a=an();rr._store._requestInitalCallbacks[o](a)})}).catch(()=>{})})}var ED=()=>!!document.querySelector(".w-webflow-badge"),ID=()=>{let s="";return ED()?s="34px":s="0px",s},gI=()=>{let s=document.createElement("a");s.href="https://wized.com?utm_campaign=badge",s.target="_blank",s.style.marginBottom=ID(),s.style.position="fixed",s.style.left="auto",s.style.top="auto",s.style.right="12px",s.style.bottom="12px",s.style.zIndex="2147483647",s.style.display="flex",s.style.width="135px",s.style.height="28px",s.style.justifyContent="center",s.style.alignItems="center",s.style.borderRadius="3px",s.style.backgroundColor="#fff",s.style.boxShadow="0 0 3px 0 rgba(0, 0, 0, 0.35)";let e=document.createElement("img");e.src="https://uploads-ssl.webflow.com/61bb0e2c1418ddb87c5ad11d/64eccfc2720efbbffce9eb46_branding.svg",e.alt="wized-badge",s.appendChild(e),document.body.appendChild(s)};var vI=async()=>{var o;let s=new URLSearchParams(window.location.search),e=s.get("url")?new URL(s.get("url")).href:window.location.href,t=s.get("url")?new URLSearchParams(new URL(e).search).get("w-backup-configuration"):s.get("w-backup-configuration");if(window.location!==window.parent.location){let a;Cm(),await new Promise(u=>{window.addEventListener("message",l=>{l.data.type==="configurator-configuration"&&(a=l.data.data.configuration,u())},!1)}),A.configuration=a}else if(t)A.configuration=await yI(t);else{let a=await TD();a||(a=yI()),A.configuration=a}if(!A.configuration)throw new Error(`Wized: Failed to load project configuration.
Make sure you have added the right Wized script to your website and that your project is published!`);(o=A.configuration.apps)==null||o.push({id:"upload",name:"File upload",icon:"data-out",type:"upload"}),A.configuration.showBranding&&gI()},TD=async()=>{let{wized_config:s}=window;return Array.isArray(s)?s[0]:new Promise(e=>{window.wized_config={push:t=>{e(t)}}})},yI=async s=>{let e=Om(),t=xt();if(!t)throw new Error("Missing project ID");let o=new URL(`${te.serverUrl}v2/site/configuration`);o.searchParams.set("url",e),o.searchParams.set("projectId",t),o.searchParams.set("embedVersion","1"),s&&o.searchParams.set("backupConfigId",s);let a=await fetch(o);if(!a.ok)throw new Error("Failed to fetch project config");return await a.json()};var SD="http://localhost:3000",kD="https://ss.wized.com",AD="https://server.wized.com",Do=window.location!==window.parent.location&&[SD,kD,AD].includes(window.location.origin);var xD=(s=window.location.href)=>{let e=new URL(s);if(Do){let{searchParams:t}=e,o=t.get("url");return o?new URL(o):e}return e},wI=s=>{let e=xD();try{let t=new URL(s,e);if(Do){let o=new URL(window.location.href);return o.searchParams.set("url",t.toString()),o}return t}catch{return null}};var Qp=new Set,RD=s=>{let e,t;try{let a=new URL(window.location.href).searchParams.get("url");if(!a)throw new Error;e=new URL(a),t=new URL(s,e)}catch{return!1}return e.hostname!==t.hostname},CD=s=>{if(Qp.has(s))return;let e=s.getAttribute("href");if(!e||e.startsWith("#")||s.getAttribute("target")==="_blank")return;let o=wI(e);if(o){if(RD(e)){s.setAttribute("target","_blank"),Qp.add(s);return}s.setAttribute("href",o.toString()),Qp.add(s)}},bI=()=>{if(!Do)return;document.querySelectorAll("a[href]").forEach(CD)};console.time("Wized: init -> dom-loaded");console.time("Wized: init -> configuration-loaded");console.time("Wized: init -> render");var OD=async()=>{gm();let s=Tm();gt({type:"init",data:{siteInfo:s}}),xm(window.location.href),Rm(1),Sm(),document.addEventListener("DOMContentLoaded",()=>{console.timeEnd("Wized: init -> dom-loaded"),document.querySelectorAll("[wized-cloak]").forEach(t=>{let o=window.getComputedStyle(t).opacity;t.setAttribute("wized-cloak-opacity",o),t.style.opacity="0"}),bI()}),window.addEventListener("load",async()=>{await vI(),console.timeEnd("Wized: init -> configuration-loaded"),bm(),zi(),mI(),pI(),dI(),document.querySelectorAll("[wized-cloak]").forEach(o=>{let a=o.getAttribute("wized-cloak");if(a){let l=a?a.split(",").map(h=>h.trim()):[];A.cloakElements.push({element:o,requestNames:l,custom:!1});return}let u=o.getAttribute("wized-cloak-opacity");o.style.opacity=u}),document.querySelectorAll("[wized-cloak-custom]").forEach(o=>{let a=o.getAttribute("wized-cloak-custom");if(a){let u=a?a.split(",").map(l=>l.trim()):[];A.cloakElements.push({element:o,requestNames:u,custom:!0});return}o.removeAttribute("wized-cloak-custom")}),console.timeEnd("Wized: init -> render"),mm(),Nm()})};OD();})();
/*! Bundled license information:

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/util/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/component/dist/esm/index.esm2017.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/logger/dist/esm/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/app/dist/esm/index.esm2017.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/app/dist/esm/index.esm2017.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/app/dist/esm/index.esm2017.js:
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

firebase/app/dist/esm/index.esm.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/auth/dist/esm2017/index-e3d5d3f4.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
  * @license
  * Copyright 2020 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2018 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2023 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2018 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2023 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2023 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2018 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2023 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2023 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/firestore/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/storage/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2022 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/storage/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/storage/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/storage/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/storage/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2019 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/storage/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
  (**
   * @license
   * Copyright 2020 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@firebase/storage/dist/index.esm2017.js:
  (**
   * @license
   * Copyright 2021 Google LLC
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)
*/
