@purr-core/services.firebase 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Bg9DBNtp.cjs");exports.addDocument=e.addDocument;exports.deleteDocument=e.deleteDocument;exports.getAllDocuments=e.getAllDocuments;exports.getDocumentById=e.getDocumentById;exports.getFireStorage=e.getFireStorage;exports.getFireStore=e.getFireStore;exports.initFirebaseApp=e.initFirebaseApp;exports.setDocument=e.setDocument;
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './_api';
2
- export * from './_init';
3
- export * from './_types';
@@ -1,400 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-Bg9DBNtp.cjs");/**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */const ge="firebasestorage.googleapis.com",me="storageBucket",$e=2*60*1e3,je=10*60*1e3,ze=1e3;/**
17
- * @license
18
- * Copyright 2017 Google LLC
19
- *
20
- * Licensed under the Apache License, Version 2.0 (the "License");
21
- * you may not use this file except in compliance with the License.
22
- * You may obtain a copy of the License at
23
- *
24
- * http://www.apache.org/licenses/LICENSE-2.0
25
- *
26
- * Unless required by applicable law or agreed to in writing, software
27
- * distributed under the License is distributed on an "AS IS" BASIS,
28
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
- * See the License for the specific language governing permissions and
30
- * limitations under the License.
31
- */class h extends d.FirebaseError{constructor(e,n,s=0){super(Z(e),`Firebase Storage: ${n} (${Z(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,h.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Z(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
32
- ${this.customData.serverResponse}`:this.message=this._baseMessage}}exports.StorageErrorCode=void 0;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(exports.StorageErrorCode||(exports.StorageErrorCode={}));function Z(t){return"storage/"+t}function te(){const t="An unknown error occurred, please check the error payload for server response.";return new h(exports.StorageErrorCode.UNKNOWN,t)}function Xe(t){return new h(exports.StorageErrorCode.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function Ge(t){return new h(exports.StorageErrorCode.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function We(){const t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new h(exports.StorageErrorCode.UNAUTHENTICATED,t)}function Ve(){return new h(exports.StorageErrorCode.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function Ke(t){return new h(exports.StorageErrorCode.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function be(){return new h(exports.StorageErrorCode.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Re(){return new h(exports.StorageErrorCode.CANCELED,"User canceled the upload/download.")}function Ye(t){return new h(exports.StorageErrorCode.INVALID_URL,"Invalid URL '"+t+"'.")}function Ze(t){return new h(exports.StorageErrorCode.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function Je(){return new h(exports.StorageErrorCode.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+me+"' property when initializing the app?")}function Te(){return new h(exports.StorageErrorCode.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function Qe(){return new h(exports.StorageErrorCode.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function et(){return new h(exports.StorageErrorCode.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function tt(t){return new h(exports.StorageErrorCode.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function X(t){return new h(exports.StorageErrorCode.INVALID_ARGUMENT,t)}function Ee(){return new h(exports.StorageErrorCode.APP_DELETED,"The Firebase app was deleted.")}function ke(t){return new h(exports.StorageErrorCode.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function F(t,e){return new h(exports.StorageErrorCode.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function q(t){throw new h(exports.StorageErrorCode.INTERNAL_ERROR,"Internal error: "+t)}/**
33
- * @license
34
- * Copyright 2017 Google LLC
35
- *
36
- * Licensed under the Apache License, Version 2.0 (the "License");
37
- * you may not use this file except in compliance with the License.
38
- * You may obtain a copy of the License at
39
- *
40
- * http://www.apache.org/licenses/LICENSE-2.0
41
- *
42
- * Unless required by applicable law or agreed to in writing, software
43
- * distributed under the License is distributed on an "AS IS" BASIS,
44
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45
- * See the License for the specific language governing permissions and
46
- * limitations under the License.
47
- */class T{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let s;try{s=T.makeFromUrl(e,n)}catch{return new T(e,"")}if(s.path==="")return s;throw Ze(e)}static makeFromUrl(e,n){let s=null;const r="([A-Za-z0-9.\\-_]+)";function o(b){b.path.charAt(b.path.length-1)==="/"&&(b.path_=b.path_.slice(0,-1))}const i="(/(.*))?$",u=new RegExp("^gs://"+r+i,"i"),a={bucket:1,path:3};function l(b){b.path_=decodeURIComponent(b.path)}const c="v[A-Za-z0-9_]+",f=n.replace(/[.]/g,"\\."),p="(/([^?#]*).*)?$",g=new RegExp(`^https?://${f}/${c}/b/${r}/o${p}`,"i"),m={bucket:1,path:3},w=n===ge?"(?:storage.googleapis.com|storage.cloud.google.com)":n,_="([^?#]*)",O=new RegExp(`^https?://${w}/${r}/${_}`,"i"),R=[{regex:u,indices:a,postModify:o},{regex:g,indices:m,postModify:l},{regex:O,indices:{bucket:1,path:2},postModify:l}];for(let b=0;b<R.length;b++){const v=R[b],D=v.regex.exec(e);if(D){const K=D[v.indices.bucket];let B=D[v.indices.path];B||(B=""),s=new T(K,B),v.postModify(s);break}}if(s==null)throw Ye(e);return s}}class nt{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}/**
48
- * @license
49
- * Copyright 2017 Google LLC
50
- *
51
- * Licensed under the Apache License, Version 2.0 (the "License");
52
- * you may not use this file except in compliance with the License.
53
- * You may obtain a copy of the License at
54
- *
55
- * http://www.apache.org/licenses/LICENSE-2.0
56
- *
57
- * Unless required by applicable law or agreed to in writing, software
58
- * distributed under the License is distributed on an "AS IS" BASIS,
59
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
60
- * See the License for the specific language governing permissions and
61
- * limitations under the License.
62
- */function st(t,e,n){let s=1,r=null,o=null,i=!1,u=0;function a(){return u===2}let l=!1;function c(..._){l||(l=!0,e.apply(null,_))}function f(_){r=setTimeout(()=>{r=null,t(g,a())},_)}function p(){o&&clearTimeout(o)}function g(_,...O){if(l){p();return}if(_){p(),c.call(null,_,...O);return}if(a()||i){p(),c.call(null,_,...O);return}s<64&&(s*=2);let R;u===1?(u=2,R=0):R=(s+Math.random())*1e3,f(R)}let m=!1;function w(_){m||(m=!0,p(),!l&&(r!==null?(_||(u=2),clearTimeout(r),f(0)):_||(u=1)))}return f(0),o=setTimeout(()=>{i=!0,w(!0)},n),w}function rt(t){t(!1)}/**
63
- * @license
64
- * Copyright 2017 Google LLC
65
- *
66
- * Licensed under the Apache License, Version 2.0 (the "License");
67
- * you may not use this file except in compliance with the License.
68
- * You may obtain a copy of the License at
69
- *
70
- * http://www.apache.org/licenses/LICENSE-2.0
71
- *
72
- * Unless required by applicable law or agreed to in writing, software
73
- * distributed under the License is distributed on an "AS IS" BASIS,
74
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75
- * See the License for the specific language governing permissions and
76
- * limitations under the License.
77
- */function ot(t){return t!==void 0}function it(t){return typeof t=="function"}function at(t){return typeof t=="object"&&!Array.isArray(t)}function W(t){return typeof t=="string"||t instanceof String}function le(t){return ne()&&t instanceof Blob}function ne(){return typeof Blob<"u"}function ee(t,e,n,s){if(s<e)throw X(`Invalid value for '${t}'. Expected ${e} or greater.`);if(s>n)throw X(`Invalid value for '${t}'. Expected ${n} or less.`)}/**
78
- * @license
79
- * Copyright 2017 Google LLC
80
- *
81
- * Licensed under the Apache License, Version 2.0 (the "License");
82
- * you may not use this file except in compliance with the License.
83
- * You may obtain a copy of the License at
84
- *
85
- * http://www.apache.org/licenses/LICENSE-2.0
86
- *
87
- * Unless required by applicable law or agreed to in writing, software
88
- * distributed under the License is distributed on an "AS IS" BASIS,
89
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90
- * See the License for the specific language governing permissions and
91
- * limitations under the License.
92
- */function P(t,e,n){let s=e;return n==null&&(s=`https://${e}`),`${n}://${s}/v0${t}`}function we(t){const e=encodeURIComponent;let n="?";for(const s in t)if(t.hasOwnProperty(s)){const r=e(s)+"="+e(t[s]);n=n+r+"&"}return n=n.slice(0,-1),n}var x;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(x||(x={}));/**
93
- * @license
94
- * Copyright 2022 Google LLC
95
- *
96
- * Licensed under the Apache License, Version 2.0 (the "License");
97
- * you may not use this file except in compliance with the License.
98
- * You may obtain a copy of the License at
99
- *
100
- * http://www.apache.org/licenses/LICENSE-2.0
101
- *
102
- * Unless required by applicable law or agreed to in writing, software
103
- * distributed under the License is distributed on an "AS IS" BASIS,
104
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105
- * See the License for the specific language governing permissions and
106
- * limitations under the License.
107
- */function ye(t,e){const n=t>=500&&t<600,r=[408,429].indexOf(t)!==-1,o=e.indexOf(t)!==-1;return n||r||o}/**
108
- * @license
109
- * Copyright 2017 Google LLC
110
- *
111
- * Licensed under the Apache License, Version 2.0 (the "License");
112
- * you may not use this file except in compliance with the License.
113
- * You may obtain a copy of the License at
114
- *
115
- * http://www.apache.org/licenses/LICENSE-2.0
116
- *
117
- * Unless required by applicable law or agreed to in writing, software
118
- * distributed under the License is distributed on an "AS IS" BASIS,
119
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
120
- * See the License for the specific language governing permissions and
121
- * limitations under the License.
122
- */class ut{constructor(e,n,s,r,o,i,u,a,l,c,f,p=!0){this.url_=e,this.method_=n,this.headers_=s,this.body_=r,this.successCodes_=o,this.additionalRetryCodes_=i,this.callback_=u,this.errorCallback_=a,this.timeout_=l,this.progressCallback_=c,this.connectionFactory_=f,this.retry=p,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((g,m)=>{this.resolve_=g,this.reject_=m,this.start_()})}start_(){const e=(s,r)=>{if(r){s(!1,new j(!1,null,!0));return}const o=this.connectionFactory_();this.pendingConnection_=o;const i=u=>{const a=u.loaded,l=u.lengthComputable?u.total:-1;this.progressCallback_!==null&&this.progressCallback_(a,l)};this.progressCallback_!==null&&o.addUploadProgressListener(i),o.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&o.removeUploadProgressListener(i),this.pendingConnection_=null;const u=o.getErrorCode()===x.NO_ERROR,a=o.getStatus();if(!u||ye(a,this.additionalRetryCodes_)&&this.retry){const c=o.getErrorCode()===x.ABORT;s(!1,new j(!1,null,c));return}const l=this.successCodes_.indexOf(a)!==-1;s(!0,new j(l,o))})},n=(s,r)=>{const o=this.resolve_,i=this.reject_,u=r.connection;if(r.wasSuccessCode)try{const a=this.callback_(u,u.getResponse());ot(a)?o(a):o()}catch(a){i(a)}else if(u!==null){const a=te();a.serverResponse=u.getErrorText(),this.errorCallback_?i(this.errorCallback_(u,a)):i(a)}else if(r.canceled){const a=this.appDelete_?Ee():Re();i(a)}else{const a=be();i(a)}};this.canceled_?n(!1,new j(!1,null,!0)):this.backoffId_=st(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&rt(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class j{constructor(e,n,s){this.wasSuccessCode=e,this.connection=n,this.canceled=!!s}}function lt(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function ct(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function ht(t,e){e&&(t["X-Firebase-GMPID"]=e)}function dt(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function ft(t,e,n,s,r,o,i=!0){const u=we(t.urlParams),a=t.url+u,l=Object.assign({},t.headers);return ht(l,e),lt(l,n),ct(l,o),dt(l,s),new ut(a,t.method,l,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r,i)}/**
123
- * @license
124
- * Copyright 2017 Google LLC
125
- *
126
- * Licensed under the Apache License, Version 2.0 (the "License");
127
- * you may not use this file except in compliance with the License.
128
- * You may obtain a copy of the License at
129
- *
130
- * http://www.apache.org/licenses/LICENSE-2.0
131
- *
132
- * Unless required by applicable law or agreed to in writing, software
133
- * distributed under the License is distributed on an "AS IS" BASIS,
134
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135
- * See the License for the specific language governing permissions and
136
- * limitations under the License.
137
- */function _t(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function pt(...t){const e=_t();if(e!==void 0){const n=new e;for(let s=0;s<t.length;s++)n.append(t[s]);return n.getBlob()}else{if(ne())return new Blob(t);throw new h(exports.StorageErrorCode.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function gt(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}/**
138
- * @license
139
- * Copyright 2021 Google LLC
140
- *
141
- * Licensed under the Apache License, Version 2.0 (the "License");
142
- * you may not use this file except in compliance with the License.
143
- * You may obtain a copy of the License at
144
- *
145
- * http://www.apache.org/licenses/LICENSE-2.0
146
- *
147
- * Unless required by applicable law or agreed to in writing, software
148
- * distributed under the License is distributed on an "AS IS" BASIS,
149
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
150
- * See the License for the specific language governing permissions and
151
- * limitations under the License.
152
- */function mt(t){if(typeof atob>"u")throw tt("base-64");return atob(t)}/**
153
- * @license
154
- * Copyright 2017 Google LLC
155
- *
156
- * Licensed under the Apache License, Version 2.0 (the "License");
157
- * you may not use this file except in compliance with the License.
158
- * You may obtain a copy of the License at
159
- *
160
- * http://www.apache.org/licenses/LICENSE-2.0
161
- *
162
- * Unless required by applicable law or agreed to in writing, software
163
- * distributed under the License is distributed on an "AS IS" BASIS,
164
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
165
- * See the License for the specific language governing permissions and
166
- * limitations under the License.
167
- */const y={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class J{constructor(e,n){this.data=e,this.contentType=n||null}}function se(t,e){switch(t){case y.RAW:return new J(Se(e));case y.BASE64:case y.BASE64URL:return new J(Ue(t,e));case y.DATA_URL:return new J(Rt(e),Tt(e))}throw te()}function Se(t){const e=[];for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);if(s<=127)e.push(s);else if(s<=2047)e.push(192|s>>6,128|s&63);else if((s&64512)===55296)if(!(n<t.length-1&&(t.charCodeAt(n+1)&64512)===56320))e.push(239,191,189);else{const o=s,i=t.charCodeAt(++n);s=65536|(o&1023)<<10|i&1023,e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63)}else(s&64512)===56320?e.push(239,191,189):e.push(224|s>>12,128|s>>6&63,128|s&63)}return new Uint8Array(e)}function bt(t){let e;try{e=decodeURIComponent(t)}catch{throw F(y.DATA_URL,"Malformed data URL.")}return Se(e)}function Ue(t,e){switch(t){case y.BASE64:{const r=e.indexOf("-")!==-1,o=e.indexOf("_")!==-1;if(r||o)throw F(t,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case y.BASE64URL:{const r=e.indexOf("+")!==-1,o=e.indexOf("/")!==-1;if(r||o)throw F(t,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=mt(e)}catch(r){throw r.message.includes("polyfill")?r:F(t,"Invalid character found")}const s=new Uint8Array(n.length);for(let r=0;r<n.length;r++)s[r]=n.charCodeAt(r);return s}class Ce{constructor(e){this.base64=!1,this.contentType=null;const n=e.match(/^data:([^,]+)?,/);if(n===null)throw F(y.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const s=n[1]||null;s!=null&&(this.base64=Et(s,";base64"),this.contentType=this.base64?s.substring(0,s.length-7):s),this.rest=e.substring(e.indexOf(",")+1)}}function Rt(t){const e=new Ce(t);return e.base64?Ue(y.BASE64,e.rest):bt(e.rest)}function Tt(t){return new Ce(t).contentType}function Et(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}/**
168
- * @license
169
- * Copyright 2017 Google LLC
170
- *
171
- * Licensed under the Apache License, Version 2.0 (the "License");
172
- * you may not use this file except in compliance with the License.
173
- * You may obtain a copy of the License at
174
- *
175
- * http://www.apache.org/licenses/LICENSE-2.0
176
- *
177
- * Unless required by applicable law or agreed to in writing, software
178
- * distributed under the License is distributed on an "AS IS" BASIS,
179
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
180
- * See the License for the specific language governing permissions and
181
- * limitations under the License.
182
- */class U{constructor(e,n){let s=0,r="";le(e)?(this.data_=e,s=e.size,r=e.type):e instanceof ArrayBuffer?(n?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),s=this.data_.length):e instanceof Uint8Array&&(n?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),s=e.length),this.size_=s,this.type_=r}size(){return this.size_}type(){return this.type_}slice(e,n){if(le(this.data_)){const s=this.data_,r=gt(s,e,n);return r===null?null:new U(r)}else{const s=new Uint8Array(this.data_.buffer,e,n-e);return new U(s,!0)}}static getBlob(...e){if(ne()){const n=e.map(s=>s instanceof U?s.data_:s);return new U(pt.apply(null,n))}else{const n=e.map(i=>W(i)?se(y.RAW,i).data:i.data_);let s=0;n.forEach(i=>{s+=i.byteLength});const r=new Uint8Array(s);let o=0;return n.forEach(i=>{for(let u=0;u<i.length;u++)r[o++]=i[u]}),new U(r,!0)}}uploadData(){return this.data_}}/**
183
- * @license
184
- * Copyright 2017 Google LLC
185
- *
186
- * Licensed under the Apache License, Version 2.0 (the "License");
187
- * you may not use this file except in compliance with the License.
188
- * You may obtain a copy of the License at
189
- *
190
- * http://www.apache.org/licenses/LICENSE-2.0
191
- *
192
- * Unless required by applicable law or agreed to in writing, software
193
- * distributed under the License is distributed on an "AS IS" BASIS,
194
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
195
- * See the License for the specific language governing permissions and
196
- * limitations under the License.
197
- */function re(t){let e;try{e=JSON.parse(t)}catch{return null}return at(e)?e:null}/**
198
- * @license
199
- * Copyright 2017 Google LLC
200
- *
201
- * Licensed under the Apache License, Version 2.0 (the "License");
202
- * you may not use this file except in compliance with the License.
203
- * You may obtain a copy of the License at
204
- *
205
- * http://www.apache.org/licenses/LICENSE-2.0
206
- *
207
- * Unless required by applicable law or agreed to in writing, software
208
- * distributed under the License is distributed on an "AS IS" BASIS,
209
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
210
- * See the License for the specific language governing permissions and
211
- * limitations under the License.
212
- */function kt(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function wt(t,e){const n=e.split("/").filter(s=>s.length>0).join("/");return t.length===0?n:t+"/"+n}function Ie(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/**
213
- * @license
214
- * Copyright 2017 Google LLC
215
- *
216
- * Licensed under the Apache License, Version 2.0 (the "License");
217
- * you may not use this file except in compliance with the License.
218
- * You may obtain a copy of the License at
219
- *
220
- * http://www.apache.org/licenses/LICENSE-2.0
221
- *
222
- * Unless required by applicable law or agreed to in writing, software
223
- * distributed under the License is distributed on an "AS IS" BASIS,
224
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
225
- * See the License for the specific language governing permissions and
226
- * limitations under the License.
227
- */function yt(t,e){return e}class E{constructor(e,n,s,r){this.server=e,this.local=n||e,this.writable=!!s,this.xform=r||yt}}let z=null;function St(t){return!W(t)||t.length<2?t:Ie(t)}function H(){if(z)return z;const t=[];t.push(new E("bucket")),t.push(new E("generation")),t.push(new E("metageneration")),t.push(new E("name","fullPath",!0));function e(o,i){return St(i)}const n=new E("name");n.xform=e,t.push(n);function s(o,i){return i!==void 0?Number(i):i}const r=new E("size");return r.xform=s,t.push(r),t.push(new E("timeCreated")),t.push(new E("updated")),t.push(new E("md5Hash",null,!0)),t.push(new E("cacheControl",null,!0)),t.push(new E("contentDisposition",null,!0)),t.push(new E("contentEncoding",null,!0)),t.push(new E("contentLanguage",null,!0)),t.push(new E("contentType",null,!0)),t.push(new E("metadata","customMetadata",!0)),z=t,z}function Ut(t,e){function n(){const s=t.bucket,r=t.fullPath,o=new T(s,r);return e._makeStorageReference(o)}Object.defineProperty(t,"ref",{get:n})}function Ct(t,e,n){const s={};s.type="file";const r=n.length;for(let o=0;o<r;o++){const i=n[o];s[i.local]=i.xform(s,e[i.server])}return Ut(s,t),s}function Oe(t,e,n){const s=re(e);return s===null?null:Ct(t,s,n)}function It(t,e,n,s){const r=re(e);if(r===null||!W(r.downloadTokens))return null;const o=r.downloadTokens;if(o.length===0)return null;const i=encodeURIComponent;return o.split(",").map(l=>{const c=t.bucket,f=t.fullPath,p="/b/"+i(c)+"/o/"+i(f),g=P(p,n,s),m=we({alt:"media",token:l});return g+m})[0]}function oe(t,e){const n={},s=e.length;for(let r=0;r<s;r++){const o=e[r];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}/**
228
- * @license
229
- * Copyright 2019 Google LLC
230
- *
231
- * Licensed under the Apache License, Version 2.0 (the "License");
232
- * you may not use this file except in compliance with the License.
233
- * You may obtain a copy of the License at
234
- *
235
- * http://www.apache.org/licenses/LICENSE-2.0
236
- *
237
- * Unless required by applicable law or agreed to in writing, software
238
- * distributed under the License is distributed on an "AS IS" BASIS,
239
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
240
- * See the License for the specific language governing permissions and
241
- * limitations under the License.
242
- */const ce="prefixes",he="items";function Ot(t,e,n){const s={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n[ce])for(const r of n[ce]){const o=r.replace(/\/$/,""),i=t._makeStorageReference(new T(e,o));s.prefixes.push(i)}if(n[he])for(const r of n[he]){const o=t._makeStorageReference(new T(e,r.name));s.items.push(o)}return s}function At(t,e,n){const s=re(n);return s===null?null:Ot(t,e,s)}class I{constructor(e,n,s,r){this.url=e,this.method=n,this.handler=s,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
243
- * @license
244
- * Copyright 2017 Google LLC
245
- *
246
- * Licensed under the Apache License, Version 2.0 (the "License");
247
- * you may not use this file except in compliance with the License.
248
- * You may obtain a copy of the License at
249
- *
250
- * http://www.apache.org/licenses/LICENSE-2.0
251
- *
252
- * Unless required by applicable law or agreed to in writing, software
253
- * distributed under the License is distributed on an "AS IS" BASIS,
254
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
255
- * See the License for the specific language governing permissions and
256
- * limitations under the License.
257
- */function C(t){if(!t)throw te()}function V(t,e){function n(s,r){const o=Oe(t,r,e);return C(o!==null),o}return n}function Pt(t,e){function n(s,r){const o=At(t,e,r);return C(o!==null),o}return n}function xt(t,e){function n(s,r){const o=Oe(t,r,e);return C(o!==null),It(o,r,t.host,t._protocol)}return n}function M(t){function e(n,s){let r;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?r=Ve():r=We():n.getStatus()===402?r=Ge(t.bucket):n.getStatus()===403?r=Ke(t.path):r=s,r.status=n.getStatus(),r.serverResponse=s.serverResponse,r}return e}function $(t){const e=M(t);function n(s,r){let o=e(s,r);return s.getStatus()===404&&(o=Xe(t.path)),o.serverResponse=r.serverResponse,o}return n}function Ae(t,e,n){const s=e.fullServerUrl(),r=P(s,t.host,t._protocol),o="GET",i=t.maxOperationRetryTime,u=new I(r,o,V(t,n),i);return u.errorHandler=$(e),u}function Nt(t,e,n,s,r){const o={};e.isRoot?o.prefix="":o.prefix=e.path+"/",n.length>0&&(o.delimiter=n),s&&(o.pageToken=s),r&&(o.maxResults=r);const i=e.bucketOnlyServerUrl(),u=P(i,t.host,t._protocol),a="GET",l=t.maxOperationRetryTime,c=new I(u,a,Pt(t,e.bucket),l);return c.urlParams=o,c.errorHandler=M(e),c}function Pe(t,e,n){const s=e.fullServerUrl(),r=P(s,t.host,t._protocol)+"?alt=media",o="GET",i=t.maxOperationRetryTime,u=new I(r,o,(a,l)=>l,i);return u.errorHandler=$(e),n!==void 0&&(u.headers.Range=`bytes=0-${n}`,u.successCodes=[200,206]),u}function vt(t,e,n){const s=e.fullServerUrl(),r=P(s,t.host,t._protocol),o="GET",i=t.maxOperationRetryTime,u=new I(r,o,xt(t,n),i);return u.errorHandler=$(e),u}function Dt(t,e,n,s){const r=e.fullServerUrl(),o=P(r,t.host,t._protocol),i="PATCH",u=oe(n,s),a={"Content-Type":"application/json; charset=utf-8"},l=t.maxOperationRetryTime,c=new I(o,i,V(t,s),l);return c.headers=a,c.body=u,c.errorHandler=$(e),c}function Lt(t,e){const n=e.fullServerUrl(),s=P(n,t.host,t._protocol),r="DELETE",o=t.maxOperationRetryTime;function i(a,l){}const u=new I(s,r,i,o);return u.successCodes=[200,204],u.errorHandler=$(e),u}function Mt(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function xe(t,e,n){const s=Object.assign({},n);return s.fullPath=t.path,s.size=e.size(),s.contentType||(s.contentType=Mt(null,e)),s}function Ne(t,e,n,s,r){const o=e.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function u(){let R="";for(let b=0;b<2;b++)R=R+Math.random().toString().slice(2);return R}const a=u();i["Content-Type"]="multipart/related; boundary="+a;const l=xe(e,s,r),c=oe(l,n),f="--"+a+`\r
258
- Content-Type: application/json; charset=utf-8\r
259
- \r
260
- `+c+`\r
261
- --`+a+`\r
262
- Content-Type: `+l.contentType+`\r
263
- \r
264
- `,p=`\r
265
- --`+a+"--",g=U.getBlob(f,s,p);if(g===null)throw Te();const m={name:l.fullPath},w=P(o,t.host,t._protocol),_="POST",O=t.maxUploadRetryTime,A=new I(w,_,V(t,n),O);return A.urlParams=m,A.headers=i,A.body=g.uploadData(),A.errorHandler=M(e),A}class G{constructor(e,n,s,r){this.current=e,this.total=n,this.finalized=!!s,this.metadata=r||null}}function ie(t,e){let n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch{C(!1)}return C(!!n&&(e||["active"]).indexOf(n)!==-1),n}function Bt(t,e,n,s,r){const o=e.bucketOnlyServerUrl(),i=xe(e,s,r),u={name:i.fullPath},a=P(o,t.host,t._protocol),l="POST",c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":i.contentType,"Content-Type":"application/json; charset=utf-8"},f=oe(i,n),p=t.maxUploadRetryTime;function g(w){ie(w);let _;try{_=w.getResponseHeader("X-Goog-Upload-URL")}catch{C(!1)}return C(W(_)),_}const m=new I(a,l,g,p);return m.urlParams=u,m.headers=c,m.body=f,m.errorHandler=M(e),m}function qt(t,e,n,s){const r={"X-Goog-Upload-Command":"query"};function o(l){const c=ie(l,["active","final"]);let f=null;try{f=l.getResponseHeader("X-Goog-Upload-Size-Received")}catch{C(!1)}f||C(!1);const p=Number(f);return C(!isNaN(p)),new G(p,s.size(),c==="final")}const i="POST",u=t.maxUploadRetryTime,a=new I(n,i,o,u);return a.headers=r,a.errorHandler=M(e),a}const de=256*1024;function Ft(t,e,n,s,r,o,i,u){const a=new G(0,0);if(i?(a.current=i.current,a.total=i.total):(a.current=0,a.total=s.size()),s.size()!==a.total)throw Qe();const l=a.total-a.current;let c=l;r>0&&(c=Math.min(c,r));const f=a.current,p=f+c;let g="";c===0?g="finalize":l===c?g="upload, finalize":g="upload";const m={"X-Goog-Upload-Command":g,"X-Goog-Upload-Offset":`${a.current}`},w=s.slice(f,p);if(w===null)throw Te();function _(b,v){const D=ie(b,["active","final"]),K=a.current+c,B=s.size();let Y;return D==="final"?Y=V(e,o)(b,v):Y=null,new G(K,B,D==="final",Y)}const O="POST",A=e.maxUploadRetryTime,R=new I(n,O,_,A);return R.headers=m,R.body=w.uploadData(),R.progressCallback=u||null,R.errorHandler=M(t),R}/**
266
- * @license
267
- * Copyright 2017 Google LLC
268
- *
269
- * Licensed under the Apache License, Version 2.0 (the "License");
270
- * you may not use this file except in compliance with the License.
271
- * You may obtain a copy of the License at
272
- *
273
- * http://www.apache.org/licenses/LICENSE-2.0
274
- *
275
- * Unless required by applicable law or agreed to in writing, software
276
- * distributed under the License is distributed on an "AS IS" BASIS,
277
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
278
- * See the License for the specific language governing permissions and
279
- * limitations under the License.
280
- */const Ht={STATE_CHANGED:"state_changed"},k={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function Q(t){switch(t){case"running":case"pausing":case"canceling":return k.RUNNING;case"paused":return k.PAUSED;case"success":return k.SUCCESS;case"canceled":return k.CANCELED;case"error":return k.ERROR;default:return k.ERROR}}/**
281
- * @license
282
- * Copyright 2017 Google LLC
283
- *
284
- * Licensed under the Apache License, Version 2.0 (the "License");
285
- * you may not use this file except in compliance with the License.
286
- * You may obtain a copy of the License at
287
- *
288
- * http://www.apache.org/licenses/LICENSE-2.0
289
- *
290
- * Unless required by applicable law or agreed to in writing, software
291
- * distributed under the License is distributed on an "AS IS" BASIS,
292
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
293
- * See the License for the specific language governing permissions and
294
- * limitations under the License.
295
- */class $t{constructor(e,n,s){if(it(e)||n!=null||s!=null)this.next=e,this.error=n??void 0,this.complete=s??void 0;else{const o=e;this.next=o.next,this.error=o.error,this.complete=o.complete}}}/**
296
- * @license
297
- * Copyright 2017 Google LLC
298
- *
299
- * Licensed under the Apache License, Version 2.0 (the "License");
300
- * you may not use this file except in compliance with the License.
301
- * You may obtain a copy of the License at
302
- *
303
- * http://www.apache.org/licenses/LICENSE-2.0
304
- *
305
- * Unless required by applicable law or agreed to in writing, software
306
- * distributed under the License is distributed on an "AS IS" BASIS,
307
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
308
- * See the License for the specific language governing permissions and
309
- * limitations under the License.
310
- */function L(t){return(...e)=>{Promise.resolve().then(()=>t(...e))}}class ae{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=x.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=x.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=x.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,n,s,r){if(this.sent_)throw q("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(n,e,!0),r!==void 0)for(const o in r)r.hasOwnProperty(o)&&this.xhr_.setRequestHeader(o,r[o].toString());return s!==void 0?this.xhr_.send(s):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw q("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw q("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw q("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw q("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class jt extends ae{initXhr(){this.xhr_.responseType="text"}}function S(){return new jt}class zt extends ae{initXhr(){this.xhr_.responseType="arraybuffer"}}function Xt(){return new zt}class Gt extends ae{initXhr(){this.xhr_.responseType="blob"}}function Wt(){return new Gt}/**
311
- * @license
312
- * Copyright 2017 Google LLC
313
- *
314
- * Licensed under the Apache License, Version 2.0 (the "License");
315
- * you may not use this file except in compliance with the License.
316
- * You may obtain a copy of the License at
317
- *
318
- * http://www.apache.org/licenses/LICENSE-2.0
319
- *
320
- * Unless required by applicable law or agreed to in writing, software
321
- * distributed under the License is distributed on an "AS IS" BASIS,
322
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
323
- * See the License for the specific language governing permissions and
324
- * limitations under the License.
325
- */class ve{constructor(e,n,s=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=n,this._metadata=s,this._mappings=H(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=r=>{if(this._request=void 0,this._chunkMultiplier=1,r._codeEquals(exports.StorageErrorCode.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const o=this.isExponentialBackoffExpired();if(ye(r.status,[]))if(o)r=be();else{this.sleepTime=Math.max(this.sleepTime*2,ze),this._needToFetchStatus=!0,this.completeTransitions_();return}this._error=r,this._transition("error")}},this._metadataErrorHandler=r=>{this._request=void 0,r._codeEquals(exports.StorageErrorCode.CANCELED)?this.completeTransitions_():(this._error=r,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((r,o)=>{this._resolve=r,this._reject=o,this._start()}),this._promise.then(null,()=>{})}isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}_makeProgressCallback(){const e=this._transferred;return n=>this._updateProgress(e+n)}_shouldDoResumable(e){return e.size()>256*1024}_start(){this._state==="running"&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([n,s])=>{switch(this._state){case"running":e(n,s);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused");break}})}_createResumable(){this._resolveToken((e,n)=>{const s=Bt(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),r=this._ref.storage._makeRequest(s,S,e,n);this._request=r,r.getPromise().then(o=>{this._request=void 0,this._uploadUrl=o,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const e=this._uploadUrl;this._resolveToken((n,s)=>{const r=qt(this._ref.storage,this._ref._location,e,this._blob),o=this._ref.storage._makeRequest(r,S,n,s);this._request=o,o.getPromise().then(i=>{i=i,this._request=void 0,this._updateProgress(i.current),this._needToFetchStatus=!1,i.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const e=de*this._chunkMultiplier,n=new G(this._transferred,this._blob.size()),s=this._uploadUrl;this._resolveToken((r,o)=>{let i;try{i=Ft(this._ref._location,this._ref.storage,s,this._blob,e,this._mappings,n,this._makeProgressCallback())}catch(a){this._error=a,this._transition("error");return}const u=this._ref.storage._makeRequest(i,S,r,o,!1);this._request=u,u.getPromise().then(a=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(a.current),a.finalized?(this._metadata=a.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){de*this._chunkMultiplier*2<32*1024*1024&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,n)=>{const s=Ae(this._ref.storage,this._ref._location,this._mappings),r=this._ref.storage._makeRequest(s,S,e,n);this._request=r,r.getPromise().then(o=>{this._request=void 0,this._metadata=o,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,n)=>{const s=Ne(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),r=this._ref.storage._makeRequest(s,S,e,n);this._request=r,r.getPromise().then(o=>{this._request=void 0,this._metadata=o,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){const n=this._transferred;this._transferred=e,this._transferred!==n&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,this._request!==void 0?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const n=this._state==="paused";this._state=e,n&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=Re(),this._state=e,this._notifyObservers();break;case"error":this._state=e,this._notifyObservers();break;case"success":this._state=e,this._notifyObservers();break}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}}get snapshot(){const e=Q(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,n,s,r){const o=new $t(n||void 0,s||void 0,r||void 0);return this._addObserver(o),()=>{this._removeObserver(o)}}then(e,n){return this._promise.then(e,n)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){const n=this._observers.indexOf(e);n!==-1&&this._observers.splice(n,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(n=>{this._notifyObserver(n)})}_finishPromise(){if(this._resolve!==void 0){let e=!0;switch(Q(this._state)){case k.SUCCESS:L(this._resolve.bind(null,this.snapshot))();break;case k.CANCELED:case k.ERROR:const n=this._reject;L(n.bind(null,this._error))();break;default:e=!1;break}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(Q(this._state)){case k.RUNNING:case k.PAUSED:e.next&&L(e.next.bind(e,this.snapshot))();break;case k.SUCCESS:e.complete&&L(e.complete.bind(e))();break;case k.CANCELED:case k.ERROR:e.error&&L(e.error.bind(e,this._error))();break;default:e.error&&L(e.error.bind(e,this._error))()}}resume(){const e=this._state==="paused"||this._state==="pausing";return e&&this._transition("running"),e}pause(){const e=this._state==="running";return e&&this._transition("pausing"),e}cancel(){const e=this._state==="running"||this._state==="pausing";return e&&this._transition("canceling"),e}}/**
326
- * @license
327
- * Copyright 2019 Google LLC
328
- *
329
- * Licensed under the Apache License, Version 2.0 (the "License");
330
- * you may not use this file except in compliance with the License.
331
- * You may obtain a copy of the License at
332
- *
333
- * http://www.apache.org/licenses/LICENSE-2.0
334
- *
335
- * Unless required by applicable law or agreed to in writing, software
336
- * distributed under the License is distributed on an "AS IS" BASIS,
337
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
338
- * See the License for the specific language governing permissions and
339
- * limitations under the License.
340
- */class N{constructor(e,n){this._service=e,n instanceof T?this._location=n:this._location=T.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new N(e,n)}get root(){const e=new T(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return Ie(this._location.path)}get storage(){return this._service}get parent(){const e=kt(this._location.path);if(e===null)return null;const n=new T(this._location.bucket,e);return new N(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw ke(e)}}function Vt(t,e){t._throwIfRoot("getBytes");const n=Pe(t.storage,t._location,e);return t.storage.makeRequestWithTokens(n,Xt).then(s=>e!==void 0?s.slice(0,e):s)}function Kt(t,e){t._throwIfRoot("getBlob");const n=Pe(t.storage,t._location,e);return t.storage.makeRequestWithTokens(n,Wt).then(s=>e!==void 0?s.slice(0,e):s)}function De(t,e,n){t._throwIfRoot("uploadBytes");const s=Ne(t.storage,t._location,H(),new U(e,!0),n);return t.storage.makeRequestWithTokens(s,S).then(r=>({metadata:r,ref:t}))}function Yt(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new ve(t,new U(e),n)}function Zt(t,e,n=y.RAW,s){t._throwIfRoot("uploadString");const r=se(n,e),o=Object.assign({},s);return o.contentType==null&&r.contentType!=null&&(o.contentType=r.contentType),De(t,r.data,o)}function Jt(t){const e={prefixes:[],items:[]};return Le(t,e).then(()=>e)}async function Le(t,e,n){const r=await Me(t,{pageToken:n});e.prefixes.push(...r.prefixes),e.items.push(...r.items),r.nextPageToken!=null&&await Le(t,e,r.nextPageToken)}function Me(t,e){e!=null&&typeof e.maxResults=="number"&&ee("options.maxResults",1,1e3,e.maxResults);const n=e||{},s=Nt(t.storage,t._location,"/",n.pageToken,n.maxResults);return t.storage.makeRequestWithTokens(s,S)}function Qt(t){t._throwIfRoot("getMetadata");const e=Ae(t.storage,t._location,H());return t.storage.makeRequestWithTokens(e,S)}function en(t,e){t._throwIfRoot("updateMetadata");const n=Dt(t.storage,t._location,e,H());return t.storage.makeRequestWithTokens(n,S)}function tn(t){t._throwIfRoot("getDownloadURL");const e=vt(t.storage,t._location,H());return t.storage.makeRequestWithTokens(e,S).then(n=>{if(n===null)throw et();return n})}function nn(t){t._throwIfRoot("deleteObject");const e=Lt(t.storage,t._location);return t.storage.makeRequestWithTokens(e,S)}function Be(t,e){const n=wt(t._location.path,e),s=new T(t._location.bucket,n);return new N(t.storage,s)}/**
341
- * @license
342
- * Copyright 2017 Google LLC
343
- *
344
- * Licensed under the Apache License, Version 2.0 (the "License");
345
- * you may not use this file except in compliance with the License.
346
- * You may obtain a copy of the License at
347
- *
348
- * http://www.apache.org/licenses/LICENSE-2.0
349
- *
350
- * Unless required by applicable law or agreed to in writing, software
351
- * distributed under the License is distributed on an "AS IS" BASIS,
352
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
353
- * See the License for the specific language governing permissions and
354
- * limitations under the License.
355
- */function sn(t){return/^[A-Za-z]+:\/\//.test(t)}function rn(t,e){return new N(t,e)}function qe(t,e){if(t instanceof ue){const n=t;if(n._bucket==null)throw Je();const s=new N(n,n._bucket);return e!=null?qe(s,e):s}else return e!==void 0?Be(t,e):t}function on(t,e){if(e&&sn(e)){if(t instanceof ue)return rn(t,e);throw X("To use ref(service, url), the first argument must be a Storage instance.")}else return qe(t,e)}function fe(t,e){const n=e==null?void 0:e[me];return n==null?null:T.makeFromBucketSpec(n,t)}function an(t,e,n,s={}){t.host=`${e}:${n}`,t._protocol="http";const{mockUserToken:r}=s;r&&(t._overrideAuthToken=typeof r=="string"?r:d.createMockUserToken(r,t.app.options.projectId))}class ue{constructor(e,n,s,r,o){this.app=e,this._authProvider=n,this._appCheckProvider=s,this._url=r,this._firebaseVersion=o,this._bucket=null,this._host=ge,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=$e,this._maxUploadRetryTime=je,this._requests=new Set,r!=null?this._bucket=T.makeFromBucketSpec(r,this._host):this._bucket=fe(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=T.makeFromBucketSpec(this._url,e):this._bucket=fe(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){ee("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){ee("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new N(this,e)}_makeRequest(e,n,s,r,o=!0){if(this._deleted)return new nt(Ee());{const i=ft(e,this._appId,s,r,n,this._firebaseVersion,o);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(e,n){const[s,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,s,r).getPromise()}}const _e="@firebase/storage",pe="0.13.2";/**
356
- * @license
357
- * Copyright 2020 Google LLC
358
- *
359
- * Licensed under the Apache License, Version 2.0 (the "License");
360
- * you may not use this file except in compliance with the License.
361
- * You may obtain a copy of the License at
362
- *
363
- * http://www.apache.org/licenses/LICENSE-2.0
364
- *
365
- * Unless required by applicable law or agreed to in writing, software
366
- * distributed under the License is distributed on an "AS IS" BASIS,
367
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
368
- * See the License for the specific language governing permissions and
369
- * limitations under the License.
370
- */const Fe="storage";/**
371
- * @license
372
- * Copyright 2020 Google LLC
373
- *
374
- * Licensed under the Apache License, Version 2.0 (the "License");
375
- * you may not use this file except in compliance with the License.
376
- * You may obtain a copy of the License at
377
- *
378
- * http://www.apache.org/licenses/LICENSE-2.0
379
- *
380
- * Unless required by applicable law or agreed to in writing, software
381
- * distributed under the License is distributed on an "AS IS" BASIS,
382
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
383
- * See the License for the specific language governing permissions and
384
- * limitations under the License.
385
- */function un(t,e){return t=d.getModularInstance(t),Vt(t,e)}function ln(t,e,n){return t=d.getModularInstance(t),De(t,e,n)}function cn(t,e,n,s){return t=d.getModularInstance(t),Zt(t,e,n,s)}function hn(t,e,n){return t=d.getModularInstance(t),Yt(t,e,n)}function dn(t){return t=d.getModularInstance(t),Qt(t)}function fn(t,e){return t=d.getModularInstance(t),en(t,e)}function _n(t,e){return t=d.getModularInstance(t),Me(t,e)}function pn(t){return t=d.getModularInstance(t),Jt(t)}function gn(t){return t=d.getModularInstance(t),tn(t)}function mn(t){return t=d.getModularInstance(t),nn(t)}function bn(t,e){return t=d.getModularInstance(t),on(t,e)}function Rn(t,e){return Be(t,e)}function Tn(t=d.getApp(),e){t=d.getModularInstance(t);const s=d._getProvider(t,Fe).getImmediate({identifier:e}),r=d.getDefaultEmulatorHostnameAndPort("storage");return r&&He(s,...r),s}function He(t,e,n,s={}){an(t,e,n,s)}/**
386
- * @license
387
- * Copyright 2021 Google LLC
388
- *
389
- * Licensed under the Apache License, Version 2.0 (the "License");
390
- * you may not use this file except in compliance with the License.
391
- * You may obtain a copy of the License at
392
- *
393
- * http://www.apache.org/licenses/LICENSE-2.0
394
- *
395
- * Unless required by applicable law or agreed to in writing, software
396
- * distributed under the License is distributed on an "AS IS" BASIS,
397
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
398
- * See the License for the specific language governing permissions and
399
- * limitations under the License.
400
- */function En(t,e){return t=d.getModularInstance(t),Kt(t,e)}function kn(t,e){throw new Error("getStream() is only supported by NodeJS builds")}function wn(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),s=t.getProvider("auth-internal"),r=t.getProvider("app-check-internal");return new ue(n,s,r,e,d.SDK_VERSION)}function yn(){d._registerComponent(new d.Component(Fe,wn,"PUBLIC").setMultipleInstances(!0)),d.registerVersion(_e,pe,""),d.registerVersion(_e,pe,"esm2017")}yn();exports.StorageError=h;exports.StringFormat=y;exports._FbsBlob=U;exports._Location=T;exports._TaskEvent=Ht;exports._TaskState=k;exports._UploadTask=ve;exports._dataFromString=se;exports._getChild=Rn;exports._invalidArgument=X;exports._invalidRootOperation=ke;exports.connectStorageEmulator=He;exports.deleteObject=mn;exports.getBlob=En;exports.getBytes=un;exports.getDownloadURL=gn;exports.getMetadata=dn;exports.getStorage=Tn;exports.getStream=kn;exports.list=_n;exports.listAll=pn;exports.ref=bn;exports.updateMetadata=fn;exports.uploadBytes=ln;exports.uploadBytesResumable=hn;exports.uploadString=cn;
@@ -1,44 +0,0 @@
1
- import { a_ as e } from "./index-TTt48kNP.js";
2
- import { bj as i, a$ as o, b0 as t, b1 as n, b2 as _, b3 as v, b4 as m, b5 as A, b6 as g, b7 as d, b8 as c, b9 as l, ba as E, bb as S, bc as f, bd as C, be as F, bf as L, bg as N, bh as O, bi as x } from "./index-TTt48kNP.js";
3
- var a = "firebase", s = "10.14.1";
4
- /**
5
- * @license
6
- * Copyright 2020 Google LLC
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- */
20
- e(a, s, "app");
21
- export {
22
- i as FirebaseError,
23
- o as SDK_VERSION,
24
- t as _DEFAULT_ENTRY_NAME,
25
- n as _addComponent,
26
- _ as _addOrOverwriteComponent,
27
- v as _apps,
28
- m as _clearComponents,
29
- A as _components,
30
- g as _getProvider,
31
- d as _isFirebaseApp,
32
- c as _isFirebaseServerApp,
33
- l as _registerComponent,
34
- E as _removeServiceInstance,
35
- S as _serverApps,
36
- f as deleteApp,
37
- C as getApp,
38
- F as getApps,
39
- L as initializeApp,
40
- N as initializeServerApp,
41
- O as onLog,
42
- e as registerVersion,
43
- x as setLogLevel
44
- };
@@ -1,119 +0,0 @@
1
- import { A as s, a as t, b as r, B as o, S as n, C as i, D as l, c, F as u, d, e as g, f as m, G as y, L as C, P as h, Q as p, g as F, h as A, i as D, j as b, k as I, l as Q, m as S, n as P, o as T, p as _, T as E, q as v, V as x, W as B, _ as L, r as f, s as q, t as M, u as k, v as w, w as R, x as W, y as G, z as N, E as U, H as V, I as H, J as z, K, M as O, N as Z, O as j, R as J, U as X, X as Y, Y as $, Z as aa, $ as ea, a0 as sa, a1 as ta, a2 as ra, a3 as oa, a4 as na, a5 as ia, a6 as la, a7 as ca, a8 as ua, a9 as da, aa as ga, ab as ma, ac as ya, ad as Ca, ae as ha, af as pa, ag as Fa, ah as Aa, ai as Da, aj as ba, ak as Ia, al as Qa, am as Sa, an as Pa, ao as Ta, ap as _a, aq as Ea, ar as va, as as xa, at as Ba, au as La, av as fa, aw as qa, ax as Ma, ay as ka, az as wa, aA as Ra, aB as Wa, aC as Ga, aD as Na, aE as Ua, aF as Va, aG as Ha, aH as za, aI as Ka, aJ as Oa, aK as Za, aL as ja, aM as Ja, aN as Xa, aO as Ya, aP as $a, aQ as ae, aR as ee, aS as se, aT as te, aU as re, aV as oe, aW as ne, aX as ie, aY as le, aZ as ce } from "./index-TTt48kNP.js";
2
- export {
3
- s as AbstractUserDataWriter,
4
- t as AggregateField,
5
- r as AggregateQuerySnapshot,
6
- o as Bytes,
7
- n as CACHE_SIZE_UNLIMITED,
8
- i as CollectionReference,
9
- l as DocumentReference,
10
- c as DocumentSnapshot,
11
- u as FieldPath,
12
- d as FieldValue,
13
- g as Firestore,
14
- m as FirestoreError,
15
- y as GeoPoint,
16
- C as LoadBundleTask,
17
- h as PersistentCacheIndexManager,
18
- p as Query,
19
- F as QueryCompositeFilterConstraint,
20
- A as QueryConstraint,
21
- D as QueryDocumentSnapshot,
22
- b as QueryEndAtConstraint,
23
- I as QueryFieldFilterConstraint,
24
- Q as QueryLimitConstraint,
25
- S as QueryOrderByConstraint,
26
- P as QuerySnapshot,
27
- T as QueryStartAtConstraint,
28
- _ as SnapshotMetadata,
29
- E as Timestamp,
30
- v as Transaction,
31
- x as VectorValue,
32
- B as WriteBatch,
33
- L as _AutoId,
34
- f as _ByteString,
35
- q as _DatabaseId,
36
- M as _DocumentKey,
37
- k as _EmptyAppCheckTokenProvider,
38
- w as _EmptyAuthCredentialsProvider,
39
- R as _FieldPath,
40
- W as _TestingHooks,
41
- G as _cast,
42
- N as _debugAssert,
43
- U as _internalAggregationQueryToProtoRunAggregationQueryRequest,
44
- V as _internalQueryToProtoQueryTarget,
45
- H as _isBase64Available,
46
- z as _logWarn,
47
- K as _validateIsNotUsedTogether,
48
- O as addDoc,
49
- Z as aggregateFieldEqual,
50
- j as aggregateQuerySnapshotEqual,
51
- J as and,
52
- X as arrayRemove,
53
- Y as arrayUnion,
54
- $ as average,
55
- aa as clearIndexedDbPersistence,
56
- ea as collection,
57
- sa as collectionGroup,
58
- ta as connectFirestoreEmulator,
59
- ra as count,
60
- oa as deleteAllPersistentCacheIndexes,
61
- na as deleteDoc,
62
- ia as deleteField,
63
- la as disableNetwork,
64
- ca as disablePersistentCacheIndexAutoCreation,
65
- ua as doc,
66
- da as documentId,
67
- ga as enableIndexedDbPersistence,
68
- ma as enableMultiTabIndexedDbPersistence,
69
- ya as enableNetwork,
70
- Ca as enablePersistentCacheIndexAutoCreation,
71
- ha as endAt,
72
- pa as endBefore,
73
- Fa as ensureFirestoreConfigured,
74
- Aa as executeWrite,
75
- Da as getAggregateFromServer,
76
- ba as getCountFromServer,
77
- Ia as getDoc,
78
- Qa as getDocFromCache,
79
- Sa as getDocFromServer,
80
- Pa as getDocs,
81
- Ta as getDocsFromCache,
82
- _a as getDocsFromServer,
83
- Ea as getFirestore,
84
- va as getPersistentCacheIndexManager,
85
- xa as increment,
86
- Ba as initializeFirestore,
87
- La as limit,
88
- fa as limitToLast,
89
- qa as loadBundle,
90
- Ma as memoryEagerGarbageCollector,
91
- ka as memoryLocalCache,
92
- wa as memoryLruGarbageCollector,
93
- Ra as namedQuery,
94
- Wa as onSnapshot,
95
- Ga as onSnapshotsInSync,
96
- Na as or,
97
- Ua as orderBy,
98
- Va as persistentLocalCache,
99
- Ha as persistentMultipleTabManager,
100
- za as persistentSingleTabManager,
101
- Ka as query,
102
- Oa as queryEqual,
103
- Za as refEqual,
104
- ja as runTransaction,
105
- Ja as serverTimestamp,
106
- Xa as setDoc,
107
- Ya as setIndexConfiguration,
108
- $a as setLogLevel,
109
- ae as snapshotEqual,
110
- ee as startAfter,
111
- se as startAt,
112
- te as sum,
113
- re as terminate,
114
- oe as updateDoc,
115
- ne as vector,
116
- ie as waitForPendingWrites,
117
- le as where,
118
- ce as writeBatch
119
- };