UNPKG

@angular/fire

Version:
2 lines (1 loc) • 47.2 kB
var Br=Object.create;var _=Object.defineProperty,Mr=Object.defineProperties,Xr=Object.getOwnPropertyDescriptor,Hr=Object.getOwnPropertyDescriptors,Wr=Object.getOwnPropertyNames,Ce=Object.getOwnPropertySymbols,Yr=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty,zr=Object.prototype.propertyIsEnumerable;var be=(t,e,r)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ce=(t,e)=>{for(var r in e||(e={}))Fe.call(e,r)&&be(t,r,e[r]);if(Ce)for(var r of Ce(e))zr.call(e,r)&&be(t,r,e[r]);return t},De=(t,e)=>Mr(t,Hr(e));var h=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Kr=(t,e)=>{for(var r in e)_(t,r,{get:e[r],enumerable:!0})},Pe=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Wr(e))!Fe.call(t,i)&&i!==r&&_(t,i,{get:()=>e[i],enumerable:!(s=Xr(e,i))||s.enumerable});return t};var Qr=(t,e,r)=>(r=t!=null?Br(Yr(t)):{},Pe(e||!t||!t.__esModule?_(r,"default",{value:t,enumerable:!0}):r,t)),Zr=t=>Pe(_({},"__esModule",{value:!0}),t);var U=h((wo,qe)=>{"use strict";var Jr="2.0.0",es=Number.MAX_SAFE_INTEGER||9007199254740991,ts=16,rs=250,ss=["major","premajor","minor","preminor","patch","prepatch","prerelease"];qe.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:ts,MAX_SAFE_BUILD_LENGTH:rs,MAX_SAFE_INTEGER:es,RELEASE_TYPES:ss,SEMVER_SPEC_VERSION:Jr,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var B=h((yo,Ve)=>{"use strict";var is=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Ve.exports=is});var P=h((w,ke)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:le,MAX_SAFE_BUILD_LENGTH:ns,MAX_LENGTH:os}=U(),as=B();w=ke.exports={};var cs=w.re=[],ls=w.safeRe=[],f=w.src=[],us=w.safeSrc=[],m=w.t={},ps=0,ue="[a-zA-Z0-9-]",fs=[["\\s",1],["\\d",os],[ue,ns]],ms=t=>{for(let[e,r]of fs)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},E=(t,e,r)=>{let s=ms(e),i=ps++;as(t,i,e),m[t]=i,f[i]=e,us[i]=s,cs[i]=new RegExp(e,r?"g":void 0),ls[i]=new RegExp(s,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ue}*`);E("MAINVERSION",`(${f[m.NUMERICIDENTIFIER]})\\.(${f[m.NUMERICIDENTIFIER]})\\.(${f[m.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${f[m.NUMERICIDENTIFIERLOOSE]})\\.(${f[m.NUMERICIDENTIFIERLOOSE]})\\.(${f[m.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${f[m.NONNUMERICIDENTIFIER]}|${f[m.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${f[m.NONNUMERICIDENTIFIER]}|${f[m.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${f[m.PRERELEASEIDENTIFIER]}(?:\\.${f[m.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${f[m.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[m.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${ue}+`);E("BUILD",`(?:\\+(${f[m.BUILDIDENTIFIER]}(?:\\.${f[m.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${f[m.MAINVERSION]}${f[m.PRERELEASE]}?${f[m.BUILD]}?`);E("FULL",`^${f[m.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${f[m.MAINVERSIONLOOSE]}${f[m.PRERELEASELOOSE]}?${f[m.BUILD]}?`);E("LOOSE",`^${f[m.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${f[m.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${f[m.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${f[m.XRANGEIDENTIFIER]})(?:\\.(${f[m.XRANGEIDENTIFIER]})(?:\\.(${f[m.XRANGEIDENTIFIER]})(?:${f[m.PRERELEASE]})?${f[m.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${f[m.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[m.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[m.XRANGEIDENTIFIERLOOSE]})(?:${f[m.PRERELEASELOOSE]})?${f[m.BUILD]}?)?)?`);E("XRANGE",`^${f[m.GTLT]}\\s*${f[m.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${f[m.GTLT]}\\s*${f[m.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${le}})(?:\\.(\\d{1,${le}}))?(?:\\.(\\d{1,${le}}))?`);E("COERCE",`${f[m.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",f[m.COERCEPLAIN]+`(?:${f[m.PRERELEASE]})?(?:${f[m.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",f[m.COERCE],!0);E("COERCERTLFULL",f[m.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${f[m.LONETILDE]}\\s+`,!0);w.tildeTrimReplace="$1~";E("TILDE",`^${f[m.LONETILDE]}${f[m.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${f[m.LONETILDE]}${f[m.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${f[m.LONECARET]}\\s+`,!0);w.caretTrimReplace="$1^";E("CARET",`^${f[m.LONECARET]}${f[m.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${f[m.LONECARET]}${f[m.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${f[m.GTLT]}\\s*(${f[m.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${f[m.GTLT]}\\s*(${f[m.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${f[m.GTLT]}\\s*(${f[m.LOOSEPLAIN]}|${f[m.XRANGEPLAIN]})`,!0);w.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${f[m.XRANGEPLAIN]})\\s+-\\s+(${f[m.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${f[m.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[m.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var z=h((vo,je)=>{"use strict";var ds=Object.freeze({loose:!0}),hs=Object.freeze({}),Es=t=>t?typeof t!="object"?ds:t:hs;je.exports=Es});var pe=h((To,Ue)=>{"use strict";var Ge=/^[0-9]+$/,_e=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Ge.test(t),s=Ge.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:t<e?-1:1},gs=(t,e)=>_e(e,t);Ue.exports={compareIdentifiers:_e,rcompareIdentifiers:gs}});var x=h((Oo,Me)=>{"use strict";var K=B(),{MAX_LENGTH:Be,MAX_SAFE_INTEGER:Q}=U(),{safeRe:Z,t:J}=P(),Is=z(),{compareIdentifiers:fe}=pe(),me=class t{constructor(e,r){if(r=Is(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Be)throw new TypeError(`version is longer than ${Be} characters`);K("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?Z[J.LOOSE]:Z[J.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Q||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Q||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Q||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<Q)return n}return i}):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(K("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let s=this.prerelease[r],i=e.prerelease[r];if(K("prerelease compare",r,s,i),s===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(s===void 0)return-1;if(s===i)continue;return fe(s,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let s=this.build[r],i=e.build[r];if(K("build compare",r,s,i),s===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(s===void 0)return-1;if(s===i)continue;return fe(s,i)}while(++r)}inc(e,r,s){if(e.startsWith("pre")){if(!r&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?Z[J.PRERELEASELOOSE]:Z[J.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,s),this.inc("pre",r,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,s),this.inc("pre",r,s);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(r===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let n=[r,i];s===!1&&(n=[r]),fe(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Me.exports=me});var F=h((Co,He)=>{"use strict";var Xe=x(),xs=(t,e,r=!1)=>{if(t instanceof Xe)return t;try{return new Xe(t,e)}catch(s){if(!r)return null;throw s}};He.exports=xs});var Ye=h((bo,We)=>{"use strict";var Ss=F(),$s=(t,e)=>{let r=Ss(t,e);return r?r.version:null};We.exports=$s});var Ke=h((Fo,ze)=>{"use strict";var Rs=F(),As=(t,e)=>{let r=Rs(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};ze.exports=As});var Je=h((Do,Ze)=>{"use strict";var Qe=x(),Ns=(t,e,r,s,i)=>{typeof r=="string"&&(i=s,s=r,r=void 0);try{return new Qe(t instanceof Qe?t.version:t,r).inc(e,s,i).version}catch(n){return null}};Ze.exports=Ns});var rt=h((Po,tt)=>{"use strict";var et=F(),Ls=(t,e)=>{let r=et(t,null,!0),s=et(e,null,!0),i=r.compare(s);if(i===0)return null;let n=i>0,o=n?r:s,a=n?s:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==s.major?u+"major":r.minor!==s.minor?u+"minor":r.patch!==s.patch?u+"patch":"prerelease"};tt.exports=Ls});var it=h((qo,st)=>{"use strict";var ws=x(),ys=(t,e)=>new ws(t,e).major;st.exports=ys});var ot=h((Vo,nt)=>{"use strict";var vs=x(),Ts=(t,e)=>new vs(t,e).minor;nt.exports=Ts});var ct=h((ko,at)=>{"use strict";var Os=x(),Cs=(t,e)=>new Os(t,e).patch;at.exports=Cs});var ut=h((jo,lt)=>{"use strict";var bs=F(),Fs=(t,e)=>{let r=bs(t,e);return r&&r.prerelease.length?r.prerelease:null};lt.exports=Fs});var A=h((Go,ft)=>{"use strict";var pt=x(),Ds=(t,e,r)=>new pt(t,r).compare(new pt(e,r));ft.exports=Ds});var dt=h((_o,mt)=>{"use strict";var Ps=A(),qs=(t,e,r)=>Ps(e,t,r);mt.exports=qs});var Et=h((Uo,ht)=>{"use strict";var Vs=A(),ks=(t,e)=>Vs(t,e,!0);ht.exports=ks});var ee=h((Bo,It)=>{"use strict";var gt=x(),js=(t,e,r)=>{let s=new gt(t,r),i=new gt(e,r);return s.compare(i)||s.compareBuild(i)};It.exports=js});var St=h((Mo,xt)=>{"use strict";var Gs=ee(),_s=(t,e)=>t.sort((r,s)=>Gs(r,s,e));xt.exports=_s});var Rt=h((Xo,$t)=>{"use strict";var Us=ee(),Bs=(t,e)=>t.sort((r,s)=>Us(s,r,e));$t.exports=Bs});var M=h((Ho,At)=>{"use strict";var Ms=A(),Xs=(t,e,r)=>Ms(t,e,r)>0;At.exports=Xs});var te=h((Wo,Nt)=>{"use strict";var Hs=A(),Ws=(t,e,r)=>Hs(t,e,r)<0;Nt.exports=Ws});var de=h((Yo,Lt)=>{"use strict";var Ys=A(),zs=(t,e,r)=>Ys(t,e,r)===0;Lt.exports=zs});var he=h((zo,wt)=>{"use strict";var Ks=A(),Qs=(t,e,r)=>Ks(t,e,r)!==0;wt.exports=Qs});var re=h((Ko,yt)=>{"use strict";var Zs=A(),Js=(t,e,r)=>Zs(t,e,r)>=0;yt.exports=Js});var se=h((Qo,vt)=>{"use strict";var ei=A(),ti=(t,e,r)=>ei(t,e,r)<=0;vt.exports=ti});var Ee=h((Zo,Tt)=>{"use strict";var ri=de(),si=he(),ii=M(),ni=re(),oi=te(),ai=se(),ci=(t,e,r,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return ri(t,r,s);case"!=":return si(t,r,s);case">":return ii(t,r,s);case">=":return ni(t,r,s);case"<":return oi(t,r,s);case"<=":return ai(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};Tt.exports=ci});var Ct=h((Jo,Ot)=>{"use strict";var li=x(),ui=F(),{safeRe:ie,t:ne}=P(),pi=(t,e)=>{if(t instanceof li)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?ie[ne.COERCEFULL]:ie[ne.COERCE]);else{let c=e.includePrerelease?ie[ne.COERCERTLFULL]:ie[ne.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let s=r[2],i=r[3]||"0",n=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return ui(`${s}.${i}.${n}${o}${a}`,e)};Ot.exports=pi});var Ft=h((ea,bt)=>{"use strict";var ge=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};bt.exports=ge});var N=h((ta,Vt)=>{"use strict";var fi=/\s+/g,Ie=class t{constructor(e,r){if(r=di(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof xe)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(fi," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(i=>!Pt(i[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&$i(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let s=0;s<r.length;s++)s>0&&(this.formatted+=" "),this.formatted+=r[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let s=((this.options.includePrerelease&&xi)|(this.options.loose&&Si))+":"+e,i=Dt.get(s);if(i)return i;let n=this.options.loose,o=n?$[S.HYPHENRANGELOOSE]:$[S.HYPHENRANGE];e=e.replace(o,Ci(this.options.includePrerelease)),I("hyphen replace",e),e=e.replace($[S.COMPARATORTRIM],Ei),I("comparator trim",e),e=e.replace($[S.TILDETRIM],gi),I("tilde trim",e),e=e.replace($[S.CARETTRIM],Ii),I("caret trim",e);let a=e.split(" ").map(d=>Ri(d,this.options)).join(" ").split(/\s+/).map(d=>Oi(d,this.options));n&&(a=a.filter(d=>(I("loose invalid filter",d,this.options),!!d.match($[S.COMPARATORLOOSE])))),I("range list",a);let c=new Map,l=a.map(d=>new xe(d,this.options));for(let d of l){if(Pt(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Dt.set(s,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(s=>qt(s,r)&&e.set.some(i=>qt(i,r)&&s.every(n=>i.every(o=>n.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new hi(e,this.options)}catch(r){return!1}for(let r=0;r<this.set.length;r++)if(bi(this.set[r],e,this.options))return!0;return!1}};Vt.exports=Ie;var mi=Ft(),Dt=new mi,di=z(),xe=X(),I=B(),hi=x(),{safeRe:$,t:S,comparatorTrimReplace:Ei,tildeTrimReplace:gi,caretTrimReplace:Ii}=P(),{FLAG_INCLUDE_PRERELEASE:xi,FLAG_LOOSE:Si}=U(),Pt=t=>t.value==="<0.0.0-0",$i=t=>t.value==="",qt=(t,e)=>{let r=!0,s=t.slice(),i=s.pop();for(;r&&s.length;)r=s.every(n=>i.intersects(n,e)),i=s.pop();return r},Ri=(t,e)=>(t=t.replace($[S.BUILD],""),I("comp",t,e),t=Li(t,e),I("caret",t),t=Ai(t,e),I("tildes",t),t=yi(t,e),I("xrange",t),t=Ti(t,e),I("stars",t),t),R=t=>!t||t.toLowerCase()==="x"||t==="*",Ai=(t,e)=>t.trim().split(/\s+/).map(r=>Ni(r,e)).join(" "),Ni=(t,e)=>{let r=e.loose?$[S.TILDELOOSE]:$[S.TILDE];return t.replace(r,(s,i,n,o,a)=>{I("tilde",t,s,i,n,o,a);let c;return R(i)?c="":R(n)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:R(o)?c=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:a?(I("replaceTilde pr",a),c=`>=${i}.${n}.${o}-${a} <${i}.${+n+1}.0-0`):c=`>=${i}.${n}.${o} <${i}.${+n+1}.0-0`,I("tilde return",c),c})},Li=(t,e)=>t.trim().split(/\s+/).map(r=>wi(r,e)).join(" "),wi=(t,e)=>{I("caret",t,e);let r=e.loose?$[S.CARETLOOSE]:$[S.CARET],s=e.includePrerelease?"-0":"";return t.replace(r,(i,n,o,a,c)=>{I("caret",t,i,n,o,a,c);let l;return R(n)?l="":R(o)?l=`>=${n}.0.0${s} <${+n+1}.0.0-0`:R(a)?n==="0"?l=`>=${n}.${o}.0${s} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.0${s} <${+n+1}.0.0-0`:c?(I("replaceCaret pr",c),n==="0"?o==="0"?l=`>=${n}.${o}.${a}-${c} <${n}.${o}.${+a+1}-0`:l=`>=${n}.${o}.${a}-${c} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${a}-${c} <${+n+1}.0.0-0`):(I("no pr"),n==="0"?o==="0"?l=`>=${n}.${o}.${a}${s} <${n}.${o}.${+a+1}-0`:l=`>=${n}.${o}.${a}${s} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${a} <${+n+1}.0.0-0`),I("caret return",l),l})},yi=(t,e)=>(I("replaceXRanges",t,e),t.split(/\s+/).map(r=>vi(r,e)).join(" ")),vi=(t,e)=>{t=t.trim();let r=e.loose?$[S.XRANGELOOSE]:$[S.XRANGE];return t.replace(r,(s,i,n,o,a,c)=>{I("xRange",t,s,i,n,o,a,c);let l=R(n),u=l||R(o),d=u||R(a),g=d;return i==="="&&g&&(i=""),c=e.includePrerelease?"-0":"",l?i===">"||i==="<"?s="<0.0.0-0":s="*":i&&g?(u&&(o=0),a=0,i===">"?(i=">=",u?(n=+n+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",u?n=+n+1:o=+o+1),i==="<"&&(c="-0"),s=`${i+n}.${o}.${a}${c}`):u?s=`>=${n}.0.0${c} <${+n+1}.0.0-0`:d&&(s=`>=${n}.${o}.0${c} <${n}.${+o+1}.0-0`),I("xRange return",s),s})},Ti=(t,e)=>(I("replaceStars",t,e),t.trim().replace($[S.STAR],"")),Oi=(t,e)=>(I("replaceGTE0",t,e),t.trim().replace($[e.includePrerelease?S.GTE0PRE:S.GTE0],"")),Ci=t=>(e,r,s,i,n,o,a,c,l,u,d,g)=>(R(s)?r="":R(i)?r=`>=${s}.0.0${t?"-0":""}`:R(n)?r=`>=${s}.${i}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,R(l)?c="":R(u)?c=`<${+l+1}.0.0-0`:R(d)?c=`<${l}.${+u+1}.0-0`:g?c=`<=${l}.${u}.${d}-${g}`:t?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),bi=(t,e,r)=>{for(let s=0;s<t.length;s++)if(!t[s].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let s=0;s<t.length;s++)if(I(t[s].semver),t[s].semver!==xe.ANY&&t[s].semver.prerelease.length>0){let i=t[s].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var X=h((ra,Bt)=>{"use strict";var H=Symbol("SemVer ANY"),Re=class t{static get ANY(){return H}constructor(e,r){if(r=kt(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),$e("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===H?this.value="":this.value=this.operator+this.semver.version,$e("comp",this)}parse(e){let r=this.options.loose?jt[Gt.COMPARATORLOOSE]:jt[Gt.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new _t(s[2],this.options.loose):this.semver=H}toString(){return this.value}test(e){if($e("Comparator.test",e,this.options.loose),this.semver===H||e===H)return!0;if(typeof e=="string")try{e=new _t(e,this.options)}catch(r){return!1}return Se(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Ut(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Ut(this.value,r).test(e.semver):(r=kt(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Se(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Se(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Bt.exports=Re;var kt=z(),{safeRe:jt,t:Gt}=P(),Se=Ee(),$e=B(),_t=x(),Ut=N()});var W=h((sa,Mt)=>{"use strict";var Fi=N(),Di=(t,e,r)=>{try{e=new Fi(e,r)}catch(s){return!1}return e.test(t)};Mt.exports=Di});var Ht=h((ia,Xt)=>{"use strict";var Pi=N(),qi=(t,e)=>new Pi(t,e).set.map(r=>r.map(s=>s.value).join(" ").trim().split(" "));Xt.exports=qi});var Yt=h((na,Wt)=>{"use strict";var Vi=x(),ki=N(),ji=(t,e,r)=>{let s=null,i=null,n=null;try{n=new ki(e,r)}catch(o){return null}return t.forEach(o=>{n.test(o)&&(!s||i.compare(o)===-1)&&(s=o,i=new Vi(s,r))}),s};Wt.exports=ji});var Kt=h((oa,zt)=>{"use strict";var Gi=x(),_i=N(),Ui=(t,e,r)=>{let s=null,i=null,n=null;try{n=new _i(e,r)}catch(o){return null}return t.forEach(o=>{n.test(o)&&(!s||i.compare(o)===1)&&(s=o,i=new Gi(s,r))}),s};zt.exports=Ui});var Jt=h((aa,Zt)=>{"use strict";var Ae=x(),Bi=N(),Qt=M(),Mi=(t,e)=>{t=new Bi(t,e);let r=new Ae("0.0.0");if(t.test(r)||(r=new Ae("0.0.0-0"),t.test(r)))return r;r=null;for(let s=0;s<t.set.length;++s){let i=t.set[s],n=null;i.forEach(o=>{let a=new Ae(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!n||Qt(a,n))&&(n=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),n&&(!r||Qt(r,n))&&(r=n)}return r&&t.test(r)?r:null};Zt.exports=Mi});var tr=h((ca,er)=>{"use strict";var Xi=N(),Hi=(t,e)=>{try{return new Xi(t,e).range||"*"}catch(r){return null}};er.exports=Hi});var oe=h((la,nr)=>{"use strict";var Wi=x(),ir=X(),{ANY:Yi}=ir,zi=N(),Ki=W(),rr=M(),sr=te(),Qi=se(),Zi=re(),Ji=(t,e,r,s)=>{t=new Wi(t,s),e=new zi(e,s);let i,n,o,a,c;switch(r){case">":i=rr,n=Qi,o=sr,a=">",c=">=";break;case"<":i=sr,n=Zi,o=rr,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ki(t,e,s))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],d=null,g=null;if(u.forEach(p=>{p.semver===Yi&&(p=new ir(">=0.0.0")),d=d||p,g=g||p,i(p.semver,d.semver,s)?d=p:o(p.semver,g.semver,s)&&(g=p)}),d.operator===a||d.operator===c||(!g.operator||g.operator===a)&&n(t,g.semver))return!1;if(g.operator===c&&o(t,g.semver))return!1}return!0};nr.exports=Ji});var ar=h((ua,or)=>{"use strict";var en=oe(),tn=(t,e,r)=>en(t,e,">",r);or.exports=tn});var lr=h((pa,cr)=>{"use strict";var rn=oe(),sn=(t,e,r)=>rn(t,e,"<",r);cr.exports=sn});var fr=h((fa,pr)=>{"use strict";var ur=N(),nn=(t,e,r)=>(t=new ur(t,r),e=new ur(e,r),t.intersects(e,r));pr.exports=nn});var dr=h((ma,mr)=>{"use strict";var on=W(),an=A();mr.exports=(t,e,r)=>{let s=[],i=null,n=null,o=t.sort((u,d)=>an(u,d,r));for(let u of o)on(u,e,r)?(n=u,i||(i=u)):(n&&s.push([i,n]),n=null,i=null);i&&s.push([i,null]);let a=[];for(let[u,d]of s)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Sr=h((da,xr)=>{"use strict";var hr=N(),Le=X(),{ANY:Ne}=Le,Y=W(),we=A(),cn=(t,e,r={})=>{if(t===e)return!0;t=new hr(t,r),e=new hr(e,r);let s=!1;e:for(let i of t.set){for(let n of e.set){let o=un(i,n,r);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},ln=[new Le(">=0.0.0-0")],Er=[new Le(">=0.0.0")],un=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ne){if(e.length===1&&e[0].semver===Ne)return!0;r.includePrerelease?t=ln:t=Er}if(e.length===1&&e[0].semver===Ne){if(r.includePrerelease)return!0;e=Er}let s=new Set,i,n;for(let p of t)p.operator===">"||p.operator===">="?i=gr(i,p,r):p.operator==="<"||p.operator==="<="?n=Ir(n,p,r):s.add(p.semver);if(s.size>1)return null;let o;if(i&&n){if(o=we(i.semver,n.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||n.operator!=="<="))return null}for(let p of s){if(i&&!Y(p,String(i),r)||n&&!Y(p,String(n),r))return null;for(let b of e)if(!Y(p,String(b),r))return!1;return!0}let a,c,l,u,d=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,g=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&n.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let p of e){if(u=u||p.operator===">"||p.operator===">=",l=l||p.operator==="<"||p.operator==="<=",i){if(g&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===g.major&&p.semver.minor===g.minor&&p.semver.patch===g.patch&&(g=!1),p.operator===">"||p.operator===">="){if(a=gr(i,p,r),a===p&&a!==i)return!1}else if(i.operator===">="&&!Y(i.semver,String(p),r))return!1}if(n){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator==="<"||p.operator==="<="){if(c=Ir(n,p,r),c===p&&c!==n)return!1}else if(n.operator==="<="&&!Y(n.semver,String(p),r))return!1}if(!p.operator&&(n||i)&&o!==0)return!1}return!(i&&l&&!n&&o!==0||n&&u&&!i&&o!==0||g||d)},gr=(t,e,r)=>{if(!t)return e;let s=we(t.semver,e.semver,r);return s>0?t:s<0||e.operator===">"&&t.operator===">="?e:t},Ir=(t,e,r)=>{if(!t)return e;let s=we(t.semver,e.semver,r);return s<0?t:s>0||e.operator==="<"&&t.operator==="<="?e:t};xr.exports=cn});var Nr=h((ha,Ar)=>{"use strict";var ye=P(),$r=U(),pn=x(),Rr=pe(),fn=F(),mn=Ye(),dn=Ke(),hn=Je(),En=rt(),gn=it(),In=ot(),xn=ct(),Sn=ut(),$n=A(),Rn=dt(),An=Et(),Nn=ee(),Ln=St(),wn=Rt(),yn=M(),vn=te(),Tn=de(),On=he(),Cn=re(),bn=se(),Fn=Ee(),Dn=Ct(),Pn=X(),qn=N(),Vn=W(),kn=Ht(),jn=Yt(),Gn=Kt(),_n=Jt(),Un=tr(),Bn=oe(),Mn=ar(),Xn=lr(),Hn=fr(),Wn=dr(),Yn=Sr();Ar.exports={parse:fn,valid:mn,clean:dn,inc:hn,diff:En,major:gn,minor:In,patch:xn,prerelease:Sn,compare:$n,rcompare:Rn,compareLoose:An,compareBuild:Nn,sort:Ln,rsort:wn,gt:yn,lt:vn,eq:Tn,neq:On,gte:Cn,lte:bn,cmp:Fn,coerce:Dn,Comparator:Pn,Range:qn,satisfies:Vn,toComparators:kn,maxSatisfying:jn,minSatisfying:Gn,minVersion:_n,validRange:Un,outside:Bn,gtr:Mn,ltr:Xn,intersects:Hn,simplifyRange:Wn,subset:Yn,SemVer:pn,re:ye.re,src:ye.src,tokens:ye.t,SEMVER_SPEC_VERSION:$r.SEMVER_SPEC_VERSION,RELEASE_TYPES:$r.RELEASE_TYPES,compareIdentifiers:Rr.compareIdentifiers,rcompareIdentifiers:Rr.rcompareIdentifiers}});var No={};Kr(No,{ngUpdate:()=>Ao});module.exports=Zr(No);var Ur=require("@angular-devkit/schematics/tasks");var ve=require("@angular-devkit/schematics"),V=Qr(Nr());var Lr=t=>JSON.stringify(t,null,2),ae=(t,e,r)=>{t.exists(e)?t.overwrite(e,r):t.create(e,r)};function Te(t,e){try{return JSON.parse(e.read(t).toString())}catch(r){throw new ve.SchematicsException(`Error when parsing ${t}: ${r.message}`)}}var q="^12.18.0",wr=(t,e)=>{var n;if(!t.exists("package.json"))throw new ve.SchematicsException("Could not locate package.json");let r=Te("package.json",t),s=["dependencies","devDependencies"].filter(o=>{var a;return typeof((a=r[o])==null?void 0:a.firebase)=="string"});if(s.length===0)return(n=r.dependencies)!=null||(r.dependencies={}),r.dependencies.firebase=q,e.logger.info(`Added firebase ${q} to your package.json.`),ae(t,"package.json",Lr(r)),!0;let i=!1;for(let o of s){let a=r[o].firebase,c;try{c=(0,V.subset)(a,q)}catch(l){e.logger.warn(`\u26A0\uFE0F The firebase version in your package.json (${a}) is not a semver range, so it was left as-is; make sure it resolves inside ${q}, the range @angular/fire requires; a version outside it can leave the install with two copies of the firebase SDK.`);continue}c||(r[o].firebase=q,e.logger.info(`Updated the firebase version in your package.json from ${a} to ${q}, the range @angular/fire requires; a workspace range outside it can leave the install with a second copy of the firebase SDK, which fails at runtime.`),i=!0)}return i&&ae(t,"package.json",Lr(r)),i};var kr=require("path");var yr=require("path"),vr=()=>{if(typeof require!="function")return;let t=[()=>require("typescript"),()=>require("module").createRequire((0,yr.join)(process.cwd(),"package.json"))("typescript")];for(let e of t)try{return e()}catch(r){}};var k=(t,e,r)=>{let s=[e];for(;s.length>0;){let i=s.pop();if(!i||r(i)===!1)continue;let n=[];t.forEachChild(i,o=>{n.push(o)});for(let o=n.length-1;o>=0;o--)s.push(n[o])}};var O={"@angular/fire/vertexai":"@angular/fire/ai","@angular/fire/vertexai-preview":"@angular/fire/ai","firebase/vertexai":"firebase/ai","firebase/vertexai-preview":"firebase/ai"},y={provideVertexAI:"provideAI",VertexAI:"AI",VertexAIError:"AIError",VertexAIErrorCode:"AIErrorCode",VertexAIModel:"AIModel",VertexAIInstances:"AIInstances",vertexAIInstance$:"AIInstance$",VertexAIModule:"AIModule"},j={VertexAIOptions:"the new AIOptions takes a backend instead of a location, rebuild the options by hand",getImagenModel:"the Imagen models were shut down in August 2026 and firebase 12.18 removed the API, move image generation to the Gemini image models through getGenerativeModel"},C="getVertexAI",D="getAI",L="AgentPlatformBackend";var Tr=new Set([...Object.keys(O),...Object.values(O)]);var Or=(t,e)=>{let{sourceFile:r}=t,s={edits:[],renamedLocalBindings:new Map,namespaceBindings:new Set,editedSpecifierTokenStarts:new Set,vertexImports:[],vertexExportSpecifiers:[],shadowedImports:[],starExportPositions:[],removedSymbols:[]};for(let i of r.statements)zn(i,t,s,e);return s},zn=(t,e,r,s)=>{var d;let{compiler:i,sourceFile:n}=e,o=i.isImportDeclaration(t),a=i.isExportDeclaration(t);if(!o&&!a)return;let c=t.moduleSpecifier,l=c&&i.isStringLiteral(c)&&O[c.text];if(!l)return;if(a&&(!t.exportClause||i.isNamespaceExport(t.exportClause))){r.starExportPositions.push(t.getStart(n));return}r.edits.push({start:c.getStart(n)+1,end:c.getEnd()-1,replacement:l});let u=o?(d=t.importClause)==null?void 0:d.namedBindings:t.exportClause;if(u&&i.isNamespaceImport(u)){s.has(u.name.text)?r.shadowedImports.push({position:u.getStart(n),name:u.name.text}):r.namespaceBindings.add(u.name.text);return}if(u&&(i.isNamedImports(u)||i.isNamedExports(u)))for(let g of u.elements)Kn(g,t,e,r,s)},Kn=(t,e,r,s,i)=>{var u;let{compiler:n,sourceFile:o}=r,a=(u=t.propertyName)!=null?u:t.name;if(n.isImportSpecifier(t)&&i.has(t.name.text)){s.shadowedImports.push({position:t.getStart(o),name:t.name.text});return}if(a.text===C){n.isImportSpecifier(t)&&n.isImportDeclaration(e)?s.vertexImports.push({element:t,statement:e,localName:t.name.text}):n.isExportSpecifier(t)&&s.vertexExportSpecifiers.push(t);return}if(j[a.text]!==void 0){s.removedSymbols.push({position:a.getStart(o),name:a.text});return}let c=y[a.text];if(!c)return;let l=n.isExportSpecifier(t)&&!t.propertyName;s.edits.push({start:a.getStart(o),end:a.getEnd(),replacement:l?`${c} as ${a.text}`:c}),s.editedSpecifierTokenStarts.add(a.getStart(o)),n.isImportSpecifier(t)&&!t.propertyName&&s.renamedLocalBindings.set(t.name.text,c)},Cr=(t,e,r,s)=>{let{compiler:i,sourceFile:n}=t,o={renamedNames:new Set(e.renamedLocalBindings.keys()),namespaceNames:e.namespaceBindings,vertexNames:new Set(r.keys())};k(i,n,a=>{let c=io(a,e.namespaceBindings,t);c&&e.edits.push(c);let l=Qn(a,e.namespaceBindings,t);if(l&&e.removedSymbols.push(l),Zn(a,e.namespaceBindings,t,s,o),i.isIdentifier(a)){Jn(a,r,t,s,o);let u=no(a,e,t);u&&e.edits.push(u)}})},Qn=(t,e,r)=>{let{compiler:s,sourceFile:i}=r;if(s.isPropertyAccessExpression(t)&&s.isIdentifier(t.expression)&&e.has(t.expression.text)&&j[t.name.text]!==void 0)return{position:t.name.getStart(i),name:t.name.text};if(s.isQualifiedName(t)&&s.isIdentifier(t.left)&&e.has(t.left.text)&&j[t.right.text]!==void 0)return{position:t.right.getStart(i),name:t.right.text}},Zn=(t,e,r,s,i)=>{let{compiler:n,sourceFile:o}=r;if(!n.isPropertyAccessExpression(t)||!n.isIdentifier(t.expression)||!e.has(t.expression.text)||t.name.text!==C)return;let a=t.parent;if(n.isCallExpression(a)&&a.expression===t){br(a,{namespaceAccess:t},r,s,"namespace",i);return}s.unsupported.push({position:t.getStart(o),reason:`a use of ${t.expression.text}.getVertexAI that is not a direct call`,origin:"namespace"})},Jn=(t,e,r,s,i)=>{let{compiler:n,sourceFile:o}=r,a=e.get(t.text);if(!a||Oe(r,t))return;let c=t.parent;if(n.isCallExpression(c)&&c.expression===t){br(c,{binding:a},r,s,"binding",i);return}s.unsupported.push({position:t.getStart(o),reason:n.isExportSpecifier(c)?"a re-export of getVertexAI (rewriting it to getAI would silently change its callers' backend)":"a use of getVertexAI that is not a direct call (only direct calls can be rewritten safely)",origin:"binding"})},eo=(t,e,r)=>{let{compiler:s}=e;if(Oe(e,t))return!1;if(r.renamedNames.has(t.text)||r.vertexNames.has(t.text))return!0;if(!r.namespaceNames.has(t.text))return!1;let i=t.parent;return s.isPropertyAccessExpression(i)&&i.expression===t?y[i.name.text]!==void 0||i.name.text===C:s.isQualifiedName(i)&&i.left===t?y[i.right.text]!==void 0:!1},to=(t,e,r)=>{let{compiler:s}=e,i=!1;return k(s,t,n=>{if(i)return!1;if(s.isIdentifier(n)&&eo(n,e,r))return i=!0,!1}),i},ro=(t,e,r)=>{let{compiler:s,sourceFile:i}=e;if(!s.isObjectLiteralExpression(t))return{supported:!1};if(to(t,e,r))return{supported:!1,conflicting:!0};if(t.properties.length===0)return{supported:!0};let n=t.properties.length===1?t.properties[0]:void 0;return n&&s.isPropertyAssignment(n)&&s.isIdentifier(n.name)&&n.name.text==="location"?{supported:!0,locationText:n.initializer.getText(i),locationFallback:so(n.initializer,e)}:n&&s.isShorthandPropertyAssignment(n)&&n.name.text==="location"?{supported:!0,locationText:"location",locationFallback:"possible"}:{supported:!1}},so=(t,{compiler:e})=>e.isStringLiteral(t)||e.isNoSubstitutionTemplateLiteral(t)?t.text===""?"certain":void 0:e.isIdentifier(t)&&t.text==="undefined"?"certain":"possible",br=(t,e,r,s,i,n)=>{let{compiler:o,sourceFile:a}=r,c=t.arguments,l=c.some(o.isSpreadElement);if(c.length<=1&&!l){s.supportedCalls.push(ce({call:t},e));return}let u=!1;if(c.length===2&&!l){let d=ro(c[1],r,n);if(d.supported){s.supportedCalls.push(De(ce({call:t},e),{locationText:d.locationText,locationFallback:d.locationFallback}));return}u=d.conflicting===!0}s.unsupported.push({position:t.getStart(a),reason:u?"a getVertexAI call whose options mention other symbols this migration rewrites (replacing both at once would conflict)":"a getVertexAI call whose arguments do not map onto getAI safely (only an optional app argument plus an optional literal `{ location }` object are rewritten)",origin:i})},io=(t,e,r)=>{let{compiler:s,sourceFile:i}=r;if(s.isPropertyAccessExpression(t)&&s.isIdentifier(t.expression)&&e.has(t.expression.text)&&y[t.name.text])return{start:t.name.getStart(i),end:t.name.getEnd(),replacement:y[t.name.text]};if(s.isQualifiedName(t)&&s.isIdentifier(t.left)&&e.has(t.left.text)&&y[t.right.text])return{start:t.right.getStart(i),end:t.right.getEnd(),replacement:y[t.right.text]}},no=(t,e,r)=>{let{compiler:s,sourceFile:i}=r,n=e.renamedLocalBindings.get(t.text);if(n===void 0)return;let o=t.getStart(i);if(e.editedSpecifierTokenStarts.has(o)||Oe(r,t))return;let a=t.parent;if(s.isExportSpecifier(a)&&a.name===t&&!a.propertyName){let c=a.parent.parent;return s.isExportDeclaration(c)&&!c.moduleSpecifier?{start:o,end:t.getEnd(),replacement:`${n} as ${t.text}`}:void 0}return s.isShorthandPropertyAssignment(a)&&a.name===t?{start:t.getEnd(),end:t.getEnd(),replacement:`: ${n}`}:{start:o,end:t.getEnd(),replacement:n}},Oe=(t,e)=>{let{compiler:r}=t,s=e.parent;return r.isImportSpecifier(s)&&(s.propertyName===e||s.name===e)||r.isBindingElement(s)&&(s.propertyName===e||s.name===e&&!s.propertyName)?!0:oo(t,e,s)},oo=(t,e,r)=>{let{compiler:s}=t,i=s.isPropertyAccessExpression(r)&&r.name===e||s.isQualifiedName(r)&&r.right===e,n=(s.isPropertyAssignment(r)||s.isPropertyDeclaration(r)||s.isPropertySignature(r)||s.isMethodDeclaration(r)||s.isGetAccessorDeclaration(r)||s.isSetAccessorDeclaration(r)||s.isEnumMember(r))&&r.name===e;return i||n};var ao=t=>{let{compiler:e,sourceFile:r}=t,s=new Set;for(let i of r.statements)(e.isImportDeclaration(i)||e.isExportDeclaration(i))&&i.moduleSpecifier&&e.isStringLiteral(i.moduleSpecifier)&&O[i.moduleSpecifier.text]&&s.add(i);return s},co=(t,e)=>{var i,n;let{compiler:r}=t,s=new Set;for(let o of e){if(!r.isImportDeclaration(o))continue;let a=(i=o.importClause)==null?void 0:i.namedBindings;if(a){if(r.isNamespaceImport(a)){s.add(a.name.text);continue}for(let c of a.elements){let l=((n=c.propertyName)!=null?n:c.name).text;(l===C||y[l]&&!c.propertyName)&&s.add(c.name.text)}}}return s},Fr=(t,e)=>{let{compiler:r}=t;if((r.isVariableDeclaration(e)||r.isParameter(e)||r.isBindingElement(e))&&r.isIdentifier(e.name)||(r.isFunctionDeclaration(e)||r.isFunctionExpression(e)||r.isClassDeclaration(e)||r.isClassExpression(e)||r.isInterfaceDeclaration(e)||r.isTypeAliasDeclaration(e)||r.isEnumDeclaration(e))&&e.name||r.isTypeParameterDeclaration(e)||r.isImportSpecifier(e)||r.isNamespaceImport(e)||r.isImportClause(e)&&e.name)return e.name.text},lo=(t,e)=>{let{compiler:r}=t;if(!r.isImportSpecifier(e)||e.propertyName)return!1;let s=e;for(;s&&!r.isImportDeclaration(s);)s=s.parent;return!s||!r.isImportDeclaration(s)?!1:r.isStringLiteral(s.moduleSpecifier)&&Tr.has(s.moduleSpecifier.text)},Dr=t=>{let{compiler:e,sourceFile:r}=t,s=ao(t),i=co(t,s),n=new Set;return i.size===0||k(e,r,o=>{if(s.has(o))return!1;let a=Fr(t,o);a&&i.has(a)&&n.add(a)}),n},Pr=t=>{let{compiler:e,sourceFile:r}=t,s=[];return k(e,r,i=>{let n=Fr(t,i);(n===D||n===L)&&!lo(t,i)&&s.push({position:i.getStart(r),name:n})}),s};var qr=(t,e,r,s)=>{let{sourceFile:i}=t,n=[],o=[],a=[],c=[],l=[],u=s.length>0&&e.vertexImports.length>0,d=r.unsupported.some(p=>p.origin==="binding")||u,g=new Set;for(let p of r.supportedCalls){if(p.binding&&d){l.push(p.call.getStart(i));continue}let b=p.namespaceAccess?`${p.namespaceAccess.expression.getText(i)}.${L}`:L;if(p.binding&&(g.add(p.binding.statement),p.binding.localName===C)){let T=p.call.expression;n.push({start:T.getStart(i),end:T.getEnd(),replacement:D})}if(p.namespaceAccess){let T=p.namespaceAccess.name;n.push({start:T.getStart(i),end:T.getEnd(),replacement:D})}n.push(...po(p,t,b)),o.push(p.call.getStart(i));let G={position:p.call.getStart(i),backendReference:b};p.locationText===void 0||p.locationFallback==="certain"?a.push(G):p.locationFallback==="possible"&&c.push(G)}if(!d){let p=uo(t),b=p.has(L);for(let G of e.vertexImports){let T=g.has(G.statement)&&!b;n.push(...fo(G,T,p.has(D),t)),T&&(b=!0)}}return{edits:n,callPositions:o,defaultedLocations:a,conditionalLocations:c,blockedCallPositions:l,injectionBlocked:u}},uo=t=>{let{compiler:e,sourceFile:r}=t,s=new Set;for(let i of r.statements){if(!e.isImportDeclaration(i)||!i.importClause)continue;i.importClause.name&&s.add(i.importClause.name.text);let n=i.importClause.namedBindings;if(n)if(e.isNamespaceImport(n))s.add(n.name.text);else for(let o of n.elements)s.add(o.name.text)}return s},po=(t,e,r)=>{var c;let{sourceFile:s}=e,i=t.locationFallback==="certain"?"":(c=t.locationText)!=null?c:"",n=`{ backend: new ${r}(${i}) }`,o=t.call.arguments;if(o.length===0)return[{start:t.call.getEnd()-1,end:t.call.getEnd()-1,replacement:`undefined, ${n}`}];if(o.length===1){let l=o[0];return[{start:l.getEnd(),end:l.getEnd(),replacement:`, ${n}`}]}let a=o[1];return[{start:a.getStart(s),end:a.getEnd(),replacement:n}]},fo=(t,e,r,s)=>{var d,g;let{compiler:i,sourceFile:n}=s,o=[],a=(d=t.statement.importClause)==null?void 0:d.namedBindings;if(!a||!i.isNamedImports(a))return o;let c=a.elements,l=t.element,u=(g=l.propertyName)!=null?g:l.name;if(!l.propertyName&&r){if(e)return[{start:l.getStart(n),end:l.getEnd(),replacement:L}];if(c.length===1)return[{start:l.getStart(n),end:l.getEnd(),replacement:""}];let p=c.indexOf(l);return p>0?[{start:c[p-1].getEnd(),end:l.getEnd(),replacement:""}]:[{start:l.getStart(n),end:c[1].getStart(n),replacement:""}]}return o.push({start:u.getStart(n),end:u.getEnd(),replacement:D}),e&&o.push({start:l.getEnd(),end:l.getEnd(),replacement:`, ${L}`}),o};var v="see the AngularFire v21 upgrade guide (docs/version-21-upgrade.md)",mo=["getLiveGenerativeModel","startAudioConversation"],jr="This workspace calls the Live API, which Firebase does not support in the global location, so leaving this on global stops getLiveGenerativeModel and startAudioConversation from working. ",ho=(t,e)=>e?`Pass a location that supports the Live API to ${t}, ${v}`:`Pass new ${t}('us-central1') to keep the region you had, ${v}`,Eo=t=>{let{sourceFile:e}=t,r=Or(t,Dr(t)),s=new Map;for(let a of r.vertexImports)s.set(a.localName,a);let i={supportedCalls:[],unsupported:[]};(r.renamedLocalBindings.size>0||r.namespaceBindings.size>0||s.size>0)&&Cr(t,r,s,i);for(let a of r.vertexExportSpecifiers)i.unsupported.push({position:a.getStart(e),reason:"a re-export of getVertexAI (rewriting it to getAI would silently change its callers' backend)",origin:"export"});let n=r.vertexImports.length>0?Pr(t):[],o=qr(t,r,i,n);return{edits:r.edits.concat(o.edits),vertexCallPositions:o.callPositions,defaultedLocations:o.defaultedLocations,conditionalLocations:o.conditionalLocations,blockedCallPositions:o.blockedCallPositions,unsupportedVertexUsages:i.unsupported,shadowedImports:r.shadowedImports,injectionConflicts:o.injectionBlocked?n:[],starExportPositions:r.starExportPositions,removedSymbols:r.removedSymbols}},Gr=(t,e,r)=>t.length===0?`this call ${e}`:`this call and ${t.length} other${t.length===1?"":"s"} in this file ${r}`,go=(t,e)=>{let[r,...s]=t.defaultedLocations;return r===void 0?[]:[{level:"warn",position:r.position,text:`${Gr(s,"now passes","now pass")} no location, so the region changed from us-central1 to global. us-central1 was getVertexAI's default and global is ${L}'s. `+(e?jr:"")+ho(r.backendReference,e)}]},Io=(t,e)=>{let[r,...s]=t.conditionalLocations;return r===void 0?[]:[{level:"warn",position:r.position,text:`${Gr(s,"passes","pass")} a location this migration cannot resolve. An empty value used to mean us-central1 and now means global, so the region changes if that expression is ever empty. `+(e?jr:"")+`Check it, ${v}`}]},xo=(t,e)=>[...t.vertexCallPositions.map(r=>({level:"info",position:r,text:`rewrote getVertexAI(...) to getAI(..., { backend: new ${L}(...) }) to keep the call on the Agent Platform Gemini API (formerly Vertex AI)`})),...go(t,e),...Io(t,e),...t.unsupportedVertexUsages.map(r=>({level:"warn",position:r.position,text:`left ${r.reason}. Plain getAI() uses the Gemini Developer API backend, NOT Vertex AI. Migrate this site by hand, ${v}`})),...t.shadowedImports.map(r=>({level:"warn",position:r.position,text:`left the \`${r.name}\` import name and its usages unrenamed: this file also declares a local named \`${r.name}\`, and name-based rewriting cannot tell the two apart. The import path itself still moves to the new entry point, so the leftover name fails to compile there. Migrate this file by hand, ${v}`})),...t.injectionConflicts.map(r=>({level:"warn",position:r.position,text:`\`${r.name}\` is already bound here from a source other than AI Logic, so the backend-preserving rewrite cannot inject or reuse it. The file's getVertexAI code was left as is, and its import path still moves to the new entry point, so the leftover getVertexAI fails to compile there. Migrate it by hand, ${v}`})),...t.blockedCallPositions.map(r=>({level:"warn",position:r,text:t.injectionConflicts.length>0?`left a rewritable getVertexAI call unrewritten because this file binds getAI or ${L} from another source (see that warning). Every use of the file's named getVertexAI imports is kept together so the pieces stay consistent, migrate them by hand`:"left a rewritable getVertexAI call unrewritten because another getVertexAI use in this file cannot be rewritten (see its own warning). Every use of the file's named getVertexAI imports is kept together so the pieces stay consistent, migrate them by hand"})),...t.starExportPositions.map(r=>({level:"warn",position:r,text:`left \`export *\` from an old Vertex AI entry point unmigrated: rewriting it would silently rename this file's re-exported public symbols. Re-export what you need by name from '@angular/fire/ai' instead, ${v}`})),...t.removedSymbols.map(r=>({level:"warn",position:r.position,text:`left \`${r.name}\`, which no longer exists in the new entry point (${j[r.name]}). The leftover name fails to compile, migrate it by hand, ${v}`}))],So=(t,e,r,s,i,n)=>{let o={compiler:r,sourceFile:r.createSourceFile(s,i,r.ScriptTarget.Latest,!0)},a=o.sourceFile;if(a.parseDiagnostics&&a.parseDiagnostics.length>0)return e.logger.warn(`${s}: skipped, the file has syntax errors, so the Vertex AI -> AI Logic rewrite cannot run on it safely. Fix the syntax and re-run ng update, or migrate it by hand, ${v}`),!1;let c=Eo(o);for(let u of xo(c,n)){let d=o.sourceFile.getLineAndCharacterOfPosition(u.position).line+1;e.logger[u.level](`${s}:${d}: ${u.text}`)}if(c.edits.length===0)return!1;let l;try{l=$o(i,c.edits)}catch(u){return e.logger.warn(`${s}: the Vertex AI -> AI Logic rewrite was skipped for this file (${u}). Migrate it by hand, ${v}`),!1}return l===i?!1:(ae(t,s,l),!0)},$o=(t,e)=>{let r=e.slice().sort((s,i)=>i.start-s.start||i.end-s.end);for(let s=1;s<r.length;s++)if(r[s].end>r[s-1].start)throw new Error(`conflicting rewrite edits at offsets ${r[s].start} and ${r[s-1].start}`);return r.reduce((s,i)=>s.slice(0,i.start)+i.replacement+s.slice(i.end),t)},Ro=t=>Object.values(t.projects).map(e=>(e==null?void 0:e.sourceRoot)||(e==null?void 0:e.root)).filter(e=>typeof e=="string").map(e=>{let r=kr.posix.join("/",e);return r==="/"?r:r.replace(/\/+$/,"")}),Vr=(t,e)=>t.endsWith(".ts")&&!t.endsWith(".d.ts")&&!t.split("/").includes("node_modules")&&e.some(r=>r==="/"||t===r||t.startsWith(r+"/")),_r=(t,e,r)=>{let s=r!=null?r:vr(),i=t.exists("angular.json")&&Te("angular.json",t);if(!(i!=null&&i.projects))return!1;let n=Ro(i);if(n.length===0)return!1;let o=!1;t.visit(c=>{var u;if(o||!Vr(c,n))return;let l=(u=t.read(c))==null?void 0:u.toString();o||(o=l!==void 0&&mo.some(d=>l.includes(d)))});let a=!1;return t.visit(c=>{var u;if(!Vr(c,n))return;let l=(u=t.read(c))==null?void 0:u.toString();if(!(!l||!Object.keys(O).some(d=>l.includes(d)))){if(!s){e.logger.warn(`${c} imports a removed Vertex AI entry point, but the Vertex AI -> AI Logic rewrite was skipped: the \`typescript\` package could not be resolved (it is an optional peer dependency of @angular/fire). Install typescript and re-run, or migrate by hand - see the v21 upgrade guide (docs/version-21-upgrade.md).`);return}a=So(t,e,s,c,l,o)||a}}),a};var Ao=t=>(e,r)=>{wr(e,r)&&r.addTask(new Ur.NodePackageInstallTask);try{_r(e,r,t==null?void 0:t.compiler)}catch(s){r.logger.warn(`Skipped the Vertex AI -> AI Logic source rewrite: ${s}. Any remaining @angular/fire/vertexai imports need a manual migration - see the v21 upgrade guide (docs/version-21-upgrade.md).`)}return e};0&&(module.exports={ngUpdate});