UNPKG

@veltdev/sdk

Version:

Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.

4 lines 6.68 MB
var SNIPPYLY_VERSION = '4.3.0'; (()=>{"use strict";var e,d={},v={};function a(e){var n=v[e];if(void 0!==n)return n.exports;var r=v[e]={exports:{}};return d[e](r,r.exports,a),r.exports}a.m=d,e=[],a.O=(n,r,u,t)=>{if(!r){var c=1/0;for(l=0;l<e.length;l++){for(var[r,u,t]=e[l],s=!0,o=0;o<r.length;o++)(!1&t||c>=t)&&Object.keys(a.O).every(p=>a.O[p](r[o]))?r.splice(o--,1):(s=!1,t<c&&(c=t));if(s){e.splice(l--,1);var f=u();void 0!==f&&(n=f)}}return n}t=t||0;for(var l=e.length;l>0&&e[l-1][2]>t;l--)e[l]=e[l-1];e[l]=[r,u,t]},a.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return a.d(n,{a:n}),n},a.d=(e,n)=>{for(var r in n)a.o(n,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},a.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),a.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={121:0};a.O.j=u=>0===e[u];var n=(u,t)=>{var o,f,[l,c,s]=t,_=0;if(l.some(b=>0!==e[b])){for(o in c)a.o(c,o)&&(a.m[o]=c[o]);if(s)var i=s(a)}for(u&&u(t);_<l.length;_++)a.o(e,f=l[_])&&e[f]&&e[f][0](),e[f]=0;return a.O(i)},r=self.webpackChunkangular_elements_demo=self.webpackChunkangular_elements_demo||[];r.forEach(n.bind(null,0)),r.push=n.bind(null,r.push.bind(r))})()})(); (self.webpackChunkangular_elements_demo=self.webpackChunkangular_elements_demo||[]).push([[461],{2195:()=>{!function(c,L){"use strict";function R(){var e=X.splice(0,X.length);for(ce=0;e.length;)e.shift().call(null,e.shift())}function O(e,t){for(var n=0,r=e.length;n<r;n++)Ee(e[n],t)}function fe(e){return function(t){Et(t)&&(Ee(t,e),E.length&&O(t.querySelectorAll(E),e))}}function pe(e){var t=ie.call(e,"is"),n=e.nodeName.toUpperCase(),r=H.call(D,t?ee+t.toUpperCase():q+n);return t&&-1<r&&!Ie(n,t)?-1:r}function Ie(e,t){return-1<E.indexOf(e+'[is="'+t+'"]')}function Fe(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,o=e.target,a=e[J]||2,l=e[ge]||3;!me||o&&o!==t||!t[C]||"style"===r||e.prevValue===e.newValue&&(""!==e.newValue||n!==a&&n!==l)||t[C](r,n===a?null:e.prevValue,n===l?null:e.newValue)}function Pe(e){var t=fe(e);return function(n){X.push(t,n.target),ce&&clearTimeout(ce),ce=setTimeout(R,1)}}function he(e){ot&&(ot=!1,e.currentTarget.removeEventListener(Ke,he)),E.length&&O((e.target||u).querySelectorAll(E),e.detail===v?v:y),k&&function lt(){for(var e,t=0,n=W.length;t<n;t++)S.contains(e=W[t])||(n--,W.splice(t--,1),Ee(e,v))}()}function at(e,t){var n=this;et.call(n,e,t),Me.call(n,{target:n})}function Se(e,t,n){var r=t.apply(e,n),o=pe(r);return-1<o&&U(r,Z[o]),n.pop()&&E.length&&function De(e){for(var t,n=0,r=e.length;n<r;n++)U(t=e[n],Z[pe(t)])}(r.querySelectorAll(E)),r}function Te(e,t){Tt(e,t),Q?Q.observe(e,gt):(se&&(e.setAttribute=at,e[g]=ve(e),e[b](st,Me)),e[b](N,Fe)),e[B]&&me&&(e.created=!0,e[B](),e.created=!1)}function Ve(e){throw new Error("A "+e+" type is already registered")}function Ee(e,t){var n,r,o=pe(e);-1<o&&!Lt.call(e,"TEMPLATE")&&(Y(e,Z[o]),o=0,t!==y||e[y]?t!==v||e[v]||(e[y]=!1,e[v]=!0,r="disconnected",o=1):(e[v]=!1,e[y]=!0,r="connected",o=1,k&&H.call(W,e)<0&&W.push(e)),o&&(n=e[t+_]||e[r+_])&&n.call(e))}function z(){}function ke(e,t,n){var r=n&&n[x]||"",o=t.prototype,a=we(o),l=t.observedAttributes||Ce,m={prototype:a};le(a,B,{value:function(){if(re)re=!1;else if(!this[j]){this[j]=!0,new t(this),o[B]&&o[B].call(this);var i=G[oe.get(t)];(!K||i.create.length>1)&&xe(this)}}}),le(a,C,{value:function(i){-1<H.call(l,i)&&o[C]&&o[C].apply(this,arguments)}}),o[Ze]&&le(a,ut,{value:o[Ze]}),o[je]&&le(a,ct,{value:o[je]}),r&&(m[x]=r),e=e.toUpperCase(),G[e]={constructor:t,create:r?[r,ae(e)]:[e]},oe.set(t,e),u[P](e.toLowerCase(),m),Le(e),V[e].r()}function Re(e){var t=G[e.toUpperCase()];return t&&t.constructor}function Ue(e){return"string"==typeof e?e:e&&e.is||""}function xe(e){for(var t,n=e[C],r=n?e.attributes:Ce,o=r.length;o--;)n.call(e,(t=r[o]).name||t.nodeName,null,t.value||t.nodeValue)}function Le(e){return(e=e.toUpperCase())in V||(V[e]={},V[e].p=new $e(function(t){V[e].r=t})),V[e].p}function Be(){w&&delete c.customElements,I(c,"customElements",{configurable:!0,value:new z}),I(c,"CustomElementRegistry",{configurable:!0,value:z});for(var e=it.get(/^HTML[A-Z]*[a-z]/),t=e.length;t--;function(n){var r=c[n];if(r){c[n]=function(o){var a,l;return o||(o=this),o[j]||(re=!0,a=G[oe.get(o.constructor)],(o=(l=K&&1===a.create.length)?Reflect.construct(r,Ce,a.constructor):u.createElement.apply(u,a.create))[j]=!0,re=!1,l||xe(o)),o},c[n].prototype=r.prototype;try{r.prototype.constructor=c[n]}catch{I(r,j,{value:c[n]})}}}(e[t]));u.createElement=function(n,r){var o=Ue(r);return o?_e.call(this,n,ae(o)):_e.call(this,n)},nt||(Oe=!0,u[P](""))}var u=c.document,T=c.Object,it=function(e){var t,n,r,o,a=/^[A-Z]+[a-z]/,m=function(f,d){(d=d.toLowerCase())in i||(i[f]=(i[f]||[]).concat(d),i[d]=i[d.toUpperCase()]=f)},i=(T.create||T)(null),s={};for(n in e)for(o in e[n])for(i[o]=r=e[n][o],t=0;t<r.length;t++)i[r[t].toLowerCase()]=i[r[t].toUpperCase()]=o;return s.get=function(f){return"string"==typeof f?i[f]||(a.test(f)?[]:""):function(f){var d,h=[];for(d in i)f.test(d)&&h.push(d);return h}(f)},s.set=function(f,d){return a.test(f)?m(f,d):m(d,f),s},s}({collections:{HTMLAllCollection:["all"],HTMLCollection:["forms"],HTMLFormControlsCollection:["elements"],HTMLOptionsCollection:["options"]},elements:{Element:["element"],HTMLAnchorElement:["a"],HTMLAppletElement:["applet"],HTMLAreaElement:["area"],HTMLAttachmentElement:["attachment"],HTMLAudioElement:["audio"],HTMLBRElement:["br"],HTMLBaseElement:["base"],HTMLBodyElement:["body"],HTMLButtonElement:["button"],HTMLCanvasElement:["canvas"],HTMLContentElement:["content"],HTMLDListElement:["dl"],HTMLDataElement:["data"],HTMLDataListElement:["datalist"],HTMLDetailsElement:["details"],HTMLDialogElement:["dialog"],HTMLDirectoryElement:["dir"],HTMLDivElement:["div"],HTMLDocument:["document"],HTMLElement:["element","abbr","address","article","aside","b","bdi","bdo","cite","code","command","dd","dfn","dt","em","figcaption","figure","footer","header","i","kbd","mark","nav","noscript","rp","rt","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr"],HTMLEmbedElement:["embed"],HTMLFieldSetElement:["fieldset"],HTMLFontElement:["font"],HTMLFormElement:["form"],HTMLFrameElement:["frame"],HTMLFrameSetElement:["frameset"],HTMLHRElement:["hr"],HTMLHeadElement:["head"],HTMLHeadingElement:["h1","h2","h3","h4","h5","h6"],HTMLHtmlElement:["html"],HTMLIFrameElement:["iframe"],HTMLImageElement:["img"],HTMLInputElement:["input"],HTMLKeygenElement:["keygen"],HTMLLIElement:["li"],HTMLLabelElement:["label"],HTMLLegendElement:["legend"],HTMLLinkElement:["link"],HTMLMapElement:["map"],HTMLMarqueeElement:["marquee"],HTMLMediaElement:["media"],HTMLMenuElement:["menu"],HTMLMenuItemElement:["menuitem"],HTMLMetaElement:["meta"],HTMLMeterElement:["meter"],HTMLModElement:["del","ins"],HTMLOListElement:["ol"],HTMLObjectElement:["object"],HTMLOptGroupElement:["optgroup"],HTMLOptionElement:["option"],HTMLOutputElement:["output"],HTMLParagraphElement:["p"],HTMLParamElement:["param"],HTMLPictureElement:["picture"],HTMLPreElement:["pre"],HTMLProgressElement:["progress"],HTMLQuoteElement:["blockquote","q","quote"],HTMLScriptElement:["script"],HTMLSelectElement:["select"],HTMLShadowElement:["shadow"],HTMLSlotElement:["slot"],HTMLSourceElement:["source"],HTMLSpanElement:["span"],HTMLStyleElement:["style"],HTMLTableCaptionElement:["caption"],HTMLTableCellElement:["td","th"],HTMLTableColElement:["col","colgroup"],HTMLTableElement:["table"],HTMLTableRowElement:["tr"],HTMLTableSectionElement:["thead","tbody","tfoot"],HTMLTemplateElement:["template"],HTMLTextAreaElement:["textarea"],HTMLTimeElement:["time"],HTMLTitleElement:["title"],HTMLTrackElement:["track"],HTMLUListElement:["ul"],HTMLUnknownElement:["unknown","vhgroupv","vkeygen"],HTMLVideoElement:["video"]},nodes:{Attr:["node"],Audio:["audio"],CDATASection:["node"],CharacterData:["node"],Comment:["#comment"],Document:["#document"],DocumentFragment:["#document-fragment"],DocumentType:["node"],HTMLDocument:["#document"],Image:["img"],Option:["option"],ProcessingInstruction:["node"],ShadowRoot:["#shadow-root"],Text:["#text"],XMLDocument:["xml"]}});"object"!=typeof L&&(L={type:L||"auto"});var X,Me,$,ve,Q,He,Y,U,A,e,t,n,r,o,P="registerElement",qe=1e5*c.Math.random()|0,g="__"+P+qe,b="addEventListener",y="attached",_="Callback",v="detached",x="extends",C="attributeChanged"+_,ut=y+_,Ze="connected"+_,je="disconnected"+_,B="created"+_,ct=v+_,J="ADDITION",ge="REMOVAL",N="DOMAttrModified",Ke="DOMContentLoaded",st="DOMSubtreeModified",q="<",ee="=",mt=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,dt=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],D=[],Z=[],E="",S=u.documentElement,H=D.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},be=T.prototype,ye=be.hasOwnProperty,te=be.isPrototypeOf,I=T.defineProperty,Ce=[],ne=T.getOwnPropertyDescriptor,Ge=T.getOwnPropertyNames,ft=T.getPrototypeOf,We=T.setPrototypeOf,ze=!!T.__proto__,j="__dreCEv1",w=c.customElements,K=!/^force/.test(L.type)&&!!(w&&w.define&&w.get&&w.whenDefined),Xe=T.create||T,ht=c.Map||function(){var e,t=[],n=[];return{get:function(r){return n[H.call(t,r)]},set:function(r,o){(e=H.call(t,r))<0?n[t.push(r)-1]=o:n[e]=o}}},$e=c.Promise||function(e){function t(a){for(r=!0;n.length;)n.shift()(a)}var n=[],r=!1,o={catch:function(){return o},then:function(a){return n.push(a),r&&setTimeout(t,1),o}};return e(t),o},re=!1,G=Xe(null),V=Xe(null),oe=new ht,ae=function(e){return e.toLowerCase()},we=T.create||function e(t){return t?(e.prototype=t,new e):this},Tt=We||(ze?function(e,t){return e.__proto__=t,e}:Ge&&ne?function(){function e(t,n){for(var r,o=Ge(n),a=0,l=o.length;a<l;a++)ye.call(t,r=o[a])||I(t,r,ne(n,r))}return function(t,n){do{e(t,n)}while((n=ft(n))&&!te.call(n,t));return t}}():function(e,t){for(var n in t)e[n]=t[n];return e}),F=c.MutationObserver||c.WebKitMutationObserver,Qe=c.HTMLAnchorElement,p=(c.HTMLElement||c.Element||c.Node).prototype,k=!te.call(p,S),le=k?function(e,t,n){return e[t]=n.value,e}:I,Et=k?function(e){return 1===e.nodeType}:function(e){return te.call(p,e)},W=k&&[],Ye=p.attachShadow,Je=p.cloneNode,Lt=p.closest||function(e){for(var t=this;t&&t.nodeName!==e;)t=t.parentNode;return t},Ae=p.dispatchEvent,ie=p.getAttribute,Mt=p.hasAttribute,vt=p.removeAttribute,et=p.setAttribute,ue=u.createElement,Ht=u.importNode,_e=ue,gt=F&&{attributes:!0,characterData:!0,attributeOldValue:!0},tt=F||function(e){se=!1,S.removeEventListener(N,tt)},ce=0,nt=P in u&&!/^force-all/.test(L.type),rt=!0,Oe=!1,se=!0,ot=!0,me=!0;if(F&&((A=u.createElement("div")).innerHTML="<div><div></div></div>",new F(function(e,t){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var n=(A=ne(p,"innerHTML"))&&A.set;n&&I(p,"innerHTML",{set:function(r){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,r)}})}t.disconnect(),A=null}).observe(A,{childList:!0,subtree:!0}),A.innerHTML=""),nt||(We||ze?(Y=function(e,t){te.call(t,e)||Te(e,t)},U=Te):(Y=function(e,t){e[g]||(e[g]=T(!0),Te(e,t))},U=Y),k?(se=!1,e=ne(p,b),t=e.value,n=function(a){var l=new CustomEvent(N,{bubbles:!0});l.attrName=a,l.prevValue=ie.call(this,a),l.newValue=null,l[ge]=l.attrChange=2,vt.call(this,a),Ae.call(this,l)},r=function(a,l){var m=Mt.call(this,a),i=m&&ie.call(this,a),s=new CustomEvent(N,{bubbles:!0});et.call(this,a,l),s.attrName=a,s.prevValue=m?i:null,s.newValue=l,m?s.MODIFICATION=s.attrChange=1:s[J]=s.attrChange=0,Ae.call(this,s)},o=function(a){var l,m=a.currentTarget,i=m[g],s=a.propertyName;i.hasOwnProperty(s)&&(i=i[s],(l=new CustomEvent(N,{bubbles:!0})).attrName=i.name,l.prevValue=i.value||null,l.newValue=i.value=m[s]||null,null==l.prevValue?l[J]=l.attrChange=0:l.MODIFICATION=l.attrChange=1,Ae.call(m,l))},e.value=function(a,l,m){a===N&&this[C]&&this.setAttribute!==r&&(this[g]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,a,l,m)},I(p,b,e)):F||(S[b](N,tt),S.setAttribute(g,1),S.removeAttribute(g),se&&(Me=function(e){var t,n,r,o=this;if(o===e.target){for(r in t=o[g],o[g]=n=ve(o),n){if(!(r in t))return $(0,o,r,t[r],n[r],J);if(n[r]!==t[r])return $(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return $(2,o,r,t[r],n[r],ge)}},$=function(e,t,n,r,o,a){var l={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};l[a]=e,Fe(l)},ve=function(e){for(var t,n,r={},o=e.attributes,a=0,l=o.length;a<l;a++)"setAttribute"!==(n=(t=o[a]).name)&&(r[n]=t.value);return r})),u[P]=function(e,t){if(n=e.toUpperCase(),rt&&(rt=!1,F?(Q=function(i,s){function f(d,h){for(var M=0,de=d.length;M<de;h(d[M++]));}return new F(function(d){for(var h,M,de,Ne=0,bt=d.length;Ne<bt;Ne++)"childList"===(h=d[Ne]).type?(f(h.addedNodes,i),f(h.removedNodes,s)):(M=h.target,me&&M[C]&&"style"!==h.attributeName&&(de=ie.call(M,h.attributeName))!==h.oldValue&&M[C](h.attributeName,h.oldValue,de))})}(fe(y),fe(v)),(He=function(i){return Q.observe(i,{childList:!0,subtree:!0}),i})(u),Ye&&(p.attachShadow=function(){return He(Ye.apply(this,arguments))})):(X=[],u[b]("DOMNodeInserted",Pe(y)),u[b]("DOMNodeRemoved",Pe(v))),u[b](Ke,he),u[b]("readystatechange",he),u.importNode=function(i,s){switch(i.nodeType){case 1:return Se(u,Ht,[i,!!s]);case 11:for(var f=u.createDocumentFragment(),d=i.childNodes,h=d.length,M=0;M<h;M++)f.appendChild(u.importNode(d[M],!!s));return f;default:return Je.call(i,!!s)}},p.cloneNode=function(i){return Se(this,Je,[!!i])}),Oe)return Oe=!1;if(-2<H.call(D,ee+n)+H.call(D,q+n)&&Ve(e),!mt.test(n)||-1<H.call(dt,n))throw new Error("The type "+e+" is invalid");var n,r,o=function(){return l?u.createElement(m,n):u.createElement(m)},a=t||be,l=ye.call(a,x),m=l?t[x].toUpperCase():n;return l&&-1<H.call(D,q+m)&&Ve(m),r=D.push((l?ee:q)+n)-1,E=E.concat(E.length?",":"",l?m+'[is="'+e.toLowerCase()+'"]':m),o.prototype=Z[r]=ye.call(a,"prototype")?a.prototype:we(p),E.length&&O(u.querySelectorAll(E),y),o},u.createElement=_e=function(e,t){var n=Ue(t),r=n?ue.call(u,e,ae(n)):ue.call(u,e),o=""+e,a=H.call(D,(n?ee:q)+(n||o).toUpperCase()),l=-1<a;return n&&(r.setAttribute("is",n=n.toLowerCase()),l&&(l=Ie(o.toUpperCase(),n))),me=!u.createElement.innerHTMLHelper,l&&U(r,Z[a]),r}),addEventListener("beforeunload",function(){delete u.createElement,delete u.importNode,delete u[P]},!1),z.prototype={constructor:z,define:K?function(e,t,n){if(n)ke(e,t,n);else{var r=e.toUpperCase();G[r]={constructor:t,create:[r]},oe.set(t,r),w.define(e,t)}}:ke,get:K?function(e){return w.get(e)||Re(e)}:Re,whenDefined:K?function(e){return $e.race([w.whenDefined(e),Le(e)])}:Le},!w||/^force/.test(L.type))Be();else if(!L.noBuiltIn)try{!function(e,t,n){var r=new RegExp("^<a\\s+is=('|\")"+n+"\\1></a>$");if(t[x]="a",(e.prototype=we(Qe.prototype)).constructor=e,c.customElements.define(n,e,t),!r.test(u.createElement("a",{is:n}).outerHTML)||!r.test((new e).outerHTML))throw t}(function e(){return Reflect.construct(Qe,[],e)},{},"document-register-element-a"+qe)}catch{Be()}if(!L.noBuiltIn)try{if(ue.call(u,"a","a").outerHTML.indexOf("is")<0)throw{}}catch{ae=function(t){return{is:t.toLowerCase()}}}}(window)},4050:(c,L,R)=>{"use strict";R(2195)}},c=>{c(c.s=4050)}]); "use strict";(self.webpackChunkangular_elements_demo=self.webpackChunkangular_elements_demo||[]).push([[792],{32:(Tt,Ie,b)=>{b.d(Ie,{o:()=>fe});var A=b(1413),G=b(7673),pe=b(9498),X=b(6955);let fe=(()=>{class ie{constructor(e){this.loggingService=e,this.actionSubjects=new Map,this.subscriptions=[]}triggerAction(e,ce){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new A.B),this.actionSubjects.get(e)?.next(ce)}catch(le){this.loggingService.catch("Error in CoreActionsService triggerAction: ",le)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new A.B),this.actionSubjects.get(e)?.asObservable()}catch(ce){return this.loggingService.catch("Error in CoreActionsService onAction: ",ce),(0,G.of)(null)}}static{this.\u0275fac=function(ce){return new(ce||ie)(pe.KVO(X.J))}}static{this.\u0275prov=pe.jDH({token:ie,factory:ie.\u0275fac,providedIn:"root"})}}return ie})()},62:(Tt,Ie,b)=>{b.d(Ie,{Nj:()=>Ea,DF:()=>ef,wh:()=>Xd,xI:()=>xl,yx:()=>ep,_q:()=>Ig,p:()=>af,CI:()=>Tg});var A=b(2967),G=b(9498),pe=b(7440),X=b(4125),fe=b(2214),ie=b(467),ne=b(7852),e=b(6858),ce=b(8041),le=b(1635),re=b(1362);const st=function pt(){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."}},Et=new e.FA("auth","Firebase",{"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."}),Fe=new ce.Vy("@firebase/auth");function nt(H,...D){Fe.logLevel<=ce.$b.ERROR&&Fe.error(`Auth (${ne.MF}): ${H}`,...D)}function Qe(H,...D){throw Rn(H,...D)}function ht(H,...D){return Rn(H,...D)}function _t(H,D,k){const Q=Object.assign(Object.assign({},st()),{[D]:k});return new e.FA("auth","Firebase",Q).create(D,{appName:H.name})}function en(H){return _t(H,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Rn(H,...D){if("string"!=typeof H){const k=D[0],Q=[...D.slice(1)];return Q[0]&&(Q[0].appName=H.name),H._errorFactory.create(k,...Q)}return Et.create(H,...D)}function oe(H,D,...k){if(!H)throw Rn(D,...k)}function _e(H){const D="INTERNAL ASSERTION FAILED: "+H;throw nt(D),new Error(D)}function F(H,D){H||_e(D)}function V(){var H;return typeof self<"u"&&(null===(H=self.location)||void 0===H?void 0:H.href)||""}function P(){var H;return typeof self<"u"&&(null===(H=self.location)||void 0===H?void 0:H.protocol)||null}class se{constructor(D,k){this.shortDelay=D,this.longDelay=k,F(k>D,"Short delay should be less than long delay!"),this.isMobile=(0,e.jZ)()||(0,e.lV)()}get(){return function E(){return!(typeof navigator<"u"&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(function J(){return"http:"===P()||"https:"===P()}()||(0,e.sr)()||"connection"in navigator))||navigator.onLine}()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function te(H,D){F(H.emulator,"Emulator should always be set here");const{url:k}=H.emulator;return D?`${k}${D.startsWith("/")?D.slice(1):D}`:k}class z{static initialize(D,k,Q){this.fetchImpl=D,k&&(this.headersImpl=k),Q&&(this.responseImpl=Q)}static fetch(){return this.fetchImpl?this.fetchImpl:typeof self<"u"&&"fetch"in self?self.fetch:typeof globalThis<"u"&&globalThis.fetch?globalThis.fetch:typeof fetch<"u"?fetch:void _e("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:typeof self<"u"&&"Headers"in self?self.Headers:typeof globalThis<"u"&&globalThis.Headers?globalThis.Headers:typeof Headers<"u"?Headers:void _e("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:typeof self<"u"&&"Response"in self?self.Response:typeof globalThis<"u"&&globalThis.Response?globalThis.Response:typeof Response<"u"?Response:void _e("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const W={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},K=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],it=new se(3e4,6e4);function rt(H,D){return H.tenantId&&!D.tenantId?Object.assign(Object.assign({},D),{tenantId:H.tenantId}):D}function kt(H,D,k,Q){return rn.apply(this,arguments)}function rn(){return(rn=(0,ie.A)(function*(H,D,k,Q,ke={}){return mn(H,ke,(0,ie.A)(function*(){let ut={},nn={};Q&&("GET"===D?nn=Q:ut={body:JSON.stringify(Q)});const Tn=(0,e.Am)(Object.assign({key:H.config.apiKey},nn)).slice(1),qn=yield H._getAdditionalHeaders();qn["Content-Type"]="application/json",H.languageCode&&(qn["X-Firebase-Locale"]=H.languageCode);const uo=Object.assign({method:D,headers:qn},ut);return(0,e.c1)()||(uo.referrerPolicy="no-referrer"),z.fetch()(yield Wn(H,H.config.apiHost,k,Tn),uo)}))})).apply(this,arguments)}function mn(H,D,k){return Un.apply(this,arguments)}function Un(){return(Un=(0,ie.A)(function*(H,D,k){H._canInitEmulator=!1;const Q=Object.assign(Object.assign({},W),D);try{const ke=new Zi(H),ut=yield Promise.race([k(),ke.promise]);ke.clearNetworkTimeout();const nn=yield ut.json();if("needConfirmation"in nn)throw Di(H,"account-exists-with-different-credential",nn);if(ut.ok&&!("errorMessage"in nn))return nn;{const Tn=ut.ok?nn.errorMessage:nn.error.message,[qn,uo]=Tn.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===qn)throw Di(H,"credential-already-in-use",nn);if("EMAIL_EXISTS"===qn)throw Di(H,"email-already-in-use",nn);if("USER_DISABLED"===qn)throw Di(H,"user-disabled",nn);const Ro=Q[qn]||qn.toLowerCase().replace(/[_\s]+/g,"-");if(uo)throw _t(H,Ro,uo);Qe(H,Ro)}}catch(ke){if(ke instanceof e.g)throw ke;Qe(H,"network-request-failed",{message:String(ke)})}})).apply(this,arguments)}function Cn(H,D,k,Q){return co.apply(this,arguments)}function co(){return(co=(0,ie.A)(function*(H,D,k,Q,ke={}){const ut=yield kt(H,D,k,Q,ke);return"mfaPendingCredential"in ut&&Qe(H,"multi-factor-auth-required",{_serverResponse:ut}),ut})).apply(this,arguments)}function Wn(H,D,k,Q){return fo.apply(this,arguments)}function fo(){return(fo=(0,ie.A)(function*(H,D,k,Q){const ke=`${D}${k}?${Q}`,ut=H,nn=ut.config.emulator?te(H.config,ke):`${H.config.apiScheme}://${ke}`;return K.includes(k)&&(yield ut._persistenceManagerAvailable,"COOKIE"===ut._getPersistenceType())?ut._getPersistence()._getFinalTarget(nn).toString():nn})).apply(this,arguments)}class Zi{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(D){this.auth=D,this.timer=null,this.promise=new Promise((k,Q)=>{this.timer=setTimeout(()=>Q(ht(this.auth,"network-request-failed")),it.get())})}}function Di(H,D,k){const Q={appName:H.name};k.email&&(Q.email=k.email),k.phoneNumber&&(Q.phoneNumber=k.phoneNumber);const ke=ht(H,D,Q);return ke.customData._tokenResponse=k,ke}function et(){return(et=(0,ie.A)(function*(H,D){return kt(H,"POST","/v1/accounts:delete",D)})).apply(this,arguments)}function Rt(H,D){return lt.apply(this,arguments)}function lt(){return(lt=(0,ie.A)(function*(H,D){return kt(H,"POST","/v1/accounts:lookup",D)})).apply(this,arguments)}function Se(H){if(H)try{const D=new Date(Number(H));if(!isNaN(D.getTime()))return D.toUTCString()}catch{}}function mt(H){return Ht.apply(this,arguments)}function Ht(){return(Ht=(0,ie.A)(function*(H,D=!1){const k=(0,e.Ku)(H),Q=yield k.getIdToken(D),ke=jt(Q);oe(ke&&ke.exp&&ke.auth_time&&ke.iat,k.auth,"internal-error");const ut="object"==typeof ke.firebase?ke.firebase:void 0,nn=ut?.sign_in_provider;return{claims:ke,token:Q,authTime:Se(Ot(ke.auth_time)),issuedAtTime:Se(Ot(ke.iat)),expirationTime:Se(Ot(ke.exp)),signInProvider:nn||null,signInSecondFactor:ut?.sign_in_second_factor||null}})).apply(this,arguments)}function Ot(H){return 1e3*Number(H)}function jt(H){const[D,k,Q]=H.split(".");if(void 0===D||void 0===k||void 0===Q)return nt("JWT malformed, contained fewer than 3 sections"),null;try{const ke=(0,e.u)(k);return ke?JSON.parse(ke):(nt("Failed to decode base64 JWT payload"),null)}catch(ke){return nt("Caught error parsing JWT payload as JSON",ke?.toString()),null}}function ot(H){const D=jt(H);return oe(D,"internal-error"),oe(typeof D.exp<"u","internal-error"),oe(typeof D.iat<"u","internal-error"),Number(D.exp)-Number(D.iat)}function Lt(H,D){return Vt.apply(this,arguments)}function Vt(){return(Vt=(0,ie.A)(function*(H,D,k=!1){if(k)return D;try{return yield D}catch(Q){throw Q instanceof e.g&&function cn({code:H}){return"auth/user-disabled"===H||"auth/user-token-expired"===H}(Q)&&H.auth.currentUser===H&&(yield H.auth.signOut()),Q}})).apply(this,arguments)}class fn{constructor(D){this.user=D,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(D){var k;if(D){const Q=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),Q}{this.errorBackoff=3e4;const ke=(null!==(k=this.user.stsTokenManager.expirationTime)&&void 0!==k?k:0)-Date.now()-3e5;return Math.max(0,ke)}}schedule(D=!1){var k=this;if(!this.isRunning)return;const Q=this.getInterval(D);this.timerId=setTimeout((0,ie.A)(function*(){yield k.iteration()}),Q)}iteration(){var D=this;return(0,ie.A)(function*(){try{yield D.user.getIdToken(!0)}catch(k){return void("auth/network-request-failed"===k?.code&&D.schedule(!0))}D.schedule()})()}}class ye{constructor(D,k){this.createdAt=D,this.lastLoginAt=k,this._initializeTime()}_initializeTime(){this.lastSignInTime=Se(this.lastLoginAt),this.creationTime=Se(this.createdAt)}_copy(D){this.createdAt=D.createdAt,this.lastLoginAt=D.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}function xe(H){return St.apply(this,arguments)}function St(){return(St=(0,ie.A)(function*(H){var D;const k=H.auth,Q=yield H.getIdToken(),ke=yield Lt(H,Rt(k,{idToken:Q}));oe(ke?.users.length,k,"internal-error");const ut=ke.users[0];H._notifyReloadListener(ut);const nn=null!==(D=ut.providerUserInfo)&&void 0!==D&&D.length?Yt(ut.providerUserInfo):[],Tn=function vt(H,D){return[...H.filter(Q=>!D.some(ke=>ke.providerId===Q.providerId)),...D]}(H.providerData,nn),Ro=!!H.isAnonymous&&!(H.email&&ut.passwordHash||Tn?.length),ni={uid:ut.localId,displayName:ut.displayName||null,photoURL:ut.photoUrl||null,email:ut.email||null,emailVerified:ut.emailVerified||!1,phoneNumber:ut.phoneNumber||null,tenantId:ut.tenantId||null,providerData:Tn,metadata:new ye(ut.createdAt,ut.lastLoginAt),isAnonymous:Ro};Object.assign(H,ni)})).apply(this,arguments)}function je(){return(je=(0,ie.A)(function*(H){const D=(0,e.Ku)(H);yield xe(D),yield D.auth._persistUserIfCurrent(D),D.auth._notifyListenersIfCurrent(D)})).apply(this,arguments)}function Yt(H){return H.map(D=>{var{providerId:k}=D,Q=(0,le.Tt)(D,["providerId"]);return{providerId:k,uid:Q.rawId||"",displayName:Q.displayName||null,email:Q.email||null,phoneNumber:Q.phoneNumber||null,photoURL:Q.photoUrl||null}})}function Mn(){return(Mn=(0,ie.A)(function*(H,D){const k=yield mn(H,{},(0,ie.A)(function*(){const Q=(0,e.Am)({grant_type:"refresh_token",refresh_token:D}).slice(1),{tokenApiHost:ke,apiKey:ut}=H.config,nn=yield Wn(H,ke,"/v1/token",`key=${ut}`),Tn=yield H._getAdditionalHeaders();return Tn["Content-Type"]="application/x-www-form-urlencoded",z.fetch()(nn,{method:"POST",headers:Tn,body:Q})}));return{accessToken:k.access_token,expiresIn:k.expires_in,refreshToken:k.refresh_token}})).apply(this,arguments)}function pi(){return(pi=(0,ie.A)(function*(H,D){return kt(H,"POST","/v2/accounts:revokeToken",rt(H,D))})).apply(this,arguments)}class vi{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(D){oe(D.idToken,"internal-error"),oe(typeof D.idToken<"u","internal-error"),oe(typeof D.refreshToken<"u","internal-error");const k="expiresIn"in D&&typeof D.expiresIn<"u"?Number(D.expiresIn):ot(D.idToken);this.updateTokensAndExpiration(D.idToken,D.refreshToken,k)}updateFromIdToken(D){oe(0!==D.length,"internal-error");const k=ot(D);this.updateTokensAndExpiration(D,null,k)}getToken(D,k=!1){var Q=this;return(0,ie.A)(function*(){return k||!Q.accessToken||Q.isExpired?(oe(Q.refreshToken,D,"user-token-expired"),Q.refreshToken?(yield Q.refresh(D,Q.refreshToken),Q.accessToken):null):Q.accessToken})()}clearRefreshToken(){this.refreshToken=null}refresh(D,k){var Q=this;return(0,ie.A)(function*(){const{accessToken:ke,refreshToken:ut,expiresIn:nn}=yield function wt(H,D){return Mn.apply(this,arguments)}(D,k);Q.updateTokensAndExpiration(ke,ut,Number(nn))})()}updateTokensAndExpiration(D,k,Q){this.refreshToken=k||null,this.accessToken=D||null,this.expirationTime=Date.now()+1e3*Q}static fromJSON(D,k){const{refreshToken:Q,accessToken:ke,expirationTime:ut}=k,nn=new vi;return Q&&(oe("string"==typeof Q,"internal-error",{appName:D}),nn.refreshToken=Q),ke&&(oe("string"==typeof ke,"internal-error",{appName:D}),nn.accessToken=ke),ut&&(oe("number"==typeof ut,"internal-error",{appName:D}),nn.expirationTime=ut),nn}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(D){this.accessToken=D.accessToken,this.refreshToken=D.refreshToken,this.expirationTime=D.expirationTime}_clone(){return Object.assign(new vi,this.toJSON())}_performRefresh(){return _e("not implemented")}}function li(H,D){oe("string"==typeof H||typeof H>"u","internal-error",{appName:D})}class zo{constructor(D){var{uid:k,auth:Q,stsTokenManager:ke}=D,ut=(0,le.Tt)(D,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new fn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=k,this.auth=Q,this.stsTokenManager=ke,this.accessToken=ke.accessToken,this.displayName=ut.displayName||null,this.email=ut.email||null,this.emailVerified=ut.emailVerified||!1,this.phoneNumber=ut.phoneNumber||null,this.photoURL=ut.photoURL||null,this.isAnonymous=ut.isAnonymous||!1,this.tenantId=ut.tenantId||null,this.providerData=ut.providerData?[...ut.providerData]:[],this.metadata=new ye(ut.createdAt||void 0,ut.lastLoginAt||void 0)}getIdToken(D){var k=this;return(0,ie.A)(function*(){const Q=yield Lt(k,k.stsTokenManager.getToken(k.auth,D));return oe(Q,k.auth,"internal-error"),k.accessToken!==Q&&(k.accessToken=Q,yield k.auth._persistUserIfCurrent(k),k.auth._notifyListenersIfCurrent(k)),Q})()}getIdTokenResult(D){return mt(this,D)}reload(){return function Je(H){return je.apply(this,arguments)}(this)}_assign(D){this!==D&&(oe(this.uid===D.uid,this.auth,"internal-error"),this.displayName=D.displayName,this.photoURL=D.photoURL,this.email=D.email,this.emailVerified=D.emailVerified,this.phoneNumber=D.phoneNumber,this.isAnonymous=D.isAnonymous,this.tenantId=D.tenantId,this.providerData=D.providerData.map(k=>Object.assign({},k)),this.metadata._copy(D.metadata),this.stsTokenManager._assign(D.stsTokenManager))}_clone(D){const k=new zo(Object.assign(Object.assign({},this),{auth:D,stsTokenManager:this.stsTokenManager._clone()}));return k.metadata._copy(this.metadata),k}_onReload(D){oe(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=D,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(D){this.reloadListener?this.reloadListener(D):this.reloadUserInfo=D}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}_updateTokensIfNecessary(D,k=!1){var Q=this;return(0,ie.A)(function*(){let ke=!1;D.idToken&&D.idToken!==Q.stsTokenManager.accessToken&&(Q.stsTokenManager.updateFromServerResponse(D),ke=!0),k&&(yield xe(Q)),yield Q.auth._persistUserIfCurrent(Q),ke&&Q.auth._notifyListenersIfCurrent(Q)})()}delete(){var D=this;return(0,ie.A)(function*(){if((0,ne.xZ)(D.auth.app))return Promise.reject(en(D.auth));const k=yield D.getIdToken();return yield Lt(D,function Gt(H,D){return et.apply(this,arguments)}(D.auth,{idToken:k})),D.stsTokenManager.clearRefreshToken(),D.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(D=>Object.assign({},D)),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(D,k){var Q,ke,ut,nn,Tn,qn,uo,Ro;const ni=null!==(Q=k.displayName)&&void 0!==Q?Q:void 0,Vi=null!==(ke=k.email)&&void 0!==ke?ke:void 0,Fa=null!==(ut=k.phoneNumber)&&void 0!==ut?ut:void 0,Fm=null!==(nn=k.photoURL)&&void 0!==nn?nn:void 0,Hd=null!==(Tn=k.tenantId)&&void 0!==Tn?Tn:void 0,Ws=null!==(qn=k._redirectEventId)&&void 0!==qn?qn:void 0,Bc=null!==(uo=k.createdAt)&&void 0!==uo?uo:void 0,du=null!==(Ro=k.lastLoginAt)&&void 0!==Ro?Ro:void 0,{uid:Fc,emailVerified:mu,isAnonymous:gu,providerData:zd,stsTokenManager:ip}=k;oe(Fc&&ip,D,"internal-error");const rp=vi.fromJSON(this.name,ip);oe("string"==typeof Fc,D,"internal-error"),li(ni,D.name),li(Vi,D.name),oe("boolean"==typeof mu,D,"internal-error"),oe("boolean"==typeof gu,D,"internal-error"),li(Fa,D.name),li(Fm,D.name),li(Hd,D.name),li(Ws,D.name),li(Bc,D.name),li(du,D.name);const uu=new zo({uid:Fc,auth:D,email:Vi,emailVerified:mu,displayName:ni,isAnonymous:gu,photoURL:Fm,phoneNumber:Fa,tenantId:Hd,stsTokenManager:rp,createdAt:Bc,lastLoginAt:du});return zd&&Array.isArray(zd)&&(uu.providerData=zd.map(wg=>Object.assign({},wg))),Ws&&(uu._redirectEventId=Ws),uu}static _fromIdTokenResponse(D,k,Q=!1){return(0,ie.A)(function*(){const ke=new vi;ke.updateFromServerResponse(k);const ut=new zo({uid:k.localId,auth:D,stsTokenManager:ke,isAnonymous:Q});return yield xe(ut),ut})()}static _fromGetAccountInfoResponse(D,k,Q){return(0,ie.A)(function*(){const ke=k.users[0];oe(void 0!==ke.localId,"internal-error");const ut=void 0!==ke.providerUserInfo?Yt(ke.providerUserInfo):[],nn=!(ke.email&&ke.passwordHash||ut?.length),Tn=new vi;Tn.updateFromIdToken(Q);const qn=new zo({uid:ke.localId,auth:D,stsTokenManager:Tn,isAnonymous:nn}),uo={uid:ke.localId,displayName:ke.displayName||null,photoURL:ke.photoUrl||null,email:ke.email||null,emailVerified:ke.emailVerified||!1,phoneNumber:ke.phoneNumber||null,tenantId:ke.tenantId||null,providerData:ut,metadata:new ye(ke.createdAt,ke.lastLoginAt),isAnonymous:!(ke.email&&ke.passwordHash||ut?.length)};return Object.assign(qn,uo),qn})()}}const Ci=new Map;function Zn(H){F(H instanceof Function,"Expected a class definition");let D=Ci.get(H);return D?(F(D instanceof H,"Instance stored in cache mismatched with class"),D):(D=new H,Ci.set(H,D),D)}const Vn=(()=>{class H{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return(0,ie.A)(function*(){return!0})()}_set(k,Q){var ke=this;return(0,ie.A)(function*(){ke.storage[k]=Q})()}_get(k){var Q=this;return(0,ie.A)(function*(){const ke=Q.storage[k];return void 0===ke?null:ke})()}_remove(k){var Q=this;return(0,ie.A)(function*(){delete Q.storage[k]})()}_addListener(k,Q){}_removeListener(k,Q){}}return H.type="NONE",H})();function yo(H,D,k){return`firebase:${H}:${D}:${k}`}class wi{constructor(D,k,Q){this.persistence=D,this.auth=k,this.userKey=Q;const{config:ke,name:ut}=this.auth;this.fullUserKey=yo(this.userKey,ke.apiKey,ut),this.fullPersistenceKey=yo("persistence",ke.apiKey,ut),this.boundEventHandler=k._onStorageEvent.bind(k),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(D){return this.persistence._set(this.fullUserKey,D.toJSON())}getCurrentUser(){var D=this;return(0,ie.A)(function*(){const k=yield D.persistence._get(D.fullUserKey);if(!k)return null;if("string"==typeof k){const Q=yield Rt(D.auth,{idToken:k}).catch(()=>{});return Q?zo._fromGetAccountInfoResponse(D.auth,Q,k):null}return zo._fromJSON(D.auth,k)})()}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(D){var k=this;return(0,ie.A)(function*(){if(k.persistence===D)return;const Q=yield k.getCurrentUser();return yield k.removeCurrentUser(),k.persistence=D,Q?k.setCurrentUser(Q):void 0})()}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(D,k,Q="authUser"){return(0,ie.A)(function*(){if(!k.length)return new wi(Zn(Vn),D,Q);const ke=(yield Promise.all(k.map(function(){var uo=(0,ie.A)(function*(Ro){if(yield Ro._isAvailable())return Ro});return function(Ro){return uo.apply(this,arguments)}}()))).filter(uo=>uo);let ut=ke[0]||Zn(Vn);const nn=yo(Q,D.config.apiKey,D.name);let Tn=null;for(const uo of k)try{const Ro=yield uo._get(nn);if(Ro){let ni;if("string"==typeof Ro){const Vi=yield Rt(D,{idToken:Ro}).catch(()=>{});if(!Vi)break;ni=yield zo._fromGetAccountInfoResponse(D,Vi,Ro)}else ni=zo._fromJSON(D,Ro);uo!==ut&&(Tn=ni),ut=uo;break}}catch{}const qn=ke.filter(uo=>uo._shouldAllowMigration);return ut._shouldAllowMigration&&qn.length?(ut=qn[0],Tn&&(yield ut._set(nn,Tn.toJSON())),yield Promise.all(k.map(function(){var uo=(0,ie.A)(function*(Ro){if(Ro!==ut)try{yield Ro._remove(nn)}catch{}});return function(Ro){return uo.apply(this,arguments)}}())),new wi(ut,D,Q)):new wi(ut,D,Q)})()}}function ue(H){const D=H.toLowerCase();if(D.includes("opera/")||D.includes("opr/")||D.includes("opios/"))return"Opera";if(Wi(D))return"IEMobile";if(D.includes("msie")||D.includes("trident/"))return"IE";if(D.includes("edge/"))return"Edge";if(Mi(D))return"Firefox";if(D.includes("silk/"))return"Silk";if(bn(D))return"Blackberry";if(vn(D))return"Webos";if(Io(D))return"Safari";if((D.includes("chrome/")||Dr(D))&&!D.includes("edge/"))return"Chrome";if(ci(D))return"Android";{const Q=H.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(2===Q?.length)return Q[1]}return"Other"}function Mi(H=(0,e.ZQ)()){return/firefox\//i.test(H)}function Io(H=(0,e.ZQ)()){const D=H.toLowerCase();return D.includes("safari/")&&!D.includes("chrome/")&&!D.includes("crios/")&&!D.includes("android")}function Dr(H=(0,e.ZQ)()){return/crios\//i.test(H)}function Wi(H=(0,e.ZQ)()){return/iemobile/i.test(H)}function ci(H=(0,e.ZQ)()){return/android/i.test(H)}function bn(H=(0,e.ZQ)()){return/blackberry/i.test(H)}function vn(H=(0,e.ZQ)()){return/webos/i.test(H)}function Dn(H=(0,e.ZQ)()){return/iphone|ipad|ipod/i.test(H)||/macintosh/i.test(H)&&/mobile/i.test(H)}function Ne(H=(0,e.ZQ)()){return Dn(H)||ci(H)||vn(H)||bn(H)||/windows phone/i.test(H)||Wi(H)}function Re(H,D=[]){let k;switch(H){case"Browser":k=ue((0,e.ZQ)());break;case"Worker":k=`${ue((0,e.ZQ)())}-${H}`;break;default:k=H}const Q=D.length?D.join(","):"FirebaseCore-web";return`${k}/JsCore/${ne.MF}/${Q}`}class tt{constructor(D){this.auth=D,this.queue=[]}pushCallback(D,k){const Q=ut=>new Promise((nn,Tn)=>{try{nn(D(ut))}catch(qn){Tn(qn)}});Q.onAbort=k,this.queue.push(Q);const ke=this.queue.length-1;return()=>{this.queue[ke]=()=>Promise.resolve()}}runMiddleware(D){var k=this;return(0,ie.A)(function*(){if(k.auth.currentUser===D)return;const Q=[];try{for(const ke of k.queue)yield ke(D),ke.onAbort&&Q.push(ke.onAbort)}catch(ke){Q.reverse();for(const ut of Q)try{ut()}catch{}throw k.auth._errorFactory.create("login-blocked",{originalMessage:ke?.message})}})()}}function gt(){return(gt=(0,ie.A)(function*(H,D={}){return kt(H,"GET","/v2/passwordPolicy",rt(H,D))})).apply(this,arguments)}class Bt{constructor(D){var k,Q,ke,ut;const nn=D.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(k=nn.minPasswordLength)&&void 0!==k?k:6,nn.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=nn.maxPasswordLength),void 0!==nn.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=nn.containsLowercaseCharacter),void 0!==nn.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=nn.containsUppercaseCharacter),void 0!==nn.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=nn.containsNumericCharacter),void 0!==nn.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=nn.containsNonAlphanumericCharacter),this.enforcementState=D.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(ke=null===(Q=D.allowedNonAlphanumericCharacters)||void 0===Q?void 0:Q.join(""))&&void 0!==ke?ke:"",this.forceUpgradeOnSignin=null!==(ut=D.forceUpgradeOnSignin)&&void 0!==ut&&ut,this.schemaVersion=D.schemaVersion}validatePassword(D){var k,Q,ke,ut,nn,Tn;const qn={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(D,qn),this.validatePasswordCharacterOptions(D,qn),qn.isValid&&(qn.isValid=null===(k=qn.meetsMinPasswordLength)||void 0===k||k),qn.isValid&&(qn.isValid=null===(Q=qn.meetsMaxPasswordLength)||void 0===Q||Q),qn.isValid&&(qn.isValid=null===(ke=qn.containsLowercaseLetter)||void 0===ke||ke),qn.isValid&&(qn.isValid=null===(ut=qn.containsUppercaseLetter)||void 0===ut||ut),qn.isValid&&(qn.isValid=null===(nn=qn.containsNumericCharacter)||void 0===nn||nn),qn.isValid&&(qn.isValid=null===(Tn=qn.containsNonAlphanumericCharacter)||void 0===Tn||Tn),qn}validatePasswordLengthOptions(D,k){const Q=this.customStrengthOptions.minPasswordLength,ke=this.customStrengthOptions.maxPasswordLength;Q&&(k.meetsMinPasswordLength=D.length>=Q),ke&&(k.meetsMaxPasswordLength=D.length<=ke)}validatePasswordCharacterOptions(D,k){let Q;this.updatePasswordCharacterOptionsStatuses(k,!1,!1,!1,!1);for(let ke=0;ke<D.length;ke++)Q=D.charAt(ke),this.updatePasswordCharacterOptionsStatuses(k,Q>="a"&&Q<="z",Q>="A"&&Q<="Z",Q>="0"&&Q<="9",this.allowedNonAlphanumericCharacters.includes(Q))}updatePasswordCharacterOptionsStatuses(D,k,Q,ke,ut){this.customStrengthOptions.containsLowercaseLetter&&(D.containsLowercaseLetter||(D.containsLowercaseLetter=k)),this.customStrengthOptions.containsUppercaseLetter&&(D.containsUppercaseLetter||(D.containsUppercaseLetter=Q)),this.customStrengthOptions.containsNumericCharacter&&(D.containsNumericCharacter||(D.containsNumericCharacter=ke)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(D.containsNonAlphanumericCharacter||(D.containsNonAlphanumericCharacter=ut))}}class ao{constructor(D,k,Q,ke){this.app=D,this.heartbeatServiceProvider=k,this.appCheckServiceProvider=Q,this.config=ke,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new $t(this),this.idTokenSubscription=new $t(this),this.beforeStateQueue=new tt(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Et,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=D.name,this.clientVersion=ke.sdkClientVersion,this._persistenceManagerAvailable=new Promise(ut=>this._resolvePersistenceManagerAvailable=ut)}_initializeWithPersistence(D,k){var Q=this;return k&&(this._popupRedirectResolver=Zn(k)),this._initializationPromise=this.queue((0,ie.A)(function*(){var ke,ut,nn;if(!Q._deleted&&(Q.persistenceManager=yield wi.create(Q,D),null===(ke=Q._resolvePersistenceManagerAvailable)||void 0===ke||ke.call(Q),!Q._deleted)){if(null!==(ut=Q._popupRedirectResolver)&&void 0!==ut&&ut._shouldInitProactively)try{yield Q._popupRedirectResolver._initialize(Q)}catch{}yield Q.initializeCurrentUser(k),Q.lastNotifiedUid=(null===(nn=Q.currentUser)||void 0===nn?void 0:nn.uid)||null,!Q._deleted&&(Q._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){var D=this;return(0,ie.A)(function*(){if(D._deleted)return;const k=yield D.assertedPersistence.getCurrentUser();if(D.currentUser||k){if(D.currentUser&&k&&D.currentUser.uid===k.uid)return D._currentUser._assign(k),void(yield D.currentUser.getIdToken());yield D._updateCurrentUser(k,!0)}})()}initializeCurrentUserFromIdToken(D){var k=this;return(0,ie.A)(function*(){try{const Q=yield Rt(k,{idToken:D}),ke=yield zo._fromGetAccountInfoResponse(k,Q,D);yield k.directlySetCurrentUser(ke)}catch(Q){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",Q),yield k.directlySetCurrentUser(null)}})()}initializeCurrentUser(D){var k=this;return(0,ie.A)(function*(){var Q;if((0,ne.xZ)(k.app)){const Tn=k.app.settings.authIdToken;return Tn?new Promise(qn=>{setTimeout(()=>k.initializeCurrentUserFromIdToken(Tn).then(qn,qn))}):k.directlySetCurrentUser(null)}const ke=yield k.assertedPersistence.getCurrentUser();let ut=ke,nn=!1;if(D&&k.config.authDomain){yield k.getOrInitRedirectPersistenceManager();const Tn=null===(Q=k.redirectUser)||void 0===Q?void 0:Q._redirectEventId,qn=ut?._redirectEventId,uo=yield k.tryRedirectSignIn(D);(!Tn||Tn===qn)&&uo?.user&&(ut=uo.user,nn=!0)}if(!ut)return k.directlySetCurrentUser(null);if(!ut._redirectEventId){if(nn)try{yield k.beforeStateQueue.runMiddleware(ut)}catch(Tn){ut=ke,k._popupRedirectResolver._overrideRedirectResult(k,()=>Promise.reject(Tn))}return ut?k.reloadAndSetCurrentUserOrClear(ut):k.directlySetCurrentUser(null)}return oe(k._popupRedirectResolver,k,"argument-error"),yield k.getOrInitRedirectPersistenceManager(),k.redirectUser&&k.redirectUser._redirectEventId===ut._redirectEventId?k.directlySetCurrentUser(ut):k.reloadAndSetCurrentUserOrClear(ut)})()}tryRedirectSignIn(D){var k=this;return(0,ie.A)(function*(){let Q=null;try{Q=yield k._popupRedirectResolver._completeRedirectFn(k,D,!0)}catch{yield k._setRedirectUser(null)}return Q})()}reloadAndSetCurrentUserOrClear(D){var k=this;return(0,ie.A)(function*(){try{yield xe(D)}catch(Q){if("auth/network-request-failed"!==Q?.code)return k.directlySetCurrentUser(null)}return k.directlySetCurrentUser(D)})()}useDeviceLanguage(){this.languageCode=function Y(){if(typeof navigator>"u")return null;const H=navigator;return H.languages&&H.languages[0]||H.language||null}()}_delete(){var D=this;return(0,ie.A)(function*(){D._deleted=!0})()}updateCurrentUser(D){var k=this;return(0,ie.A)(function*(){if((0,ne.xZ)(k.app))return Promise.reject(en(k));const Q=D?(0,e.Ku)(D):null;return Q&&oe(Q.auth.config.apiKey===k.config.apiKey,k,"invalid-user-token"),k._updateCurrentUser(Q&&Q._clone(k))})()}_updateCurrentUser(D,k=!1){var Q=this;return(0,ie.A)(function*(){if(!Q._deleted)return D&&oe(Q.tenantId===D.tenantId,Q,"tenant-id-mismatch"),k||(yield Q.beforeStateQueue.runMiddleware(D)),Q.queue((0,ie.A)(function*(){yield Q.directlySetCurrentUser(D),Q.notifyAuthListeners()}))})()}signOut(){var D=this;return(0,ie.A)(function*(){return(0,ne.xZ)(D.app)?Promise.reject(en(D)):(yield D.beforeStateQueue.runMiddleware(null),(D.redirectPersistenceManager||D._popupRedirectResolver)&&(yield D._setRedirectUser(null)),D._updateCurrentUser(null,!0))})()}setPersistence(D){var k=this;return(0,ne.xZ)(this.app)?Promise.reject(en(this)):this.queue((0,ie.A)(function*(){yield k.assertedPersistence.setPersistence(Zn(D))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(D){var k=this;return(0,ie.A)(function*(){k._getPasswordPolicyInternal()||(yield k._updatePasswordPolicy());const Q=k._getPasswordPolicyInternal();return Q.schemaVersion!==k.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(k._errorFactory.create("unsupported-password-policy-schema-version",{})):Q.validatePassword(D)})()}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){var D=this;return(0,ie.A)(function*(){const k=yield function We(H){return gt.