1 |
- {"version":3,"file":"index.esm5.js","sources":["../src/util/input_validation.ts","../src/api/blob.ts","../src/api/observer.ts","../src/api/database.ts","../src/api/field_path.ts","../src/api/field_value.ts","../src/config.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirestoreError } from '@firebase/firestore';\nimport { SetOptions } from '@firebase/firestore-types';\n\nexport function validateSetOptions(\n methodName: string,\n options: SetOptions | undefined\n): SetOptions {\n if (options === undefined) {\n return {\n merge: false\n };\n }\n\n if (options.mergeFields !== undefined && options.merge !== undefined) {\n throw new FirestoreError(\n 'invalid-argument',\n `Invalid options passed to function ${methodName}(): You cannot ` +\n 'specify both \"merge\" and \"mergeFields\".'\n );\n }\n\n return options;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Bytes, FirestoreError, _isBase64Available } from '@firebase/firestore';\nimport { Compat } from '@firebase/util';\n\n/** Helper function to assert Uint8Array is available at runtime. */\nfunction assertUint8ArrayAvailable(): void {\n if (typeof Uint8Array === 'undefined') {\n throw new FirestoreError(\n 'unimplemented',\n 'Uint8Arrays are not available in this environment.'\n );\n }\n}\n\n/** Helper function to assert Base64 functions are available at runtime. */\nfunction assertBase64Available(): void {\n if (!_isBase64Available()) {\n throw new FirestoreError(\n 'unimplemented',\n 'Blobs are unavailable in Firestore in this environment.'\n );\n }\n}\n\n/** Immutable class holding a blob (binary data) */\nexport class Blob implements Compat<Bytes> {\n constructor(readonly _delegate: Bytes) {}\n static fromBase64String(base64: string): Blob {\n assertBase64Available();\n return new Blob(Bytes.fromBase64String(base64));\n }\n\n static fromUint8Array(array: Uint8Array): Blob {\n assertUint8ArrayAvailable();\n return new Blob(Bytes.fromUint8Array(array));\n }\n\n toBase64(): string {\n assertBase64Available();\n return this._delegate.toBase64();\n }\n\n toUint8Array(): Uint8Array {\n assertUint8ArrayAvailable();\n return this._delegate.toUint8Array();\n }\n\n isEqual(other: Blob): boolean {\n return this._delegate.isEqual(other._delegate);\n }\n\n toString(): string {\n return 'Blob(base64: ' + this.toBase64() + ')';\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirestoreError } from '@firebase/firestore';\n\n/**\n * Observer/Subscribe interfaces.\n */\nexport type NextFn<T> = (value: T) => void;\nexport type ErrorFn = (error: FirestoreError) => void;\nexport type CompleteFn = () => void;\n\n// Allow for any of the Observer methods to be undefined.\nexport interface PartialObserver<T> {\n next?: NextFn<T>;\n error?: ErrorFn;\n complete?: CompleteFn;\n}\n\nexport function isPartialObserver<T>(obj: unknown): obj is PartialObserver<T> {\n return implementsAnyMethods(obj, ['next', 'error', 'complete']);\n}\n\n/**\n * Returns true if obj is an object and contains at least one of the specified\n * methods.\n */\nfunction implementsAnyMethods(obj: unknown, methods: string[]): boolean {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n\n const object = obj as Record<string, unknown>;\n for (const method of methods) {\n if (method in object && typeof object[method] === 'function') {\n return true;\n }\n }\n return false;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp } from '@firebase/app-types';\nimport { _FirebaseApp, FirebaseService } from '@firebase/app-types/private';\nimport {\n LoadBundleTask,\n Bytes,\n clearIndexedDbPersistence,\n disableNetwork,\n enableIndexedDbPersistence,\n enableMultiTabIndexedDbPersistence,\n enableNetwork,\n ensureFirestoreConfigured,\n Firestore as ExpFirestore,\n connectFirestoreEmulator,\n waitForPendingWrites,\n FieldPath as ExpFieldPath,\n limit,\n limitToLast,\n where,\n orderBy,\n startAfter,\n startAt,\n query,\n endBefore,\n endAt,\n doc,\n collection,\n collectionGroup,\n queryEqual,\n Query as ExpQuery,\n CollectionReference as ExpCollectionReference,\n DocumentReference as ExpDocumentReference,\n refEqual,\n addDoc,\n deleteDoc,\n executeWrite,\n getDoc,\n getDocFromCache,\n getDocFromServer,\n getDocs,\n getDocsFromCache,\n getDocsFromServer,\n onSnapshot,\n onSnapshotsInSync,\n setDoc,\n updateDoc,\n Unsubscribe,\n DocumentChange as ExpDocumentChange,\n DocumentSnapshot as ExpDocumentSnapshot,\n QueryDocumentSnapshot as ExpQueryDocumentSnapshot,\n QuerySnapshot as ExpQuerySnapshot,\n snapshotEqual,\n SnapshotMetadata,\n runTransaction,\n Transaction as ExpTransaction,\n WriteBatch as ExpWriteBatch,\n AbstractUserDataWriter,\n FirestoreError,\n FirestoreDataConverter as ModularFirestoreDataConverter,\n setLogLevel as setClientLogLevel,\n _DatabaseId,\n _validateIsNotUsedTogether,\n _cast,\n _DocumentKey,\n _debugAssert,\n _FieldPath,\n _ResourcePath,\n _ByteString,\n _logWarn,\n namedQuery,\n loadBundle,\n PartialWithFieldValue,\n WithFieldValue\n} from '@firebase/firestore';\nimport {\n CollectionReference as PublicCollectionReference,\n DocumentChange as PublicDocumentChange,\n DocumentChangeType as PublicDocumentChangeType,\n DocumentData,\n DocumentData as PublicDocumentData,\n DocumentReference as PublicDocumentReference,\n DocumentSnapshot as PublicDocumentSnapshot,\n FieldPath as PublicFieldPath,\n FirebaseFirestore as PublicFirestore,\n FirestoreDataConverter as PublicFirestoreDataConverter,\n GetOptions as PublicGetOptions,\n LogLevel as PublicLogLevel,\n OrderByDirection as PublicOrderByDirection,\n PersistenceSettings as PublicPersistenceSettings,\n Query as PublicQuery,\n QueryDocumentSnapshot as PublicQueryDocumentSnapshot,\n QuerySnapshot as PublicQuerySnapshot,\n SetOptions as PublicSetOptions,\n Settings as PublicSettings,\n SnapshotListenOptions as PublicSnapshotListenOptions,\n SnapshotOptions as PublicSnapshotOptions,\n Transaction as PublicTransaction,\n UpdateData as PublicUpdateData,\n WhereFilterOp as PublicWhereFilterOp,\n WriteBatch as PublicWriteBatch\n} from '@firebase/firestore-types';\nimport {\n Compat,\n EmulatorMockTokenOptions,\n getModularInstance\n} from '@firebase/util';\n\nimport { validateSetOptions } from '../util/input_validation';\n\nimport { Blob } from './blob';\nimport {\n CompleteFn,\n ErrorFn,\n isPartialObserver,\n NextFn,\n PartialObserver\n} from './observer';\n\n/**\n * A persistence provider for either memory-only or IndexedDB persistence.\n * Mainly used to allow optional inclusion of IndexedDB code.\n */\nexport interface PersistenceProvider {\n enableIndexedDbPersistence(\n firestore: Firestore,\n forceOwnership: boolean\n ): Promise<void>;\n enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise<void>;\n clearIndexedDbPersistence(firestore: Firestore): Promise<void>;\n}\n\n/**\n * The persistence provider included with the full Firestore SDK.\n */\nexport class IndexedDbPersistenceProvider implements PersistenceProvider {\n enableIndexedDbPersistence(\n firestore: Firestore,\n forceOwnership: boolean\n ): Promise<void> {\n return enableIndexedDbPersistence(firestore._delegate, { forceOwnership });\n }\n enableMultiTabIndexedDbPersistence(firestore: Firestore): Promise<void> {\n return enableMultiTabIndexedDbPersistence(firestore._delegate);\n }\n clearIndexedDbPersistence(firestore: Firestore): Promise<void> {\n return clearIndexedDbPersistence(firestore._delegate);\n }\n}\n\n/**\n * Compat class for Firestore. Exposes Firestore Legacy API, but delegates\n * to the functional API of firestore-exp.\n */\nexport class Firestore\n implements PublicFirestore, FirebaseService, Compat<ExpFirestore>\n{\n _appCompat?: FirebaseApp;\n constructor(\n databaseIdOrApp: _DatabaseId | FirebaseApp,\n readonly _delegate: ExpFirestore,\n private _persistenceProvider: PersistenceProvider\n ) {\n if (!(databaseIdOrApp instanceof _DatabaseId)) {\n this._appCompat = databaseIdOrApp as FirebaseApp;\n }\n }\n\n get _databaseId(): _DatabaseId {\n return this._delegate._databaseId;\n }\n\n settings(settingsLiteral: PublicSettings): void {\n const currentSettings = this._delegate._getSettings();\n if (\n !settingsLiteral.merge &&\n currentSettings.host !== settingsLiteral.host\n ) {\n _logWarn(\n 'You are overriding the original host. If you did not intend ' +\n 'to override your settings, use {merge: true}.'\n );\n }\n\n if (settingsLiteral.merge) {\n settingsLiteral = {\n ...currentSettings,\n ...settingsLiteral\n };\n // Remove the property from the settings once the merge is completed\n delete settingsLiteral.merge;\n }\n\n this._delegate._setSettings(settingsLiteral);\n }\n\n useEmulator(\n host: string,\n port: number,\n options: {\n mockUserToken?: EmulatorMockTokenOptions | string;\n } = {}\n ): void {\n connectFirestoreEmulator(this._delegate, host, port, options);\n }\n\n enableNetwork(): Promise<void> {\n return enableNetwork(this._delegate);\n }\n\n disableNetwork(): Promise<void> {\n return disableNetwork(this._delegate);\n }\n\n enablePersistence(settings?: PublicPersistenceSettings): Promise<void> {\n let synchronizeTabs = false;\n let experimentalForceOwningTab = false;\n\n if (settings) {\n synchronizeTabs = !!settings.synchronizeTabs;\n experimentalForceOwningTab = !!settings.experimentalForceOwningTab;\n\n _validateIsNotUsedTogether(\n 'synchronizeTabs',\n synchronizeTabs,\n 'experimentalForceOwningTab',\n experimentalForceOwningTab\n );\n }\n\n return synchronizeTabs\n ? this._persistenceProvider.enableMultiTabIndexedDbPersistence(this)\n : this._persistenceProvider.enableIndexedDbPersistence(\n this,\n experimentalForceOwningTab\n );\n }\n\n clearPersistence(): Promise<void> {\n return this._persistenceProvider.clearIndexedDbPersistence(this);\n }\n\n terminate(): Promise<void> {\n if (this._appCompat) {\n (this._appCompat as _FirebaseApp)._removeServiceInstance(\n 'firestore-compat'\n );\n (this._appCompat as _FirebaseApp)._removeServiceInstance('firestore');\n }\n return this._delegate._delete();\n }\n\n waitForPendingWrites(): Promise<void> {\n return waitForPendingWrites(this._delegate);\n }\n\n onSnapshotsInSync(observer: PartialObserver<void>): Unsubscribe;\n onSnapshotsInSync(onSync: () => void): Unsubscribe;\n onSnapshotsInSync(arg: unknown): Unsubscribe {\n return onSnapshotsInSync(this._delegate, arg as PartialObserver<void>);\n }\n\n get app(): FirebaseApp {\n if (!this._appCompat) {\n throw new FirestoreError(\n 'failed-precondition',\n \"Firestore was not initialized using the Firebase SDK. 'app' is \" +\n 'not available'\n );\n }\n return this._appCompat as FirebaseApp;\n }\n\n INTERNAL = {\n delete: () => this.terminate()\n };\n\n collection(pathString: string): PublicCollectionReference {\n try {\n return new CollectionReference(\n this,\n collection(this._delegate, pathString)\n );\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n 'collection()',\n 'Firestore.collection()'\n );\n }\n }\n\n doc(pathString: string): PublicDocumentReference {\n try {\n return new DocumentReference(this, doc(this._delegate, pathString));\n } catch (e) {\n throw replaceFunctionName(e as Error, 'doc()', 'Firestore.doc()');\n }\n }\n\n collectionGroup(collectionId: string): PublicQuery {\n try {\n return new Query(this, collectionGroup(this._delegate, collectionId));\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n 'collectionGroup()',\n 'Firestore.collectionGroup()'\n );\n }\n }\n\n runTransaction<T>(\n updateFunction: (transaction: PublicTransaction) => Promise<T>\n ): Promise<T> {\n return runTransaction(this._delegate, transaction =>\n updateFunction(new Transaction(this, transaction))\n );\n }\n\n batch(): PublicWriteBatch {\n ensureFirestoreConfigured(this._delegate);\n return new WriteBatch(\n new ExpWriteBatch(this._delegate, mutations =>\n executeWrite(this._delegate, mutations)\n )\n );\n }\n\n loadBundle(\n bundleData: ArrayBuffer | ReadableStream<Uint8Array> | string\n ): LoadBundleTask {\n return loadBundle(this._delegate, bundleData);\n }\n\n namedQuery(name: string): Promise<PublicQuery<DocumentData> | null> {\n return namedQuery(this._delegate, name).then(expQuery => {\n if (!expQuery) {\n return null;\n }\n return new Query(\n this,\n // We can pass `expQuery` here directly since named queries don't have a UserDataConverter.\n // Otherwise, we would have to create a new ExpQuery and pass the old UserDataConverter.\n expQuery\n );\n });\n }\n}\n\nexport class UserDataWriter extends AbstractUserDataWriter {\n constructor(protected firestore: Firestore) {\n super();\n }\n\n protected convertBytes(bytes: _ByteString): Blob {\n return new Blob(new Bytes(bytes));\n }\n\n protected convertReference(name: string): DocumentReference {\n const key = this.convertDocumentKey(name, this.firestore._databaseId);\n return DocumentReference.forKey(key, this.firestore, /* converter= */ null);\n }\n}\n\nexport function setLogLevel(level: PublicLogLevel): void {\n setClientLogLevel(level);\n}\n\n/**\n * A reference to a transaction.\n */\nexport class Transaction implements PublicTransaction, Compat<ExpTransaction> {\n private _userDataWriter: UserDataWriter;\n\n constructor(\n private readonly _firestore: Firestore,\n readonly _delegate: ExpTransaction\n ) {\n this._userDataWriter = new UserDataWriter(_firestore);\n }\n\n get<T>(\n documentRef: PublicDocumentReference<T>\n ): Promise<PublicDocumentSnapshot<T>> {\n const ref = castReference(documentRef);\n return this._delegate\n .get(ref)\n .then(\n result =>\n new DocumentSnapshot(\n this._firestore,\n new ExpDocumentSnapshot<T>(\n this._firestore._delegate,\n this._userDataWriter,\n result._key,\n result._document,\n result.metadata,\n ref.converter\n )\n )\n );\n }\n\n set<T>(\n documentRef: DocumentReference<T>,\n data: Partial<T>,\n options: PublicSetOptions\n ): Transaction;\n set<T>(documentRef: DocumentReference<T>, data: T): Transaction;\n set<T>(\n documentRef: PublicDocumentReference<T>,\n data: T | Partial<T>,\n options?: PublicSetOptions\n ): Transaction {\n const ref = castReference(documentRef);\n if (options) {\n validateSetOptions('Transaction.set', options);\n this._delegate.set(ref, data as PartialWithFieldValue<T>, options);\n } else {\n this._delegate.set(ref, data as WithFieldValue<T>);\n }\n return this;\n }\n\n update(\n documentRef: PublicDocumentReference<unknown>,\n data: PublicUpdateData\n ): Transaction;\n update(\n documentRef: PublicDocumentReference<unknown>,\n field: string | PublicFieldPath,\n value: unknown,\n ...moreFieldsAndValues: unknown[]\n ): Transaction;\n update(\n documentRef: PublicDocumentReference<unknown>,\n dataOrField: unknown,\n value?: unknown,\n ...moreFieldsAndValues: unknown[]\n ): Transaction {\n const ref = castReference(documentRef);\n if (arguments.length === 2) {\n this._delegate.update(ref, dataOrField as PublicUpdateData);\n } else {\n this._delegate.update(\n ref,\n dataOrField as string | ExpFieldPath,\n value,\n ...moreFieldsAndValues\n );\n }\n\n return this;\n }\n\n delete(documentRef: PublicDocumentReference<unknown>): Transaction {\n const ref = castReference(documentRef);\n this._delegate.delete(ref);\n return this;\n }\n}\n\nexport class WriteBatch implements PublicWriteBatch, Compat<ExpWriteBatch> {\n constructor(readonly _delegate: ExpWriteBatch) {}\n set<T>(\n documentRef: DocumentReference<T>,\n data: Partial<T>,\n options: PublicSetOptions\n ): WriteBatch;\n set<T>(documentRef: DocumentReference<T>, data: T): WriteBatch;\n set<T>(\n documentRef: PublicDocumentReference<T>,\n data: T | Partial<T>,\n options?: PublicSetOptions\n ): WriteBatch {\n const ref = castReference(documentRef);\n if (options) {\n validateSetOptions('WriteBatch.set', options);\n this._delegate.set(ref, data as PartialWithFieldValue<T>, options);\n } else {\n this._delegate.set(ref, data as WithFieldValue<T>);\n }\n return this;\n }\n\n update(\n documentRef: PublicDocumentReference<unknown>,\n data: PublicUpdateData\n ): WriteBatch;\n update(\n documentRef: PublicDocumentReference<unknown>,\n field: string | PublicFieldPath,\n value: unknown,\n ...moreFieldsAndValues: unknown[]\n ): WriteBatch;\n update(\n documentRef: PublicDocumentReference<unknown>,\n dataOrField: string | PublicFieldPath | PublicUpdateData,\n value?: unknown,\n ...moreFieldsAndValues: unknown[]\n ): WriteBatch {\n const ref = castReference(documentRef);\n if (arguments.length === 2) {\n this._delegate.update(ref, dataOrField as PublicUpdateData);\n } else {\n this._delegate.update(\n ref,\n dataOrField as string | ExpFieldPath,\n value,\n ...moreFieldsAndValues\n );\n }\n return this;\n }\n\n delete(documentRef: PublicDocumentReference<unknown>): WriteBatch {\n const ref = castReference(documentRef);\n this._delegate.delete(ref);\n return this;\n }\n\n commit(): Promise<void> {\n return this._delegate.commit();\n }\n}\n\n/**\n * Wraps a `PublicFirestoreDataConverter` translating the types from the\n * experimental SDK into corresponding types from the Classic SDK before passing\n * them to the wrapped converter.\n */\nclass FirestoreDataConverter<U>\n implements\n ModularFirestoreDataConverter<U>,\n Compat<PublicFirestoreDataConverter<U>>\n{\n private static readonly INSTANCES = new WeakMap();\n\n private constructor(\n private readonly _firestore: Firestore,\n private readonly _userDataWriter: UserDataWriter,\n readonly _delegate: PublicFirestoreDataConverter<U>\n ) {}\n\n fromFirestore(\n snapshot: ExpQueryDocumentSnapshot,\n options?: PublicSnapshotOptions\n ): U {\n const expSnapshot = new ExpQueryDocumentSnapshot(\n this._firestore._delegate,\n this._userDataWriter,\n snapshot._key,\n snapshot._document,\n snapshot.metadata,\n /* converter= */ null\n );\n return this._delegate.fromFirestore(\n new QueryDocumentSnapshot(this._firestore, expSnapshot),\n options ?? {}\n );\n }\n\n toFirestore(modelObject: WithFieldValue<U>): PublicDocumentData;\n toFirestore(\n modelObject: PartialWithFieldValue<U>,\n options: PublicSetOptions\n ): PublicDocumentData;\n toFirestore(\n modelObject: WithFieldValue<U> | PartialWithFieldValue<U>,\n options?: PublicSetOptions\n ): PublicDocumentData {\n if (!options) {\n return this._delegate.toFirestore(modelObject as U);\n } else {\n return this._delegate.toFirestore(modelObject as Partial<U>, options);\n }\n }\n\n // Use the same instance of `FirestoreDataConverter` for the given instances\n // of `Firestore` and `PublicFirestoreDataConverter` so that isEqual() will\n // compare equal for two objects created with the same converter instance.\n static getInstance<U>(\n firestore: Firestore,\n converter: PublicFirestoreDataConverter<U>\n ): FirestoreDataConverter<U> {\n const converterMapByFirestore = FirestoreDataConverter.INSTANCES;\n let untypedConverterByConverter = converterMapByFirestore.get(firestore);\n if (!untypedConverterByConverter) {\n untypedConverterByConverter = new WeakMap();\n converterMapByFirestore.set(firestore, untypedConverterByConverter);\n }\n\n let instance = untypedConverterByConverter.get(converter);\n if (!instance) {\n instance = new FirestoreDataConverter(\n firestore,\n new UserDataWriter(firestore),\n converter\n );\n untypedConverterByConverter.set(converter, instance);\n }\n\n return instance;\n }\n}\n\n/**\n * A reference to a particular document in a collection in the database.\n */\nexport class DocumentReference<T = PublicDocumentData>\n implements PublicDocumentReference<T>, Compat<ExpDocumentReference<T>>\n{\n private _userDataWriter: UserDataWriter;\n\n constructor(\n readonly firestore: Firestore,\n readonly _delegate: ExpDocumentReference<T>\n ) {\n this._userDataWriter = new UserDataWriter(firestore);\n }\n\n static forPath<U>(\n path: _ResourcePath,\n firestore: Firestore,\n converter: ModularFirestoreDataConverter<U> | null\n ): DocumentReference<U> {\n if (path.length % 2 !== 0) {\n throw new FirestoreError(\n 'invalid-argument',\n 'Invalid document reference. Document ' +\n 'references must have an even number of segments, but ' +\n `${path.canonicalString()} has ${path.length}`\n );\n }\n return new DocumentReference(\n firestore,\n new ExpDocumentReference(\n firestore._delegate,\n converter,\n new _DocumentKey(path)\n )\n );\n }\n\n static forKey<U>(\n key: _DocumentKey,\n firestore: Firestore,\n converter: ModularFirestoreDataConverter<U> | null\n ): DocumentReference<U> {\n return new DocumentReference(\n firestore,\n new ExpDocumentReference(firestore._delegate, converter, key)\n );\n }\n\n get id(): string {\n return this._delegate.id;\n }\n\n get parent(): PublicCollectionReference<T> {\n return new CollectionReference(this.firestore, this._delegate.parent);\n }\n\n get path(): string {\n return this._delegate.path;\n }\n\n collection(\n pathString: string\n ): PublicCollectionReference<PublicDocumentData> {\n try {\n return new CollectionReference(\n this.firestore,\n collection(this._delegate, pathString)\n );\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n 'collection()',\n 'DocumentReference.collection()'\n );\n }\n }\n\n isEqual(other: PublicDocumentReference<T>): boolean {\n other = getModularInstance<PublicDocumentReference<T>>(other);\n\n if (!(other instanceof ExpDocumentReference)) {\n return false;\n }\n return refEqual(this._delegate, other);\n }\n\n set(value: Partial<T>, options: PublicSetOptions): Promise<void>;\n set(value: T): Promise<void>;\n set(value: T | Partial<T>, options?: PublicSetOptions): Promise<void> {\n options = validateSetOptions('DocumentReference.set', options);\n try {\n if (options) {\n return setDoc(\n this._delegate,\n value as PartialWithFieldValue<T>,\n options\n );\n } else {\n return setDoc(this._delegate, value as WithFieldValue<T>);\n }\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n 'setDoc()',\n 'DocumentReference.set()'\n );\n }\n }\n\n update(value: PublicUpdateData): Promise<void>;\n update(\n field: string | PublicFieldPath,\n value: unknown,\n ...moreFieldsAndValues: unknown[]\n ): Promise<void>;\n update(\n fieldOrUpdateData: string | PublicFieldPath | PublicUpdateData,\n value?: unknown,\n ...moreFieldsAndValues: unknown[]\n ): Promise<void> {\n try {\n if (arguments.length === 1) {\n return updateDoc(this._delegate, fieldOrUpdateData as PublicUpdateData);\n } else {\n return updateDoc(\n this._delegate,\n fieldOrUpdateData as string | ExpFieldPath,\n value,\n ...moreFieldsAndValues\n );\n }\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n 'updateDoc()',\n 'DocumentReference.update()'\n );\n }\n }\n\n delete(): Promise<void> {\n return deleteDoc(this._delegate);\n }\n\n onSnapshot(observer: PartialObserver<PublicDocumentSnapshot<T>>): Unsubscribe;\n onSnapshot(\n options: PublicSnapshotListenOptions,\n observer: PartialObserver<PublicDocumentSnapshot<T>>\n ): Unsubscribe;\n onSnapshot(\n onNext: NextFn<PublicDocumentSnapshot<T>>,\n onError?: ErrorFn,\n onCompletion?: CompleteFn\n ): Unsubscribe;\n onSnapshot(\n options: PublicSnapshotListenOptions,\n onNext: NextFn<PublicDocumentSnapshot<T>>,\n onError?: ErrorFn,\n onCompletion?: CompleteFn\n ): Unsubscribe;\n\n onSnapshot(...args: unknown[]): Unsubscribe {\n const options = extractSnapshotOptions(args);\n const observer = wrapObserver<DocumentSnapshot<T>, ExpDocumentSnapshot<T>>(\n args,\n result =>\n new DocumentSnapshot(\n this.firestore,\n new ExpDocumentSnapshot(\n this.firestore._delegate,\n this._userDataWriter,\n result._key,\n result._document,\n result.metadata,\n this._delegate.converter\n )\n )\n );\n return onSnapshot(this._delegate, options, observer);\n }\n\n get(options?: PublicGetOptions): Promise<PublicDocumentSnapshot<T>> {\n let snap: Promise<ExpDocumentSnapshot<T>>;\n if (options?.source === 'cache') {\n snap = getDocFromCache(this._delegate);\n } else if (options?.source === 'server') {\n snap = getDocFromServer(this._delegate);\n } else {\n snap = getDoc(this._delegate);\n }\n\n return snap.then(\n result =>\n new DocumentSnapshot(\n this.firestore,\n new ExpDocumentSnapshot(\n this.firestore._delegate,\n this._userDataWriter,\n result._key,\n result._document,\n result.metadata,\n this._delegate.converter\n )\n )\n );\n }\n\n withConverter(converter: null): PublicDocumentReference<PublicDocumentData>;\n withConverter<U>(\n converter: PublicFirestoreDataConverter<U>\n ): PublicDocumentReference<U>;\n withConverter<U>(\n converter: PublicFirestoreDataConverter<U> | null\n ): PublicDocumentReference<U> {\n return new DocumentReference<U>(\n this.firestore,\n converter\n ? this._delegate.withConverter(\n FirestoreDataConverter.getInstance(this.firestore, converter)\n )\n : (this._delegate.withConverter(null) as ExpDocumentReference<U>)\n );\n }\n}\n\n/**\n * Replaces the function name in an error thrown by the firestore-exp API\n * with the function names used in the classic API.\n */\nfunction replaceFunctionName(\n e: Error,\n original: string | RegExp,\n updated: string\n): Error {\n e.message = e.message.replace(original, updated);\n return e;\n}\n\n/**\n * Iterates the list of arguments from an `onSnapshot` call and returns the\n * first argument that may be an `SnapshotListenOptions` object. Returns an\n * empty object if none is found.\n */\nexport function extractSnapshotOptions(\n args: unknown[]\n): PublicSnapshotListenOptions {\n for (const arg of args) {\n if (typeof arg === 'object' && !isPartialObserver(arg)) {\n return arg as PublicSnapshotListenOptions;\n }\n }\n return {};\n}\n\n/**\n * Creates an observer that can be passed to the firestore-exp SDK. The\n * observer converts all observed values into the format expected by the classic\n * SDK.\n *\n * @param args - The list of arguments from an `onSnapshot` call.\n * @param wrapper - The function that converts the firestore-exp type into the\n * type used by this shim.\n */\nexport function wrapObserver<CompatType, ExpType>(\n args: unknown[],\n wrapper: (val: ExpType) => CompatType\n): PartialObserver<ExpType> {\n let userObserver: PartialObserver<CompatType>;\n if (isPartialObserver(args[0])) {\n userObserver = args[0] as PartialObserver<CompatType>;\n } else if (isPartialObserver(args[1])) {\n userObserver = args[1];\n } else if (typeof args[0] === 'function') {\n userObserver = {\n next: args[0] as NextFn<CompatType> | undefined,\n error: args[1] as ErrorFn | undefined,\n complete: args[2] as CompleteFn | undefined\n };\n } else {\n userObserver = {\n next: args[1] as NextFn<CompatType> | undefined,\n error: args[2] as ErrorFn | undefined,\n complete: args[3] as CompleteFn | undefined\n };\n }\n\n return {\n next: val => {\n if (userObserver!.next) {\n userObserver!.next(wrapper(val));\n }\n },\n error: userObserver.error?.bind(userObserver),\n complete: userObserver.complete?.bind(userObserver)\n };\n}\n\n/**\n * Options interface that can be provided to configure the deserialization of\n * DocumentSnapshots.\n */\nexport interface SnapshotOptions extends PublicSnapshotOptions {}\n\nexport class DocumentSnapshot<T = PublicDocumentData>\n implements PublicDocumentSnapshot<T>, Compat<ExpDocumentSnapshot<T>>\n{\n constructor(\n private readonly _firestore: Firestore,\n readonly _delegate: ExpDocumentSnapshot<T>\n ) {}\n\n get ref(): DocumentReference<T> {\n return new DocumentReference<T>(this._firestore, this._delegate.ref);\n }\n\n get id(): string {\n return this._delegate.id;\n }\n\n get metadata(): SnapshotMetadata {\n return this._delegate.metadata;\n }\n\n get exists(): boolean {\n return this._delegate.exists();\n }\n\n data(options?: PublicSnapshotOptions): T | undefined {\n return this._delegate.data(options);\n }\n\n get(\n fieldPath: string | PublicFieldPath,\n options?: PublicSnapshotOptions\n // We are using `any` here to avoid an explicit cast by our users.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): any {\n return this._delegate.get(fieldPath as string | ExpFieldPath, options);\n }\n\n isEqual(other: DocumentSnapshot<T>): boolean {\n return snapshotEqual(this._delegate, other._delegate);\n }\n}\n\nexport class QueryDocumentSnapshot<T = PublicDocumentData>\n extends DocumentSnapshot<T>\n implements PublicQueryDocumentSnapshot<T>\n{\n data(options?: PublicSnapshotOptions): T {\n const data = this._delegate.data(options);\n _debugAssert(\n data !== undefined,\n 'Document in a QueryDocumentSnapshot should exist'\n );\n return data;\n }\n}\n\nexport class Query<T = PublicDocumentData>\n implements PublicQuery<T>, Compat<ExpQuery<T>>\n{\n private readonly _userDataWriter: UserDataWriter;\n\n constructor(readonly firestore: Firestore, readonly _delegate: ExpQuery<T>) {\n this._userDataWriter = new UserDataWriter(firestore);\n }\n\n where(\n fieldPath: string | _FieldPath,\n opStr: PublicWhereFilterOp,\n value: unknown\n ): Query<T> {\n try {\n // The \"as string\" cast is a little bit of a hack. `where` accepts the\n // FieldPath Compat type as input, but is not typed as such in order to\n // not expose this via our public typings file.\n return new Query<T>(\n this.firestore,\n query(this._delegate, where(fieldPath as string, opStr, value))\n );\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n /(orderBy|where)\\(\\)/,\n 'Query.$1()'\n );\n }\n }\n\n orderBy(\n fieldPath: string | _FieldPath,\n directionStr?: PublicOrderByDirection\n ): Query<T> {\n try {\n // The \"as string\" cast is a little bit of a hack. `orderBy` accepts the\n // FieldPath Compat type as input, but is not typed as such in order to\n // not expose this via our public typings file.\n return new Query<T>(\n this.firestore,\n query(this._delegate, orderBy(fieldPath as string, directionStr))\n );\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n /(orderBy|where)\\(\\)/,\n 'Query.$1()'\n );\n }\n }\n\n limit(n: number): Query<T> {\n try {\n return new Query<T>(this.firestore, query(this._delegate, limit(n)));\n } catch (e) {\n throw replaceFunctionName(e as Error, 'limit()', 'Query.limit()');\n }\n }\n\n limitToLast(n: number): Query<T> {\n try {\n return new Query<T>(\n this.firestore,\n query(this._delegate, limitToLast(n))\n );\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n 'limitToLast()',\n 'Query.limitToLast()'\n );\n }\n }\n\n startAt(...args: any[]): Query<T> {\n try {\n return new Query(this.firestore, query(this._delegate, startAt(...args)));\n } catch (e) {\n throw replaceFunctionName(e as Error, 'startAt()', 'Query.startAt()');\n }\n }\n\n startAfter(...args: any[]): Query<T> {\n try {\n return new Query(\n this.firestore,\n query(this._delegate, startAfter(...args))\n );\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n 'startAfter()',\n 'Query.startAfter()'\n );\n }\n }\n\n endBefore(...args: any[]): Query<T> {\n try {\n return new Query(\n this.firestore,\n query(this._delegate, endBefore(...args))\n );\n } catch (e) {\n throw replaceFunctionName(e as Error, 'endBefore()', 'Query.endBefore()');\n }\n }\n\n endAt(...args: any[]): Query<T> {\n try {\n return new Query(this.firestore, query(this._delegate, endAt(...args)));\n } catch (e) {\n throw replaceFunctionName(e as Error, 'endAt()', 'Query.endAt()');\n }\n }\n\n isEqual(other: PublicQuery<T>): boolean {\n return queryEqual(this._delegate, (other as Query<T>)._delegate);\n }\n\n get(options?: PublicGetOptions): Promise<QuerySnapshot<T>> {\n let query: Promise<ExpQuerySnapshot<T>>;\n if (options?.source === 'cache') {\n query = getDocsFromCache(this._delegate);\n } else if (options?.source === 'server') {\n query = getDocsFromServer(this._delegate);\n } else {\n query = getDocs(this._delegate);\n }\n return query.then(\n result =>\n new QuerySnapshot(\n this.firestore,\n new ExpQuerySnapshot<T>(\n this.firestore._delegate,\n this._userDataWriter,\n this._delegate,\n result._snapshot\n )\n )\n );\n }\n\n onSnapshot(observer: PartialObserver<PublicQuerySnapshot<T>>): Unsubscribe;\n onSnapshot(\n options: PublicSnapshotListenOptions,\n observer: PartialObserver<PublicQuerySnapshot<T>>\n ): Unsubscribe;\n onSnapshot(\n onNext: NextFn<PublicQuerySnapshot<T>>,\n onError?: ErrorFn,\n onCompletion?: CompleteFn\n ): Unsubscribe;\n onSnapshot(\n options: PublicSnapshotListenOptions,\n onNext: NextFn<PublicQuerySnapshot<T>>,\n onError?: ErrorFn,\n onCompletion?: CompleteFn\n ): Unsubscribe;\n\n onSnapshot(...args: unknown[]): Unsubscribe {\n const options = extractSnapshotOptions(args);\n const observer = wrapObserver<QuerySnapshot<T>, ExpQuerySnapshot<T>>(\n args,\n snap =>\n new QuerySnapshot(\n this.firestore,\n new ExpQuerySnapshot<T>(\n this.firestore._delegate,\n this._userDataWriter,\n this._delegate,\n snap._snapshot\n )\n )\n );\n return onSnapshot(this._delegate, options, observer);\n }\n\n withConverter(converter: null): Query<PublicDocumentData>;\n withConverter<U>(converter: PublicFirestoreDataConverter<U>): Query<U>;\n withConverter<U>(\n converter: PublicFirestoreDataConverter<U> | null\n ): Query<U> {\n return new Query<U>(\n this.firestore,\n converter\n ? this._delegate.withConverter(\n FirestoreDataConverter.getInstance(this.firestore, converter)\n )\n : (this._delegate.withConverter(null) as ExpQuery<U>)\n );\n }\n}\n\nexport class DocumentChange<T = PublicDocumentData>\n implements PublicDocumentChange<T>, Compat<ExpDocumentChange<T>>\n{\n constructor(\n private readonly _firestore: Firestore,\n readonly _delegate: ExpDocumentChange<T>\n ) {}\n\n get type(): PublicDocumentChangeType {\n return this._delegate.type;\n }\n\n get doc(): QueryDocumentSnapshot<T> {\n return new QueryDocumentSnapshot<T>(this._firestore, this._delegate.doc);\n }\n\n get oldIndex(): number {\n return this._delegate.oldIndex;\n }\n\n get newIndex(): number {\n return this._delegate.newIndex;\n }\n}\n\nexport class QuerySnapshot<T = PublicDocumentData>\n implements PublicQuerySnapshot<T>, Compat<ExpQuerySnapshot<T>>\n{\n constructor(\n readonly _firestore: Firestore,\n readonly _delegate: ExpQuerySnapshot<T>\n ) {}\n\n get query(): Query<T> {\n return new Query(this._firestore, this._delegate.query);\n }\n\n get metadata(): SnapshotMetadata {\n return this._delegate.metadata;\n }\n\n get size(): number {\n return this._delegate.size;\n }\n\n get empty(): boolean {\n return this._delegate.empty;\n }\n\n get docs(): Array<QueryDocumentSnapshot<T>> {\n return this._delegate.docs.map(\n doc => new QueryDocumentSnapshot<T>(this._firestore, doc)\n );\n }\n\n docChanges(\n options?: PublicSnapshotListenOptions\n ): Array<PublicDocumentChange<T>> {\n return this._delegate\n .docChanges(options)\n .map(docChange => new DocumentChange<T>(this._firestore, docChange));\n }\n\n forEach(\n callback: (result: QueryDocumentSnapshot<T>) => void,\n thisArg?: unknown\n ): void {\n this._delegate.forEach(snapshot => {\n callback.call(\n thisArg,\n new QueryDocumentSnapshot(this._firestore, snapshot)\n );\n });\n }\n\n isEqual(other: QuerySnapshot<T>): boolean {\n return snapshotEqual(this._delegate, other._delegate);\n }\n}\n\nexport class CollectionReference<T = PublicDocumentData>\n extends Query<T>\n implements PublicCollectionReference<T>\n{\n constructor(\n readonly firestore: Firestore,\n readonly _delegate: ExpCollectionReference<T>\n ) {\n super(firestore, _delegate);\n }\n\n get id(): string {\n return this._delegate.id;\n }\n\n get path(): string {\n return this._delegate.path;\n }\n\n get parent(): DocumentReference<PublicDocumentData> | null {\n const docRef = this._delegate.parent;\n return docRef ? new DocumentReference(this.firestore, docRef) : null;\n }\n\n doc(documentPath?: string): DocumentReference<T> {\n try {\n if (documentPath === undefined) {\n // Call `doc` without `documentPath` if `documentPath` is `undefined`\n // as `doc` validates the number of arguments to prevent users from\n // accidentally passing `undefined`.\n return new DocumentReference(this.firestore, doc(this._delegate));\n } else {\n return new DocumentReference(\n this.firestore,\n doc(this._delegate, documentPath)\n );\n }\n } catch (e) {\n throw replaceFunctionName(\n e as Error,\n 'doc()',\n 'CollectionReference.doc()'\n );\n }\n }\n\n add(data: T): Promise<DocumentReference<T>> {\n return addDoc(this._delegate, data as WithFieldValue<T>).then(\n docRef => new DocumentReference(this.firestore, docRef)\n );\n }\n\n isEqual(other: CollectionReference<T>): boolean {\n return refEqual(this._delegate, other._delegate);\n }\n\n withConverter(converter: null): CollectionReference<PublicDocumentData>;\n withConverter<U>(\n converter: PublicFirestoreDataConverter<U>\n ): CollectionReference<U>;\n withConverter<U>(\n converter: PublicFirestoreDataConverter<U> | null\n ): CollectionReference<U> {\n return new CollectionReference<U>(\n this.firestore,\n converter\n ? this._delegate.withConverter(\n FirestoreDataConverter.getInstance(this.firestore, converter)\n )\n : (this._delegate.withConverter(null) as ExpCollectionReference<U>)\n );\n }\n}\n\nfunction castReference<T>(\n documentRef: PublicDocumentReference<T>\n): ExpDocumentReference<T> {\n return _cast<ExpDocumentReference<T>>(documentRef, ExpDocumentReference);\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FieldPath as ExpFieldPath,\n _FieldPath as InternalFieldPath\n} from '@firebase/firestore';\nimport { FieldPath as PublicFieldPath } from '@firebase/firestore-types';\nimport { Compat, getModularInstance } from '@firebase/util';\n\n// The objects that are a part of this API are exposed to third-parties as\n// compiled javascript so we want to flag our private members with a leading\n// underscore to discourage their use.\n\n/**\n * A `FieldPath` refers to a field in a document. The path may consist of a\n * single field name (referring to a top-level field in the document), or a list\n * of field names (referring to a nested field in the document).\n */\nexport class FieldPath implements PublicFieldPath, Compat<ExpFieldPath> {\n readonly _delegate: ExpFieldPath;\n /**\n * Creates a FieldPath from the provided field names. If more than one field\n * name is provided, the path will point to a nested field in a document.\n *\n * @param fieldNames - A list of field names.\n */\n constructor(...fieldNames: string[]) {\n this._delegate = new ExpFieldPath(...fieldNames);\n }\n\n static documentId(): FieldPath {\n /**\n * Internal Note: The backend doesn't technically support querying by\n * document ID. Instead it queries by the entire document name (full path\n * included), but in the cases we currently support documentId(), the net\n * effect is the same.\n */\n return new FieldPath(InternalFieldPath.keyField().canonicalString());\n }\n\n isEqual(other: PublicFieldPath): boolean {\n other = getModularInstance(other);\n\n if (!(other instanceof ExpFieldPath)) {\n return false;\n }\n return this._delegate._internalPath.isEqual(other._internalPath);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n arrayRemove,\n arrayUnion,\n deleteField,\n FieldValue as FieldValue1,\n increment,\n serverTimestamp\n} from '@firebase/firestore';\nimport { FieldValue as PublicFieldValue } from '@firebase/firestore-types';\nimport { Compat } from '@firebase/util';\n\nexport class FieldValue implements PublicFieldValue, Compat<FieldValue1> {\n static serverTimestamp(): FieldValue {\n const delegate = serverTimestamp();\n delegate._methodName = 'FieldValue.serverTimestamp';\n return new FieldValue(delegate);\n }\n\n static delete(): FieldValue {\n const delegate = deleteField();\n delegate._methodName = 'FieldValue.delete';\n return new FieldValue(delegate);\n }\n\n static arrayUnion(...elements: unknown[]): FieldValue {\n const delegate = arrayUnion(...elements);\n delegate._methodName = 'FieldValue.arrayUnion';\n return new FieldValue(delegate);\n }\n\n static arrayRemove(...elements: unknown[]): FieldValue {\n const delegate = arrayRemove(...elements);\n delegate._methodName = 'FieldValue.arrayRemove';\n return new FieldValue(delegate);\n }\n\n static increment(n: number): FieldValue {\n const delegate = increment(n);\n delegate._methodName = 'FieldValue.increment';\n return new FieldValue(delegate);\n }\n\n constructor(readonly _delegate: FieldValue1) {}\n\n isEqual(other: FieldValue): boolean {\n return this._delegate.isEqual(other._delegate);\n }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { FirebaseApp } from '@firebase/app-compat';\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport { Component, ComponentType } from '@firebase/component';\nimport {\n Firestore as ModularFirestore,\n CACHE_SIZE_UNLIMITED,\n GeoPoint,\n Timestamp\n} from '@firebase/firestore';\n\nimport { Blob } from './api/blob';\nimport {\n Firestore,\n Transaction,\n CollectionReference,\n DocumentReference,\n DocumentSnapshot,\n Query,\n QueryDocumentSnapshot,\n QuerySnapshot,\n WriteBatch,\n setLogLevel\n} from './api/database';\nimport { FieldPath } from './api/field_path';\nimport { FieldValue } from './api/field_value';\n\nconst firestoreNamespace = {\n Firestore,\n GeoPoint,\n Timestamp,\n Blob,\n Transaction,\n WriteBatch,\n DocumentReference,\n DocumentSnapshot,\n Query,\n QueryDocumentSnapshot,\n QuerySnapshot,\n CollectionReference,\n FieldPath,\n FieldValue,\n setLogLevel,\n CACHE_SIZE_UNLIMITED\n};\n\n/**\n * Configures Firestore as part of the Firebase SDK by calling registerComponent.\n *\n * @param firebase - The FirebaseNamespace to register Firestore with\n * @param firestoreFactory - A factory function that returns a new Firestore\n * instance.\n */\nexport function configureForFirebase(\n firebase: FirebaseNamespace,\n firestoreFactory: (\n app: FirebaseApp,\n firestoreExp: ModularFirestore\n ) => Firestore\n): void {\n (firebase as _FirebaseNamespace).INTERNAL.registerComponent(\n new Component(\n 'firestore-compat',\n container => {\n const app = container.getProvider('app-compat').getImmediate()!;\n const firestoreExp = container.getProvider('firestore').getImmediate()!;\n return firestoreFactory(app, firestoreExp);\n },\n 'PUBLIC' as ComponentType.PUBLIC\n ).setServiceProps({ ...firestoreNamespace })\n );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport firebase from '@firebase/app-compat';\nimport type { FirebaseNamespace } from '@firebase/app-types';\nimport * as types from '@firebase/firestore-types';\n\nimport { name, version } from '../package.json';\n\nimport { Firestore, IndexedDbPersistenceProvider } from './api/database';\nimport { configureForFirebase } from './config';\n\nimport './register-module';\n\n/**\n * Registers the main Firestore build with the components framework.\n * Persistence can be enabled via `firebase.firestore().enablePersistence()`.\n */\nexport function registerFirestore(instance: FirebaseNamespace): void {\n configureForFirebase(\n instance,\n (app, firestoreExp) =>\n new Firestore(app, firestoreExp, new IndexedDbPersistenceProvider())\n );\n instance.registerVersion(name, version);\n}\n\nregisterFirestore(firebase as unknown as FirebaseNamespace);\n\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n firestore: {\n (app?: FirebaseApp): types.FirebaseFirestore;\n Blob: typeof types.Blob;\n CollectionReference: typeof types.CollectionReference;\n DocumentReference: typeof types.DocumentReference;\n DocumentSnapshot: typeof types.DocumentSnapshot;\n FieldPath: typeof types.FieldPath;\n FieldValue: typeof types.FieldValue;\n Firestore: typeof types.FirebaseFirestore;\n GeoPoint: typeof types.GeoPoint;\n Query: typeof types.Query;\n QueryDocumentSnapshot: typeof types.QueryDocumentSnapshot;\n QuerySnapshot: typeof types.QuerySnapshot;\n Timestamp: typeof types.Timestamp;\n Transaction: typeof types.Transaction;\n WriteBatch: typeof types.WriteBatch;\n setLogLevel: typeof types.setLogLevel;\n };\n }\n interface FirebaseApp {\n firestore?(): types.FirebaseFirestore;\n }\n}\n"],"names":["ExpWriteBatch","setClientLogLevel","ExpDocumentSnapshot","ExpQueryDocumentSnapshot","ExpDocumentReference","ExpQuerySnapshot","ExpFieldPath","InternalFieldPath"],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAKa,SAAA,kBAAkB,CAChC,UAAkB,EAClB,OAA+B,EAAA;IAE/B,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO;AACL,YAAA,KAAK,EAAE,KAAK;SACb,CAAC;AACH,KAAA;IAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE;AACpE,QAAA,MAAM,IAAI,cAAc,CACtB,kBAAkB,EAClB,qCAAA,CAAA,MAAA,CAAsC,UAAU,EAAiB,iBAAA,CAAA;AAC/D,YAAA,yCAAyC,CAC5C,CAAC;AACH,KAAA;AAED,IAAA,OAAO,OAAO,CAAC;AACjB;;ACvCA;;;;;;;;;;;;;;;AAeG;AAKH;AAC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